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

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

Issue 101113004: Revert 239759 "The comment in base64.h implies that base::Base64..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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
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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 decoded_server_auth_token_.c_str())), 273 decoded_server_auth_token_.c_str())),
274 decoded_server_auth_token_.length(), 274 decoded_server_auth_token_.length(),
275 &out_buf, 275 &out_buf,
276 &out_buf_len); 276 &out_buf_len);
277 if (rv != OK) 277 if (rv != OK)
278 return rv; 278 return rv;
279 279
280 // Base64 encode data in output buffer and prepend the scheme. 280 // Base64 encode data in output buffer and prepend the scheme.
281 std::string encode_input(static_cast<char*>(out_buf), out_buf_len); 281 std::string encode_input(static_cast<char*>(out_buf), out_buf_len);
282 std::string encode_output; 282 std::string encode_output;
283 base::Base64Encode(encode_input, &encode_output); 283 bool base64_rv = base::Base64Encode(encode_input, &encode_output);
284 // OK, we are done with |out_buf| 284 // OK, we are done with |out_buf|
285 free(out_buf); 285 free(out_buf);
286 if (!base64_rv) {
287 LOG(ERROR) << "Base64 encoding of auth token failed.";
288 return ERR_ENCODING_CONVERSION_FAILED;
289 }
286 *auth_token = scheme_ + " " + encode_output; 290 *auth_token = scheme_ + " " + encode_output;
287 return OK; 291 return OK;
288 } 292 }
289 293
290 int HttpAuthSSPI::OnFirstRound(const AuthCredentials* credentials) { 294 int HttpAuthSSPI::OnFirstRound(const AuthCredentials* credentials) {
291 DCHECK(!SecIsValidHandle(&cred_)); 295 DCHECK(!SecIsValidHandle(&cred_));
292 int rv = OK; 296 int rv = OK;
293 if (credentials) { 297 if (credentials) {
294 base::string16 domain; 298 base::string16 domain;
295 base::string16 user; 299 base::string16 user;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 int token_length = pkg_info->cbMaxToken; 421 int token_length = pkg_info->cbMaxToken;
418 status = library->FreeContextBuffer(pkg_info); 422 status = library->FreeContextBuffer(pkg_info);
419 rv = MapFreeContextBufferStatusToError(status); 423 rv = MapFreeContextBufferStatusToError(status);
420 if (rv != OK) 424 if (rv != OK)
421 return rv; 425 return rv;
422 *max_token_length = token_length; 426 *max_token_length = token_length;
423 return OK; 427 return OK;
424 } 428 }
425 429
426 } // namespace net 430 } // namespace net
OLDNEW
« no previous file with comments | « trunk/src/net/http/http_auth_handler_ntlm.cc ('k') | trunk/src/net/test/spawned_test_server/base_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698