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

Unified Diff: net/http/http_auth_sspi_win.cc

Issue 1128043007: Support Kerberos on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cbentzel@'s nits Created 5 years, 5 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
Index: net/http/http_auth_sspi_win.cc
diff --git a/net/http/http_auth_sspi_win.cc b/net/http/http_auth_sspi_win.cc
index c935d33a7c2e8b570a6305a6fb750f4180cc4226..f59ce4d9d781d28dc38847f9a88bf3615acafa4d 100644
--- a/net/http/http_auth_sspi_win.cc
+++ b/net/http/http_auth_sspi_win.cc
@@ -13,7 +13,7 @@
#include "base/strings/utf_string_conversions.h"
#include "net/base/net_errors.h"
#include "net/http/http_auth.h"
-#include "net/http/http_auth_challenge_tokenizer.h"
+#include "net/http/http_auth_multi_round_parse.h"
namespace net {
@@ -282,37 +282,18 @@ void HttpAuthSSPI::ResetSecurityContext() {
HttpAuth::AuthorizationResult HttpAuthSSPI::ParseChallenge(
HttpAuthChallengeTokenizer* tok) {
- // Verify the challenge's auth-scheme.
- if (!base::LowerCaseEqualsASCII(tok->scheme(),
- base::StringToLowerASCII(scheme_).c_str()))
- return HttpAuth::AUTHORIZATION_RESULT_INVALID;
-
- std::string encoded_auth_token = tok->base64_param();
- if (encoded_auth_token.empty()) {
- // If a context has already been established, an empty challenge
- // should be treated as a rejection of the current attempt.
- if (SecIsValidHandle(&ctxt_))
- return HttpAuth::AUTHORIZATION_RESULT_REJECT;
- DCHECK(decoded_server_auth_token_.empty());
- return HttpAuth::AUTHORIZATION_RESULT_ACCEPT;
- } else {
- // If a context has not already been established, additional tokens should
- // not be present in the auth challenge.
- if (!SecIsValidHandle(&ctxt_))
- return HttpAuth::AUTHORIZATION_RESULT_INVALID;
+ if (!SecIsValidHandle(&ctxt_)) {
+ return net::ParseFirstRoundChallenge(scheme_, tok);
}
-
- std::string decoded_auth_token;
- bool base64_rv = base::Base64Decode(encoded_auth_token, &decoded_auth_token);
- if (!base64_rv)
- return HttpAuth::AUTHORIZATION_RESULT_INVALID;
- decoded_server_auth_token_ = decoded_auth_token;
- return HttpAuth::AUTHORIZATION_RESULT_ACCEPT;
+ std::string encoded_auth_token;
+ return net::ParseLaterRoundChallenge(scheme_, tok, &encoded_auth_token,
+ &decoded_server_auth_token_);
}
int HttpAuthSSPI::GenerateAuthToken(const AuthCredentials* credentials,
const std::string& spn,
- std::string* auth_token) {
+ std::string* auth_token,
+ const CompletionCallback& /*callback*/) {
// Initial challenge.
if (!SecIsValidHandle(&cred_)) {
int rv = OnFirstRound(credentials);

Powered by Google App Engine
This is Rietveld 408576698