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

Side by Side Diff: net/base/openssl_memory_private_key_store.cc

Issue 6276002: Abstracts SHA256 context for NSS / OpenSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/download/base_file.cc ('k') | net/net.gyp » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // Defines an in-memory private key store, primarily used for testing. 5 // Defines an in-memory private key store, primarily used for testing.
6 6
7 #include <openssl/evp.h> 7 #include <openssl/evp.h>
8 8
9 #include "net/base/openssl_private_key_store.h" 9 #include "net/base/openssl_private_key_store.h"
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/openssl_util.h" 12 #include "base/openssl_util.h"
13 #include "base/singleton.h" 13 #include "base/singleton.h"
14 #include "base/synchronization/lock.h"
14 #include "net/base/x509_certificate.h" 15 #include "net/base/x509_certificate.h"
15 16
16 namespace net { 17 namespace net {
17 18
18 namespace { 19 namespace {
19 20
20 class OpenSSLMemoryKeyStore : public OpenSSLPrivateKeyStore { 21 class OpenSSLMemoryKeyStore : public OpenSSLPrivateKeyStore {
21 public: 22 public:
22 OpenSSLMemoryKeyStore() {} 23 OpenSSLMemoryKeyStore() {}
23 24
(...skipping 21 matching lines...) Expand all
45 for (std::vector<EVP_PKEY*>::iterator it = keys_.begin(); 46 for (std::vector<EVP_PKEY*>::iterator it = keys_.begin();
46 it != keys_.end(); ++it) { 47 it != keys_.end(); ++it) {
47 if (EVP_PKEY_cmp(*it, pkey) == 1) 48 if (EVP_PKEY_cmp(*it, pkey) == 1)
48 return *it; 49 return *it;
49 } 50 }
50 return NULL; 51 return NULL;
51 } 52 }
52 53
53 private: 54 private:
54 std::vector<EVP_PKEY*> keys_; 55 std::vector<EVP_PKEY*> keys_;
55 Lock lock_; 56 base::Lock lock_;
56 57
57 DISALLOW_COPY_AND_ASSIGN(OpenSSLMemoryKeyStore); 58 DISALLOW_COPY_AND_ASSIGN(OpenSSLMemoryKeyStore);
58 }; 59 };
59 60
60 } // namespace 61 } // namespace
61 62
62 // static 63 // static
63 OpenSSLPrivateKeyStore* OpenSSLPrivateKeyStore::GetInstance() { 64 OpenSSLPrivateKeyStore* OpenSSLPrivateKeyStore::GetInstance() {
64 return OpenSSLMemoryKeyStore::GetInstance(); 65 return OpenSSLMemoryKeyStore::GetInstance();
65 } 66 }
66 67
67 } // namespace net 68 } // namespace net
68 69
OLDNEW
« no previous file with comments | « chrome/browser/download/base_file.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698