Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Unified Diff: net/http/http_auth_handler_ntlm.cc

Issue 1535019: Kerberos SPN generation for Negotiate challenges (Closed)
Patch Set: Fix to GetCanonicalName that is another CL. Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_auth_handler_ntlm.h ('k') | net/http/http_auth_handler_ntlm_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler_ntlm.cc
diff --git a/net/http/http_auth_handler_ntlm.cc b/net/http/http_auth_handler_ntlm.cc
index dab239d7790b34f1421d5fe4f881a7f6c0967dfb..ed3eb3a1224b7fe2913925c6e2ab85780ca10cd2 100644
--- a/net/http/http_auth_handler_ntlm.cc
+++ b/net/http/http_auth_handler_ntlm.cc
@@ -9,6 +9,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "net/base/net_errors.h"
+#include "net/base/net_util.h"
namespace net {
@@ -22,7 +23,7 @@ int HttpAuthHandlerNTLM::GenerateAuthToken(
return auth_sspi_.GenerateAuthToken(
&username,
&password,
- origin_,
+ CreateSPN(origin_),
request,
proxy,
auth_token);
@@ -109,4 +110,13 @@ bool HttpAuthHandlerNTLM::ParseChallenge(
#endif // defined(NTLM_SSPI)
}
+// static
+std::wstring HttpAuthHandlerNTLM::CreateSPN(const GURL& origin) {
+ // The service principal name of the destination server. See
+ // http://msdn.microsoft.com/en-us/library/ms677949%28VS.85%29.aspx
+ std::wstring target(L"HTTP/");
+ target.append(ASCIIToWide(GetHostAndPort(origin)));
+ return target;
+}
+
} // namespace net
« no previous file with comments | « net/http/http_auth_handler_ntlm.h ('k') | net/http/http_auth_handler_ntlm_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698