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

Side by Side Diff: net/ssl/openssl_client_key_store.h

Issue 610533003: Allow custom deleters to opt out of self reset checks for scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sigh android Created 6 years, 2 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 | « crypto/scoped_openssl_types.h ('k') | net/ssl/openssl_client_key_store.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 #ifndef NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_ 5 #ifndef NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_
6 #define NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_ 6 #define NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_
7 7
8 #include <openssl/evp.h> 8 #include <openssl/evp.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // must still call EVP_PKEY_free on them. 66 // must still call EVP_PKEY_free on them.
67 void AddKeyPair(EVP_PKEY* pub_key, EVP_PKEY* private_key); 67 void AddKeyPair(EVP_PKEY* pub_key, EVP_PKEY* private_key);
68 68
69 private: 69 private:
70 // KeyPair is an internal class used to hold a pair of private / public 70 // KeyPair is an internal class used to hold a pair of private / public
71 // EVP_PKEY objects, with appropriate ownership. 71 // EVP_PKEY objects, with appropriate ownership.
72 class KeyPair { 72 class KeyPair {
73 public: 73 public:
74 explicit KeyPair(EVP_PKEY* pub_key, EVP_PKEY* priv_key); 74 explicit KeyPair(EVP_PKEY* pub_key, EVP_PKEY* priv_key);
75 KeyPair(const KeyPair& other); 75 KeyPair(const KeyPair& other);
76 void operator=(const KeyPair& other); 76 // Intentionally pass by value, in order to use the copy-and-swap idiom.
77 void operator=(KeyPair other);
78 void swap(KeyPair& other);
77 ~KeyPair(); 79 ~KeyPair();
78 80
79 crypto::ScopedEVP_PKEY public_key; 81 crypto::ScopedEVP_PKEY public_key;
80 crypto::ScopedEVP_PKEY private_key; 82 crypto::ScopedEVP_PKEY private_key;
81 83
82 private: 84 private:
83 KeyPair(); // intentionally not implemented. 85 KeyPair(); // intentionally not implemented.
84 }; 86 };
85 87
86 // Returns the index of the keypair for |public_key|. or -1 if not found. 88 // Returns the index of the keypair for |public_key|. or -1 if not found.
87 int FindKeyPairIndex(EVP_PKEY* public_key); 89 int FindKeyPairIndex(EVP_PKEY* public_key);
88 90
89 std::vector<KeyPair> pairs_; 91 std::vector<KeyPair> pairs_;
90 92
91 friend struct DefaultSingletonTraits<OpenSSLClientKeyStore>; 93 friend struct DefaultSingletonTraits<OpenSSLClientKeyStore>;
92 94
93 DISALLOW_COPY_AND_ASSIGN(OpenSSLClientKeyStore); 95 DISALLOW_COPY_AND_ASSIGN(OpenSSLClientKeyStore);
94 }; 96 };
95 97
96 } // namespace net 98 } // namespace net
97 99
98 #endif // NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_ 100 #endif // NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_
OLDNEW
« no previous file with comments | « crypto/scoped_openssl_types.h ('k') | net/ssl/openssl_client_key_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698