| OLD | NEW |
| 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 <openssl/evp.h> | 7 #include <openssl/evp.h> |
| 8 #include <openssl/x509.h> | 8 #include <openssl/x509.h> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| 45 | 45 |
| 46 OpenSSLClientKeyStore::OpenSSLClientKeyStore() { | 46 OpenSSLClientKeyStore::OpenSSLClientKeyStore() { |
| 47 } | 47 } |
| 48 | 48 |
| 49 OpenSSLClientKeyStore::~OpenSSLClientKeyStore() { | 49 OpenSSLClientKeyStore::~OpenSSLClientKeyStore() { |
| 50 } | 50 } |
| 51 | 51 |
| 52 OpenSSLClientKeyStore::KeyPair::KeyPair(EVP_PKEY* pub_key, | 52 OpenSSLClientKeyStore::KeyPair::KeyPair(EVP_PKEY* pub_key, EVP_PKEY* priv_key) { |
| 53 EVP_PKEY* priv_key) { | |
| 54 public_key = CopyEVP_PKEY(pub_key); | 53 public_key = CopyEVP_PKEY(pub_key); |
| 55 private_key = CopyEVP_PKEY(priv_key); | 54 private_key = CopyEVP_PKEY(priv_key); |
| 56 } | 55 } |
| 57 | 56 |
| 58 OpenSSLClientKeyStore::KeyPair::~KeyPair() { | 57 OpenSSLClientKeyStore::KeyPair::~KeyPair() { |
| 59 EVP_PKEY_free(public_key); | 58 EVP_PKEY_free(public_key); |
| 60 EVP_PKEY_free(private_key); | 59 EVP_PKEY_free(private_key); |
| 61 } | 60 } |
| 62 | 61 |
| 63 OpenSSLClientKeyStore::KeyPair::KeyPair(const KeyPair& other) { | 62 OpenSSLClientKeyStore::KeyPair::KeyPair(const KeyPair& other) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 128 |
| 130 void OpenSSLClientKeyStore::Flush() { | 129 void OpenSSLClientKeyStore::Flush() { |
| 131 pairs_.clear(); | 130 pairs_.clear(); |
| 132 } | 131 } |
| 133 | 132 |
| 134 OpenSSLClientKeyStore* OpenSSLClientKeyStore::GetInstance() { | 133 OpenSSLClientKeyStore* OpenSSLClientKeyStore::GetInstance() { |
| 135 return Singleton<OpenSSLClientKeyStore>::get(); | 134 return Singleton<OpenSSLClientKeyStore>::get(); |
| 136 } | 135 } |
| 137 | 136 |
| 138 } // namespace net | 137 } // namespace net |
| 139 | |
| 140 | |
| OLD | NEW |