| 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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 gss_oid_(gss_oid), | 660 gss_oid_(gss_oid), |
| 661 library_(library), | 661 library_(library), |
| 662 scoped_sec_context_(library), | 662 scoped_sec_context_(library), |
| 663 can_delegate_(false) { | 663 can_delegate_(false) { |
| 664 DCHECK(library_); | 664 DCHECK(library_); |
| 665 } | 665 } |
| 666 | 666 |
| 667 HttpAuthGSSAPI::~HttpAuthGSSAPI() { | 667 HttpAuthGSSAPI::~HttpAuthGSSAPI() { |
| 668 } | 668 } |
| 669 | 669 |
| 670 // TODO(asanka): Take a HttpResonseInfo along with the initial challenge to |
| 671 // initialize the HttpAuthHandler. Then HttpAuthHandlerNegotiate can generate a |
| 672 // channel binding token from the SSLInfo which can then be used when tokens are |
| 673 // being generated. |
| 674 // |
| 675 // Only the HandleAnotherChallenge() and InitFromChallenge() phases have |
| 676 // realiable access to a HttpResonseInfo. |
| 677 // |
| 678 // There is a lot of cleanup to do here, but should be kept separate from the |
| 679 // other ongoing work. |
| 680 // |
| 681 // We unfortunately can't move the token generation code to be after header |
| 682 // receipt in http_network_transaction because it's needed for pre-emptive |
| 683 // authentication :(. We need to make both HTTP auth challenge handling and |
| 684 // token generation to be potentially asynchronous. |
| 670 bool HttpAuthGSSAPI::Init() { | 685 bool HttpAuthGSSAPI::Init() { |
| 671 if (!library_) | 686 if (!library_) |
| 672 return false; | 687 return false; |
| 673 return library_->Init(); | 688 return library_->Init(); |
| 674 } | 689 } |
| 675 | 690 |
| 676 bool HttpAuthGSSAPI::NeedsIdentity() const { | 691 bool HttpAuthGSSAPI::NeedsIdentity() const { |
| 677 return decoded_server_auth_token_.empty(); | 692 return decoded_server_auth_token_.empty(); |
| 678 } | 693 } |
| 679 | 694 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 if (rv != OK) { | 877 if (rv != OK) { |
| 863 LOG(ERROR) << "Problem initializing context. \n" | 878 LOG(ERROR) << "Problem initializing context. \n" |
| 864 << DisplayExtendedStatus(library_, major_status, minor_status) | 879 << DisplayExtendedStatus(library_, major_status, minor_status) |
| 865 << '\n' | 880 << '\n' |
| 866 << DescribeContext(library_, scoped_sec_context_.get()); | 881 << DescribeContext(library_, scoped_sec_context_.get()); |
| 867 } | 882 } |
| 868 return rv; | 883 return rv; |
| 869 } | 884 } |
| 870 | 885 |
| 871 } // namespace net | 886 } // namespace net |
| OLD | NEW |