Skip to content

Commit 984e60d

Browse files
committed
modify:x-crypto 9.32 version build support
1 parent 1db2b64 commit 984e60d

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

XEngine_Module/XEngine_Verification/Verification_XAuth/Verification_XAuthKey.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ bool CVerification_XAuthKey::Verification_XAuthKey_FileRead(VERIFICATION_XAUTHKE
7171
else
7272
{
7373
//解密
74+
#if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
75+
if (!Cryption_XCrypto_Decoder((LPCXBTR)tszENCodecBuffer, &nRet, (XBYTE *)tszDECodecBuffer, lpszKeyPass))
76+
#else
7477
if (!Cryption_XCrypto_Decoder(tszENCodecBuffer, &nRet, tszDECodecBuffer, lpszKeyPass))
78+
#endif
7579
{
7680
Verification_IsErrorOccur = true;
7781
Verification_dwErrorCode = Cryption_GetLastError();
@@ -166,12 +170,17 @@ bool CVerification_XAuthKey::Verification_XAuthKey_FileWrite(VERIFICATION_XAUTHK
166170
}
167171
else
168172
{
173+
#if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
174+
if (!Cryption_XCrypto_Encoder((LPCXBTR)tszDECodecBuffer, &nSize, (XBYTE *)tszENCodecBuffer, lpszKeyPass))
175+
#else
169176
if (!Cryption_XCrypto_Encoder(tszDECodecBuffer, &nSize, (XBYTE*)tszENCodecBuffer, lpszKeyPass))
177+
#endif
170178
{
171179
Verification_IsErrorOccur = true;
172180
Verification_dwErrorCode = Cryption_GetLastError();
173181
return false;
174182
}
183+
175184
fwrite(tszENCodecBuffer, 1, nSize, pSt_File);
176185
}
177186
fclose(pSt_File);
@@ -199,7 +208,11 @@ bool CVerification_XAuthKey::Verification_XAuthKey_MemoryRead(VERIFICATION_XAUTH
199208
else
200209
{
201210
//解密
211+
#if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
212+
if (!Cryption_XCrypto_Decoder((LPCXBTR)tszENCodecBuffer, &nRet, (XBYTE *)tszDECodecBuffer, lpszKeyPass))
213+
#else
202214
if (!Cryption_XCrypto_Decoder(tszENCodecBuffer, &nRet, tszDECodecBuffer, lpszKeyPass))
215+
#endif
203216
{
204217
Verification_IsErrorOccur = true;
205218
Verification_dwErrorCode = Cryption_GetLastError();
@@ -261,7 +274,11 @@ bool CVerification_XAuthKey::Verification_XAuthKey_MemoryWrite(VERIFICATION_XAUT
261274
}
262275
else
263276
{
264-
if (!Cryption_XCrypto_Encoder(tszDECodecBuffer, &nSize, (XBYTE*)ptszMSGBuffer, lpszKeyPass))
277+
#if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
278+
if (!Cryption_XCrypto_Encoder((LPCXBTR)tszDECodecBuffer, &nSize, (XBYTE *)ptszMSGBuffer, lpszKeyPass))
279+
#else
280+
if (!Cryption_XCrypto_Encoder(tszDECodecBuffer, &nSize, (XBYTE *)ptszMSGBuffer, lpszKeyPass))
281+
#endif
265282
{
266283
Verification_IsErrorOccur = true;
267284
Verification_dwErrorCode = Cryption_GetLastError();

XEngine_Module/XEngine_Verification/Verification_XAuth/Verification_XAuthNet.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,11 @@ bool CVerification_XAuthNet::Verification_XAuthNet_Login(LPCXSTR lpszUser, LPCXS
781781
XCHAR tszCodecBuffer[2048] = {};
782782

783783
st_ProtocolHdr.wCrypto = ENUM_XENGINE_PROTOCOLHDR_CRYPTO_TYPE_XCRYPT;
784+
#if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
785+
Cryption_XCrypto_Encoder((LPCXBTR)&st_AuthUser, (int*)&st_ProtocolHdr.unPacketSize, (XBYTE*)tszCodecBuffer, tszPassStr);
786+
#else
784787
Cryption_XCrypto_Encoder((LPCXSTR)&st_AuthUser, (int*)&st_ProtocolHdr.unPacketSize, (XBYTE*)tszCodecBuffer, tszPassStr);
785-
788+
#endif
786789
memcpy(tszMsgBuffer, &st_ProtocolHdr, sizeof(XENGINE_PROTOCOLHDR));
787790
memcpy(tszMsgBuffer + sizeof(XENGINE_PROTOCOLHDR), tszCodecBuffer, st_ProtocolHdr.unPacketSize);
788791

@@ -819,7 +822,11 @@ bool CVerification_XAuthNet::Verification_XAuthNet_Login(LPCXSTR lpszUser, LPCXS
819822
{
820823
XCHAR tszCodecBuffer[2048] = {};
821824
st_ProtocolHdr.wCrypto = ENUM_XENGINE_PROTOCOLHDR_CRYPTO_TYPE_XCRYPT;
825+
#if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
826+
Cryption_XCrypto_Decoder((LPCXBTR)ptszMsgBuffer, &nMsgLen, (XBYTE *)tszCodecBuffer, tszPassStr);
827+
#else
822828
Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszCodecBuffer, tszPassStr);
829+
#endif
823830
memcpy(&st_UserInfo, tszCodecBuffer, sizeof(VERIFICATION_USERINFO));
824831
}
825832
else
@@ -934,7 +941,11 @@ bool CVerification_XAuthNet::Verification_XAuthNet_HTTPRequest(LPCXSTR lpszURLAd
934941
else
935942
{
936943
XCHAR tszENCodec[2048] = {};
944+
#if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
945+
if (!Cryption_XCrypto_Encoder((LPCXBTR)lpszMSGBuffer, &nHTTPLen, (XBYTE*)tszENCodec, lpszPassword))
946+
#else
937947
if (!Cryption_XCrypto_Encoder(lpszMSGBuffer, &nHTTPLen, (XBYTE*)tszENCodec, lpszPassword))
948+
#endif
938949
{
939950
Verification_IsErrorOccur = true;
940951
Verification_dwErrorCode = Cryption_GetLastError();
@@ -958,7 +969,11 @@ bool CVerification_XAuthNet::Verification_XAuthNet_HTTPRequest(LPCXSTR lpszURLAd
958969
else
959970
{
960971
XCHAR tszDECodec[2048] = {};
972+
#if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
973+
if (!Cryption_XCrypto_Decoder((LPCXBTR)ptszHTTPBuffer, &nHTTPLen, (XBYTE *)tszDECodec, lpszPassword))
974+
#else
961975
if (!Cryption_XCrypto_Decoder(ptszHTTPBuffer, &nHTTPLen, tszDECodec, lpszPassword))
976+
#endif
962977
{
963978
Verification_IsErrorOccur = true;
964979
Verification_dwErrorCode = Cryption_GetLastError();
@@ -1018,7 +1033,11 @@ XHTHREAD XCALLBACK CVerification_XAuthNet::Verification_XAuthNet_Thread(XPVOID l
10181033
if (nMsgLen > 0 && _tcsxlen(pClass_This->tszPassStr) > 0)
10191034
{
10201035
//只有有后续数据的情况才需要解密
1036+
#if XENGINE_VERSION_KERNEL >= 9 && XENGINE_VERSION_MAIN >= 32
1037+
Cryption_XCrypto_Decoder((LPCXBTR)ptszMsgBuffer, &nMsgLen, (XBYTE *)tszMsgBuffer, pClass_This->tszPassStr);
1038+
#else
10211039
Cryption_XCrypto_Decoder(ptszMsgBuffer, &nMsgLen, tszMsgBuffer, pClass_This->tszPassStr);
1040+
#endif
10221041
}
10231042
else
10241043
{

0 commit comments

Comments
 (0)