1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-07-01 02:42:44 +02:00

* keyedit.c (sign_uids): If --expert it set, allow re-signing a uid to

promote a v3 self-sig to a v4 one.  This essentially deletes the old v3
self-sig and replaces it with a v4 one.
This commit is contained in:
David Shaw 2002-05-07 04:27:40 +00:00
parent 50c9a5bd25
commit 2e56b988c8
3 changed files with 66 additions and 23 deletions

View File

@ -1,5 +1,9 @@
2002-05-07 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (sign_uids): If --expert it set, allow re-signing a
uid to promote a v3 self-sig to a v4 one. This essentially
deletes the old v3 self-sig and replaces it with a v4 one.
* packet.h, parse-packet.c (parse_key), getkey.c
(merge_keys_and_selfsig, merge_selfsigs_main): a v3 key with a v4
self-sig must never let the v4 self-sig express a key expiration

View File

@ -1049,10 +1049,10 @@ merge_keys_and_selfsig( KBNODE keyblock )
}
}
if(pk->expiredate==0 || pk->expiredate>pk->max_expiredate)
if(pk && (pk->expiredate==0 || pk->expiredate>pk->max_expiredate))
pk->expiredate=pk->max_expiredate;
if(sk->expiredate==0 || sk->expiredate>sk->max_expiredate)
if(sk && (sk->expiredate==0 || sk->expiredate>sk->max_expiredate))
sk->expiredate=sk->max_expiredate;
}
}

View File

@ -301,7 +301,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
/* loop over all signators */
for( sk_rover = sk_list; sk_rover; sk_rover = sk_rover->next ) {
u32 sk_keyid[2],pk_keyid[2];
u32 sk_keyid[2],pk_keyid[2];
size_t n;
char *p;
int force_v4=0,class=0,selfsig=0;
@ -374,6 +374,28 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
uidnode->pkt->pkt.user_id->len,
0);
/* It's a v3 self-sig. Make it into a v4 self-sig? */
if(node->pkt->pkt.signature->version<4 && selfsig)
{
tty_printf(_("The self-signature on \"%s\"\n"
"is a PGP 2.x-style signature.\n"),user);
/* Note that the regular PGP2 warning below
still applies if there are no v4 sigs on
this key at all. */
if(opt.expert)
if(cpr_get_answer_is_yes("sign_uid.v4_promote_okay",
_("Do you want to promote "
"it to an OpenPGP self-"
"signature? (y/N) ")))
{
force_v4=1;
node->flag|=NODFLG_DELSIG;
continue;
}
}
if(!node->pkt->pkt.signature->flags.exportable && !local)
{
/* It's a local sig, and we want to make a
@ -381,7 +403,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
tty_printf(_("Your current signature on \"%s\"\n"
"is a local signature.\n"),user);
if(cpr_get_answer_is_yes("sign_uid.promote_okay",
if(cpr_get_answer_is_yes("sign_uid.local_promote_okay",
_("Do you want to promote "
"it to a full exportable "
"signature? (y/N) ")))
@ -558,27 +580,44 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
m_free(p); p = NULL;
tty_printf("\"\n");
if( local )
tty_printf(
_("\nThe signature will be marked as non-exportable.\n"));
if( nonrevocable )
tty_printf(
_("\nThe signature will be marked as non-revocable.\n"));
switch(class)
if(selfsig)
{
case 0x11:
tty_printf(_("\nI have not checked this key at all.\n"));
break;
tty_printf(_("\nThis will be a self-signature.\n"));
case 0x12:
tty_printf(_("\nI have checked this key casually.\n"));
break;
if( local )
tty_printf(
_("\nWarning: the signature will not be marked "
"as non-exportable.\n"));
case 0x13:
tty_printf(_("\nI have checked this key very carefully.\n"));
break;
if( nonrevocable )
tty_printf(
_("\nWarning: the signature will not be marked "
"as non-revocable.\n"));
}
else
{
if( local )
tty_printf(
_("\nThe signature will be marked as non-exportable.\n"));
if( nonrevocable )
tty_printf(
_("\nThe signature will be marked as non-revocable.\n"));
switch(class)
{
case 0x11:
tty_printf(_("\nI have not checked this key at all.\n"));
break;
case 0x12:
tty_printf(_("\nI have checked this key casually.\n"));
break;
case 0x13:
tty_printf(_("\nI have checked this key very carefully.\n"));
break;
}
}
tty_printf("\n");
@ -642,7 +681,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
}
}
/* Delete any local sigs that got promoted */
/* Delete any sigs that got promoted */
for( node=keyblock; node; node = node->next )
if( node->flag & NODFLG_DELSIG)
delete_kbnode(node);