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

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

Issue 448143008: Move StringToUpperASCII and LowerCaseEqualsASCII to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_auth_handler_mock.cc ('k') | net/http/http_auth_handler_ntlm_portable.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 return auth_sspi_.ParseChallenge(tok); 107 return auth_sspi_.ParseChallenge(tok);
108 #else 108 #else
109 // TODO(cbentzel): Most of the logic between SSPI, GSSAPI, and portable NTLM 109 // TODO(cbentzel): Most of the logic between SSPI, GSSAPI, and portable NTLM
110 // authentication parsing could probably be shared - just need to know if 110 // authentication parsing could probably be shared - just need to know if
111 // there was previously a challenge round. 111 // there was previously a challenge round.
112 // TODO(cbentzel): Write a test case to validate that auth_data_ is left empty 112 // TODO(cbentzel): Write a test case to validate that auth_data_ is left empty
113 // in all failure conditions. 113 // in all failure conditions.
114 auth_data_.clear(); 114 auth_data_.clear();
115 115
116 // Verify the challenge's auth-scheme. 116 // Verify the challenge's auth-scheme.
117 if (!LowerCaseEqualsASCII(tok->scheme(), "ntlm")) 117 if (!base::LowerCaseEqualsASCII(tok->scheme(), "ntlm"))
118 return HttpAuth::AUTHORIZATION_RESULT_INVALID; 118 return HttpAuth::AUTHORIZATION_RESULT_INVALID;
119 119
120 std::string base64_param = tok->base64_param(); 120 std::string base64_param = tok->base64_param();
121 if (base64_param.empty()) { 121 if (base64_param.empty()) {
122 if (!initial_challenge) 122 if (!initial_challenge)
123 return HttpAuth::AUTHORIZATION_RESULT_REJECT; 123 return HttpAuth::AUTHORIZATION_RESULT_REJECT;
124 return HttpAuth::AUTHORIZATION_RESULT_ACCEPT; 124 return HttpAuth::AUTHORIZATION_RESULT_ACCEPT;
125 } else { 125 } else {
126 if (initial_challenge) 126 if (initial_challenge)
127 return HttpAuth::AUTHORIZATION_RESULT_INVALID; 127 return HttpAuth::AUTHORIZATION_RESULT_INVALID;
128 } 128 }
129 129
130 auth_data_ = base64_param; 130 auth_data_ = base64_param;
131 return HttpAuth::AUTHORIZATION_RESULT_ACCEPT; 131 return HttpAuth::AUTHORIZATION_RESULT_ACCEPT;
132 #endif // defined(NTLM_SSPI) 132 #endif // defined(NTLM_SSPI)
133 } 133 }
134 134
135 // static 135 // static
136 std::string HttpAuthHandlerNTLM::CreateSPN(const GURL& origin) { 136 std::string HttpAuthHandlerNTLM::CreateSPN(const GURL& origin) {
137 // The service principal name of the destination server. See 137 // The service principal name of the destination server. See
138 // http://msdn.microsoft.com/en-us/library/ms677949%28VS.85%29.aspx 138 // http://msdn.microsoft.com/en-us/library/ms677949%28VS.85%29.aspx
139 std::string target("HTTP/"); 139 std::string target("HTTP/");
140 target.append(GetHostAndPort(origin)); 140 target.append(GetHostAndPort(origin));
141 return target; 141 return target;
142 } 142 }
143 143
144 } // namespace net 144 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_mock.cc ('k') | net/http/http_auth_handler_ntlm_portable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698