summaryrefslogtreecommitdiff
path: root/gtests
diff options
context:
space:
mode:
authorKevin Jacobs <kjacobs@mozilla.com>2019-10-03 00:23:47 +0000
committerKevin Jacobs <kjacobs@mozilla.com>2019-10-03 00:23:47 +0000
commit6adcc806db2fe933634c02b9b428bae617d4b99f (patch)
tree6ec8372c36ba28dd8544289d2670a487ac26e84f /gtests
parent3246acfff91e20b7bc18184da77206812eb756c3 (diff)
downloadnss-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.cc15
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, &param, 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, &param, encrypted, &encrypted_len,
- sizeof(encrypted), kInput, input_len);
- EXPECT_EQ(SECFailure, rv);
-
- param.len++;
- rv = PK11_Encrypt(key.get(), CKM_AES_ECB, &param, 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, &param, encrypted, &encrypted_len,
+ rv = PK11_Encrypt(key.get(), CKM_AES_CTS, &param, encrypted, &encrypted_len,
sizeof(encrypted), kInput, input_len);
EXPECT_EQ(SECFailure, rv);