digest: handle quotes in the path

- The 'uri' component needs to be escaped as well
- Rewrote the quote function to use dynbuf
- Build the digest at least partly with dynbuf
- Use goto as a general error mechanism
- Make test 64 use a double quote in the URL

Closes #20295
This commit is contained in:
Daniel Stenberg 2026-01-13 15:31:06 +01:00
parent 2949faa93c
commit 134fb66121
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 146 additions and 145 deletions

View file

@ -61,21 +61,21 @@ digest
HTTP with Digest authorization
</name>
<command>
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --digest
'http://%HOSTIP:%HTTPPORT/%TESTNUMBER"' -u testuser:testpass --digest
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol crlf="headers">
GET /%TESTNUMBER HTTP/1.1
GET /%TESTNUMBER" HTTP/1.1
Host: %HOSTIP:%HTTPPORT
User-Agent: curl/%VERSION
Accept: */*
GET /%TESTNUMBER HTTP/1.1
GET /%TESTNUMBER" HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER", response="c55f7f30d83d774a3d2dcacf725abaca"
Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER\"", response="1ee14b238b3259f17602e9ce41491ef9"
User-Agent: curl/%VERSION
Accept: */*