OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
712 std::string decoded_auth_token; | 712 std::string decoded_auth_token; |
713 bool base64_rv = base::Base64Decode(encoded_auth_token, &decoded_auth_token); | 713 bool base64_rv = base::Base64Decode(encoded_auth_token, &decoded_auth_token); |
714 if (!base64_rv) | 714 if (!base64_rv) |
715 return HttpAuth::AUTHORIZATION_RESULT_INVALID; | 715 return HttpAuth::AUTHORIZATION_RESULT_INVALID; |
716 decoded_server_auth_token_ = decoded_auth_token; | 716 decoded_server_auth_token_ = decoded_auth_token; |
717 return HttpAuth::AUTHORIZATION_RESULT_ACCEPT; | 717 return HttpAuth::AUTHORIZATION_RESULT_ACCEPT; |
718 } | 718 } |
719 | 719 |
720 int HttpAuthGSSAPI::GenerateAuthToken(const AuthCredentials* credentials, | 720 int HttpAuthGSSAPI::GenerateAuthToken(const AuthCredentials* credentials, |
721 const std::string& spn, | 721 const std::string& spn, |
722 std::string* auth_token) { | 722 std::string* auth_token, |
723 const CompletionCallback& callback) { | |
Bernhard Bauer
2015/05/15 15:06:16
Comment out the parameter name like on Windows?
aberent
2015/05/18 13:45:28
Done
| |
723 DCHECK(auth_token); | 724 DCHECK(auth_token); |
724 | 725 |
725 gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER; | 726 gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER; |
726 input_token.length = decoded_server_auth_token_.length(); | 727 input_token.length = decoded_server_auth_token_.length(); |
727 input_token.value = (input_token.length > 0) ? | 728 input_token.value = (input_token.length > 0) ? |
728 const_cast<char*>(decoded_server_auth_token_.data()) : | 729 const_cast<char*>(decoded_server_auth_token_.data()) : |
729 NULL; | 730 NULL; |
730 gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER; | 731 gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER; |
731 ScopedBuffer scoped_output_token(&output_token, library_); | 732 ScopedBuffer scoped_output_token(&output_token, library_); |
732 int rv = GetNextSecurityToken(spn, &input_token, &output_token); | 733 int rv = GetNextSecurityToken(spn, &input_token, &output_token); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
883 if (rv != OK) { | 884 if (rv != OK) { |
884 LOG(ERROR) << "Problem initializing context. \n" | 885 LOG(ERROR) << "Problem initializing context. \n" |
885 << DisplayExtendedStatus(library_, major_status, minor_status) | 886 << DisplayExtendedStatus(library_, major_status, minor_status) |
886 << '\n' | 887 << '\n' |
887 << DescribeContext(library_, scoped_sec_context_.get()); | 888 << DescribeContext(library_, scoped_sec_context_.get()); |
888 } | 889 } |
889 return rv; | 890 return rv; |
890 } | 891 } |
891 | 892 |
892 } // namespace net | 893 } // namespace net |
OLD | NEW |