Log hide ProductKey and ProductSecury information

This commit is contained in:
HuangXin 2019-03-11 10:17:00 +08:00
parent 27f9675a90
commit 024acdda9a
1 changed files with 14 additions and 4 deletions

View File

@ -24,7 +24,6 @@ static int CfgEncrypto(unsigned char* pDest, unsigned char* pSrc, int iSlen);
static void __dumpGlobalCfg(void) static void __dumpGlobalCfg(void)
{ {
#if !RELEASE_VERSION
int err; int err;
char *pSerial; char *pSerial;
@ -37,7 +36,6 @@ static void __dumpGlobalCfg(void)
LOG_EX(LOG_Debug, "Global Configure Information:\n%s\n", pSerial); LOG_EX(LOG_Debug, "Global Configure Information:\n%s\n", pSerial);
free(pSerial); free(pSerial);
#endif
} }
PUSER_CONFIG ne_cfg_get_user_cfg(void) PUSER_CONFIG ne_cfg_get_user_cfg(void)
@ -210,10 +208,20 @@ void ne_clear_ssid_psk(void)
} }
} }
static void __dumpUserConfig(PUSER_CONFIG pCfg) static void __dumpUserConfig(PUSER_CONFIG pInCfg)
{ {
char* pStr; char* pStr;
int i; int i;
USER_CONFIG usrCfg;
PUSER_CONFIG pCfg = &usrCfg;
memcpy(&usrCfg, pInCfg, sizeof(USER_CONFIG));
#if RELEASE_VERSION
pCfg->ServerCfg.ProductKey = "********************************";
pCfg->ServerCfg.ProductSecury = "********";
#endif
#if 0 #if 0
printf("FactoryMode: %d\n", pCfg->FactoryMode); printf("FactoryMode: %d\n", pCfg->FactoryMode);
printf("DeviceType: %d\n", pCfg->DeviceType); printf("DeviceType: %d\n", pCfg->DeviceType);
@ -242,6 +250,7 @@ static void __dumpUserConfig(PUSER_CONFIG pCfg)
printf(" FlowCtrl[%d]: %d\n", i, pCfg->UART[i].FlowCtrl); printf(" FlowCtrl[%d]: %d\n", i, pCfg->UART[i].FlowCtrl);
} }
#endif #endif
pStr = (char*)Struct2Json(pCfg, JE_USER_CFG, CRYPTO_NONE, &i); pStr = (char*)Struct2Json(pCfg, JE_USER_CFG, CRYPTO_NONE, &i);
if(pStr == NULL || i != ERR_OK) if(pStr == NULL || i != ERR_OK)
@ -253,6 +262,7 @@ static void __dumpUserConfig(PUSER_CONFIG pCfg)
LOG_EX(LOG_Debug, "User Configure Information:\n%s\n", pStr); LOG_EX(LOG_Debug, "User Configure Information:\n%s\n", pStr);
free(pStr); free(pStr);
} }
PUSER_CONFIG CreateDefaultUserCfg(void) PUSER_CONFIG CreateDefaultUserCfg(void)