Index: net/http/http_auth_handler_ntlm.cc |
diff --git a/net/http/http_auth_handler_ntlm.cc b/net/http/http_auth_handler_ntlm.cc |
index 4873de4860cd86d042d01a9ecb567e7e5458b601..378991fb82e0d646daa3361e0d54d8706a868632 100644 |
--- a/net/http/http_auth_handler_ntlm.cc |
+++ b/net/http/http_auth_handler_ntlm.cc |
@@ -17,18 +17,22 @@ |
namespace net { |
HttpAuth::AuthorizationResult HttpAuthHandlerNTLM::HandleAnotherChallenge( |
- HttpAuthChallengeTokenizer* challenge) { |
+ const HttpAuthChallengeTokenizer& challenge) { |
return ParseChallenge(challenge, false); |
} |
-bool HttpAuthHandlerNTLM::Init(HttpAuthChallengeTokenizer* tok) { |
+int HttpAuthHandlerNTLM::Init(const HttpAuthChallengeTokenizer& tok) { |
auth_scheme_ = "ntlm"; |
- return ParseChallenge(tok, true) == HttpAuth::AUTHORIZATION_RESULT_ACCEPT; |
+ return ParseChallenge(tok, true) == HttpAuth::AUTHORIZATION_RESULT_ACCEPT |
+ ? OK |
+ : ERR_INVALID_RESPONSE; |
} |
int HttpAuthHandlerNTLM::GenerateAuthTokenImpl( |
- const AuthCredentials* credentials, const HttpRequestInfo* request, |
- const CompletionCallback& callback, std::string* auth_token) { |
+ const AuthCredentials* credentials, |
+ const HttpRequestInfo& request, |
+ const CompletionCallback& callback, |
+ std::string* auth_token) { |
#if defined(NTLM_SSPI) |
return auth_sspi_.GenerateAuthToken(credentials, CreateSPN(origin_), |
auth_token, callback); |
@@ -96,7 +100,8 @@ int HttpAuthHandlerNTLM::GenerateAuthTokenImpl( |
// The NTLM challenge header looks like: |
// WWW-Authenticate: NTLM auth-data |
HttpAuth::AuthorizationResult HttpAuthHandlerNTLM::ParseChallenge( |
- HttpAuthChallengeTokenizer* tok, bool initial_challenge) { |
+ const HttpAuthChallengeTokenizer& tok, |
+ bool initial_challenge) { |
#if defined(NTLM_SSPI) |
// auth_sspi_ contains state for whether or not this is the initial challenge. |
return auth_sspi_.ParseChallenge(tok); |
@@ -109,10 +114,10 @@ HttpAuth::AuthorizationResult HttpAuthHandlerNTLM::ParseChallenge( |
auth_data_.clear(); |
// Verify the challenge's auth-scheme. |
- if (!tok->SchemeIs("ntlm")) |
+ if (!tok.SchemeIs("ntlm")) |
return HttpAuth::AUTHORIZATION_RESULT_INVALID; |
- std::string base64_param = tok->base64_param(); |
+ std::string base64_param = tok.base64_param(); |
if (base64_param.empty()) { |
if (!initial_challenge) |
return HttpAuth::AUTHORIZATION_RESULT_REJECT; |