Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: net/ssl/openssl_client_key_store_unittest.cc

Issue 2822283002: Remove SSLPrivateKey metadata hooks. (Closed)
Patch Set: emaxx comment Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/socket/ssl_client_socket_impl.cc ('k') | net/ssl/ssl_client_auth_cache_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/openssl_client_key_store.h" 5 #include "net/ssl/openssl_client_key_store.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "net/ssl/ssl_private_key.h" 9 #include "net/ssl/ssl_private_key.h"
10 #include "net/test/cert_test_util.h" 10 #include "net/test/cert_test_util.h"
(...skipping 20 matching lines...) Expand all
31 protected: 31 protected:
32 OpenSSLClientKeyStore* store_; 32 OpenSSLClientKeyStore* store_;
33 }; 33 };
34 34
35 class MockSSLPrivateKey : public SSLPrivateKey { 35 class MockSSLPrivateKey : public SSLPrivateKey {
36 public: 36 public:
37 MockSSLPrivateKey() : on_destroyed_(nullptr) {} 37 MockSSLPrivateKey() : on_destroyed_(nullptr) {}
38 38
39 void set_on_destroyed(bool* on_destroyed) { on_destroyed_ = on_destroyed; } 39 void set_on_destroyed(bool* on_destroyed) { on_destroyed_ = on_destroyed; }
40 40
41 Type GetType() override {
42 NOTREACHED();
43 return Type::RSA;
44 }
45
46 std::vector<Hash> GetDigestPreferences() override { 41 std::vector<Hash> GetDigestPreferences() override {
47 NOTREACHED(); 42 NOTREACHED();
48 return {}; 43 return {};
49 } 44 }
50 45
51 size_t GetMaxSignatureLengthInBytes() override {
52 NOTREACHED();
53 return 0;
54 }
55
56 void SignDigest(Hash hash, 46 void SignDigest(Hash hash,
57 const base::StringPiece& input, 47 const base::StringPiece& input,
58 const SignCallback& callback) override { 48 const SignCallback& callback) override {
59 NOTREACHED(); 49 NOTREACHED();
60 } 50 }
61 51
62 private: 52 private:
63 ~MockSSLPrivateKey() override { 53 ~MockSSLPrivateKey() override {
64 if (on_destroyed_) 54 if (on_destroyed_)
65 *on_destroyed_ = true; 55 *on_destroyed_ = true;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 152
163 EXPECT_TRUE(fetch_key1); 153 EXPECT_TRUE(fetch_key1);
164 EXPECT_TRUE(fetch_key2); 154 EXPECT_TRUE(fetch_key2);
165 155
166 EXPECT_EQ(fetch_key1.get(), priv_key1.get()); 156 EXPECT_EQ(fetch_key1.get(), priv_key1.get());
167 EXPECT_EQ(fetch_key2.get(), priv_key2.get()); 157 EXPECT_EQ(fetch_key2.get(), priv_key2.get());
168 } 158 }
169 159
170 } // namespace 160 } // namespace
171 } // namespace net 161 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_impl.cc ('k') | net/ssl/ssl_client_auth_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698