mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-01 16:33:02 +01:00
* keygen.c (print_status_key_created): New.
(do_generate_keypair): Use it to print the fingerprint. (generate_subkeypair): Likewise.
This commit is contained in:
parent
10128a5e25
commit
e5f14f15da
@ -1,3 +1,9 @@
|
||||
2002-10-12 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* keygen.c (print_status_key_created): New.
|
||||
(do_generate_keypair): Use it to print the fingerprint.
|
||||
(generate_subkeypair): Likewise.
|
||||
|
||||
2002-10-11 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* keyedit.c (menu_addrevoker): Properly back out if the signature
|
||||
|
22
g10/keygen.c
22
g10/keygen.c
@ -2065,6 +2065,24 @@ generate_keypair( const char *fname )
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
print_status_key_created (int letter, PKT_public_key *pk)
|
||||
{
|
||||
byte array[MAX_FINGERPRINT_LEN], *s;
|
||||
char buf[MAX_FINGERPRINT_LEN*2+30], *p;
|
||||
size_t i, n;
|
||||
|
||||
p = buf;
|
||||
*p++ = letter;
|
||||
*p++ = ' ';
|
||||
fingerprint_from_pk (pk, array, &n);
|
||||
s = array;
|
||||
for (i=0; i < n ; i++, s++, p += 2)
|
||||
sprintf (p, "%02X", *s);
|
||||
*p = 0;
|
||||
write_status_text (STATUS_KEY_CREATED, buf);
|
||||
}
|
||||
|
||||
static void
|
||||
do_generate_keypair( struct para_data_s *para,
|
||||
struct output_control_s *outctrl )
|
||||
@ -2276,7 +2294,9 @@ do_generate_keypair( struct para_data_s *para,
|
||||
tty_printf(_("Key generation failed: %s\n"), g10_errstr(rc) );
|
||||
}
|
||||
else {
|
||||
write_status_text (STATUS_KEY_CREATED, did_sub? "B":"P");
|
||||
PKT_public_key *pk = find_kbnode (pub_root,
|
||||
PKT_PUBLIC_KEY)->pkt->pkt.public_key;
|
||||
print_status_key_created (did_sub? 'B':'P', pk);
|
||||
}
|
||||
release_kbnode( pub_root );
|
||||
release_kbnode( sec_root );
|
||||
|
Loading…
x
Reference in New Issue
Block a user