aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_ffi.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-07-24 15:35:43 -0400
committerJack Lloyd <[email protected]>2018-07-24 15:35:43 -0400
commit5d89df3fd37f93f07e04111712f2a21d9f418b74 (patch)
tree61a9866d3c9123925f71226300f51b7a70e489d4 /src/tests/test_ffi.cpp
parent552719cee2f90293a01454221997cf781c45df4b (diff)
Add botan_block_cipher_query_keylen plus some new FFI error codes
Diffstat (limited to 'src/tests/test_ffi.cpp')
-rw-r--r--src/tests/test_ffi.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tests/test_ffi.cpp b/src/tests/test_ffi.cpp
index c0afd9ac2..5940a1009 100644
--- a/src/tests/test_ffi.cpp
+++ b/src/tests/test_ffi.cpp
@@ -860,6 +860,16 @@ class FFI_Unit_Tests final : public Test
TEST_FFI_RC(16, botan_block_cipher_block_size, (cipher));
+ size_t min_keylen = 0, max_keylen = 0, mod_keylen = 0;
+ TEST_FFI_RC(0, botan_block_cipher_query_keylen, (cipher, nullptr, nullptr, nullptr));
+ TEST_FFI_RC(0, botan_block_cipher_query_keylen, (cipher, &min_keylen, nullptr, nullptr));
+ TEST_FFI_RC(0, botan_block_cipher_query_keylen, (cipher, nullptr, &max_keylen, nullptr));
+ TEST_FFI_RC(0, botan_block_cipher_query_keylen, (cipher, nullptr, nullptr, &mod_keylen));
+
+ result.test_eq("Expected min keylen", min_keylen, 16);
+ result.test_eq("Expected max keylen", max_keylen, 16);
+ result.test_eq("Expected mod keylen", mod_keylen, 1);
+
TEST_FFI_OK(botan_block_cipher_set_key, (cipher, zero16.data(), zero16.size()));
TEST_FFI_OK(botan_block_cipher_encrypt_blocks, (cipher, block.data(), block.data(), 1));