Changeset View
Changeset View
Standalone View
Standalone View
g10/delkey.c
Context not available. | |||||
} | } | ||||
static int | static int | ||||
confirm_deletion(ctrl_t ctrl, PKT_public_key *pk, int secret, int fingerprint) | confirm_deletion(ctrl_t ctrl, PACKET *pkt, int secret, int fingerprint) | ||||
{ | { | ||||
int yes = 0; | int yes = 0; | ||||
Context not available. | |||||
} | } | ||||
if (secret) | if (secret) | ||||
print_seckey_info (ctrl, pk); | print_seckey_info (ctrl, pkt->pkt.public_key); | ||||
else | else | ||||
print_pubkey_info (ctrl, NULL, pk); | print_pubkey_info (ctrl, NULL, pkt->pkt.public_key); | ||||
tty_printf( "\n" ); | tty_printf( "\n" ); | ||||
yes = cpr_get_answer_is_yes (secret? "delete_key.secret.okay": "delete_key.okay", | yes = cpr_get_answer_is_yes (secret? "delete_key.secret.okay": "delete_key.okay", | ||||
_("Delete this key from the keyring? (y/N) ")); | _("Delete this key from the keyring? (y/N) ")); | ||||
if (!cpr_enabled() && secret && yes) | if (!cpr_enabled() && secret) | ||||
{ | { | ||||
/* I think it is not required to check a passphrase; if the | /* I think it is not required to check a passphrase; if the | ||||
* user is so stupid as to let others access his secret | * user is so stupid as to let others access his secret | ||||
* keyring (and has no backup) - it is up him to read some | * keyring (and has no backup) - it is up him to read some | ||||
* very basic texts about security. */ | * very basic texts about security. */ | ||||
yes = cpr_get_answer_is_yes ("delete_key.secret.okay", | if (yes) | ||||
_("This is a secret key! - really delete? (y/N) ")); | yes = cpr_get_answer_is_yes ("delete_key.secret.okay", | ||||
_("This is a secret key! - really delete? (y/N) ")); | |||||
/* Extra confirmation before deleting the user's primary key. */ | |||||
if (yes && pkt->pkttype != PKT_PUBLIC_SUBKEY) | |||||
yes = cpr_get_answer_is_yes ("delete_key.secret.primary.okay", | |||||
_("This is the primary key! - really delete? (y/N) ")); | |||||
} | } | ||||
return yes; | return yes; | ||||
Context not available. | |||||
if (should_skip (&desc, node->pkt->pkt.public_key)) | if (should_skip (&desc, node->pkt->pkt.public_key)) | ||||
continue; | continue; | ||||
if (confirm_deletion (ctrl, node->pkt->pkt.public_key, secret, exactmatch)) | if (confirm_deletion (ctrl, node->pkt, secret, exactmatch)) | ||||
{ | { | ||||
err = gpg_agent_delete_secret_key (ctrl, node->pkt->pkt.public_key); | err = gpg_agent_delete_secret_key (ctrl, node->pkt->pkt.public_key); | ||||
Context not available. | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
if (confirm_deletion (ctrl, pk, secret, exactmatch)) | if (confirm_deletion (ctrl, node->pkt, secret, exactmatch)) | ||||
{ | { | ||||
err = keydb_delete_keyblock (hd); | err = keydb_delete_keyblock (hd); | ||||
if (err) | if (err) | ||||
Context not available. |