| Index: net/http/http_auth_handler_digest.cc
|
| diff --git a/net/http/http_auth_handler_digest.cc b/net/http/http_auth_handler_digest.cc
|
| index ce4b1484cf82145d8f0a11d60d1be728f12837a7..39bcb5232886ef8ed9311d42f2a79e79bf2ad31a 100644
|
| --- a/net/http/http_auth_handler_digest.cc
|
| +++ b/net/http/http_auth_handler_digest.cc
|
| @@ -129,9 +129,9 @@ HttpAuth::AuthorizationResult HttpAuthHandlerDigest::HandleAnotherChallenge(
|
| original_realm = parameters.value();
|
| }
|
| }
|
| - return (original_realm_ != original_realm) ?
|
| - HttpAuth::AUTHORIZATION_RESULT_DIFFERENT_REALM :
|
| - HttpAuth::AUTHORIZATION_RESULT_REJECT;
|
| + return (original_realm_ != original_realm)
|
| + ? HttpAuth::AUTHORIZATION_RESULT_DIFFERENT_REALM
|
| + : HttpAuth::AUTHORIZATION_RESULT_REJECT;
|
| }
|
|
|
| bool HttpAuthHandlerDigest::Init(HttpAuthChallengeTokenizer* challenge) {
|
| @@ -139,8 +139,10 @@ bool HttpAuthHandlerDigest::Init(HttpAuthChallengeTokenizer* challenge) {
|
| }
|
|
|
| int HttpAuthHandlerDigest::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) {
|
| // Generate a random client nonce.
|
| std::string cnonce = nonce_generator_->GenerateNonce();
|
|
|
| @@ -150,13 +152,14 @@ int HttpAuthHandlerDigest::GenerateAuthTokenImpl(
|
| std::string path;
|
| GetRequestMethodAndPath(request, &method, &path);
|
|
|
| - *auth_token = AssembleCredentials(method, path, *credentials,
|
| - cnonce, nonce_count_);
|
| + *auth_token =
|
| + AssembleCredentials(method, path, *credentials, cnonce, nonce_count_);
|
| return OK;
|
| }
|
|
|
| HttpAuthHandlerDigest::HttpAuthHandlerDigest(
|
| - int nonce_count, const NonceGenerator* nonce_generator)
|
| + int nonce_count,
|
| + const NonceGenerator* nonce_generator)
|
| : stale_(false),
|
| algorithm_(ALGORITHM_UNSPECIFIED),
|
| qop_(QOP_UNSPECIFIED),
|
| @@ -207,8 +210,7 @@ bool HttpAuthHandlerDigest::ParseChallenge(
|
| // Loop through all the properties.
|
| while (parameters.GetNext()) {
|
| // FAIL -- couldn't parse a property.
|
| - if (!ParseChallengeProperty(parameters.name(),
|
| - parameters.value()))
|
| + if (!ParseChallengeProperty(parameters.name(), parameters.value()))
|
| return false;
|
| }
|
|
|
| @@ -351,9 +353,9 @@ std::string HttpAuthHandlerDigest::AssembleCredentials(
|
| std::string nc = base::StringPrintf("%08x", nonce_count);
|
|
|
| // TODO(eroman): is this the right encoding?
|
| - std::string authorization = (std::string("Digest username=") +
|
| - HttpUtil::Quote(
|
| - base::UTF16ToUTF8(credentials.username())));
|
| + std::string authorization =
|
| + (std::string("Digest username=") +
|
| + HttpUtil::Quote(base::UTF16ToUTF8(credentials.username())));
|
| authorization += ", realm=" + HttpUtil::Quote(original_realm_);
|
| authorization += ", nonce=" + HttpUtil::Quote(nonce_);
|
| authorization += ", uri=" + HttpUtil::Quote(path);
|
| @@ -361,8 +363,8 @@ std::string HttpAuthHandlerDigest::AssembleCredentials(
|
| if (algorithm_ != ALGORITHM_UNSPECIFIED) {
|
| authorization += ", algorithm=" + AlgorithmToString(algorithm_);
|
| }
|
| - std::string response = AssembleResponseDigest(method, path, credentials,
|
| - cnonce, nc);
|
| + std::string response =
|
| + AssembleResponseDigest(method, path, credentials, cnonce, nc);
|
| // No need to call HttpUtil::Quote() as the response digest cannot contain
|
| // any characters needing to be escaped.
|
| authorization += ", response=\"" + response + "\"";
|
|
|