[gnutls-dev] Fixing OpenPGP keyring import
Timo Schulz
twoaday at gmx.net
Wed Apr 18 08:57:11 CEST 2007
Ludovic Courtès wrote:
> The patch is kludgey: since `cdk_keydb_new ()' only supports the raw
> format, it changes `gnutls_openpgp_keyring_import ()' so that it returns
> an error when asked for a base64 import.
Actually that's not true, maybe the code does not work in the used
CDK release, but the keydb code has the ability to automatically
decode base64 files which are used as
CDK_DBTYPE_PK_KEYRING.
As Simon pointed out, I re-wrote lots of the opencdk code and I
added a lot of tests to make sure all changes really work as expected.
I also write a test to use a base64 file as a keyring and I succeeded
to search for a key by keyid or by pattern.
> Fixing this would require one of the following:
>
> 1. fixing `cdk_keydb_new ()' so that one can pass an additional
> argument indicating the format.
As I said before, this is usually not needed. The both format which
are possible: raw, base64 should be supported.
If the opencdk version gnutls currently uses, does not support to
push the de-armor filter automatically, I guess it's the best idea to
fix it in keydb.c.
> 2. providing a new function, say `cdk_keydb_from_stream ()', where one
> can pass an arbitrary stream as the keyring source.
This might be a useful function and I will consider it.
> thereby fixing our problem. It would also have the advantage of not
> breaking OpenCDK's ABI. `cdk_keydb_new ()' could then be rewritten in
..if the only reason for the new code is that base64 data is not supported,
Timo
More information about the Gnutls-dev
mailing list