diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ffi/ffi.cpp | 5 | ||||
-rw-r--r-- | src/tests/test_ffi.cpp | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp index 74c576631..48b9cf803 100644 --- a/src/lib/ffi/ffi.cpp +++ b/src/lib/ffi/ffi.cpp @@ -16,7 +16,10 @@ namespace Botan_FFI { int ffi_error_exception_thrown(const char* func_name, const char* exn, int rc) { - fprintf(stderr, "in %s exception '%s' returning %d\n", func_name, exn, rc); + if(std::getenv("BOTAN_FFI_PRINT_EXCEPTIONS")) + { + std::fprintf(stderr, "in %s exception '%s' returning %d\n", func_name, exn, rc); + } return rc; } diff --git a/src/tests/test_ffi.cpp b/src/tests/test_ffi.cpp index de80f3e3b..8f3639ad4 100644 --- a/src/tests/test_ffi.cpp +++ b/src/tests/test_ffi.cpp @@ -868,6 +868,9 @@ class FFI_Unit_Tests final : public Test TEST_FFI_OK(botan_block_cipher_clear, (cipher)); + TEST_FFI_RC(BOTAN_FFI_ERROR_KEY_NOT_SET, botan_block_cipher_encrypt_blocks, (cipher, nullptr, nullptr, 0)); + TEST_FFI_RC(BOTAN_FFI_ERROR_KEY_NOT_SET, botan_block_cipher_decrypt_blocks, (cipher, nullptr, nullptr, 0)); + TEST_FFI_RC(16, botan_block_cipher_block_size, (cipher)); size_t min_keylen = 0, max_keylen = 0, mod_keylen = 0; |