| 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 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ |
| 6 #define NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 QOP_UNSPECIFIED, | 115 QOP_UNSPECIFIED, |
| 116 QOP_AUTH, | 116 QOP_AUTH, |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 // |nonce_count| indicates how many times the server-specified nonce has | 119 // |nonce_count| indicates how many times the server-specified nonce has |
| 120 // been used so far. | 120 // been used so far. |
| 121 // |nonce_generator| is used to create a client nonce, and is not owned by | 121 // |nonce_generator| is used to create a client nonce, and is not owned by |
| 122 // the handler. The lifetime of the |nonce_generator| must exceed that of this | 122 // the handler. The lifetime of the |nonce_generator| must exceed that of this |
| 123 // handler. | 123 // handler. |
| 124 HttpAuthHandlerDigest(int nonce_count, const NonceGenerator* nonce_generator); | 124 HttpAuthHandlerDigest(int nonce_count, const NonceGenerator* nonce_generator); |
| 125 ~HttpAuthHandlerDigest(); | 125 virtual ~HttpAuthHandlerDigest(); |
| 126 | 126 |
| 127 // Parse the challenge, saving the results into this instance. | 127 // Parse the challenge, saving the results into this instance. |
| 128 // Returns true on success. | 128 // Returns true on success. |
| 129 bool ParseChallenge(HttpAuth::ChallengeTokenizer* challenge); | 129 bool ParseChallenge(HttpAuth::ChallengeTokenizer* challenge); |
| 130 | 130 |
| 131 // Parse an individual property. Returns true on success. | 131 // Parse an individual property. Returns true on success. |
| 132 bool ParseChallengeProperty(const std::string& name, | 132 bool ParseChallengeProperty(const std::string& name, |
| 133 const std::string& value); | 133 const std::string& value); |
| 134 | 134 |
| 135 // Generates a random string, to be used for client-nonce. | 135 // Generates a random string, to be used for client-nonce. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 DigestAlgorithm algorithm_; | 169 DigestAlgorithm algorithm_; |
| 170 QualityOfProtection qop_; | 170 QualityOfProtection qop_; |
| 171 | 171 |
| 172 int nonce_count_; | 172 int nonce_count_; |
| 173 const NonceGenerator* nonce_generator_; | 173 const NonceGenerator* nonce_generator_; |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 } // namespace net | 176 } // namespace net |
| 177 | 177 |
| 178 #endif // NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ | 178 #endif // NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ |
| OLD | NEW |