| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory { | 60 class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory { |
| 61 public: | 61 public: |
| 62 Factory(); | 62 Factory(); |
| 63 ~Factory() override; | 63 ~Factory() override; |
| 64 | 64 |
| 65 // This factory owns the passed in |nonce_generator|. | 65 // This factory owns the passed in |nonce_generator|. |
| 66 void set_nonce_generator(const NonceGenerator* nonce_generator); | 66 void set_nonce_generator(const NonceGenerator* nonce_generator); |
| 67 | 67 |
| 68 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, | 68 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, |
| 69 HttpAuth::Target target, | 69 HttpAuth::Target target, |
| 70 const SSLInfo& ssl_info, |
| 70 const GURL& origin, | 71 const GURL& origin, |
| 71 CreateReason reason, | 72 CreateReason reason, |
| 72 int digest_nonce_count, | 73 int digest_nonce_count, |
| 73 const BoundNetLog& net_log, | 74 const BoundNetLog& net_log, |
| 74 scoped_ptr<HttpAuthHandler>* handler) override; | 75 scoped_ptr<HttpAuthHandler>* handler) override; |
| 75 | 76 |
| 76 private: | 77 private: |
| 77 scoped_ptr<const NonceGenerator> nonce_generator_; | 78 scoped_ptr<const NonceGenerator> nonce_generator_; |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 HttpAuth::AuthorizationResult HandleAnotherChallenge( | 81 HttpAuth::AuthorizationResult HandleAnotherChallenge( |
| 81 HttpAuthChallengeTokenizer* challenge) override; | 82 HttpAuthChallengeTokenizer* challenge) override; |
| 82 | 83 |
| 83 protected: | 84 protected: |
| 84 bool Init(HttpAuthChallengeTokenizer* challenge) override; | 85 bool Init(HttpAuthChallengeTokenizer* challenge, |
| 86 const SSLInfo& ssl_info) override; |
| 85 | 87 |
| 86 int GenerateAuthTokenImpl(const AuthCredentials* credentials, | 88 int GenerateAuthTokenImpl(const AuthCredentials* credentials, |
| 87 const HttpRequestInfo* request, | 89 const HttpRequestInfo* request, |
| 88 const CompletionCallback& callback, | 90 const CompletionCallback& callback, |
| 89 std::string* auth_token) override; | 91 std::string* auth_token) override; |
| 90 | 92 |
| 91 private: | 93 private: |
| 92 FRIEND_TEST_ALL_PREFIXES(HttpAuthHandlerDigestTest, ParseChallenge); | 94 FRIEND_TEST_ALL_PREFIXES(HttpAuthHandlerDigestTest, ParseChallenge); |
| 93 FRIEND_TEST_ALL_PREFIXES(HttpAuthHandlerDigestTest, AssembleCredentials); | 95 FRIEND_TEST_ALL_PREFIXES(HttpAuthHandlerDigestTest, AssembleCredentials); |
| 94 FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, DigestPreAuthNonceCount); | 96 FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, DigestPreAuthNonceCount); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // UTF-8. | 172 // UTF-8. |
| 171 std::string original_realm_; | 173 std::string original_realm_; |
| 172 | 174 |
| 173 int nonce_count_; | 175 int nonce_count_; |
| 174 const NonceGenerator* nonce_generator_; | 176 const NonceGenerator* nonce_generator_; |
| 175 }; | 177 }; |
| 176 | 178 |
| 177 } // namespace net | 179 } // namespace net |
| 178 | 180 |
| 179 #endif // NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ | 181 #endif // NET_HTTP_HTTP_AUTH_HANDLER_DIGEST_H_ |
| OLD | NEW |