@@ -24,32 +24,21 @@ bool XEngine_AuthorizeHTTP_CDKey(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, LP
2424
2525 Protocol_Parse_HttpParseCDKey (lpszMsgBuffer, nMsgLen, &st_Authorize);
2626
27- if (_tcsxlen (st_Authorize.st_AuthSerial .st_TimeLimit .tszTimeSerial ) <= 0 )
28- {
29- XCHAR tszSerialStr[XPATH_MIN] = {};
30- Verification_XAuthKey_KeySerial (tszSerialStr, 8 , 0 );
31-
32- st_Authorize.st_AuthSerial .st_TimeLimit .nTimeCount = 9999 ;
33- _tcsxcpy (st_Authorize.st_AuthSerial .st_TimeLimit .tszTimeSerial , tszSerialStr);
34-
35- memset (tszSerialStr, ' \0 ' , sizeof (tszSerialStr));
36- Verification_XAuthKey_KeySerial (tszSerialStr, 8 , 0 );
37- st_Authorize.st_AuthSerial .st_DataLimit .bTimeAdd = false ;
38- _tcsxcpy (st_Authorize.st_AuthSerial .st_DataLimit .tszDataSerial , tszSerialStr);
27+ st_Authorize.st_AuthSerial .st_TimeLimit .nTimeCount = 9999 ;
28+ memset (st_Authorize.st_AuthSerial .st_TimeLimit .tszTimeSerial , 0 , XPATH_MIN);
29+ Verification_XAuthKey_KeySerial (st_Authorize.st_AuthSerial .st_TimeLimit .tszTimeSerial , 8 , 0 );
3930
40- XCHAR tszTimeStr[128 ] = {};
41- XENGINE_LIBTIME st_LibTime = {};
42- BaseLib_Time_GetSysTime (&st_LibTime);
43- st_LibTime.wYear += 1 ; // 一年后过期
44- BaseLib_Time_TimeToStr (tszTimeStr, NULL , true , &st_LibTime);
31+ memset (st_Authorize.st_AuthSerial .st_DataLimit .tszDataSerial , 0 , XPATH_MIN);
32+ XENGINE_LIBTIME st_LibTime = {};
33+ BaseLib_Time_GetSysTime (&st_LibTime);
34+ st_LibTime.wYear += 1 ; // 一年后过期
35+ st_Authorize.st_AuthSerial .st_DataLimit .bTimeAdd = false ;
36+ BaseLib_Time_TimeToStr (st_Authorize.st_AuthSerial .st_DataLimit .tszDataTime , NULL , true , &st_LibTime);
37+ Verification_XAuthKey_KeySerial (st_Authorize.st_AuthSerial .st_DataLimit .tszDataSerial , 8 , 0 );
4538
46- memset (tszSerialStr, ' \0 ' , sizeof (tszSerialStr) );
47- Verification_XAuthKey_KeySerial (tszSerialStr , 8 , 0 );
39+ memset (st_Authorize. st_AuthSerial . st_UNLimit . tszUNLimitSerial , 0 , XPATH_MIN );
40+ Verification_XAuthKey_KeySerial (st_Authorize. st_AuthSerial . st_UNLimit . tszUNLimitSerial , 8 , 0 );
4841
49- _tcsxcpy (st_Authorize.st_AuthSerial .st_DataLimit .tszDataTime , tszTimeStr);
50- _tcsxcpy (st_Authorize.st_AuthSerial .st_UNLimit .tszUNLimitSerial , tszSerialStr);
51- }
52-
5342 if (!Verification_XAuthKey_WriteMemory (m_MemoryPoolRecv.get (), &nRVLen, &st_Authorize))
5443 {
5544 Protocol_Packet_HttpComm (m_MemoryPoolSend.get (), &nSDLen, ERROR_AUTHORIZE_PROTOCOL_SERVER, " Not Acceptable,write key failed" );
@@ -77,7 +66,6 @@ bool XEngine_AuthorizeHTTP_CDKey(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, LP
7766 memset (&st_Authorize, ' \0 ' , sizeof (VERIFICATION_XAUTHKEY));
7867
7968 Verification_XAuthKey_ReadMemory (lpszMsgBuffer, nMsgLen, &st_Authorize);
80-
8169 if (ENUM_VERIFICATION_MODULE_VERMODE_TYPE_NETWORK != st_Authorize.st_AuthRegInfo .enVModeType )
8270 {
8371 Protocol_Packet_HttpComm (m_MemoryPoolSend.get (), &nSDLen, ERROR_AUTHORIZE_PROTOCOL_UNAUTHORIZE, " unsupport,cdkey is not authorized" );
0 commit comments