[GPGME PATCH] core: Enable extraction of session keys.

Werner Koch wk at gnupg.org
Tue Nov 15 10:42:34 CET 2016


Hi!

Thanks for the patch.  I applied it with this comment:

    On the concern of adding a new field to a structure: It may not be
    clearly documented but we don't expect that a user ever allocates such
    a structure - those result structure may only be created bu gpgme and
    are read-only for the user.  Adding a new member constitutes a
    compatible ABI change and thus an older SO may not be used by code
    compiled with a header for the newer API.  Unless someone tinkers with
    the build system, this should never happen.  We have added new fields
    to result structure may times and I can't remember any problems.

I also went forward and implemented the override feature.  However I
changed the API for both:

    To keep the number of context manipulation functions at bay, this
    patches removes the just added gpgme_set_export_session_keys and
    gpgme_get_export_session_keys by flags for the generic context
    function.

This is because I consider the session-key exporting a rarely used
feature and thus the generic flag setting function is more appropriate.
This also instantly provides the Qt and cpp bindings.  Usage is pretty
simple:

  if (export_session_key)
    gpgme_set_ctx_flag (ctx, "export-session-key", "1");
  if (override_session_key)
    gpgme_set_ctx_flag (ctx, "override-session-key", override_session_key);

see tests/run-decrypt.c


Shalom-Salam,

   Werner
    

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: </pipermail/attachments/20161115/f5a57200/attachment.sig>


More information about the Gnupg-devel mailing list