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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 return false; | 680 return false; |
681 } | 681 } |
682 | 682 |
683 void HttpAuthGSSAPI::Delegate() { | 683 void HttpAuthGSSAPI::Delegate() { |
684 can_delegate_ = true; | 684 can_delegate_ = true; |
685 } | 685 } |
686 | 686 |
687 HttpAuth::AuthorizationResult HttpAuthGSSAPI::ParseChallenge( | 687 HttpAuth::AuthorizationResult HttpAuthGSSAPI::ParseChallenge( |
688 HttpAuthChallengeTokenizer* tok) { | 688 HttpAuthChallengeTokenizer* tok) { |
689 // Verify the challenge's auth-scheme. | 689 // Verify the challenge's auth-scheme. |
690 if (!base::LowerCaseEqualsASCII(tok->scheme(), | 690 if (!LowerCaseEqualsASCII(tok->scheme(), |
691 base::StringToLowerASCII(scheme_).c_str())) | 691 base::StringToLowerASCII(scheme_).c_str())) |
692 return HttpAuth::AUTHORIZATION_RESULT_INVALID; | 692 return HttpAuth::AUTHORIZATION_RESULT_INVALID; |
693 | 693 |
694 std::string encoded_auth_token = tok->base64_param(); | 694 std::string encoded_auth_token = tok->base64_param(); |
695 | 695 |
696 if (encoded_auth_token.empty()) { | 696 if (encoded_auth_token.empty()) { |
697 // If a context has already been established, an empty Negotiate challenge | 697 // If a context has already been established, an empty Negotiate challenge |
698 // should be treated as a rejection of the current attempt. | 698 // should be treated as a rejection of the current attempt. |
699 if (scoped_sec_context_.get() != GSS_C_NO_CONTEXT) | 699 if (scoped_sec_context_.get() != GSS_C_NO_CONTEXT) |
700 return HttpAuth::AUTHORIZATION_RESULT_REJECT; | 700 return HttpAuth::AUTHORIZATION_RESULT_REJECT; |
701 DCHECK(decoded_server_auth_token_.empty()); | 701 DCHECK(decoded_server_auth_token_.empty()); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 if (rv != OK) { | 882 if (rv != OK) { |
883 LOG(ERROR) << "Problem initializing context. \n" | 883 LOG(ERROR) << "Problem initializing context. \n" |
884 << DisplayExtendedStatus(library_, major_status, minor_status) | 884 << DisplayExtendedStatus(library_, major_status, minor_status) |
885 << '\n' | 885 << '\n' |
886 << DescribeContext(library_, scoped_sec_context_.get()); | 886 << DescribeContext(library_, scoped_sec_context_.get()); |
887 } | 887 } |
888 return rv; | 888 return rv; |
889 } | 889 } |
890 | 890 |
891 } // namespace net | 891 } // namespace net |
OLD | NEW |