[Pkg-gnupg-commit] [gnupg2] 65/159: gpg: Simplify status message code from commit b30c15bf.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Jan 27 13:23:54 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit 363ed2e892adc97fae97111bb56b64f9f809e8d5
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Dec 23 15:45:30 2015 +0100

    gpg: Simplify status message code from commit b30c15bf.
    
    * g10/keygen.c (card_write_key_to_backup_file): Simplify by using
    hexfingerprint.
    --
    
    Note that the extra blank added to FPRBUF in the old code was not
    needed because write_status_text_and_buffer already ensures that
    there will be a space.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>
---
 g10/keygen.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/g10/keygen.c b/g10/keygen.c
index 03fc53c..992e572 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -3861,28 +3861,13 @@ card_write_key_to_backup_file (PKT_public_key *sk, const char *backup_dir)
     }
   else
     {
-      unsigned char array[MAX_FINGERPRINT_LEN];
-      char *fprbuf, *p;
-      size_t n;
-      int i;
+      char *fprbuf;
 
       iobuf_close (fp);
       iobuf_ioctl (NULL, IOBUF_IOCTL_INVALIDATE_CACHE, 0, (char*)fname);
       log_info (_("Note: backup of card key saved to '%s'\n"), fname);
 
-      fingerprint_from_pk (sk, array, &n);
-      p = fprbuf = xmalloc (MAX_FINGERPRINT_LEN*2 + 1 + 1);
-      if (!p)
-        {
-          err = gpg_error_from_syserror ();
-          goto leave;
-        }
-
-      for (i=0; i < n ; i++, p += 2)
-        sprintf (p, "%02X", array[i]);
-      *p++ = ' ';
-      *p = 0;
-
+      fprbuf = hexfingerprint (sk, NULL, 0);
       write_status_text_and_buffer (STATUS_BACKUP_KEY_CREATED, fprbuf,
                                     fname, strlen (fname), 0);
       xfree (fprbuf);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list