| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/md5.h" | 7 #include "base/md5.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // [opaque="<opaque-token-value>"] | 193 // [opaque="<opaque-token-value>"] |
| 194 // [stale="<true-or-false>"] | 194 // [stale="<true-or-false>"] |
| 195 // [algorithm="<digest-algorithm>"] | 195 // [algorithm="<digest-algorithm>"] |
| 196 // [qop="<list-of-qop-values>"] | 196 // [qop="<list-of-qop-values>"] |
| 197 // [<extension-directive>] | 197 // [<extension-directive>] |
| 198 bool HttpAuthHandlerDigest::ParseChallenge( | 198 bool HttpAuthHandlerDigest::ParseChallenge( |
| 199 std::string::const_iterator challenge_begin, | 199 std::string::const_iterator challenge_begin, |
| 200 std::string::const_iterator challenge_end) { | 200 std::string::const_iterator challenge_end) { |
| 201 scheme_ = "digest"; | 201 scheme_ = "digest"; |
| 202 score_ = 2; | 202 score_ = 2; |
| 203 properties_ = ENCRYPTS_IDENTITY; |
| 203 | 204 |
| 204 // Initialize to defaults. | 205 // Initialize to defaults. |
| 205 stale_ = false; | 206 stale_ = false; |
| 206 algorithm_ = ALGORITHM_UNSPECIFIED; | 207 algorithm_ = ALGORITHM_UNSPECIFIED; |
| 207 qop_ = QOP_UNSPECIFIED; | 208 qop_ = QOP_UNSPECIFIED; |
| 208 realm_ = nonce_ = domain_ = opaque_ = std::string(); | 209 realm_ = nonce_ = domain_ = opaque_ = std::string(); |
| 209 | 210 |
| 210 HttpAuth::ChallengeTokenizer props(challenge_begin, challenge_end); | 211 HttpAuth::ChallengeTokenizer props(challenge_begin, challenge_end); |
| 211 | 212 |
| 212 if (!props.valid() || !LowerCaseEqualsASCII(props.scheme(), "digest")) | 213 if (!props.valid() || !LowerCaseEqualsASCII(props.scheme(), "digest")) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } | 269 } |
| 269 } | 270 } |
| 270 } else { | 271 } else { |
| 271 DLOG(INFO) << "Skipping unrecognized digest property"; | 272 DLOG(INFO) << "Skipping unrecognized digest property"; |
| 272 // TODO(eroman): perhaps we should fail instead of silently skipping? | 273 // TODO(eroman): perhaps we should fail instead of silently skipping? |
| 273 } | 274 } |
| 274 return true; | 275 return true; |
| 275 } | 276 } |
| 276 | 277 |
| 277 } // namespace net | 278 } // namespace net |
| OLD | NEW |