]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Update NTLM and Negotiate TT result code handlers to use token=
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 22 Sep 2012 11:31:12 +0000 (23:31 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 22 Sep 2012 11:31:12 +0000 (23:31 +1200)
src/HelperReply.cc
src/auth/negotiate/UserRequest.cc
src/auth/ntlm/UserRequest.cc

index 24a67646d2bfd8b62c87eed7c46206a72fd25ccc..cfd7015627d4d26c5ff21207ce909af7324f4be0 100644 (file)
@@ -34,6 +34,10 @@ HelperReply::HelperReply(const char *buf, size_t len, bool urlQuoting) :
             // NTLM challenge token
             result = HelperReply::TT;
             p+=2;
+            // followed by an auth token
+            char *token = strwordtok(NULL, &p);
+            authToken.init();
+            authToken.append(token, strlen(token));
         } else if (!strncmp(p,"AF ",3)) {
             // NTLM/Negotate OK response
             result = HelperReply::OK;
index 24ae06081e43e1aad2aa864ec8cc0c062fb6abac..530fc908362d56f47f870506e65ec01a3a8a5420 100644 (file)
@@ -281,13 +281,13 @@ Auth::Negotiate::UserRequest::HandleReply(void *data, const HelperReply &reply)
         safe_free(lm_request->server_blob);
         lm_request->request->flags.must_keepalive = 1;
         if (lm_request->request->flags.proxy_keepalive) {
-            lm_request->server_blob = xstrdup(blob);
+            lm_request->server_blob = xstrdup(reply.authToken.content());
             auth_user_request->user()->credentials(Auth::Handshake);
             auth_user_request->denyMessage("Authentication in progress");
-            debugs(29, 4, HERE << "Need to challenge the client with a server blob '" << blob << "'");
+            debugs(29, 4, HERE << "Need to challenge the client with a server token: '" << reply.authToken << "'");
         } else {
             auth_user_request->user()->credentials(Auth::Failed);
-            auth_user_request->denyMessage("NTLM authentication requires a persistent connection");
+            auth_user_request->denyMessage("Negotiate authentication requires a persistent connection");
         }
         break;
 
index e613207b1250b5bfb014cf0d61d3c763b0a07425..8e9384608242ff600a5b233c49891b4f20d8d81e 100644 (file)
@@ -265,10 +265,10 @@ Auth::Ntlm::UserRequest::HandleReply(void *data, const HelperReply &reply)
         safe_free(lm_request->server_blob);
         lm_request->request->flags.must_keepalive = 1;
         if (lm_request->request->flags.proxy_keepalive) {
-            lm_request->server_blob = xstrdup(blob);
+            lm_request->server_blob = xstrdup(reply.authToken.content());
             auth_user_request->user()->credentials(Auth::Handshake);
             auth_user_request->denyMessage("Authentication in progress");
-            debugs(29, 4, HERE << "Need to challenge the client with a server blob '" << blob << "'");
+            debugs(29, 4, HERE << "Need to challenge the client with a server token: '" << reply.authToken << "'");
         } else {
             auth_user_request->user()->credentials(Auth::Failed);
             auth_user_request->denyMessage("NTLM authentication requires a persistent connection");