Skip to content

Commit 207abe8

Browse files
committed
modify:crypt instead Cryption_XCrypto to Cryption_Api
1 parent adf48e2 commit 207abe8

2 files changed

Lines changed: 13 additions & 31 deletions

File tree

XEngine_Module/XEngine_Verification/Verification_XAuth/Verification_XAuthKey.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ bool CVerification_XAuthKey::Verification_XAuthKey_FileRead(VERIFICATION_XAUTHKE
7171
else
7272
{
7373
//解密
74-
if (!Cryption_XCrypto_Decoder((LPCXBTR)tszENCodecBuffer, &nRet, (XBYTE *)tszDECodecBuffer, lpszKeyPass))
74+
if (!Cryption_Api_CryptDecodec((LPCXBTR)tszENCodecBuffer, (XBYTE*)tszDECodecBuffer, &nRet, lpszKeyPass, ENUM_XENGINE_CRYPTION_SYMMETRIC_AES128))
7575
{
7676
Verification_IsErrorOccur = true;
7777
Verification_dwErrorCode = Cryption_GetLastError();
@@ -166,7 +166,7 @@ bool CVerification_XAuthKey::Verification_XAuthKey_FileWrite(VERIFICATION_XAUTHK
166166
}
167167
else
168168
{
169-
if (!Cryption_XCrypto_Encoder((LPCXBTR)tszDECodecBuffer, &nSize, (XBYTE *)tszENCodecBuffer, lpszKeyPass))
169+
if (!Cryption_Api_CryptEncodec((LPCXBTR)tszDECodecBuffer, (XBYTE*)tszENCodecBuffer, &nSize, lpszKeyPass, ENUM_XENGINE_CRYPTION_SYMMETRIC_AES128))
170170
{
171171
Verification_IsErrorOccur = true;
172172
Verification_dwErrorCode = Cryption_GetLastError();
@@ -200,7 +200,7 @@ bool CVerification_XAuthKey::Verification_XAuthKey_MemoryRead(VERIFICATION_XAUTH
200200
else
201201
{
202202
//解密
203-
if (!Cryption_XCrypto_Decoder((LPCXBTR)tszENCodecBuffer, &nRet, (XBYTE *)tszDECodecBuffer, lpszKeyPass))
203+
if (!Cryption_Api_CryptDecodec((LPCXBTR)tszENCodecBuffer, (XBYTE*)tszDECodecBuffer, &nRet, lpszKeyPass, ENUM_XENGINE_CRYPTION_SYMMETRIC_AES128))
204204
{
205205
Verification_IsErrorOccur = true;
206206
Verification_dwErrorCode = Cryption_GetLastError();
@@ -262,7 +262,7 @@ bool CVerification_XAuthKey::Verification_XAuthKey_MemoryWrite(VERIFICATION_XAUT
262262
}
263263
else
264264
{
265-
if (!Cryption_XCrypto_Encoder((LPCXBTR)tszDECodecBuffer, &nSize, (XBYTE *)ptszMSGBuffer, lpszKeyPass))
265+
if (!Cryption_Api_CryptEncodec((LPCXBTR)tszDECodecBuffer, (XBYTE*)ptszMSGBuffer, &nSize, lpszKeyPass, ENUM_XENGINE_CRYPTION_SYMMETRIC_AES128))
266266
{
267267
Verification_IsErrorOccur = true;
268268
Verification_dwErrorCode = Cryption_GetLastError();

XEngine_Module/XEngine_Verification/Verification_XAuth/Verification_XAuthNet.cpp

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)