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

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

Issue 1128043007: Support Kerberos on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a nit I had missed. Created 5 years, 6 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 // 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 std::string decoded_auth_token; 305 std::string decoded_auth_token;
306 bool base64_rv = base::Base64Decode(encoded_auth_token, &decoded_auth_token); 306 bool base64_rv = base::Base64Decode(encoded_auth_token, &decoded_auth_token);
307 if (!base64_rv) 307 if (!base64_rv)
308 return HttpAuth::AUTHORIZATION_RESULT_INVALID; 308 return HttpAuth::AUTHORIZATION_RESULT_INVALID;
309 decoded_server_auth_token_ = decoded_auth_token; 309 decoded_server_auth_token_ = decoded_auth_token;
310 return HttpAuth::AUTHORIZATION_RESULT_ACCEPT; 310 return HttpAuth::AUTHORIZATION_RESULT_ACCEPT;
311 } 311 }
312 312
313 int HttpAuthSSPI::GenerateAuthToken(const AuthCredentials* credentials, 313 int HttpAuthSSPI::GenerateAuthToken(const AuthCredentials* credentials,
314 const std::string& spn, 314 const std::string& spn,
315 std::string* auth_token) { 315 std::string* auth_token,
316 const CompletionCallback& /*callback*/) {
316 // Initial challenge. 317 // Initial challenge.
317 if (!SecIsValidHandle(&cred_)) { 318 if (!SecIsValidHandle(&cred_)) {
318 int rv = OnFirstRound(credentials); 319 int rv = OnFirstRound(credentials);
319 if (rv != OK) 320 if (rv != OK)
320 return rv; 321 return rv;
321 } 322 }
322 323
323 DCHECK(SecIsValidHandle(&cred_)); 324 DCHECK(SecIsValidHandle(&cred_));
324 void* out_buf; 325 void* out_buf;
325 int out_buf_len; 326 int out_buf_len;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 int token_length = pkg_info->cbMaxToken; 474 int token_length = pkg_info->cbMaxToken;
474 status = library->FreeContextBuffer(pkg_info); 475 status = library->FreeContextBuffer(pkg_info);
475 rv = MapFreeContextBufferStatusToError(status); 476 rv = MapFreeContextBufferStatusToError(status);
476 if (rv != OK) 477 if (rv != OK)
477 return rv; 478 return rv;
478 *max_token_length = token_length; 479 *max_token_length = token_length;
479 return OK; 480 return OK;
480 } 481 }
481 482
482 } // namespace net 483 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698