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

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: Add a header + guard 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
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 void operator=(KeyPair other);
77 void swap(KeyPair& other);
77 ~KeyPair(); 78 ~KeyPair();
78 79
79 crypto::ScopedEVP_PKEY public_key; 80 crypto::ScopedEVP_PKEY public_key;
80 crypto::ScopedEVP_PKEY private_key; 81 crypto::ScopedEVP_PKEY private_key;
81 82
82 private: 83 private:
83 KeyPair(); // intentionally not implemented. 84 KeyPair(); // intentionally not implemented.
84 }; 85 };
85 86
86 // Returns the index of the keypair for |public_key|. or -1 if not found. 87 // Returns the index of the keypair for |public_key|. or -1 if not found.
87 int FindKeyPairIndex(EVP_PKEY* public_key); 88 int FindKeyPairIndex(EVP_PKEY* public_key);
88 89
89 std::vector<KeyPair> pairs_; 90 std::vector<KeyPair> pairs_;
90 91
91 friend struct DefaultSingletonTraits<OpenSSLClientKeyStore>; 92 friend struct DefaultSingletonTraits<OpenSSLClientKeyStore>;
92 93
93 DISALLOW_COPY_AND_ASSIGN(OpenSSLClientKeyStore); 94 DISALLOW_COPY_AND_ASSIGN(OpenSSLClientKeyStore);
94 }; 95 };
95 96
96 } // namespace net 97 } // namespace net
97 98
98 #endif // NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_ 99 #endif // NET_SSL_OPENSSL_CLIENT_KEY_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698