Chromium Code Reviews| Index: net/base/openssl_memory_private_key_store.cc |
| diff --git a/net/base/openssl_memory_private_key_store.cc b/net/base/openssl_memory_private_key_store.cc |
| index 92716f236e1d341edc1f392bdcaa40bd44c0f726..1ab6cc486ba37be5b2c3d4bbc01a4b914ac7defb 100644 |
| --- a/net/base/openssl_memory_private_key_store.cc |
| +++ b/net/base/openssl_memory_private_key_store.cc |
| @@ -17,6 +17,8 @@ namespace net { |
| namespace { |
| +// This is the linux_redux specific implementation of |
|
Ryan Sleevi
2013/02/15 23:53:26
nit: "linux_redux" is meaningless here. Try to exp
digit1
2013/02/25 14:26:22
Done.
|
| +// OpenSSLPrivateKeyStore. |
| class OpenSSLMemoryKeyStore : public OpenSSLPrivateKeyStore { |
|
ppi
2013/02/15 19:54:46
Suggestion: We might want to rename this to OpenSS
digit1
2013/02/25 14:26:22
I've renamed this to OpenSSLPrivateKeyStoreMemory,
|
| public: |
| OpenSSLMemoryKeyStore() {} |
| @@ -25,35 +27,14 @@ class OpenSSLMemoryKeyStore : public OpenSSLPrivateKeyStore { |
| return Singleton<OpenSSLMemoryKeyStore>::get(); |
| } |
| - virtual ~OpenSSLMemoryKeyStore() { |
| - base::AutoLock lock(lock_); |
| - for (std::vector<EVP_PKEY*>::iterator it = keys_.begin(); |
| - it != keys_.end(); ++it) { |
| - EVP_PKEY_free(*it); |
| - } |
| - } |
| - |
| - virtual bool StorePrivateKey(const GURL& url, EVP_PKEY* pkey) { |
| - CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY); |
| - base::AutoLock lock(lock_); |
| - keys_.push_back(pkey); |
| + virtual bool StoreKeyPair(const GURL& url, EVP_PKEY* pkey) OVERRIDE { |
| + // Since there is no real key store, just record the keys in |
| + // memory. |
| + AddKeyPair(pkey, pkey); |
| return true; |
| } |
| - virtual EVP_PKEY* FetchPrivateKey(EVP_PKEY* pkey) { |
| - base::AutoLock lock(lock_); |
| - for (std::vector<EVP_PKEY*>::iterator it = keys_.begin(); |
| - it != keys_.end(); ++it) { |
| - if (EVP_PKEY_cmp(*it, pkey) == 1) |
| - return *it; |
| - } |
| - return NULL; |
| - } |
| - |
| private: |
| - std::vector<EVP_PKEY*> keys_; |
| - base::Lock lock_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(OpenSSLMemoryKeyStore); |
| }; |