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

Side by Side Diff: components/webcrypto/test/test_helpers.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
« no previous file with comments | « components/webcrypto/nss/util_nss.cc ('k') | content/app/content_main_runner.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 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/test/test_helpers.h" 5 #include "components/webcrypto/test/test_helpers.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 EXPECT_EQ(blink::WebCryptoErrorTypeNotSupported, status.error_type()); 106 EXPECT_EQ(blink::WebCryptoErrorTypeNotSupported, status.error_type());
107 return status.IsSuccess(); 107 return status.IsSuccess();
108 } 108 }
109 109
110 bool SupportsRsaOaep() { 110 bool SupportsRsaOaep() {
111 #if defined(USE_OPENSSL) 111 #if defined(USE_OPENSSL)
112 return true; 112 return true;
113 #else 113 #else
114 crypto::EnsureNSSInit(); 114 crypto::EnsureNSSInit();
115 // TODO(eroman): Exclude version test for OS_CHROMEOS 115 // TODO(eroman): Exclude version test for OS_CHROMEOS
116 #if defined(USE_NSS) 116 #if defined(USE_NSS_CERTS)
117 if (!NSS_VersionCheck("3.16.2")) 117 if (!NSS_VersionCheck("3.16.2"))
118 return false; 118 return false;
119 #endif 119 #endif
120 crypto::ScopedPK11Slot slot(PK11_GetInternalKeySlot()); 120 crypto::ScopedPK11Slot slot(PK11_GetInternalKeySlot());
121 return !!PK11_DoesMechanism(slot.get(), CKM_RSA_PKCS_OAEP); 121 return !!PK11_DoesMechanism(slot.get(), CKM_RSA_PKCS_OAEP);
122 #endif 122 #endif
123 } 123 }
124 124
125 bool SupportsRsaPrivateKeyImport() { 125 bool SupportsRsaPrivateKeyImport() {
126 // TODO(eroman): Exclude version test for OS_CHROMEOS 126 // TODO(eroman): Exclude version test for OS_CHROMEOS
127 #if defined(USE_NSS) 127 #if defined(USE_NSS_CERTS)
128 crypto::EnsureNSSInit(); 128 crypto::EnsureNSSInit();
129 if (!NSS_VersionCheck("3.16.2")) { 129 if (!NSS_VersionCheck("3.16.2")) {
130 LOG(WARNING) << "RSA key import is not supported by this version of NSS. " 130 LOG(WARNING) << "RSA key import is not supported by this version of NSS. "
131 "Skipping some tests"; 131 "Skipping some tests";
132 return false; 132 return false;
133 } 133 }
134 #endif 134 #endif
135 return true; 135 return true;
136 } 136 }
137 137
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 return blink::WebCryptoNamedCurveP384; 679 return blink::WebCryptoNamedCurveP384;
680 if (curve_str == "P-521") 680 if (curve_str == "P-521")
681 return blink::WebCryptoNamedCurveP521; 681 return blink::WebCryptoNamedCurveP521;
682 else 682 else
683 ADD_FAILURE() << "Unrecognized curve name: " << curve_str; 683 ADD_FAILURE() << "Unrecognized curve name: " << curve_str;
684 684
685 return blink::WebCryptoNamedCurveP384; 685 return blink::WebCryptoNamedCurveP384;
686 } 686 }
687 687
688 } // namespace webcrypto 688 } // namespace webcrypto
OLDNEW
« no previous file with comments | « components/webcrypto/nss/util_nss.cc ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698