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

Daniel Kahn Gillmor at
Fri Jun 27 07:50:36 CEST 2008

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.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: 16_functional_read_s2k.diff
Type: text/x-diff
Size: 2126 bytes
Desc: enable read_s2k() in src/opencdk/read-packet.c
URL: </pipermail/attachments/20080627/1d8811f2/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 826 bytes
Desc: not available
URL: </pipermail/attachments/20080627/1d8811f2/attachment.pgp>

More information about the Gnutls-devel mailing list