help-gnutls
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gnutls] gnutls_openpgp_privkey_import() behavior seems inconsi


From: Daniel Kahn Gillmor
Subject: Re: [Help-gnutls] gnutls_openpgp_privkey_import() behavior seems inconsistent depending on choice of "format" variable
Date: Thu, 03 Apr 2008 16:47:48 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

On Thu 2008-04-03 13:48:37 -0400, Nikos Mavrogiannopoulos wrote:

> This is not quite easy to fix since it depends on the internals of
> opencdk. As far as I remember opencdk auto detects the input data
> and acts accordingly. However in gnutls we specifically set the
> raw/base64 flag. An improvement I could think would be to check the
> data after the import in order to verify that import was successful.
> 
> Does the attached patch solve the issue for you?

Thanks, Nikos.  That's certainly an improvement -- i now get
GNUTLS_E_OPENPGP_GETKEY_FAILED when i try a privkey_import in RAW mode
but the incoming datum is BASE64-encoded.  I think this patch should
be applied to the master branch.

However, i don't get any failures when i set format to
GNUTLS_OPENPGP_FMT_BASE64, whether the input is raw or not.  In fact,
i can successfully import the key and use it regardless of the input
format as long as i've set format this way.

So: why bother with this parameter to privkey_import, since one
setting (FMT_BASE64) works no matter what kind of input you've got?
Why would anyone choose FMT_RAW?

The inconsistency between format flags is confusing and unpredictable
From the docs; and unpredictability is a property that's undesirable
in a library, no?

Thanks for all your work on this!  It's exciting to see what the new
versions of GnuTLS make possible.

    --dkg

PS no need to Cc me.  I read the list!

Attachment: pgpLh0F7oauFX.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]