[Botan-devel] Catching 'Botan::Decoding_Error'

Gregor Schrägle gregor.schraegle at gmx.de
Wed Nov 3 13:38:28 EDT 2010


Dear Botan experts,

 

I am trying to handle the following exception: 'Botan::Decoding_Error'.

 

The exception is thrown in my decryption method
(pipe.process_msg(encryptedPassword), 

when the parameter handed over is not a valid encrypted string (not
previously AES/ECB/PKCS7 encrypted).

 

Pipe pipe(new Base64_Decoder(), get_cipher("AES/ECB/PKCS7", key,
DECRYPTION));

pipe.process_msg(encryptedPassword);

 

In this situation it is absolutely correct that the exception is thrown, but
it leads to a termination of the entire runtime,

and I am not able to catch the exception with a catch statement (e.g. catch
(std::exception& e) ).

 

The console output I get after termination is this:

terminate called after throwing an instance of 'Botan::Decoding_Error'

  what():  Botan: Decoding error: AES/ECB/PKCS7

 

This application has requested the Runtime to terminate it in an unusual
way.

Please contact the application's support team for more information.

 

Can anyone provide me some help?

How can I get a hold of the exception and handle it in a way that my program
does not terminate abnormally?

 

Thank you very much and best regards,

Gregor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20101103/dfd0ddbf/attachment.html>


More information about the botan-devel mailing list