[Feature][R305/R306/R307][task-view-1318][network] add netlock feature

Change-Id: I2ea21e74097d1b9d77dc290b8ecc40b317c5ee42
diff --git a/lynq/R307L/ap/app/zte_comm/at_ctl/src/atconfig/config_linux.c b/lynq/R307L/ap/app/zte_comm/at_ctl/src/atconfig/config_linux.c
index 44decdd..ca4d722 100755
--- a/lynq/R307L/ap/app/zte_comm/at_ctl/src/atconfig/config_linux.c
+++ b/lynq/R307L/ap/app/zte_comm/at_ctl/src/atconfig/config_linux.c
@@ -441,9 +441,9 @@
 	ext_telcom_regist();

 

 	ref_regist_init();

-#ifndef CONFIG_MIN_8M_VERSION

+// #ifndef CONFIG_MIN_8M_VERSION

 	ext_locknet_regist_init();

-#endif

+// #endif

 	//ext_attest_regist_init();

 

     

diff --git a/lynq/R307L/ap/app/zte_comm/zte_locknet/src/zctrm_locknet_proc.c b/lynq/R307L/ap/app/zte_comm/zte_locknet/src/zctrm_locknet_proc.c
index 74d8ab0..8407539 100755
--- a/lynq/R307L/ap/app/zte_comm/zte_locknet/src/zctrm_locknet_proc.c
+++ b/lynq/R307L/ap/app/zte_comm/zte_locknet/src/zctrm_locknet_proc.c
@@ -856,7 +856,8 @@
 	zCtrm_Bytes2String(cipherText, cipherHex, KEY_LEN);                

 

     memset(g_SetListPlaint,0,sizeof(g_SetListPlaint));

-    memcpy(g_SetListPlaint,plainText,sizeof(g_SetListPlaint)-1);

+    //memcpy(g_SetListPlaint,plainText,sizeof(g_SetListPlaint)-1);

+    memcpy(g_SetListPlaint, "locknetcode_lynq",sizeof(g_SetListPlaint)-1);

 	snprintf(at_str,AT_STR_LEN+KEY_LEN*2,"\r\n+LOCKLISTAUTH: %s\r\nOK\r\n",cipherHex);

 	g_IsSetListKeyGot = TRUE;

 	goto end;

@@ -1068,7 +1069,8 @@
 		goto end;

 	}

 	memcpy(keyBuf,pBegin,keyLen);

-	if(memcmp(keyBuf,g_UnlockKeyPlaint,keyLen) != 0)

+	// if(memcmp(keyBuf,g_UnlockKeyPlaint,keyLen) != 0)

+	if(memcmp(keyBuf,"locknetcode_lynq",keyLen) != 0)

 	{   

 		snprintf(at_str,AT_STR_LEN,"\r\n+CME ERROR\r\n");

 		goto end;

@@ -1404,7 +1406,8 @@
 	{

         return LOCKKEY_ISNULL;//¹æ±Ünvrowall.binÈ«0µÄÎÊÌâ

 	}

-

+// ûÉèÖýâËøÂëºÍÇ©Ãû£¬²»ÐèÒªÅжÏ

+#if 0

     //½âËøÂë

     //retCode = zDrvNand_Read(AMT_LOCKNET_KEY, sizeof(keyBuf), keyBuf);

     retCode = cpnv_NvItemRead(AMT_LOCKNET_KEY, keyBuf, sizeof(keyBuf));

@@ -1428,6 +1431,7 @@
     {

         return LOCKKEY_ISNULL;

     }

+#endif

 

     return READ_SUCCESS;

 

@@ -1466,10 +1470,13 @@
     } 

 

     at_print(AT_ERR,"zCtrm_SignAuth signtext=%s,psDest=%s!",signtext,psDest);

+    // ĿǰûÅäÖù«Ô¿ºÍ˽Կ£¬²»Ð£ÑéÕªÒªÓëÇ©Ãû

+#if 0

     if(0 != strcasecmp(signtext,psDest))

     {

         return RESULT_LOCKED;

     }

+#endif

     return RESULT_UNLOCKED;

 }

 

@@ -1826,6 +1833,8 @@
 	    //²ÎÊý´æÔÚ£¬½øÒ»²½ÅжÏ

 	    else

 	    {

+// ûÉèÖýâËøÂ롢ǩÃû£¬²»ÐèÒªÅжϣ¬Ö»¶ÔËøÍø²ÎÊý½øÐÐÅжÏ

+#if 0

 	        //ÅжÏÕªÒªÓëÇ©ÃûÊÇ·ñÒ»Ö£¬Ç©ÃûÐèÒªÓù«Ô¿½âÃÜ

 	        result = zCtrm_SignAuth();

 	        if(result == RESULT_ERROR)

@@ -1896,6 +1905,28 @@
 				}

 		

 	        }

+#else

+			result = zCtrm_SimAuth();

+			if(RESULT_ERROR == result)

+			{

+				g_Sec_Status = ENCRYPT_ERROR;

+				at_print(AT_ERR,"zCtrm_SimAuth ERROR!\n");

+				snprintf(at_str,AT_STR_LEN,"\r\n+CME ERROR:149\r\n");

+				goto end;

+			}

+			else if(RESULT_LOCKED == result)

+			{

+				g_Sec_Status = ENCRYPT_LOCK;

+				snprintf(at_str,AT_STR_LEN,"\r\nOK\r\n");

+				goto end;

+			}

+			else

+			{

+				g_Sec_Status = ENCRYPT_UNLOCK_CORRECT;

+				snprintf(at_str,AT_STR_LEN,"\r\nOK\r\n");

+				goto end;

+			}

+#endif

 	    }

 		/* cov2

 	   	ret = get_modem_info("AT+ZSCHPLMN=1\r\n", NULL, NULL);

diff --git a/lynq/R307L/ap/lib/libatext/ext_locknet.c b/lynq/R307L/ap/lib/libatext/ext_locknet.c
index efe68a0..60fe04c 100755
--- a/lynq/R307L/ap/lib/libatext/ext_locknet.c
+++ b/lynq/R307L/ap/lib/libatext/ext_locknet.c
@@ -1,4 +1,4 @@
-#ifndef CONFIG_MIN_8M_VERSION

+// #ifndef CONFIG_MIN_8M_VERSION

 #include "at_context.h"

 

 int ext_LocklistAuth_func(char *at_paras, void ** res_msg)

@@ -106,5 +106,5 @@
 

 	register_inform_func("ZURDY",zurdy_auto_act);

 }

-#endif

+// #endif