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

Side by Side Diff: net/http/http_auth_handler_ntlm.cc

Issue 1128043007: Support Kerberos on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cbentzel@'s nits Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_auth_handler_ntlm.h" 5 #include "net/http/http_auth_handler_ntlm.h"
6 6
7 #if !defined(NTLM_SSPI) 7 #if !defined(NTLM_SSPI)
8 #include "base/base64.h" 8 #include "base/base64.h"
9 #endif 9 #endif
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 15 matching lines...) Expand all
26 score_ = 3; 26 score_ = 3;
27 properties_ = ENCRYPTS_IDENTITY | IS_CONNECTION_BASED; 27 properties_ = ENCRYPTS_IDENTITY | IS_CONNECTION_BASED;
28 28
29 return ParseChallenge(tok, true) == HttpAuth::AUTHORIZATION_RESULT_ACCEPT; 29 return ParseChallenge(tok, true) == HttpAuth::AUTHORIZATION_RESULT_ACCEPT;
30 } 30 }
31 31
32 int HttpAuthHandlerNTLM::GenerateAuthTokenImpl( 32 int HttpAuthHandlerNTLM::GenerateAuthTokenImpl(
33 const AuthCredentials* credentials, const HttpRequestInfo* request, 33 const AuthCredentials* credentials, const HttpRequestInfo* request,
34 const CompletionCallback& callback, std::string* auth_token) { 34 const CompletionCallback& callback, std::string* auth_token) {
35 #if defined(NTLM_SSPI) 35 #if defined(NTLM_SSPI)
36 return auth_sspi_.GenerateAuthToken( 36 return auth_sspi_.GenerateAuthToken(credentials, CreateSPN(origin_),
37 credentials, 37 auth_token, callback);
38 CreateSPN(origin_),
39 auth_token);
40 #else // !defined(NTLM_SSPI) 38 #else // !defined(NTLM_SSPI)
41 // TODO(cbentzel): Shouldn't be hitting this case. 39 // TODO(cbentzel): Shouldn't be hitting this case.
42 if (!credentials) { 40 if (!credentials) {
43 LOG(ERROR) << "Username and password are expected to be non-NULL."; 41 LOG(ERROR) << "Username and password are expected to be non-NULL.";
44 return ERR_MISSING_AUTH_CREDENTIALS; 42 return ERR_MISSING_AUTH_CREDENTIALS;
45 } 43 }
46 // TODO(wtc): See if we can use char* instead of void* for in_buf and 44 // TODO(wtc): See if we can use char* instead of void* for in_buf and
47 // out_buf. This change will need to propagate to GetNextToken, 45 // out_buf. This change will need to propagate to GetNextToken,
48 // GenerateType1Msg, and GenerateType3Msg, and perhaps further. 46 // GenerateType1Msg, and GenerateType3Msg, and perhaps further.
49 const void* in_buf; 47 const void* in_buf;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // static 133 // static
136 std::string HttpAuthHandlerNTLM::CreateSPN(const GURL& origin) { 134 std::string HttpAuthHandlerNTLM::CreateSPN(const GURL& origin) {
137 // The service principal name of the destination server. See 135 // The service principal name of the destination server. See
138 // http://msdn.microsoft.com/en-us/library/ms677949%28VS.85%29.aspx 136 // http://msdn.microsoft.com/en-us/library/ms677949%28VS.85%29.aspx
139 std::string target("HTTP/"); 137 std::string target("HTTP/");
140 target.append(GetHostAndPort(origin)); 138 target.append(GetHostAndPort(origin));
141 return target; 139 return target;
142 } 140 }
143 141
144 } // namespace net 142 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698