Эх сурвалжийг харах

Z991239-6443 #comment 协助通道 基本类型调整

80374374 1 сар өмнө
parent
commit
7bdfac5ec1

+ 3 - 3
Module/mod_accessauth/mod_AccessAuth.cpp

@@ -617,7 +617,7 @@ bool CAccessAuthEntity::GetTerminalPublicKey(BYTE* pBuf, int& nBufLen, string& p
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetTerminalPublicKey")("iPublicKeyLen=%d,iPrivateKeyLen=%d", iPublicKeyLen, iPrivateKeyLen);
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetTerminalPublicKey")("[btPublicKey=%s]", (char*)btPublicKey);
 
-	//TODO: CrossPlaform  [Gifur@2025820]
+	//TODO: CrossPlaform 待定 [Gifur@2025820]
 	char* pEncode = Str2Hex((char*)btPublicKey, iPublicKeyLen);
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetTerminalPublicKey")("pEncode=%s,%d", pEncode, strlen(pEncode));
 
@@ -638,7 +638,7 @@ bool CAccessAuthEntity::GetTerminalPublicKey(BYTE* pBuf, int& nBufLen, string& p
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetTerminalPublicKey")("sm4 encrypt pri key success.");
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetTerminalPublicKey")("cryptPrivateKeyLen=%d", cryptPrivateKeyLen);
 
-	//TODO: CrossPlaform  [Gifur@2025820]
+	//TODO: CrossPlaform 待定 [Gifur@2025820]
 	char* pEncodedCryptPrivateKey = Str2Hex((char*)pCryptPrivateKey, cryptPrivateKeyLen);
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetTerminalPublicKey")("encode pri key success.");
 
@@ -992,7 +992,7 @@ bool CAccessAuthEntity::SendInitMKReqACS(CInitlizerMKReq& initMKReq)
 		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("GetEncTerminalInfo failed:%d", nRet);
 		return false;
 	}
-	//TODO: CrossPlaform  [Gifur@202584]
+	//TODO: CrossPlaform 待定 [Gifur@202584]
 	char* pTmp = Str2Hex((char*)encInfo.m_pData, encInfo.m_iLength);
 	initMKReq.iniTerminalInfo = pTmp;
 

+ 2 - 17
Module/mod_assistantchannel/chan_protocol.h

@@ -53,18 +53,13 @@ typedef struct acm_hdr {
 	unsigned char encrypt : 1;
 	unsigned char error : 7;
 	unsigned short sub_type;
-	//TODO: CrossPlaform  [Gifur@2025730]
-#if defined(RVC_OS_WIN)
-	unsigned long length; // 需要注意的是长度最大为2^16-1,65535
-	unsigned long id; // 包id
-	unsigned long hash;
-#else
 	unsigned int length; // 需要注意的是长度最大为2^16-1,65535
 	unsigned int id; // 包id
 	unsigned int hash;
-#endif //RVC_OS_WIN
 	unsigned char data[0]; // 长度由length决定
 }acm_hdr;
+
+
 typedef struct proxy_hdr {
 	char	 tag[3]; // 必须为’ACM’
 	char	 version; // 版本号,目前为1
@@ -73,12 +68,7 @@ typedef struct proxy_hdr {
 	unsigned int rtp_port; // 视频rtp端口
 	int media_desc; // 媒体描述
 	char client_id[20]; // 用户身份证号码,用与视频面签
-	//TODO: CrossPlaform  [Gifur@2025730]
-#if defined(RVC_OS_WIN)
-	unsigned long encrypt_keyhash; // 加密key hash code
-#else
 	unsigned int  encrypt_keyhash; // 加密key hash code
-#endif //RVC_OS_WIN
 	char encrypt_key[16]; // encodestring(密钥),传送过去之后利用decodestring解密
 }proxy_hdr;
 typedef struct proxy_ack_hdr {
@@ -87,12 +77,7 @@ typedef struct proxy_ack_hdr {
 	unsigned int rtp_port; // 视频rtp端口
 	int media_desc; // 媒体描述
 	char client_id[20]; // peer request client_id
-	//TODO: CrossPlaform  [Gifur@2025730]
-#if defined(RVC_OS_WIN)
-	unsigned long encrypt_keyhash; // 加密key hash code
-#else
 	unsigned int encrypt_keyhash; // 加密key hash code
-#endif //RVC_OS_WIN
 	char encrypt_key[16]; // encodestring(密钥),传送过去之后利用decodestring解密
 }proxy_ack_hdr;
 

+ 1 - 13
Module/mod_assistantchannel/mod_assistantchannel.cpp

@@ -1,6 +1,7 @@
 #include "stdafx.h"
 #include "mod_assistantchannel.h"
 #include "EventCode.h"
+#include <winpr/string.h>
 
 static const char *__states[] = {
 	"Idle", "Connecting", "Connected", "Closing"
@@ -68,13 +69,7 @@ static void __on_destroy(bizchan_t *chan, void *user_data)
 
 static void __dbg(void *user_data, const char *fmt, va_list arg)
 {
-	//vDbg(fmt, arg);
-	//TODO: CrossPlaform  [Gifur@2025730]
-#if defined(RVC_OS_WIN)
 	int n = _vscprintf(fmt, arg);
-#else
-	int n = _scprintf(fmt, arg);
-#endif //RVC_OS_WIN
 	if (n >= MAX_PATH) {
 		char* buf = (char*)malloc((size_t)(n + 1));
 		vsnprintf(buf, n + 1, fmt, arg);
@@ -83,18 +78,11 @@ static void __dbg(void *user_data, const char *fmt, va_list arg)
 	}
 	else {
 		char strlog[MAX_PATH] = { 0 };
-		//TODO: CrossPlaform  [Gifur@2025730]
-#if defined(RVC_OS_WIN)
 		_vsnprintf(strlog, MAX_PATH, fmt, arg);
-#else
-		vsnprintf(strlog, MAX_PATH, fmt, arg);
-#endif //RVC_OS_WIN
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s", strlog);
 	}
 }
 
-
-
 void CBizChannelEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPointer<ITransactionContext> pTransactionContext) 
 { 
 	ErrorCodeEnum Error = __OnStart(Error_Succeed);