Przeglądaj źródła

#IQRV #comment [AccessAuth][BugFix]2

gifur 3 lat temu
rodzic
commit
6285611e5c

+ 5 - 2
Module/mod_accessauth/AccessAuthConn.cpp

@@ -1388,8 +1388,11 @@ DWORD CAccessAuthConn::HandleTimeSyn(int nTimeDiff,BYTE nAuthVersion,BYTE* nSess
 
 	// 检查准入请求版本 //会话密钥缓存
 	Dbg("auth version: %d", nAuthVersion);
-	if (((CAccessAuthEntity*)m_pEntity)->SaveAuthVerAndKey(nAuthVersion, nSessionKey)) return Error_Succeed;
-	return Error_Unexpect;
+	if (((CAccessAuthEntity*)m_pEntity)->SaveAuthVerAndKey(nAuthVersion, nSessionKey)) {
+		return Error_Succeed;
+	} else {
+        return Error_Unexpect;
+	}
 }
 DWORD CAccessAuthConn::HandleLockState(int nState)
 {

+ 5 - 3
Module/mod_accessauth/AccessAuthFSM.cpp

@@ -419,7 +419,8 @@ struct UpdateWKTask : ITaskSp {
         {
             std::string terminalNo;
             JSONCONVERT2OBJECT_MEMEBER_REGISTER(terminalNo)
-        } updateWKReq{ si.strTerminalID.GetData() };
+        } updateWKReq;
+
             struct UpdateWKAns
             {
                 string TMK;
@@ -429,9 +430,12 @@ struct UpdateWKTask : ITaskSp {
                 JSONCONVERT2OBJECT_MEMEBER_REGISTER(TMK, TPK, EDK, index)
             } updateWKAns;
 
+            updateWKReq.terminalNo = si.strTerminalID.GetData();
+
             HttpClientResponseResult result;
             HttpClientRequestConfig config(HttpRequestMethod::POST, m_fsm->GetmAccessAuthHost().GetData());
             config.SetChildUri("/api/wkupdate");
+
             SP::Module::Restful::FulfillRequestJsonBody(&config, updateWKReq);
 
             RestfulClient client = RestfulClient::getInstance();
@@ -984,9 +988,7 @@ void CAccessAuthFSM::doWarnMsg(int errReason, std::string errMsg, bool bNeedEven
 	if (bNeedEvent)
 	{
 		m_pEntity->GetFunction()->SetSysVar("AuthErrMsg", fullErrMsg.c_str(), true);
-		//oiltest@20211124
 		LogEvent(Severity_Middle, checkErrType(errReason), errMsg.c_str());
-		//LogEvent(Severity_Middle, CONTROL_ACCESSAUTH_NORETRY_NORESTART, errMsgStr.c_str());
 	}
 	LogWarn(Severity_Middle, Error_Unexpect, errReason, errMsgStr.c_str());
 }

+ 3 - 2
Module/mod_accessauth/mod_AccessAuth.cpp

@@ -670,8 +670,10 @@ int Char2Int(char * ch) {
 bool CAccessAuthEntity::SaveAuthVerAndKey(int nAuthVer, BYTE *pKey)
 {
 	LOG_FUNCTION();
+
 	m_nAuthVersion = nAuthVer;
 	memset(m_AuthSessionKey, 0, 140);
+
 	if (m_nAuthVersion == 2)
 	{
 		CSimpleString runInfoPath;
@@ -683,6 +685,7 @@ bool CAccessAuthEntity::SaveAuthVerAndKey(int nAuthVer, BYTE *pKey)
 		
 		char privateKey[BUF_SIZE] = { 0 };
         runInfoPath += SPLIT_SLASH_STR "runcfg" SPLIT_SLASH_STR "Initializer.ini";
+
 #ifdef RVC_OS_WIN
 		GetPrivateProfileString("TerminalPD", "PrivateKey", "", privateKey, BUF_SIZE, runInfoPath.GetData());
 #else
@@ -691,8 +694,6 @@ bool CAccessAuthEntity::SaveAuthVerAndKey(int nAuthVer, BYTE *pKey)
 		strcpy(privateKey, tmp);
 		delete tmp;
 #endif // RVC_OS_WIN
-
-		
 		
 		if (strlen(privateKey) <= 0) {
 			printPasswdError();