fixup hash the unquoted URI

This commit is contained in:
Daniel Stenberg 2026-01-14 09:43:03 +01:00
parent e130c8ff61
commit 4aa5e2b4ed
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 5 additions and 3 deletions

View file

@ -783,7 +783,7 @@ static CURLcode auth_create_digest_http_message(
goto oom;
}
hashthis = curl_maprintf("%s:%s", request, uri_quoted);
hashthis = curl_maprintf("%s:%s", request, uripath);
if(!hashthis) {
result = CURLE_OUT_OF_MEMORY;
goto oom;
@ -908,8 +908,10 @@ static CURLcode auth_create_digest_http_message(
if(digest->opaque) {
/* Append the opaque */
char *opaque_quoted = auth_digest_string_quoted(digest->opaque);
if(!opaque_quoted)
if(!opaque_quoted) {
result = CURLE_OUT_OF_MEMORY;
goto oom;
}
result = curlx_dyn_addf(&response, ", opaque=\"%s\"", opaque_quoted);
curlx_free(opaque_quoted);
if(result)

View file

@ -75,7 +75,7 @@ Accept: */*
GET /%TESTNUMBER" HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER\"", response="eacb00efdf72fed986b32b8d42e99bb9"
Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER\"", response="1ee14b238b3259f17602e9ce41491ef9"
User-Agent: curl/%VERSION
Accept: */*