You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Digest auth fails when the username or realm has non-ASCII bytes (regression since 8.21.0) #23683
A non-ASCII user name breaks the same way: -u 'josé:secret' sends username="jos%C3%A9".
I expected the following
The values should be echoed back exactly as received, which is what 8.20.0 does, and the authentication should succeed. Instead, every one of these requests ends with a 401.
a2b943b (digest: escape control codes too) added percent-encoding to auth_digest_string_quoted() for *s < ' ' and *s > 0x7e, and that catches every byte >= 0x80:
Where char is signed, those bytes are negative and match the first check.
Everywhere else, they match the second.
The response hash is still computed over the raw username and realm. Servers don't percent-decode quoted-string values (RFC 7616 uses unq()), so the server either can't find the user or realm, or it computes a different hash.
Bytes >= 0x80 are allowed as obs-text inside a quoted-string, so they don't need encoding. Only the control codes were the problem.
The same helper also quotes nonce, opaque and uri, and it is used by SASL DIGEST-MD5 (IMAP/POP3/SMTP), so those fields are affected the same way.
curl/libcurl version
curl 8.23.1-DEV (master, a502385). Affects 8.21.0 and later. Builds using Windows SSPI for Digest are not affected.
Activity