]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-ana: fix NTLM response parsing again
authorWilly Tarreau <w@1wt.eu>
Thu, 7 May 2020 17:10:15 +0000 (19:10 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 7 May 2020 17:22:37 +0000 (19:22 +0200)
Commit 9df188695f ("BUG/MEDIUM: http-ana: Handle NTLM messages correctly.")
tried to address an HTTP-reuse issue reported in github issue #511 by making
sure we properly detect extended NTLM responses, but made the match case-
sensitive while it's a token so it's case insensitive.

This should be backported to the same versions as the commit above.

src/http_ana.c

index d475cd24deeb296996ea7402555eeac51664b4cb..79124e7567a42c04f21ffc5555d94494a498d334 100644 (file)
@@ -1824,7 +1824,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
                ctx.blk = NULL;
                while (http_find_header(htx, hdr, &ctx, 0)) {
                        if ((ctx.value.len >= 9 && word_match(ctx.value.ptr, ctx.value.len, "Negotiate", 9)) ||
-                           (ctx.value.len >= 4 && !memcmp(ctx.value.ptr, "NTLM", 4))) {
+                           (ctx.value.len >= 4 && strncasecmp(ctx.value.ptr, "NTLM", 4) == 0)) {
                                sess->flags |= SESS_FL_PREFER_LAST;
                                srv_conn->flags |= CO_FL_PRIVATE;
                        }