From f97bf16fe68446bf83f447cc010b271cbd4fcfd6 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Tue, 23 Oct 2018 13:58:52 -0400 Subject: Use more informative error message for invalid CBC padding GH #1714 --- src/lib/modes/cbc/cbc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/modes') diff --git a/src/lib/modes/cbc/cbc.cpp b/src/lib/modes/cbc/cbc.cpp index c01fc4328..aa73eb884 100644 --- a/src/lib/modes/cbc/cbc.cpp +++ b/src/lib/modes/cbc/cbc.cpp @@ -256,7 +256,7 @@ void CBC_Decryption::finish(secure_vector& buffer, size_t offset) buffer.resize(buffer.size() - pad_bytes); // remove padding if(pad_bytes == 0 && padding().name() != "NoPadding") { - throw Decoding_Error(name()); + throw Decoding_Error("Invalid CBC padding"); } } -- cgit v1.2.3