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-02-22 16:41:01 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-22 16:41:01 +0000
commit5b9eb6cd8f4428c4647e1546aa2461d0062e0301 (patch)
treed2ecf90ec66cfb7d1b6d3503f46973e9e4c381fe /net/http/http_auth_sspi_win.h
parent74d1423427b9665b5506e8fdc285597358ed3cf6 (diff)
downloadchromium_src-5b9eb6cd8f4428c4647e1546aa2461d0062e0301.zip
chromium_src-5b9eb6cd8f4428c4647e1546aa2461d0062e0301.tar.gz
chromium_src-5b9eb6cd8f4428c4647e1546aa2461d0062e0301.tar.bz2
Validate that an SSPI scheme is supported before generating a handler.
When SSPI is used (for Windows builds), the NTLM and Negotiate handler factories determine the maximum token length the first time it is used. The SSPI call to determinine the maximum length also returns an error code if the scheme is unsupported. The factories remember if the scheme is unsupported and will not attempt to create any handlers. If the token length is found, it is remembered. If a different error occurs, don't create a handler this round, but try again in the future. BUG=None TEST=Manually used an incorrect auth scheme and validated that it worked. Working on a mock SSPI Library I can use for unit testing. Review URL: http://codereview.chromium.org/600129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39600 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_sspi_win.h')
-rw-r--r--net/http/http_auth_sspi_win.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/net/http/http_auth_sspi_win.h b/net/http/http_auth_sspi_win.h
index 526e25b..186c65f 100644
--- a/net/http/http_auth_sspi_win.h
+++ b/net/http/http_auth_sspi_win.h
@@ -28,7 +28,8 @@ class ProxyInfo;
class HttpAuthSSPI {
public:
HttpAuthSSPI(const std::string& scheme,
- SEC_WCHAR* security_package);
+ SEC_WCHAR* security_package,
+ ULONG max_token_length);
~HttpAuthSSPI();
bool NeedsIdentity() const;
@@ -79,10 +80,20 @@ void SplitDomainAndUser(const std::wstring& combined,
std::wstring* domain,
std::wstring* user);
-// Determines the max token length for a particular SSPI package.
-// If the return value is not OK, than the value of max_token_length
-// is undefined.
-// |max_token_length| must be non-NULL.
+// Determines the maximum token length in bytes for a particular SSPI package.
+//
+// If the return value is OK, |*max_token_length| contains the maximum token
+// length in bytes.
+//
+// If the return value is ERR_INVALID_ARGUMENT, |max_token_length| is NULL.
+//
+// If the return value is ERR_UNSUPPORTED_AUTH_SCHEME, |package| is not an
+// known SSPI authentication scheme on this system. |*max_token_length| is not
+// changed.
+//
+// If the return value is ERR_UNEXPECTED, there was an unanticipated problem
+// in the underlying SSPI call. The details are logged, and |*max_token_length|
+// is not changed.
int DetermineMaxTokenLength(const std::wstring& package,
ULONG* max_token_length);