1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-04-17 15:44:34 +02:00

gpg: Allow updating the expiration time of multiple subkeys at once.

* g10/keyedit.c (menu_expire): Allow updating the expiration time of
multiple subkeys at once.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
GnuPG-bug-id: 1944
This commit is contained in:
Neal H. Walfield 2015-11-23 12:16:33 +01:00
parent 19f099463c
commit b64b33bb80

View File

@ -4003,7 +4003,22 @@ menu_expire (KBNODE pub_keyblock)
n1 = count_selected_keys (pub_keyblock); n1 = count_selected_keys (pub_keyblock);
if (n1 > 1) if (n1 > 1)
{ {
tty_printf (_("Please select at most one subkey.\n")); char *s = xtryasprintf (_("Are you sure you want to change the"
" expiration time %d subkeys? (y/N) "), n1);
int s_need_free;
if (s)
s_need_free = 0;
else
{
s = _("Are you sure you want to change the"
" expiration time for multiple subkeys? (y/N) ");
s_need_free = 0;
}
rc = cpr_get_answer_is_yes ("keyedit.expire_multiple_subkeys.okay", s);
if (s_need_free)
xfree (s);
if (! rc)
return 0; return 0;
} }
else if (n1) else if (n1)
@ -4029,12 +4044,16 @@ menu_expire (KBNODE pub_keyblock)
keyid_from_pk (main_pk, keyid); keyid_from_pk (main_pk, keyid);
main_pk->expiredate = expiredate; main_pk->expiredate = expiredate;
} }
else if (node->pkt->pkttype == PKT_PUBLIC_SUBKEY else if (node->pkt->pkttype == PKT_PUBLIC_SUBKEY)
&& (node->flag & NODFLG_SELKEY)) {
if (node->flag & NODFLG_SELKEY)
{ {
sub_pk = node->pkt->pkt.public_key; sub_pk = node->pkt->pkt.public_key;
sub_pk->expiredate = expiredate; sub_pk->expiredate = expiredate;
} }
else
sub_pk = NULL;
}
else if (node->pkt->pkttype == PKT_USER_ID) else if (node->pkt->pkttype == PKT_USER_ID)
uid = node->pkt->pkt.user_id; uid = node->pkt->pkt.user_id;
else if (main_pk && node->pkt->pkttype == PKT_SIGNATURE else if (main_pk && node->pkt->pkttype == PKT_SIGNATURE