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

Unified Diff: content/child/webcrypto/nss/rsa_hashed_algorithm_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 side-by-side diff with in-line comments
Download patch
Index: content/child/webcrypto/nss/rsa_hashed_algorithm_nss.cc
diff --git a/content/child/webcrypto/nss/rsa_hashed_algorithm_nss.cc b/content/child/webcrypto/nss/rsa_hashed_algorithm_nss.cc
index 6232246307ae6f039f7b664a9d636a143a8d51d0..4098e119f3b30b800ae3af7b19ae73aa96a85de2 100644
--- a/content/child/webcrypto/nss/rsa_hashed_algorithm_nss.cc
+++ b/content/child/webcrypto/nss/rsa_hashed_algorithm_nss.cc
@@ -24,7 +24,7 @@ namespace webcrypto {
namespace {
-#if defined(USE_NSS) && !defined(OS_CHROMEOS)
+#if defined(USE_NSS_CERTS) && !defined(OS_CHROMEOS)
Status ErrorRsaPrivateKeyImportNotSupported() {
return Status::ErrorUnsupported(
"NSS version must be at least 3.16.2 for RSA private key import. See "
@@ -127,7 +127,7 @@ struct RSAPrivateKey {
// The system NSS library doesn't have the new PK11_ExportDERPrivateKeyInfo
// function yet (https://bugzilla.mozilla.org/show_bug.cgi?id=519255). So we
// provide a fallback implementation.
-#if defined(USE_NSS)
+#if defined(USE_NSS_CERTS)
const SEC_ASN1Template RSAPrivateKeyTemplate[] = {
{SEC_ASN1_SEQUENCE, 0, NULL, sizeof(RSAPrivateKey)},
{SEC_ASN1_INTEGER, offsetof(RSAPrivateKey, version)},
@@ -140,7 +140,7 @@ const SEC_ASN1Template RSAPrivateKeyTemplate[] = {
{SEC_ASN1_INTEGER, offsetof(RSAPrivateKey, exponent2)},
{SEC_ASN1_INTEGER, offsetof(RSAPrivateKey, coefficient)},
{0}};
-#endif // defined(USE_NSS)
+#endif // defined(USE_NSS_CERTS)
// On success |value| will be filled with data which must be freed by
// SECITEM_FreeItem(value, PR_FALSE);
@@ -254,7 +254,7 @@ Status ExportKeyPkcs8Nss(SECKEYPrivateKey* key, std::vector<uint8_t>* buffer) {
// TODO(rsleevi): Implement OAEP support according to the spec.
-#if defined(USE_NSS)
+#if defined(USE_NSS_CERTS)
// PK11_ExportDERPrivateKeyInfo isn't available. Use our fallback code.
const SECOidTag algorithm = SEC_OID_PKCS1_RSA_ENCRYPTION;
const int kPrivateKeyInfoVersion = 0;
@@ -292,9 +292,9 @@ Status ExportKeyPkcs8Nss(SECKEYPrivateKey* key, std::vector<uint8_t>* buffer) {
crypto::ScopedSECItem encoded_key(
SEC_ASN1EncodeItem(NULL, NULL, &private_key_info,
SEC_ASN1_GET(SECKEY_PrivateKeyInfoTemplate)));
-#else // defined(USE_NSS)
+#else // defined(USE_NSS_CERTS)
crypto::ScopedSECItem encoded_key(PK11_ExportDERPrivateKeyInfo(key, NULL));
-#endif // defined(USE_NSS)
+#endif // defined(USE_NSS_CERTS)
if (!encoded_key.get())
return Status::OperationError();

Powered by Google App Engine
This is Rietveld 408576698