Bug Fix for #175 and #167 (#182)

Prevent double MD5 hashing
This commit is contained in:
omersiar 2017-06-21 13:37:19 +03:00 committed by Me No Dev
parent 9bfd52529a
commit e56e1a6370
1 changed files with 2 additions and 2 deletions

View File

@ -205,9 +205,9 @@ bool checkDigestAuthentication(const char * header, const char * method, const c
}
} while(nextBreak > 0);
String ha1 = (passwordIsHash) ? String(password) : myUsername + ":" + myRealm + ":" + String(password);
String ha1 = (passwordIsHash) ? String(password) : stringMD5(myUsername + ":" + myRealm + ":" + String(password));
String ha2 = String(method) + ":" + myUri;
String response = stringMD5(ha1) + ":" + myNonce + ":" + myNc + ":" + myCnonce + ":" + myQop + ":" + stringMD5(ha2);
String response = ha1 + ":" + myNonce + ":" + myNc + ":" + myCnonce + ":" + myQop + ":" + stringMD5(ha2);
if(myResponse.equals(stringMD5(response))){
//os_printf("AUTH SUCCESS\n");