[git] GPGME - branch, master, updated. gpgme-1.11.1-56-g54146d9

by Andre Heinecke cvs at cvs.gnupg.org
Fri Jun 8 14:52:48 CEST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  54146d90dd5518c24c30e6d2ebeb7f47ed4eb29e (commit)
      from  6c74a59e8855d1cac0d8001ad1b7843d2d15be5e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 54146d90dd5518c24c30e6d2ebeb7f47ed4eb29e
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Jun 8 14:52:41 2018 +0200

    json: Return fingerprint as createkey result
    
    * src/gpgme-json.c (op_createkey): Return fingerprint of new key.

diff --git a/src/gpgme-json.c b/src/gpgme-json.c
index 598c587..ae878bd 100644
--- a/src/gpgme-json.c
+++ b/src/gpgme-json.c
@@ -2778,7 +2778,7 @@ static const char hlp_createkey[] =
   "expires: Seconds since epoch to expiry as Number. 0 means no expiry.\n"
   "\n"
   "Response on success:\n"
-  "success:   Boolean true.\n"
+  "fingerprint:   The fingerprint of the created key.\n"
   "\n"
   "Note: This interface does not allow key generation if the userid\n"
   "of the new key already exists in the keyring.\n";
@@ -2792,6 +2792,7 @@ op_createkey (cjson_t request, cjson_t result)
   cjson_t j_tmp;
   const char *algo = "default";
   const char *userid;
+  gpgme_genkey_result_t res;
 
 #ifdef GPG_AGENT_ALLOWS_KEYGEN_TRHOUGH_BROWSER
   /* GnuPG forbids keygen through the browser socket so for
@@ -2838,7 +2839,14 @@ op_createkey (cjson_t request, cjson_t result)
   if ((err = gpgme_op_createkey (ctx, userid, algo, 0, expires, NULL, flags)))
     goto leave;
 
-  xjson_AddBoolToObject (result, "success", 1);
+  res = gpgme_op_genkey_result (ctx);
+  if (!res)
+    {
+      err = gpg_error (GPG_ERR_GENERAL);
+      goto leave;
+    }
+
+  xjson_AddStringToObject0 (result, "fingerprint", res->fpr);
 
 leave:
 #ifdef GPG_AGENT_ALLOWS_KEYGEN_TRHOUGH_BROWSER

-----------------------------------------------------------------------

Summary of changes:
 src/gpgme-json.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list