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

Side by Side Diff: components/webcrypto/nss/util_nss.cc

Issue 1082123003: Rename USE_NSS to USE_NSS_CERTS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use-nss-certs
Patch Set: rebase Created 5 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/webcrypto/nss/util_nss.h" 5 #include "components/webcrypto/nss/util_nss.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "components/webcrypto/crypto_data.h" 8 #include "components/webcrypto/crypto_data.h"
9 #include "components/webcrypto/platform_crypto.h" 9 #include "components/webcrypto/platform_crypto.h"
10 #include "crypto/nss_util.h" 10 #include "crypto/nss_util.h"
11 #include "crypto/scoped_nss_types.h" 11 #include "crypto/scoped_nss_types.h"
12 12
13 #if defined(USE_NSS) 13 #if defined(USE_NSS_CERTS)
14 #include <dlfcn.h> 14 #include <dlfcn.h>
15 #include <secoid.h> 15 #include <secoid.h>
16 #endif 16 #endif
17 17
18 namespace webcrypto { 18 namespace webcrypto {
19 19
20 namespace { 20 namespace {
21 base::LazyInstance<NssRuntimeSupport>::Leaky g_nss_runtime_support = 21 base::LazyInstance<NssRuntimeSupport>::Leaky g_nss_runtime_support =
22 LAZY_INSTANCE_INITIALIZER; 22 LAZY_INSTANCE_INITIALIZER;
23 } // namespace 23 } // namespace
(...skipping 11 matching lines...) Expand all
35 35
36 CryptoData SECItemToCryptoData(const SECItem& item) { 36 CryptoData SECItemToCryptoData(const SECItem& item) {
37 return CryptoData(item.data, item.len); 37 return CryptoData(item.data, item.len);
38 } 38 }
39 39
40 NssRuntimeSupport* NssRuntimeSupport::Get() { 40 NssRuntimeSupport* NssRuntimeSupport::Get() {
41 return &g_nss_runtime_support.Get(); 41 return &g_nss_runtime_support.Get();
42 } 42 }
43 43
44 NssRuntimeSupport::NssRuntimeSupport() : internal_slot_does_oaep_(false) { 44 NssRuntimeSupport::NssRuntimeSupport() : internal_slot_does_oaep_(false) {
45 #if !defined(USE_NSS) 45 #if !defined(USE_NSS_CERTS)
46 // Using a bundled version of NSS that is guaranteed to have this symbol. 46 // Using a bundled version of NSS that is guaranteed to have this symbol.
47 pk11_encrypt_func_ = PK11_Encrypt; 47 pk11_encrypt_func_ = PK11_Encrypt;
48 pk11_decrypt_func_ = PK11_Decrypt; 48 pk11_decrypt_func_ = PK11_Decrypt;
49 pk11_pub_encrypt_func_ = PK11_PubEncrypt; 49 pk11_pub_encrypt_func_ = PK11_PubEncrypt;
50 pk11_priv_decrypt_func_ = PK11_PrivDecrypt; 50 pk11_priv_decrypt_func_ = PK11_PrivDecrypt;
51 internal_slot_does_oaep_ = true; 51 internal_slot_does_oaep_ = true;
52 #else 52 #else
53 // Using system NSS libraries and PCKS #11 modules, which may not have the 53 // Using system NSS libraries and PCKS #11 modules, which may not have the
54 // necessary function (PK11_Encrypt) or mechanism support (CKM_AES_GCM). 54 // necessary function (PK11_Encrypt) or mechanism support (CKM_AES_GCM).
55 55
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 return NULL; 104 return NULL;
105 } 105 }
106 106
107 AlgorithmImplementation* CreatePlatformPbkdf2Implementation() { 107 AlgorithmImplementation* CreatePlatformPbkdf2Implementation() {
108 // PBKDF2 will only be implemented for BoringSSL, since the NSS 108 // PBKDF2 will only be implemented for BoringSSL, since the NSS
109 // implementation is being deprecated. 109 // implementation is being deprecated.
110 return NULL; 110 return NULL;
111 } 111 }
112 112
113 } // namespace webcrypto 113 } // namespace webcrypto
OLDNEW
« no previous file with comments | « components/webcrypto/nss/rsa_hashed_algorithm_nss.cc ('k') | components/webcrypto/test/test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698