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

Side by Side Diff: content/child/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: 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/test/test_helpers.h" 5 #include "content/child/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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 EXPECT_EQ(blink::WebCryptoErrorTypeNotSupported, status.error_type()); 109 EXPECT_EQ(blink::WebCryptoErrorTypeNotSupported, status.error_type());
110 return status.IsSuccess(); 110 return status.IsSuccess();
111 } 111 }
112 112
113 bool SupportsRsaOaep() { 113 bool SupportsRsaOaep() {
114 #if defined(USE_OPENSSL) 114 #if defined(USE_OPENSSL)
115 return true; 115 return true;
116 #else 116 #else
117 crypto::EnsureNSSInit(); 117 crypto::EnsureNSSInit();
118 // TODO(eroman): Exclude version test for OS_CHROMEOS 118 // TODO(eroman): Exclude version test for OS_CHROMEOS
119 #if defined(USE_NSS) 119 #if defined(USE_NSS_CERTS)
120 if (!NSS_VersionCheck("3.16.2")) 120 if (!NSS_VersionCheck("3.16.2"))
121 return false; 121 return false;
122 #endif 122 #endif
123 crypto::ScopedPK11Slot slot(PK11_GetInternalKeySlot()); 123 crypto::ScopedPK11Slot slot(PK11_GetInternalKeySlot());
124 return !!PK11_DoesMechanism(slot.get(), CKM_RSA_PKCS_OAEP); 124 return !!PK11_DoesMechanism(slot.get(), CKM_RSA_PKCS_OAEP);
125 #endif 125 #endif
126 } 126 }
127 127
128 bool SupportsRsaPrivateKeyImport() { 128 bool SupportsRsaPrivateKeyImport() {
129 // TODO(eroman): Exclude version test for OS_CHROMEOS 129 // TODO(eroman): Exclude version test for OS_CHROMEOS
130 #if defined(USE_NSS) 130 #if defined(USE_NSS_CERTS)
131 crypto::EnsureNSSInit(); 131 crypto::EnsureNSSInit();
132 if (!NSS_VersionCheck("3.16.2")) { 132 if (!NSS_VersionCheck("3.16.2")) {
133 LOG(WARNING) << "RSA key import is not supported by this version of NSS. " 133 LOG(WARNING) << "RSA key import is not supported by this version of NSS. "
134 "Skipping some tests"; 134 "Skipping some tests";
135 return false; 135 return false;
136 } 136 }
137 #endif 137 #endif
138 return true; 138 return true;
139 } 139 }
140 140
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
689 689
690 } // namesapce content 690 } // namesapce content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698