diff options
author | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 13:28:44 +0000 |
---|---|---|
committer | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 13:28:44 +0000 |
commit | e3fe59bfb0912596e8975f9c50b01683c19ee5d9 (patch) | |
tree | 04b9c722b6f9db105acfc70bd286cb4f78c7d843 /net/http/http_auth_handler_ntlm.cc | |
parent | d1cd0715ae8b15982b7ca46f4497eeddb4b73bca (diff) | |
download | chromium_src-e3fe59bfb0912596e8975f9c50b01683c19ee5d9.zip chromium_src-e3fe59bfb0912596e8975f9c50b01683c19ee5d9.tar.gz chromium_src-e3fe59bfb0912596e8975f9c50b01683c19ee5d9.tar.bz2 |
Extract name-value pair parsing from http_auth.cc (ChallengeTokenizer) into http_util.cc (NameValuePairsIterator). In preparation for re-use of name-value pair parsing in ChromeFrame (for X-UA-Compatible header).
BUG=None
TEST=net_unittests (HttpAuth* and HttpUtilTest.NameValuePairs*)
Review URL: http://codereview.chromium.org/3525004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61061 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_handler_ntlm.cc')
-rw-r--r-- | net/http/http_auth_handler_ntlm.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/http/http_auth_handler_ntlm.cc b/net/http/http_auth_handler_ntlm.cc index dddddb4..352b2ed 100644 --- a/net/http/http_auth_handler_ntlm.cc +++ b/net/http/http_auth_handler_ntlm.cc @@ -116,14 +116,16 @@ HttpAuth::AuthorizationResult HttpAuthHandlerNTLM::ParseChallenge( // TODO(cbentzel): Most of the logic between SSPI, GSSAPI, and portable NTLM // authentication parsing could probably be shared - just need to know if // there was previously a challenge round. + // TODO(cbentzel): Write a test case to validate that auth_data_ is left empty + // in all failure conditions. auth_data_.clear(); // Verify the challenge's auth-scheme. - if (!tok->valid() || !LowerCaseEqualsASCII(tok->scheme(), "ntlm")) + if (!LowerCaseEqualsASCII(tok->scheme(), "ntlm")) return HttpAuth::AUTHORIZATION_RESULT_INVALID; - tok->set_expect_base64_token(true); - if (!tok->GetNext()) { + std::string base64_param = tok->base64_param(); + if (base64_param.empty()) { if (!initial_challenge) return HttpAuth::AUTHORIZATION_RESULT_REJECT; return HttpAuth::AUTHORIZATION_RESULT_ACCEPT; @@ -132,7 +134,7 @@ HttpAuth::AuthorizationResult HttpAuthHandlerNTLM::ParseChallenge( return HttpAuth::AUTHORIZATION_RESULT_INVALID; } - auth_data_.assign(tok->value_begin(), tok->value_end()); + auth_data_ = base64_param; return HttpAuth::AUTHORIZATION_RESULT_ACCEPT; #endif // defined(NTLM_SSPI) } |