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

Side by Side Diff: content/child/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: long line 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 "content/child/webcrypto/nss/util_nss.h" 5 #include "content/child/webcrypto/nss/util_nss.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "content/child/webcrypto/crypto_data.h" 8 #include "content/child/webcrypto/crypto_data.h"
9 #include "content/child/webcrypto/platform_crypto.h" 9 #include "content/child/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 content { 18 namespace content {
19 19
20 namespace webcrypto { 20 namespace webcrypto {
21 21
22 namespace { 22 namespace {
23 base::LazyInstance<NssRuntimeSupport>::Leaky g_nss_runtime_support = 23 base::LazyInstance<NssRuntimeSupport>::Leaky g_nss_runtime_support =
(...skipping 13 matching lines...) Expand all
37 37
38 CryptoData SECItemToCryptoData(const SECItem& item) { 38 CryptoData SECItemToCryptoData(const SECItem& item) {
39 return CryptoData(item.data, item.len); 39 return CryptoData(item.data, item.len);
40 } 40 }
41 41
42 NssRuntimeSupport* NssRuntimeSupport::Get() { 42 NssRuntimeSupport* NssRuntimeSupport::Get() {
43 return &g_nss_runtime_support.Get(); 43 return &g_nss_runtime_support.Get();
44 } 44 }
45 45
46 NssRuntimeSupport::NssRuntimeSupport() : internal_slot_does_oaep_(false) { 46 NssRuntimeSupport::NssRuntimeSupport() : internal_slot_does_oaep_(false) {
47 #if !defined(USE_NSS) 47 #if !defined(USE_NSS_CERTS)
48 // Using a bundled version of NSS that is guaranteed to have this symbol. 48 // Using a bundled version of NSS that is guaranteed to have this symbol.
49 pk11_encrypt_func_ = PK11_Encrypt; 49 pk11_encrypt_func_ = PK11_Encrypt;
50 pk11_decrypt_func_ = PK11_Decrypt; 50 pk11_decrypt_func_ = PK11_Decrypt;
51 pk11_pub_encrypt_func_ = PK11_PubEncrypt; 51 pk11_pub_encrypt_func_ = PK11_PubEncrypt;
52 pk11_priv_decrypt_func_ = PK11_PrivDecrypt; 52 pk11_priv_decrypt_func_ = PK11_PrivDecrypt;
53 internal_slot_does_oaep_ = true; 53 internal_slot_does_oaep_ = true;
54 #else 54 #else
55 // Using system NSS libraries and PCKS #11 modules, which may not have the 55 // Using system NSS libraries and PCKS #11 modules, which may not have the
56 // necessary function (PK11_Encrypt) or mechanism support (CKM_AES_GCM). 56 // necessary function (PK11_Encrypt) or mechanism support (CKM_AES_GCM).
57 57
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 AlgorithmImplementation* CreatePlatformPbkdf2Implementation() { 109 AlgorithmImplementation* CreatePlatformPbkdf2Implementation() {
110 // PBKDF2 will only be implemented for BoringSSL, since the NSS 110 // PBKDF2 will only be implemented for BoringSSL, since the NSS
111 // implementation is being deprecated. 111 // implementation is being deprecated.
112 return NULL; 112 return NULL;
113 } 113 }
114 114
115 } // namespace webcrypto 115 } // namespace webcrypto
116 116
117 } // namespace content 117 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698