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

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

Issue 8340026: Use AuthCredentials throughout the network stack instead of username/password. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: mac compile fix Created 9 years, 1 month 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 #include "net/http/http_auth_gssapi_posix.h" 5 #include "net/http/http_auth_gssapi_posix.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 716
717 // Make sure the additional token is base64 encoded. 717 // Make sure the additional token is base64 encoded.
718 std::string decoded_auth_token; 718 std::string decoded_auth_token;
719 bool base64_rv = base::Base64Decode(encoded_auth_token, &decoded_auth_token); 719 bool base64_rv = base::Base64Decode(encoded_auth_token, &decoded_auth_token);
720 if (!base64_rv) 720 if (!base64_rv)
721 return HttpAuth::AUTHORIZATION_RESULT_INVALID; 721 return HttpAuth::AUTHORIZATION_RESULT_INVALID;
722 decoded_server_auth_token_ = decoded_auth_token; 722 decoded_server_auth_token_ = decoded_auth_token;
723 return HttpAuth::AUTHORIZATION_RESULT_ACCEPT; 723 return HttpAuth::AUTHORIZATION_RESULT_ACCEPT;
724 } 724 }
725 725
726 int HttpAuthGSSAPI::GenerateAuthToken(const string16* username, 726 int HttpAuthGSSAPI::GenerateAuthToken(const AuthCredentials* credentials,
727 const string16* password,
728 const std::wstring& spn, 727 const std::wstring& spn,
729 std::string* auth_token) { 728 std::string* auth_token) {
730 DCHECK(auth_token); 729 DCHECK(auth_token);
731 DCHECK(username == NULL && password == NULL);
732 730
733 gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER; 731 gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER;
734 input_token.length = decoded_server_auth_token_.length(); 732 input_token.length = decoded_server_auth_token_.length();
735 input_token.value = (input_token.length > 0) ? 733 input_token.value = (input_token.length > 0) ?
736 const_cast<char*>(decoded_server_auth_token_.data()) : 734 const_cast<char*>(decoded_server_auth_token_.data()) :
737 NULL; 735 NULL;
738 gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER; 736 gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER;
739 ScopedBuffer scoped_output_token(&output_token, library_); 737 ScopedBuffer scoped_output_token(&output_token, library_);
740 int rv = GetNextSecurityToken(spn, &input_token, &output_token); 738 int rv = GetNextSecurityToken(spn, &input_token, &output_token);
741 if (rv != OK) 739 if (rv != OK)
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 if (rv != OK) { 893 if (rv != OK) {
896 LOG(ERROR) << "Problem initializing context. \n" 894 LOG(ERROR) << "Problem initializing context. \n"
897 << DisplayExtendedStatus(library_, major_status, minor_status) 895 << DisplayExtendedStatus(library_, major_status, minor_status)
898 << '\n' 896 << '\n'
899 << DescribeContext(library_, scoped_sec_context_.get()); 897 << DescribeContext(library_, scoped_sec_context_.get());
900 } 898 }
901 return rv; 899 return rv;
902 } 900 }
903 901
904 } // namespace net 902 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698