@@ -786,12 +786,9 @@ bool CVerification_XAuthNet::Verification_XAuthNet_Login(LPCXSTR lpszUser, LPCXS
786786 {
787787 XCHAR tszCodecBuffer[2048 ] = {};
788788
789- st_ProtocolHdr.wCrypto = ENUM_XENGINE_PROTOCOLHDR_CRYPTO_TYPE_XCRYPT;
790- #if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
791- Cryption_XCrypto_Encoder ((LPCXBTR)&st_AuthUser, (int *)&st_ProtocolHdr.unPacketSize , (XBYTE*)tszCodecBuffer, tszPassStr);
792- #else
793- Cryption_XCrypto_Encoder ((LPCXSTR)&st_AuthUser, (int *)&st_ProtocolHdr.unPacketSize , (XBYTE*)tszCodecBuffer, tszPassStr);
794- #endif
789+ st_ProtocolHdr.wCrypto = ENUM_XENGINE_CRYPTION_SYMMETRIC_AES128;
790+ Cryption_Api_CryptEncodec ((LPCXBTR)&st_AuthUser, (XBYTE*)tszCodecBuffer, (int *)&st_ProtocolHdr.unPacketSize , tszPassStr, ENUM_XENGINE_CRYPTION_SYMMETRIC_AES128);
791+
795792 memcpy (tszMsgBuffer, &st_ProtocolHdr, sizeof (XENGINE_PROTOCOLHDR));
796793 memcpy (tszMsgBuffer + sizeof (XENGINE_PROTOCOLHDR), tszCodecBuffer, st_ProtocolHdr.unPacketSize );
797794
@@ -827,12 +824,9 @@ bool CVerification_XAuthNet::Verification_XAuthNet_Login(LPCXSTR lpszUser, LPCXS
827824 if (ENUM_XENGINE_PROTOCOLHDR_CRYPTO_TYPE_XCRYPT == st_ProtocolHdr.wCrypto )
828825 {
829826 XCHAR tszCodecBuffer[2048 ] = {};
830- st_ProtocolHdr.wCrypto = ENUM_XENGINE_PROTOCOLHDR_CRYPTO_TYPE_XCRYPT;
831- #if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
832- Cryption_XCrypto_Decoder ((LPCXBTR)ptszMsgBuffer, &nMsgLen, (XBYTE *)tszCodecBuffer, tszPassStr);
833- #else
834- Cryption_XCrypto_Decoder (ptszMsgBuffer, &nMsgLen, tszCodecBuffer, tszPassStr);
835- #endif
827+ st_ProtocolHdr.wCrypto = ENUM_XENGINE_CRYPTION_SYMMETRIC_AES128;
828+ Cryption_Api_CryptDecodec ((LPCXBTR)ptszMsgBuffer, (XBYTE*)tszCodecBuffer, &nMsgLen, tszPassStr, ENUM_XENGINE_CRYPTION_SYMMETRIC_AES128);
829+
836830 memcpy (&st_UserInfo, tszCodecBuffer, sizeof (VERIFICATION_USERINFO));
837831 }
838832 else
@@ -947,11 +941,7 @@ bool CVerification_XAuthNet::Verification_XAuthNet_HTTPRequest(LPCXSTR lpszURLAd
947941 else
948942 {
949943 XCHAR tszENCodec[2048 ] = {};
950- #if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
951- if (!Cryption_XCrypto_Encoder ((LPCXBTR)lpszMSGBuffer, &nHTTPLen, (XBYTE*)tszENCodec, lpszPassword))
952- #else
953- if (!Cryption_XCrypto_Encoder (lpszMSGBuffer, &nHTTPLen, (XBYTE*)tszENCodec, lpszPassword))
954- #endif
944+ if (!Cryption_Api_CryptEncodec ((LPCXBTR)lpszMSGBuffer, (XBYTE*)tszENCodec, &nHTTPLen, lpszPassword, ENUM_XENGINE_CRYPTION_SYMMETRIC_AES128))
955945 {
956946 Verification_IsErrorOccur = true ;
957947 Verification_dwErrorCode = Cryption_GetLastError ();
@@ -975,11 +965,7 @@ bool CVerification_XAuthNet::Verification_XAuthNet_HTTPRequest(LPCXSTR lpszURLAd
975965 else
976966 {
977967 XCHAR tszDECodec[2048 ] = {};
978- #if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
979- if (!Cryption_XCrypto_Decoder ((LPCXBTR)ptszHTTPBuffer, &nHTTPLen, (XBYTE *)tszDECodec, lpszPassword))
980- #else
981- if (!Cryption_XCrypto_Decoder (ptszHTTPBuffer, &nHTTPLen, tszDECodec, lpszPassword))
982- #endif
968+ if (!Cryption_Api_CryptDecodec ((LPCXBTR)ptszHTTPBuffer, (XBYTE*)tszDECodec, &nHTTPLen, lpszPassword, ENUM_XENGINE_CRYPTION_SYMMETRIC_AES128))
983969 {
984970 Verification_IsErrorOccur = true ;
985971 Verification_dwErrorCode = Cryption_GetLastError ();
@@ -1039,11 +1025,7 @@ XHTHREAD XCALLBACK CVerification_XAuthNet::Verification_XAuthNet_Thread(XPVOID l
10391025 if (nMsgLen > 0 && _tcsxlen (pClass_This->tszPassStr ) > 0 )
10401026 {
10411027 // 只有有后续数据的情况才需要解密
1042- #if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
1043- Cryption_XCrypto_Decoder ((LPCXBTR)ptszMsgBuffer, &nMsgLen, (XBYTE *)tszMsgBuffer, pClass_This->tszPassStr );
1044- #else
1045- Cryption_XCrypto_Decoder (ptszMsgBuffer, &nMsgLen, tszMsgBuffer, pClass_This->tszPassStr );
1046- #endif
1028+ Cryption_Api_CryptDecodec ((LPCXBTR)ptszMsgBuffer, (XBYTE*)tszMsgBuffer, &nMsgLen, pClass_This->tszPassStr , ENUM_XENGINE_CRYPTION_SYMMETRIC_AES128);
10471029 }
10481030 else
10491031 {
0 commit comments