summaryrefslogtreecommitdiff
path: root/src/crypto/fipsmodule/aes/aes_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/fipsmodule/aes/aes_test.cc')
-rw-r--r--src/crypto/fipsmodule/aes/aes_test.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/crypto/fipsmodule/aes/aes_test.cc b/src/crypto/fipsmodule/aes/aes_test.cc
index 2222b63d..1f9a4919 100644
--- a/src/crypto/fipsmodule/aes/aes_test.cc
+++ b/src/crypto/fipsmodule/aes/aes_test.cc
@@ -189,6 +189,13 @@ TEST(AESTest, WrapBadLengths) {
}
}
+TEST(AESTest, InvalidKeySize) {
+ static const uint8_t kZero[8] = {0};
+ AES_KEY key;
+ EXPECT_LT(AES_set_encrypt_key(kZero, 42, &key), 0);
+ EXPECT_LT(AES_set_decrypt_key(kZero, 42, &key), 0);
+}
+
#if defined(SUPPORTS_ABI_TEST)
TEST(AESTest, ABI) {
for (int bits : {128, 192, 256}) {