summaryrefslogtreecommitdiffstats
path: root/net/http/http_auth_sspi_win.h
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-21 21:38:05 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-21 21:38:05 +0000
commit4fd4a6da1114c4df949d0bf0281b4ecbfbb73534 (patch)
tree0367c2b9f0a2f7f22185fbc69f2df6ccbee5f6e9 /net/http/http_auth_sspi_win.h
parent7106ae5055a009e1ca53f0fc5ee6bb6b0c925c9f (diff)
downloadchromium_src-4fd4a6da1114c4df949d0bf0281b4ecbfbb73534.zip
chromium_src-4fd4a6da1114c4df949d0bf0281b4ecbfbb73534.tar.gz
chromium_src-4fd4a6da1114c4df949d0bf0281b4ecbfbb73534.tar.bz2
Added WWW-Authenticate Negotate support using shared HttpAuthSspi.
BUG=29862 TEST=None Review URL: http://codereview.chromium.org/551015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36785 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_sspi_win.h')
-rwxr-xr-xnet/http/http_auth_sspi_win.h47
1 files changed, 46 insertions, 1 deletions
diff --git a/net/http/http_auth_sspi_win.h b/net/http/http_auth_sspi_win.h
index d58678b..4d340aa 100755
--- a/net/http/http_auth_sspi_win.h
+++ b/net/http/http_auth_sspi_win.h
@@ -16,8 +16,53 @@
#include <string>
+class GURL;
+
namespace net {
+class HttpRequestInfo;
+class ProxyInfo;
+
+class HttpAuthSSPI {
+ public:
+ HttpAuthSSPI(const std::string& scheme,
+ SEC_WCHAR* security_package);
+ ~HttpAuthSSPI();
+
+ bool NeedsIdentity() const;
+ bool IsFinalRound() const;
+
+ bool ParseChallenge(std::string::const_iterator challenge_begin,
+ std::string::const_iterator challenge_end);
+
+ int GenerateCredentials(const std::wstring& username,
+ const std::wstring& password,
+ const GURL& origin,
+ const HttpRequestInfo* request,
+ const ProxyInfo* proxy,
+ std::string* out_credentials);
+
+ private:
+ int OnFirstRound(const std::wstring& domain,
+ const std::wstring& user,
+ const std::wstring& password);
+
+ int GetNextSecurityToken(
+ const GURL& origin,
+ const void* in_token,
+ int in_token_len,
+ void** out_token,
+ int* out_token_len);
+
+ void ResetSecurityContext();
+ std::string scheme_;
+ SEC_WCHAR* security_package_;
+ std::string decoded_server_auth_token_;
+ ULONG max_token_length_;
+ CredHandle cred_;
+ CtxtHandle ctxt_;
+};
+
// Splits |combined| into domain and username.
// If |combined| is of form "FOO\bar", |domain| will contain "FOO" and |user|
// will contain "bar".
@@ -41,7 +86,7 @@ int AcquireCredentials(const SEC_WCHAR* package,
const std::wstring& user,
const std::wstring& password,
CredHandle* cred);
-} // namespace net
+} // namespace net
#endif // NET_HTTP_HTTP_AUTH_SSPI_WIN_H_