Index: net/http/http_auth_handler_negotiate.h |
diff --git a/net/http/http_auth_handler_negotiate.h b/net/http/http_auth_handler_negotiate.h |
index a9af8d4d5d0bfcc835b29ce22e19078a4289c5a6..49459037022f18f595918982a8f760c85a181495 100644 |
--- a/net/http/http_auth_handler_negotiate.h |
+++ b/net/http/http_auth_handler_negotiate.h |
@@ -17,6 +17,14 @@ |
#include "net/http/http_auth_sspi_win.h" |
#endif |
+#if defined(OS_POSIX) |
+#include "net/http/http_auth_gssapi_posix.h" |
+#endif |
+ |
+namespace gssapi { |
+struct gss_buffer_desc_struct; |
+} // namespace gssapi |
+ |
namespace net { |
class SingleRequestHostResolver; |
@@ -68,6 +76,17 @@ class HttpAuthHandlerNegotiate : public HttpAuthHandler { |
sspi_library_ = sspi_library; |
} |
#endif // defined(OS_WIN) |
+#if defined(OS_POSIX) |
+ // Set the GSSAPILibrary to use. Typically the only callers which need to |
+ // use this are unit tests which pass in a mocked-out version of the |
+ // GSSAPI library. |
+ // The caller is responsible for managing the lifetime of |*gssapi_library|, |
+ // and the lifetime must exceed that of this Factory object and all |
+ // HttpAuthHandler's that this Factory object creates. |
+ void set_gssapi_library(GSSAPILibrary* gssapi_library) { |
+ gssapi_library_ = gssapi_library; |
+ } |
+#endif // defined(OS_WIN) |
private: |
bool disable_cname_lookup_; |
bool use_port_; |
@@ -77,14 +96,22 @@ class HttpAuthHandlerNegotiate : public HttpAuthHandler { |
bool is_unsupported_; |
SSPILibrary* sspi_library_; |
#endif // defined(OS_WIN) |
+#if defined(OS_POSIX) |
+ GSSAPILibrary* gssapi_library_; |
+#endif // defined(OS_POSIX) |
}; |
#if defined(OS_WIN) |
- HttpAuthHandlerNegotiate(SSPILibrary* sspi_library, ULONG max_token_length, |
+ HttpAuthHandlerNegotiate(SSPILibrary* sspi_library, |
+ ULONG max_token_length, |
URLSecurityManager* url_security_manager, |
- bool disable_cname_lookup, bool use_port); |
+ bool disable_cname_lookup, |
+ bool use_port); |
#else |
- explicit HttpAuthHandlerNegotiate(URLSecurityManager* url_security_manager); |
+ HttpAuthHandlerNegotiate(GSSAPILibrary* library, |
+ URLSecurityManager* url_security_manager, |
+ bool disable_cname_lookup, |
+ bool use_port); |
#endif |
virtual bool NeedsIdentity(); |
@@ -109,11 +136,9 @@ class HttpAuthHandlerNegotiate : public HttpAuthHandler { |
CompletionCallback* callback, |
const BoundNetLog& net_log); |
-#if defined(OS_WIN) |
// These are public for unit tests |
std::wstring CreateSPN(const AddressList& address_list, const GURL& orign); |
const std::wstring& spn() const { return spn_; } |
-#endif // defined(OS_WIN) |
protected: |
virtual bool Init(HttpAuth::ChallengeTokenizer* challenge); |
@@ -121,17 +146,25 @@ class HttpAuthHandlerNegotiate : public HttpAuthHandler { |
private: |
~HttpAuthHandlerNegotiate(); |
-#if defined(OS_WIN) |
void OnResolveCanonicalName(int result); |
+ |
+#if defined(OS_WIN) |
HttpAuthSSPI auth_sspi_; |
- AddressList address_list_; |
+#endif |
+ |
+#if defined(OS_POSIX) |
+ HttpAuthGSSAPI auth_gssapi_; |
+ gssapi::gss_buffer_desc_struct* current_token_; |
+#endif // defined(OS_POSIX) |
+ |
scoped_ptr<SingleRequestHostResolver> single_resolve_; |
CompletionCallback* user_callback_; |
CompletionCallbackImpl<HttpAuthHandlerNegotiate> resolve_cname_callback_; |
+ |
bool disable_cname_lookup_; |
bool use_port_; |
std::wstring spn_; |
-#endif |
+ AddressList address_list_; |
URLSecurityManager* url_security_manager_; |
}; |