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@gnupg.org>
This commit is contained in:
Werner Koch 2015-12-23 15:45:30 +01:00
parent 04c9cddda9
commit 363ed2e892
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 2 additions and 17 deletions

View File

@ -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);