[botan-devel] Feedback on Botan 1.10.x compatibility for Monotone

Markus Wanner markus at bluegap.ch
Tue Apr 24 03:42:05 EDT 2012


Jack,

as a heads up, I've just completed the adaption to botan 1.10.x for
monotone. Any next release of monotone should be able to compile and run
with botan 1.10.x.

One thing that I found silly for a stable release is the
Botan::User_Interface. Maybe it's just incomplete or I didn't read the
necessary documentation. However, monotone now ships with a simple
wrapper throwing a (custom) exception whenever get_password() is called.

For the adaption, the exception celanup (rev e30a741f) caused the most
head-aches. Monotone so far relied on Botan::Exception being the base
class of all exceptions ever thrown. Since that commit, there isn't a
common base class for all Botan exceptions anymore (well, std::exception
is the lowest common base class).

Of course, this might even be reasonable. I'm just saying it's not
possible to catch all Botan-only exceptions in a single catch() statement.

Monotone now mostly catches "Botan::Invalid_Argument" (i.e. catching
Decoding_Errors as well) wherever it wants to check and possibly retry
with a password (or with another password). Alternatively, the custom
Passphrase_Required exception thrown from our Dummy_UI class.

I tried using Botan::User_Interface, but was surprised to get an
exception based on Botan::Exception in case of a wrong or missing
passphrase, IIRC. I'm not sure about that, though. Maybe we could make
better use of Botan::User_Interface, if we'd use it properly?

Can you please take a look at how monotone uses Botan exceptions. It's
mostly in key_store.cc, here:

https://code.monotone.ca/p/monotone/source/tree/h:net.venge.monotone/src/key_store.cc

I'd appreciate comments WRT usage and interpretation of Botan exceptions.

Regards

Markus Wanner




More information about the botan-devel mailing list