From ce7b32ec949c712d4f82ed1914296a006564c776 Mon Sep 17 00:00:00 2001 From: leslie Date: Sun, 26 Apr 2009 19:46:15 +0200 Subject: [PATCH] cardclient-camd: fix non-thread safe MD5 calls --- systems/cardclient/camd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.39.5