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

Unified Diff: net/http/http_auth_handler_negotiate.cc

Issue 8340026: Use AuthCredentials throughout the network stack instead of username/password. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reduce password zapping Created 9 years, 2 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_handler_negotiate.cc
diff --git a/net/http/http_auth_handler_negotiate.cc b/net/http/http_auth_handler_negotiate.cc
index b499c5bf17eddd9428ec737b22599d2255af35d1..05604bd114df48544e65288b1830fec002c5b26d 100644
--- a/net/http/http_auth_handler_negotiate.cc
+++ b/net/http/http_auth_handler_negotiate.cc
@@ -105,7 +105,7 @@ HttpAuthHandlerNegotiate::HttpAuthHandlerNegotiate(
this, &HttpAuthHandlerNegotiate::OnIOComplete)),
resolver_(resolver),
already_called_(false),
- has_username_and_password_(false),
+ has_credentials_(false),
user_callback_(NULL),
auth_token_(NULL),
next_state_(STATE_NONE),
@@ -212,26 +212,22 @@ bool HttpAuthHandlerNegotiate::Init(HttpAuth::ChallengeTokenizer* challenge) {
}
int HttpAuthHandlerNegotiate::GenerateAuthTokenImpl(
- const string16* username,
- const string16* password,
+ const AuthCredentials* credentials,
const HttpRequestInfo* request,
OldCompletionCallback* callback,
std::string* auth_token) {
DCHECK(user_callback_ == NULL);
- DCHECK((username == NULL) == (password == NULL));
DCHECK(auth_token_ == NULL);
auth_token_ = auth_token;
if (already_called_) {
- DCHECK((!has_username_and_password_ && username == NULL) ||
- (has_username_and_password_ && *username == username_ &&
- *password == password_));
+ DCHECK((!has_credentials_ && credentials == NULL) ||
+ (has_credentials_ && credentials->Equals(credentials_)));
next_state_ = STATE_GENERATE_AUTH_TOKEN;
} else {
already_called_ = true;
- if (username) {
- has_username_and_password_ = true;
- username_ = *username;
- password_ = *password;
+ if (credentials) {
+ has_credentials_ = true;
+ credentials_ = *credentials;
}
next_state_ = STATE_RESOLVE_CANONICAL_NAME;
}
@@ -319,10 +315,9 @@ int HttpAuthHandlerNegotiate::DoResolveCanonicalNameComplete(int rv) {
int HttpAuthHandlerNegotiate::DoGenerateAuthToken() {
next_state_ = STATE_GENERATE_AUTH_TOKEN_COMPLETE;
- string16* username = has_username_and_password_ ? &username_ : NULL;
- string16* password = has_username_and_password_ ? &password_ : NULL;
+ AuthCredentials* credentials = has_credentials_ ? &credentials_ : NULL;
// TODO(cbentzel): This should possibly be done async.
- return auth_system_.GenerateAuthToken(username, password, spn_, auth_token_);
+ return auth_system_.GenerateAuthToken(credentials, spn_, auth_token_);
}
int HttpAuthHandlerNegotiate::DoGenerateAuthTokenComplete(int rv) {

Powered by Google App Engine
This is Rietveld 408576698