diff options
author | ahendrickson@google.com <ahendrickson@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-28 18:03:04 +0000 |
---|---|---|
committer | ahendrickson@google.com <ahendrickson@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-28 18:03:04 +0000 |
commit | aef042746af7a3a9a9967195c24cb7a9c755a0e8 (patch) | |
tree | 2c0aa7088f240c63f1f12b2bd19651314cdfc928 /net/http/http_auth_gssapi_posix.h | |
parent | f9f41ec4f27ba5fd19ca82d4c04b13bed6627d23 (diff) | |
download | chromium_src-aef042746af7a3a9a9967195c24cb7a9c755a0e8.zip chromium_src-aef042746af7a3a9a9967195c24cb7a9c755a0e8.tar.gz chromium_src-aef042746af7a3a9a9967195c24cb7a9c755a0e8.tar.bz2 |
Hooking GSSAPI code into HTTP authenticate Negotiate handler.
BUG=33033.
TEST=None.
Review URL: http://codereview.chromium.org/2684001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51001 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_gssapi_posix.h')
-rw-r--r-- | net/http/http_auth_gssapi_posix.h | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/net/http/http_auth_gssapi_posix.h b/net/http/http_auth_gssapi_posix.h index 74089ba..d42a523 100644 --- a/net/http/http_auth_gssapi_posix.h +++ b/net/http/http_auth_gssapi_posix.h @@ -19,10 +19,10 @@ class GURL; namespace net { class HttpRequestInfo; -class ProxyInfo; extern gss_OID CHROME_GSS_C_NT_HOSTBASED_SERVICE_X; extern gss_OID CHROME_GSS_C_NT_HOSTBASED_SERVICE; +extern gss_OID CHROME_GSS_KRB5_MECH_OID_DESC; // GSSAPILibrary is introduced so unit tests can mock the calls to the GSSAPI // library. The default implementation attempts to load one of the standard @@ -49,6 +49,11 @@ class GSSAPILibrary { virtual OM_uint32 release_buffer( OM_uint32* minor_status, gss_buffer_t buffer) = 0; + virtual OM_uint32 display_name( + OM_uint32* minor_status, + const gss_name_t input_name, + gss_buffer_t output_name_buffer, + gss_OID* output_name_type) = 0; virtual OM_uint32 display_status( OM_uint32* minor_status, OM_uint32 status_value, @@ -81,6 +86,16 @@ class GSSAPILibrary { OM_uint32* minor_status, gss_ctx_id_t* context_handle, gss_buffer_t output_token) = 0; + virtual OM_uint32 inquire_context( + OM_uint32* minor_status, + const gss_ctx_id_t context_handle, + gss_name_t* src_name, + gss_name_t* targ_name, + OM_uint32* lifetime_rec, + gss_OID* mech_type, + OM_uint32* ctx_flags, + int* locally_initiated, + int* open) = 0; // Get the default GSSPILibrary instance. The object returned is a singleton // instance, and the caller should not delete it. @@ -106,6 +121,11 @@ class GSSAPISharedLibrary : public GSSAPILibrary { virtual OM_uint32 release_buffer( OM_uint32* minor_status, gss_buffer_t buffer); + virtual OM_uint32 display_name( + OM_uint32* minor_status, + const gss_name_t input_name, + gss_buffer_t output_name_buffer, + gss_OID* output_name_type); virtual OM_uint32 display_status( OM_uint32* minor_status, OM_uint32 status_value, @@ -138,6 +158,16 @@ class GSSAPISharedLibrary : public GSSAPILibrary { OM_uint32* minor_status, gss_ctx_id_t* context_handle, gss_buffer_t output_token); + virtual OM_uint32 inquire_context( + OM_uint32* minor_status, + const gss_ctx_id_t context_handle, + gss_name_t* src_name, + gss_name_t* targ_name, + OM_uint32* lifetime_rec, + gss_OID* mech_type, + OM_uint32* ctx_flags, + int* locally_initiated, + int* open); private: FRIEND_TEST_ALL_PREFIXES(HttpAuthGSSAPIPOSIXTest, GSSAPIStartup); @@ -158,10 +188,12 @@ class GSSAPISharedLibrary : public GSSAPILibrary { gss_import_name_type import_name_; gss_release_name_type release_name_; gss_release_buffer_type release_buffer_; + gss_display_name_type display_name_; gss_display_status_type display_status_; gss_init_sec_context_type init_sec_context_; gss_wrap_size_limit_type wrap_size_limit_; gss_delete_sec_context_type delete_sec_context_; + gss_inquire_context_type inquire_context_; }; // ScopedSecurityContext releases a gss_ctx_id_t when it goes out of @@ -171,6 +203,7 @@ class ScopedSecurityContext { ScopedSecurityContext(GSSAPILibrary* gssapi_lib); ~ScopedSecurityContext(); + const gss_ctx_id_t get() const { return security_context_; } gss_ctx_id_t* receive() { return &security_context_; } private: @@ -181,7 +214,7 @@ class ScopedSecurityContext { }; -// TODO(cbentzel): Share code with HttpAuthSSPI. +// TODO(ahendrickson): Share code with HttpAuthSSPI. class HttpAuthGSSAPI { public: HttpAuthGSSAPI(GSSAPILibrary* library, @@ -189,6 +222,8 @@ class HttpAuthGSSAPI { const gss_OID gss_oid); ~HttpAuthGSSAPI(); + bool Init(); + bool NeedsIdentity() const; bool IsFinalRound() const; @@ -206,7 +241,6 @@ class HttpAuthGSSAPI { const std::wstring* password, const std::wstring& spn, const HttpRequestInfo* request, - const ProxyInfo* proxy, std::string* auth_token); private: |