Bläddra i källkod

Z991239-6413 #comment 删除无用的函数+1

80374374 3 månader sedan
förälder
incheckning
3f5593e0b1

+ 0 - 2
Framework/Common/RVCComm.h

@@ -163,8 +163,6 @@ public:
 	CSmartPointer<IClientCommFunc> GetFunction(){return m_pClientComm;}
 
 	// 鉴权开始,需提供Token信息和客户端私钥加密的设备信息
-	virtual bool OnAuthRequest(CConnAuthReq *pReq){return true;}
-
 	virtual bool OnAuthRequestSM(CConnAuthSMReq* pReq) { return true; }
 
 	// 临时会话密钥返回,需使用临时私钥解锁,*pBufLen返回0表示解密失败

+ 0 - 1
Framework/Common/SpSecureClient.h

@@ -71,7 +71,6 @@ private:
 	virtual void OnClose();
 	virtual void OnError(DWORD dwSysCode, DWORD dwUserCode, const char *pErrMsg);
 	virtual void OnAuthPass();
-	virtual bool OnAuthRequest(CConnAuthReq *pReq);
 	virtual bool OnAuthRequestSM(CConnAuthSMReq* pReq);
 	virtual bool OnSessionKeyRet(CConnAuthRet *pRet, BYTE *pBuf, int *pBufLen);
 	virtual bool OnSessionKeySMRet(CConnAuthSMRet* pRet, BYTE* pBuf, int* pBufLen);

+ 1 - 0
Framework/libtoolkit/sockutil.c

