aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-01-18 11:37:01 -0500
committerJack Lloyd <[email protected]>2019-01-18 11:37:01 -0500
commitb835fdf8fd3910a79ab408660757d9736f82d14d (patch)
treefbbd8e89d9cf910bc3a9e9ecbfce5ce290b7c8d9 /src/lib/ffi
parent9ca22335edcb9800158f4691de20fa5d0f9cc849 (diff)
Rename Integrity_Failure to Invalid_Authentication_Tag
This makes the meaning and usage more clear. Add a specific error type so invalid tags can be distinguished without having to catch that specific type. See also #1813
Diffstat (limited to 'src/lib/ffi')
-rw-r--r--src/lib/ffi/ffi.cpp3
-rw-r--r--src/lib/ffi/ffi_cipher.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp
index b0c1f6e71..4fe1d8c71 100644
--- a/src/lib/ffi/ffi.cpp
+++ b/src/lib/ffi/ffi.cpp
@@ -62,6 +62,9 @@ int ffi_map_error_type(Botan::ErrorType err)
case Botan::ErrorType::DecodingFailure:
return BOTAN_FFI_ERROR_INVALID_INPUT;
+ case Botan::ErrorType::InvalidTag:
+ return BOTAN_FFI_ERROR_BAD_MAC;
+
case Botan::ErrorType::InvalidKeyLength:
return BOTAN_FFI_ERROR_INVALID_KEY_LENGTH;
case Botan::ErrorType::LookupError:
diff --git a/src/lib/ffi/ffi_cipher.cpp b/src/lib/ffi/ffi_cipher.cpp
index dc340ea61..3c74a524f 100644
--- a/src/lib/ffi/ffi_cipher.cpp
+++ b/src/lib/ffi/ffi_cipher.cpp
@@ -128,7 +128,7 @@ int botan_cipher_update(botan_cipher_t cipher_obj,
{
cipher.finish(mbuf);
}
- catch(Integrity_Failure&)
+ catch(Invalid_Authentication_Tag&)
{
return BOTAN_FFI_ERROR_BAD_MAC;
}