From 854d2f1da57827dc1d4c290f850fb2b948cbe38e Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 7 Sep 2018 10:59:54 -0400 Subject: Increase minimum Blowfish key length to 64 bits See #1673 Also, skip tests if the provider doesn't support the given key length. --- src/tests/test_block.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/tests/test_block.cpp') diff --git a/src/tests/test_block.cpp b/src/tests/test_block.cpp index 66ef9e24b..a53ff2633 100644 --- a/src/tests/test_block.cpp +++ b/src/tests/test_block.cpp @@ -86,6 +86,17 @@ class Block_Cipher_Tests final : public Text_Based_Test cipher->encrypt(garbage); cipher->clear(); + /* + * Different providers may have additional restrictions on key sizes. + * Avoid testing the cipher with a key size that it does not natively support. + */ + if(!cipher->valid_keylength(key.size())) + { + result.test_note("Skipping test with provider " + provider + + " as it does not support key length " + std::to_string(key.size())); + continue; + } + cipher->set_key(key); if(tweak.size() > 0) -- cgit v1.2.3