1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

Add KEY_CREATED status

This commit is contained in:
Werner Koch 2001-01-03 13:36:03 +00:00
parent 9b12847f25
commit a66fa9c25e
4 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2001-01-03 Werner Koch <wk@gnupg.org>
* status.c, status.h : New status KEY_CREATED
* keygen.c (do_generate_keypair,generate_subkeypair): Emit it.
2000-12-28 Werner Koch <wk@gnupg.org>
* signal.c (got_fatal_signal): Remove lockfiles here because the

View File

@ -1511,6 +1511,7 @@ do_generate_keypair( struct para_data_s *para,
PKT_secret_key *sk = NULL;
const char *s;
int rc;
int did_sub = 0;
if( outctrl->dryrun ) {
log_info("dry-run mode - key generation skipped\n");
@ -1609,6 +1610,7 @@ do_generate_keypair( struct para_data_s *para,
rc = write_keybinding(pub_root, pub_root, sk);
if( !rc )
rc = write_keybinding(sec_root, pub_root, sk);
did_sub = 1;
}
@ -1689,6 +1691,9 @@ do_generate_keypair( struct para_data_s *para,
else
tty_printf(_("Key generation failed: %s\n"), g10_errstr(rc) );
}
else {
write_status_text (STATUS_KEY_CREATED, did_sub? "B":"P");
}
release_kbnode( pub_root );
release_kbnode( sec_root );
if( sk ) /* the unprotected secret key */
@ -1783,8 +1788,10 @@ generate_subkeypair( KBNODE pub_keyblock, KBNODE sec_keyblock )
rc = write_keybinding(pub_keyblock, pub_keyblock, sk);
if( !rc )
rc = write_keybinding(sec_keyblock, pub_keyblock, sk);
if( !rc )
if( !rc ) {
okay = 1;
write_status_text (STATUS_KEY_CREATED, "S");
}
leave:
if( rc )

View File

@ -136,6 +136,7 @@ get_status_string ( int no )
case STATUS_POLICY_URL : s = "POLICY_URL" ; break;
case STATUS_BEGIN_STREAM : s = "BEGIN_STREAM"; break;
case STATUS_END_STREAM : s = "END_STREAM"; break;
case STATUS_KEY_CREATED : s = "KEY_CREATED"; break;
default: s = "?"; break;
}
return s;

View File

@ -87,7 +87,7 @@
#define STATUS_POLICY_URL 55
#define STATUS_BEGIN_STREAM 56
#define STATUS_END_STREAM 57
#define STATUS_KEY_CREATED 58
/*-- status.c --*/
void set_status_fd ( int fd );