mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Allow a challenge with no auth-params.
This commit is contained in:
15
ncat/http.c
15
ncat/http.c
@@ -1292,8 +1292,23 @@ static const char *http_read_challenge(const char *s, struct http_challenge *cha
|
|||||||
free(scheme);
|
free(scheme);
|
||||||
scheme = NULL;
|
scheme = NULL;
|
||||||
|
|
||||||
|
/* RFC 2617, section 1.2, requires at least one auth-param:
|
||||||
|
challenge = auth-scheme 1*SP 1#auth-param
|
||||||
|
But there are some schemes (NTLM and Negotiate) that can be without
|
||||||
|
auth-params, so we allow that here. A comma indicates the end of this
|
||||||
|
challenge and the beginning of the next (see the comment in the loop
|
||||||
|
below). */
|
||||||
while (is_space_char(*s))
|
while (is_space_char(*s))
|
||||||
s++;
|
s++;
|
||||||
|
if (*s == ',') {
|
||||||
|
s++;
|
||||||
|
while (is_space_char(*s))
|
||||||
|
s++;
|
||||||
|
if (*s == '\0')
|
||||||
|
goto bail;
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
while (*s != '\0') {
|
while (*s != '\0') {
|
||||||
char *name, *value;
|
char *name, *value;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user