Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Unified Diff: net/http/http_auth_handler_negotiate.h

Issue 2268002: Implemented mid-level Negotiate protocol for Posix. (Closed)
Patch Set: Merged with trunk. Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_auth_handler_factory_unittest.cc ('k') | net/http/http_auth_handler_negotiate_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
};
« no previous file with comments | « net/http/http_auth_handler_factory_unittest.cc ('k') | net/http/http_auth_handler_negotiate_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698