From b22441dfca4be0287511838eda615cb9b2af90f7 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 7 May 2020 19:10:15 +0200 Subject: [PATCH] BUG/MINOR: http-ana: fix NTLM response parsing again 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. (cherry picked from commit 49a1d28fcb69b87317ab7ae7f26505c69ec927d9) Signed-off-by: Christopher Faulet --- src/http_ana.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http_ana.c b/src/http_ana.c index 332ae22..6c3336e 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -1793,7 +1793,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; } -- 1.7.10.4