diff options
author | Kevin Jacobs <kjacobs@mozilla.com> | 2019-10-03 00:23:47 +0000 |
---|---|---|
committer | Kevin Jacobs <kjacobs@mozilla.com> | 2019-10-03 00:23:47 +0000 |
commit | 6adcc806db2fe933634c02b9b428bae617d4b99f (patch) | |
tree | 6ec8372c36ba28dd8544289d2670a487ac26e84f /gtests | |
parent | 3246acfff91e20b7bc18184da77206812eb756c3 (diff) | |
download | nss-hg-6adcc806db2fe933634c02b9b428bae617d4b99f.tar.gz |
Bug 1576307 - Fixup for fips tests, permit NULL iv as necessary. r=jcj
ECB mode should not require an IV.
Differential Revision: https://phabricator.services.mozilla.com/D47990
Diffstat (limited to 'gtests')
-rw-r--r-- | gtests/pk11_gtest/pk11_cbc_unittest.cc | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/gtests/pk11_gtest/pk11_cbc_unittest.cc b/gtests/pk11_gtest/pk11_cbc_unittest.cc index 7de51f828..87424a73e 100644 --- a/gtests/pk11_gtest/pk11_cbc_unittest.cc +++ b/gtests/pk11_gtest/pk11_cbc_unittest.cc @@ -283,7 +283,7 @@ TEST_F(Pkcs11CbcPadTest, FailEncryptShortParam) { sizeof(encrypted), kInput, input_len); EXPECT_EQ(SECSuccess, rv); - // CBC (and the below modes) should have a 16B IV + // CBC should have a 16B IV param.len = AES_BLOCK_SIZE - 1; rv = PK11_Encrypt(key.get(), CKM_AES_CBC, ¶m, encrypted, &encrypted_len, sizeof(encrypted), kInput, input_len); @@ -294,20 +294,9 @@ TEST_F(Pkcs11CbcPadTest, FailEncryptShortParam) { sizeof(encrypted), kInput, input_len); EXPECT_EQ(SECSuccess, rv); - // ECB - param.len = AES_BLOCK_SIZE - 1; - rv = PK11_Encrypt(key.get(), CKM_AES_CBC, ¶m, encrypted, &encrypted_len, - sizeof(encrypted), kInput, input_len); - EXPECT_EQ(SECFailure, rv); - - param.len++; - rv = PK11_Encrypt(key.get(), CKM_AES_ECB, ¶m, encrypted, &encrypted_len, - sizeof(encrypted), kInput, input_len); - EXPECT_EQ(SECSuccess, rv); - // CTS param.len = AES_BLOCK_SIZE - 1; - rv = PK11_Encrypt(key.get(), CKM_AES_CBC, ¶m, encrypted, &encrypted_len, + rv = PK11_Encrypt(key.get(), CKM_AES_CTS, ¶m, encrypted, &encrypted_len, sizeof(encrypted), kInput, input_len); EXPECT_EQ(SECFailure, rv); |