| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/ssl/ssl_client_auth_cache.h" | 5 #include "net/ssl/ssl_client_auth_cache.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "net/cert/x509_certificate.h" | 9 #include "net/cert/x509_certificate.h" |
| 10 #include "net/ssl/ssl_private_key.h" | 10 #include "net/ssl/ssl_private_key.h" |
| 11 #include "net/test/cert_test_util.h" | 11 #include "net/test/cert_test_util.h" |
| 12 #include "net/test/test_data_directory.h" | 12 #include "net/test/test_data_directory.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 | 16 |
| 17 class MockSSLPrivateKey : public SSLPrivateKey { | 17 class MockSSLPrivateKey : public SSLPrivateKey { |
| 18 public: | 18 public: |
| 19 MockSSLPrivateKey() {} | 19 MockSSLPrivateKey() {} |
| 20 | 20 |
| 21 Type GetType() override { return Type::RSA; } | |
| 22 | |
| 23 std::vector<SSLPrivateKey::Hash> GetDigestPreferences() override { | 21 std::vector<SSLPrivateKey::Hash> GetDigestPreferences() override { |
| 24 NOTIMPLEMENTED(); | 22 NOTIMPLEMENTED(); |
| 25 return std::vector<SSLPrivateKey::Hash>(); | 23 return std::vector<SSLPrivateKey::Hash>(); |
| 26 } | 24 } |
| 27 | 25 |
| 28 size_t GetMaxSignatureLengthInBytes() override { | |
| 29 NOTIMPLEMENTED(); | |
| 30 return 0; | |
| 31 } | |
| 32 | |
| 33 void SignDigest(Hash hash, | 26 void SignDigest(Hash hash, |
| 34 const base::StringPiece& input, | 27 const base::StringPiece& input, |
| 35 const SignCallback& callback) override { | 28 const SignCallback& callback) override { |
| 36 NOTIMPLEMENTED(); | 29 NOTIMPLEMENTED(); |
| 37 } | 30 } |
| 38 | 31 |
| 39 private: | 32 private: |
| 40 ~MockSSLPrivateKey() override {} | 33 ~MockSSLPrivateKey() override {} |
| 41 | 34 |
| 42 DISALLOW_COPY_AND_ASSIGN(MockSSLPrivateKey); | 35 DISALLOW_COPY_AND_ASSIGN(MockSSLPrivateKey); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 EXPECT_EQ(nullptr, cached_cert.get()); | 188 EXPECT_EQ(nullptr, cached_cert.get()); |
| 196 | 189 |
| 197 cache.OnCertDBChanged(); | 190 cache.OnCertDBChanged(); |
| 198 | 191 |
| 199 // Check that we no longer have entries for either server. | 192 // Check that we no longer have entries for either server. |
| 200 EXPECT_FALSE(cache.Lookup(server1, &cached_cert, &cached_pkey)); | 193 EXPECT_FALSE(cache.Lookup(server1, &cached_cert, &cached_pkey)); |
| 201 EXPECT_FALSE(cache.Lookup(server2, &cached_cert, &cached_pkey)); | 194 EXPECT_FALSE(cache.Lookup(server2, &cached_cert, &cached_pkey)); |
| 202 } | 195 } |
| 203 | 196 |
| 204 } // namespace net | 197 } // namespace net |
| OLD | NEW |