mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-25 22:19:59 +01:00
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:
parent
04c9cddda9
commit
363ed2e892
19
g10/keygen.c
19
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user