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

Unified Diff: net/http/http_auth_sspi_win.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: Fix comments 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
« no previous file with comments | « net/http/http_auth_sspi_win.h ('k') | net/http/http_auth_sspi_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d07ce4ce19fb07386f51b455432e42ce6f2bf0af..f4cbe9d1155df68fe36847c4b2467c7915bdb445 100644
--- a/net/http/http_auth_sspi_win.cc
+++ b/net/http/http_auth_sspi_win.cc
@@ -254,15 +254,12 @@ HttpAuth::AuthorizationResult HttpAuthSSPI::ParseChallenge(
return HttpAuth::AUTHORIZATION_RESULT_ACCEPT;
}
-int HttpAuthSSPI::GenerateAuthToken(const string16* username,
- const string16* password,
+int HttpAuthSSPI::GenerateAuthToken(const AuthCredentials* credentials,
const std::wstring& spn,
std::string* auth_token) {
- DCHECK((username == NULL) == (password == NULL));
-
// Initial challenge.
if (!SecIsValidHandle(&cred_)) {
- int rv = OnFirstRound(username, password);
+ int rv = OnFirstRound(credentials);
if (rv != OK)
return rv;
}
@@ -294,17 +291,15 @@ int HttpAuthSSPI::GenerateAuthToken(const string16* username,
return OK;
}
-int HttpAuthSSPI::OnFirstRound(const string16* username,
- const string16* password) {
- DCHECK((username == NULL) == (password == NULL));
+int HttpAuthSSPI::OnFirstRound(const AuthCredentials* credentials) {
DCHECK(!SecIsValidHandle(&cred_));
int rv = OK;
- if (username) {
+ if (credentials) {
string16 domain;
string16 user;
- SplitDomainAndUser(*username, &domain, &user);
+ SplitDomainAndUser(credentials->username(), &domain, &user);
rv = AcquireExplicitCredentials(library_, security_package_, domain,
- user, *password, &cred_);
+ user, credentials->password(), &cred_);
if (rv != OK)
return rv;
} else {
« no previous file with comments | « net/http/http_auth_sspi_win.h ('k') | net/http/http_auth_sspi_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698