@@ -42,6 +42,7 @@ static int is_legal_ip(char* content)
 	}
 
 	if (strcmp(content, "127.0.0.1" == 0) /*sipphone*/
+		|| strcmp(content, "2.0.0.1" == 0) /*ConnecotrFSM*/
 		|| strstr(content, "198.168.") == content /*sipphone Ë«Íø¿¨*/
 		) {
 		return -1;

+ 1 - 120
Framework/spbase/SpSecureClient.cpp

@@ -686,125 +686,6 @@ void SpSecureClient::OnAuthPass()
 {
 }
 
-bool SpSecureClient::OnAuthRequest(CConnAuthReq *pReq)
-{
-	ErrorCodeEnum Error = Error_Unexpect;
-
-	// prepare verify info 
-	CSystemStaticInfo si;
-	m_pEntity->GetFunction()->GetSystemStaticInfo(si);
-	CVerifyInfo info;
-	memset(&info, 0, sizeof(info));
-	strncpy(info.m_arrTerminalNo, (LPCSTR)si.strTerminalID, sizeof(info.m_arrTerminalNo)-1);
-	strcpy(info.m_arrServiceType, "CMBRVC");
-	{
-
-		//TODO: CrossPlaform  [Gifur@2025729]
-#ifdef RVC_OS_WIN
-		hostent *ent = _gethostbyname(NULL);
-		if (ent && ent->h_addr_list[0] != NULL)
-		{
-			int i = 0;
-			for (; ent->h_addr_list[i] != NULL; ++i) {
-				struct in_addr* in = (struct in_addr*)ent->h_addr_list[i];
-				if (in->S_un.S_un_b.s_b1 == 99 || in->S_un.S_un_b.s_b1 == 10)
-					break;
-			}
-			if (ent->h_addr_list[i] == NULL)
-				i = 0;
-
-			auto in = (struct in_addr*)ent->h_addr_list[i];
-			info.m_arrIP[0] = in->S_un.S_un_b.s_b1;
-			info.m_arrIP[1] = in->S_un.S_un_b.s_b2;
-			info.m_arrIP[2] = in->S_un.S_un_b.s_b3;
-			info.m_arrIP[3] = in->S_un.S_un_b.s_b4;
-		}
-#else
-        char buf[512];
-        toolkit_interface_address_t* addr;
-        int count, i, aim = -1, backup = -1, third = -1;
-        toolkit_interface_addresses(&addr, &count);
-        i = count;
-        WLog_DBG(TAG, "Number of interfaces: %d", count);
-        while (i--) {
-            toolkit_interface_address_t interface = addr[i];
-            WLog_DBG(TAG, "Name: %s", interface.name);
-            WLog_DBG(TAG, "Internal? %s", interface.is_internal ? "Yes" : "No");
-            if (interface.address.address4.sin_family == AF_INET) {
-                third = i;
-                toolkit_ip4_name(&interface.address.address4, buf, sizeof(buf));
-                WLog_DBG(TAG, "IPv4 address: %s", buf);
-                CSimpleStringA s(buf);
-                if (s.IsStartWith("99.") || s.IsStartWith("10.")) {
-                    aim = i;
-                    break;
-                }
-                if (!interface.is_internal && backup != -1) {
-                    backup = i;
-                }
-            } else if (interface.address.address4.sin_family == AF_INET6) {
-                toolkit_ip6_name(&interface.address.address6, buf, sizeof(buf));
-                WLog_DBG(TAG, "IPv6 address: %s", buf);
-            }
-        }
-        if (aim == -1 && backup != -1) {
-            aim = backup;
-        }
-        if (aim == -1 && third != -1)
-            aim = third;
-        memset(info.m_arrIP, 0, sizeof(info.m_arrIP));
-        if (aim != -1) {
-            char ipStr[32];
-            int b1, b2, b3, b4;
-            b1 = b2 = b3 = b4 = 0;
-            toolkit_ip4_name(&addr[aim].address.address4, ipStr, sizeof(ipStr));
-            WLog_DBG(TAG, "specified local ip: %s", ipStr);
-            sscanf(ipStr, "%d.%d.%d.%d", &b1, &b2, &b3, &b4);
-            info.m_arrIP[0] = (BYTE)b1;
-            info.m_arrIP[1] = (BYTE)b2;
-            info.m_arrIP[2] = (BYTE)b3;
-            info.m_arrIP[3] = (BYTE)b4;
-        }
-        toolkit_free_interface_addresses(addr, count);
-#endif
-	}
-	if (pReq != NULL)
-	{
-		// call token service to encrypt verify info
-		int nDestLen = sizeof(pReq->m_arrVerifyInfo);
-		TokenService_ClientBase *client = new TokenService_ClientBase(m_pEntity);
-		Error = client->Connect();
-		if (Error == Error_Succeed) {
-			TokenService_EncryptWithPubKey_Req Req;
-			TokenService_EncryptWithPubKey_Ans Ans;
-			Req.raw_data.m_pData = (char*)&info;
-			Req.raw_data.m_iLength = sizeof(info);	//28
-				
-			Error = client->EncryptWithPubKey(Req, Ans, -1);
-			if (Error != Error_Succeed) {
-				LOG_TRACE("EncryptWithPriKey for VerifyInfo failed! Error = %s", SpStrError(Error));
-			} else {
-				memcpy_s(pReq->m_arrVerifyInfo, sizeof(pReq->m_arrVerifyInfo), Ans.enc_data.m_pData, Ans.enc_data.m_iLength);
-				// get token
-				TokenService_GetToken_Req Req1;
-				TokenService_GetToken_Ans Ans1;
-				Error = client-> GetToken(Req1, Ans1, -1);
-				if (Error != Error_Succeed) {
-					LOG_TRACE("GetToken for VerifyInfo failed! Error = %s", SpStrError(Error));
-				} else {
-					memcpy_s(pReq->m_arrVerifyToken, sizeof(pReq->m_arrVerifyToken), Ans1.token.m_pData, Ans1.token.m_iLength);
-				}
-			}
-			client->GetFunction()->CloseSession();
-		} else {
-			LOG_TRACE("connect to tokenservice failed! Error = %s", SpStrError(Error));
-			client->SafeDelete();
-		}
-	}
-
-	return Error == Error_Succeed;
-}
-
 bool SpSecureClient::OnAuthRequestSM(CConnAuthSMReq* pReq)
 {
 	ErrorCodeEnum Error = Error_Unexpect;
@@ -816,7 +697,7 @@ bool SpSecureClient::OnAuthRequestSM(CConnAuthSMReq* pReq)
 	strncpy(info.m_arrTerminalNo, (LPCSTR)si.strTerminalID, sizeof(info.m_arrTerminalNo) - 1);
 	strcpy(info.m_arrServiceType, "CMBRVC");
 	{
-		//TODO: CrossPlaform  [Gifur@2025730]
+		//TODO: CrossPlaform IP [Gifur@2025730]
 #ifdef RVC_OS_LINUX
         char buf[512];
         toolkit_interface_address_t* addr;

+ 0 - 1
Module/mod_ResourceWatcher/ResourceWatcherFSM.cpp

@@ -1,6 +1,5 @@
 #include "stdafx.h"
 #include "ResourceWatcherFSM.h"
-#include "DeviceBaseClass.h"
 #include <string.h>
 #include <string> 
 #include <assert.h>

+ 0 - 3
Module/mod_accessauth/mod_AccessAuth.cpp

@@ -19,10 +19,7 @@ using namespace PinPad;
 #include "WMIDeviceQuery.h"
 #include <WinCrypt.h>
 #include <Strsafe.h>
-#include "DeviceBaseClass.h"
 #include "MyBase64.h"
-#else
-#include "DeviceBaseClass.h"
 #endif
 
 struct InitializerInitMKTask : ITaskSp

+ 0 - 1
Module/mod_counterconnector/ConnectorFSM.cpp

@@ -131,7 +131,6 @@ ACMCallFSM::ACMCallFSM()
 {
 	m_nCurSipServer = CurServerNum::MAIN_SERVER;
 	m_nCurChanServer = CurServerNum::MAIN_SERVER;
-	m_iNetAdapterNum = 1;
 	m_pSyncServiceClient = NULL;
 	m_bConAssist = false;
 	m_bConSipphone = false;

+ 1 - 3
Module/mod_counterconnector/ConnectorFSM.h

@@ -505,7 +505,7 @@ private:
 #endif
 	}
 
-	//TODO: CrossPlaform  [Gifur@2025729]
+	//TODO: CrossPlaform IP [Gifur@2025729]
 	ErrorCodeEnum GetLocalIP(char *buff, size_t ulen)
 	{
 #if defined(RVC_OS_WIN)
@@ -517,7 +517,6 @@ private:
 			for (; ent->h_addr_list[icount]; ) {
 				++icount;
 			}
-			m_iNetAdapterNum = icount;
 			for (int i = 0; ent->h_addr_list[i]; ++i) {
 				if (ent->h_addrtype == AF_INET) {
 					struct in_addr* in = (struct in_addr*)ent->h_addr_list[i];
@@ -813,7 +812,6 @@ private:
 	std::vector<std::string> m_voipserver;
 	ErrorCodeEnum m_LastSipError;
 	ErrorCodeEnum m_LastAssistError;
-	int m_iNetAdapterNum;
 
 	CSimpleStringA m_strHttpCallRouteAddr;
 	CSimpleStringA m_strHttpServerAPI;

+ 0 - 1
Module/mod_upload/UploadFSM.cpp

@@ -1822,7 +1822,6 @@ bool UploadFSM::test_zero_ref(const char *path)
 	} else {
 		//添加获取句柄失败情况
 		LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_UPLOAD_SCANFILE_LOCK_ERROR, CSimpleStringA::Format("test_zero_ref is fail:%s",path).GetData());
-		DWORD dwRet = GetLastError();
 		return FALSE;
 	}
 #else