lib/opencdk/read-packet.c: read_s2k() implementation

Nikos Mavrogiannopoulos n.mavrogiannopoulos at
Fri Jun 27 12:21:12 CEST 2008

Hello Daniel,
 In a few days I'll merge with the new opencdk code in the development
branch (changes almost all code), thus I'd appreciate if you could
port your patch there.


On Fri, Jun 27, 2008 at 8:50 AM, Daniel Kahn Gillmor
< at> wrote:
> Hey folks--
> After wrapping my head around the relevant section of RFC 4880 and
> bits of opencdk, i've fleshed out the previously unimplemented opencdk
> internal function intended to interpret OpenPGP String-To-Key
> transformations, read_s2k() in read-packet.c.
> Attached, please find the patch for this function.  Inspection with a
> debugger shows that the values being stored are congruent with what is
> expected in other uses of the cdk_s2k_t construct.
> After my first draft of this patch, i noticed that similar code
> already existed in the read_symkey_enc() function (also in
> lib/opencdk/read-packet.c).  So instead of publishing my first draft,
> i've collapsed the code for these two so that there's a canonical
> implementation of reading s2k values present in the opencdk codebase.
> The attached patch reflects this approach.
> This change should not affect the API or ABI at all, and it allows
> GnuTLS to recognize encrypted secret keys (though it cannot yet use
> them, afaict).
> This patch was done against Andreas Metzler's 2.4.0-2 package of
> gnutls that is currently in debian/unstable.
> As always, feedback is welcome.
> Regards,
>        --dkg
> _______________________________________________
> Gnutls-devel mailing list
> Gnutls-devel at

More information about the Gnutls-devel mailing list