Skip to content

Commit 82ce149

Browse files
committed
modify:modify user encrypt password support
1 parent 4616496 commit 82ce149

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/AuthorizeHTTP_Post/AuthorizeHTTP_Client.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,15 @@ bool XEngine_AuthorizeHTTP_Client(LPCXSTR lpszClientAddr, LPCXSTR lpszAPIName, L
121121
memset(&st_UserTable, '\0', sizeof(AUTHREG_USERTABLE));
122122

123123
Protocol_Parse_HttpParseTable(lpszMsgBuffer, nMsgLen, &st_UserTable);
124+
125+
if (st_AuthConfig.st_XVerification.st_PassCrypto.bEnable)
126+
{
127+
int nPLen = _tcsxlen(st_UserTable.st_UserInfo.tszUserPass);
128+
XBYTE byMD5Buffer[MAX_PATH] = {};
129+
OPenSsl_Api_Digest(st_UserTable.st_UserInfo.tszUserPass, byMD5Buffer, &nPLen, false, st_AuthConfig.st_XVerification.st_PassCrypto.nCodec);
130+
memset(st_UserTable.st_UserInfo.tszUserPass, '\0', sizeof(st_UserTable.st_UserInfo.tszUserPass));
131+
BaseLib_OperatorString_StrToHex((LPCXSTR)byMD5Buffer, nPLen, st_UserTable.st_UserInfo.tszUserPass);
132+
}
124133
bool bSuccess = false;
125134
if (0 == st_AuthConfig.st_XSql.nDBType)
126135
{

0 commit comments

Comments
 (0)