1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

2002-12-22 Timo Schulz <ts@winpt.org>

* import.c (print_import_check): New.
        (import_one): Use it here.
        Use merge_keys_and_selfsig in the interactive mode to avoid
        wrong key information.
        * status.h: Add new status code.
        * status.c: Ditto.
This commit is contained in:
Timo Schulz 2002-12-22 20:53:20 +00:00
parent 6a4bd944a8
commit 15a2a3cd1f
4 changed files with 38 additions and 0 deletions

View file

@ -556,6 +556,31 @@ print_import_ok (PKT_public_key *pk, PKT_secret_key *sk, unsigned int reason)
}
void
print_import_check (PKT_public_key * pk, PKT_user_id * id)
{
char * buf, * p;
byte fpr[24];
u32 keyid[2];
int i, pos = 0, n;
buf = m_alloc (17+41+id->len+32);
keyid_from_pk (pk, keyid);
sprintf (buf, "%08X%08X ", keyid[0], keyid[1]);
pos = 17;
fingerprint_from_pk (pk, fpr, &n);
for (i = 0; i < n; i++, pos += 2)
sprintf (buf+pos, "%02X", fpr[i]);
strcat (buf, " ");
pos += 1;
p = native_to_utf8 (id->name);
strcat (buf, p);
write_status_text (STATUS_IMPORT_CHECK, buf);
m_free (buf);
m_free (p);
}
/****************
* Try to import one keyblock. Return an error only in serious cases, but
* never for an invalid keyblock. It uses log_error to increase the
@ -605,6 +630,8 @@ import_one( const char *fname, KBNODE keyblock,
}
if (opt.interactive) {
print_import_check (pk, uidnode->pkt->pkt.user_id);
merge_keys_and_selfsig (keyblock);
tty_printf ("\n");
show_basic_key_info (keyblock);
tty_printf ("\n");