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

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

Issue 448853002: Move StringToLowerASCII to 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_factory.cc ('k') | net/http/http_log_util.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 // See "SSPI Sample Application" at 5 // See "SSPI Sample Application" at
6 // http://msdn.microsoft.com/en-us/library/aa918273.aspx 6 // http://msdn.microsoft.com/en-us/library/aa918273.aspx
7 7
8 #include "net/http/http_auth_sspi_win.h" 8 #include "net/http/http_auth_sspi_win.h"
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 void HttpAuthSSPI::ResetSecurityContext() { 222 void HttpAuthSSPI::ResetSecurityContext() {
223 if (SecIsValidHandle(&ctxt_)) { 223 if (SecIsValidHandle(&ctxt_)) {
224 library_->DeleteSecurityContext(&ctxt_); 224 library_->DeleteSecurityContext(&ctxt_);
225 SecInvalidateHandle(&ctxt_); 225 SecInvalidateHandle(&ctxt_);
226 } 226 }
227 } 227 }
228 228
229 HttpAuth::AuthorizationResult HttpAuthSSPI::ParseChallenge( 229 HttpAuth::AuthorizationResult HttpAuthSSPI::ParseChallenge(
230 HttpAuthChallengeTokenizer* tok) { 230 HttpAuthChallengeTokenizer* tok) {
231 // Verify the challenge's auth-scheme. 231 // Verify the challenge's auth-scheme.
232 if (!LowerCaseEqualsASCII(tok->scheme(), StringToLowerASCII(scheme_).c_str())) 232 if (!LowerCaseEqualsASCII(tok->scheme(),
233 base::StringToLowerASCII(scheme_).c_str()))
233 return HttpAuth::AUTHORIZATION_RESULT_INVALID; 234 return HttpAuth::AUTHORIZATION_RESULT_INVALID;
234 235
235 std::string encoded_auth_token = tok->base64_param(); 236 std::string encoded_auth_token = tok->base64_param();
236 if (encoded_auth_token.empty()) { 237 if (encoded_auth_token.empty()) {
237 // If a context has already been established, an empty challenge 238 // If a context has already been established, an empty challenge
238 // should be treated as a rejection of the current attempt. 239 // should be treated as a rejection of the current attempt.
239 if (SecIsValidHandle(&ctxt_)) 240 if (SecIsValidHandle(&ctxt_))
240 return HttpAuth::AUTHORIZATION_RESULT_REJECT; 241 return HttpAuth::AUTHORIZATION_RESULT_REJECT;
241 DCHECK(decoded_server_auth_token_.empty()); 242 DCHECK(decoded_server_auth_token_.empty());
242 return HttpAuth::AUTHORIZATION_RESULT_ACCEPT; 243 return HttpAuth::AUTHORIZATION_RESULT_ACCEPT;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 int token_length = pkg_info->cbMaxToken; 419 int token_length = pkg_info->cbMaxToken;
419 status = library->FreeContextBuffer(pkg_info); 420 status = library->FreeContextBuffer(pkg_info);
420 rv = MapFreeContextBufferStatusToError(status); 421 rv = MapFreeContextBufferStatusToError(status);
421 if (rv != OK) 422 if (rv != OK)
422 return rv; 423 return rv;
423 *max_token_length = token_length; 424 *max_token_length = token_length;
424 return OK; 425 return OK;
425 } 426 }
426 427
427 } // namespace net 428 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_factory.cc ('k') | net/http/http_log_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698