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

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

Issue 86913002: Make base::Base64Encode() return void (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: One more chromeos-specific fix. 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
« no previous file with comments | « net/http/http_auth_handler_ntlm.cc ('k') | net/test/spawned_test_server/base_test_server.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 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 bool base64_rv = base::Base64Encode(encode_input, &encode_output); 283 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 }
290 *auth_token = scheme_ + " " + encode_output; 286 *auth_token = scheme_ + " " + encode_output;
291 return OK; 287 return OK;
292 } 288 }
293 289
294 int HttpAuthSSPI::OnFirstRound(const AuthCredentials* credentials) { 290 int HttpAuthSSPI::OnFirstRound(const AuthCredentials* credentials) {
295 DCHECK(!SecIsValidHandle(&cred_)); 291 DCHECK(!SecIsValidHandle(&cred_));
296 int rv = OK; 292 int rv = OK;
297 if (credentials) { 293 if (credentials) {
298 base::string16 domain; 294 base::string16 domain;
299 base::string16 user; 295 base::string16 user;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 int token_length = pkg_info->cbMaxToken; 417 int token_length = pkg_info->cbMaxToken;
422 status = library->FreeContextBuffer(pkg_info); 418 status = library->FreeContextBuffer(pkg_info);
423 rv = MapFreeContextBufferStatusToError(status); 419 rv = MapFreeContextBufferStatusToError(status);
424 if (rv != OK) 420 if (rv != OK)
425 return rv; 421 return rv;
426 *max_token_length = token_length; 422 *max_token_length = token_length;
427 return OK; 423 return OK;
428 } 424 }
429 425
430 } // namespace net 426 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_ntlm.cc ('k') | net/test/spawned_test_server/base_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698