From 93937caf120fed43de182e475822805afdbe3001 Mon Sep 17 00:00:00 2001 From: mostynb Date: Tue, 9 Jun 2015 12:36:17 -0700 Subject: increase crypto_unittest key sizes to satisfy NSS 3.19.1 NSS version 3.19.1 added minimum key size constraints to avoid the Logjam attack: > The minimum size of keys that NSS will generate has been raised: > The minimum modulus size for RSA keys is now 512 bits > The minimum modulus size for DSA keys is now 1023 bits > The minimum modulus size for Diffie-Hellman keys is now 1023 bits https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_3.19.1_release_notes https://bugzilla.mozilla.org/show_bug.cgi?id=1138554 BUG=490240 Review URL: https://codereview.chromium.org/1148193006 Cr-Commit-Position: refs/heads/master@{#333554} --- crypto/nss_key_util_unittest.cc | 4 ++-- crypto/rsa_private_key_unittest.cc | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crypto/nss_key_util_unittest.cc b/crypto/nss_key_util_unittest.cc index f8de8e2..ff4d55a 100644 --- a/crypto/nss_key_util_unittest.cc +++ b/crypto/nss_key_util_unittest.cc @@ -50,7 +50,7 @@ TEST_F(NSSKeyUtilTest, FindNSSKeyFromPublicKeyInfo) { // Create an NSS keypair, which will put the keys in the user's NSSDB. ScopedSECKEYPublicKey public_key; ScopedSECKEYPrivateKey private_key; - ASSERT_TRUE(GenerateRSAKeyPairNSS(internal_slot(), 256, + ASSERT_TRUE(GenerateRSAKeyPairNSS(internal_slot(), 512, false /* not permanent */, &public_key, &private_key)); @@ -68,7 +68,7 @@ TEST_F(NSSKeyUtilTest, FailedFindNSSKeyFromPublicKeyInfo) { // Create an NSS keypair, which will put the keys in the user's NSSDB. ScopedSECKEYPublicKey public_key; ScopedSECKEYPrivateKey private_key; - ASSERT_TRUE(GenerateRSAKeyPairNSS(internal_slot(), 256, + ASSERT_TRUE(GenerateRSAKeyPairNSS(internal_slot(), 512, false /* not permanent */, &public_key, &private_key)); diff --git a/crypto/rsa_private_key_unittest.cc b/crypto/rsa_private_key_unittest.cc index b231cac..9e7f6ff 100644 --- a/crypto/rsa_private_key_unittest.cc +++ b/crypto/rsa_private_key_unittest.cc @@ -447,7 +447,8 @@ TEST(RSAPrivateKeyUnitTest, ShortIntegers) { TEST(RSAPrivateKeyUnitTest, CreateFromKeyTest) { scoped_ptr key_pair( - crypto::RSAPrivateKey::Create(256)); + crypto::RSAPrivateKey::Create(512)); + ASSERT_TRUE(key_pair.get()); scoped_ptr key_copy( crypto::RSAPrivateKey::CreateFromKey(key_pair->key())); -- cgit v1.1