digest: pass over leading spaces in qop values

When parsing the "qop=" parameter of the digest authentication, and the
value is provided within quotes, the list of values can have leading
white space which the parser previously did not handle correctly.

Add test case 388 to verify.

Reported-by: vlubart on github
Fixes #9264
Closes #9270
This commit is contained in:
Daniel Stenberg 2022-08-08 00:30:58 +02:00
parent 3fe24ea322
commit 0ad7c8d7d5
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 160 additions and 1 deletions

View file

@ -560,6 +560,9 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
token = strtok_r(tmp, ",", &tok_buf);
while(token) {
/* Pass additional spaces here */
while(*token && ISSPACE(*token))
token++;
if(strcasecompare(token, DIGEST_QOP_VALUE_STRING_AUTH)) {
foundAuth = TRUE;
}