From: leslie Date: Sun, 26 Apr 2009 17:46:15 +0000 (+0200) Subject: cardclient-camd: fix non-thread safe MD5 calls X-Git-Tag: 0.9.2~39 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=ce7b32ec949c712d4f82ed1914296a006564c776;p=sasc-ng.git cardclient-camd: fix non-thread safe MD5 calls --- diff --git a/systems/cardclient/camd.c b/systems/cardclient/camd.c index a85f650..891341a 100644 --- a/systems/cardclient/camd.c +++ b/systems/cardclient/camd.c @@ -454,9 +454,10 @@ bool cCardClientCamd35::ParseUserConfig(const char *config, int *num) int startNum=*num; if(sscanf(&config[*num],":%32[^:]:%32[^:]%n",username,password,num)==2) { *num+=startNum; - ucrc=bswap_32(crc32_le(0,MD5((unsigned char *)username,strlen(username),0),16)); + unsigned char md[16]; + ucrc=bswap_32(crc32_le(0,MD5((unsigned char *)username,strlen(username),md),16)); PRINTF(L_CC_CORE,"%s: username=%s password=%s ucrc=%08x",name,username,password,ucrc);; - SetKey(MD5((unsigned char *)password,strlen(password),0)); + SetKey(MD5((unsigned char *)password,strlen(password),md)); return true; } return false;