| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_auth_handler_digest.h" | 5 #include "net/http/http_auth_handler_digest.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/i18n/icu_string_conversions.h" | 9 #include "base/i18n/icu_string_conversions.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // | 179 // |
| 180 // Note that according to RFC 2617 (section 1.2) the realm is required. | 180 // Note that according to RFC 2617 (section 1.2) the realm is required. |
| 181 // However we allow it to be omitted, in which case it will default to the | 181 // However we allow it to be omitted, in which case it will default to the |
| 182 // empty string. | 182 // empty string. |
| 183 // | 183 // |
| 184 // This allowance is for better compatibility with webservers that fail to | 184 // This allowance is for better compatibility with webservers that fail to |
| 185 // send the realm (See http://crbug.com/20984 for an instance where a | 185 // send the realm (See http://crbug.com/20984 for an instance where a |
| 186 // webserver was not sending the realm with a BASIC challenge). | 186 // webserver was not sending the realm with a BASIC challenge). |
| 187 bool HttpAuthHandlerDigest::ParseChallenge( | 187 bool HttpAuthHandlerDigest::ParseChallenge( |
| 188 HttpAuth::ChallengeTokenizer* challenge) { | 188 HttpAuth::ChallengeTokenizer* challenge) { |
| 189 auth_scheme_ = HttpAuth::AUTH_SCHEME_DIGEST; | 189 auth_scheme_ = "digest"; |
| 190 score_ = 2; | 190 score_ = 2; |
| 191 properties_ = ENCRYPTS_IDENTITY; | 191 properties_ = ENCRYPTS_IDENTITY; |
| 192 | 192 |
| 193 // Initialize to defaults. | 193 // Initialize to defaults. |
| 194 stale_ = false; | 194 stale_ = false; |
| 195 algorithm_ = ALGORITHM_UNSPECIFIED; | 195 algorithm_ = ALGORITHM_UNSPECIFIED; |
| 196 qop_ = QOP_UNSPECIFIED; | 196 qop_ = QOP_UNSPECIFIED; |
| 197 realm_ = original_realm_ = nonce_ = domain_ = opaque_ = std::string(); | 197 realm_ = original_realm_ = nonce_ = domain_ = opaque_ = std::string(); |
| 198 | 198 |
| 199 // FAIL -- Couldn't match auth-scheme. | 199 // FAIL -- Couldn't match auth-scheme. |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 // TODO(eroman): Supposedly IIS server requires quotes surrounding qop. | 371 // TODO(eroman): Supposedly IIS server requires quotes surrounding qop. |
| 372 authorization += ", qop=" + QopToString(qop_); | 372 authorization += ", qop=" + QopToString(qop_); |
| 373 authorization += ", nc=" + nc; | 373 authorization += ", nc=" + nc; |
| 374 authorization += ", cnonce=" + HttpUtil::Quote(cnonce); | 374 authorization += ", cnonce=" + HttpUtil::Quote(cnonce); |
| 375 } | 375 } |
| 376 | 376 |
| 377 return authorization; | 377 return authorization; |
| 378 } | 378 } |
| 379 | 379 |
| 380 } // namespace net | 380 } // namespace net |
| OLD | NEW |