aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--g10/ChangeLog6
-rw-r--r--g10/keygen.c22
2 files changed, 27 insertions, 1 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 639a7dc03..74adc7630 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,9 @@
+2002-10-12 Werner Koch <[email protected]>
+
+ * keygen.c (print_status_key_created): New.
+ (do_generate_keypair): Use it to print the fingerprint.
+ (generate_subkeypair): Likewise.
+
2002-10-11 David Shaw <[email protected]>
* keyedit.c (menu_addrevoker): Properly back out if the signature
diff --git a/g10/keygen.c b/g10/keygen.c
index b45618e90..7582805fa 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -2066,6 +2066,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 );