digest: compute user:realm:pass digest w/o userhash

https://datatracker.ietf.org/doc/html/rfc7616#section-3.4.4
  ... the client MUST calculate a hash of the username after
      any other hash calculation ...

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
Closes #8066
This commit is contained in:
Glenn Strauss 2021-11-28 02:22:40 -05:00 committed by Daniel Stenberg
parent 6ad053060d
commit aae235b6ba
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 17 additions and 18 deletions

View file

@ -722,8 +722,7 @@ static CURLcode auth_create_digest_http_message(
unq(nonce-value) ":" unq(cnonce-value)
*/
hashthis = aprintf("%s:%s:%s", digest->userhash ? userh : userp,
digest->realm, passwdp);
hashthis = aprintf("%s:%s:%s", userp, digest->realm, passwdp);
if(!hashthis)
return CURLE_OUT_OF_MEMORY;