mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-10 13:04:23 +01:00
* keyedit.c (sign_uids, show_key_and_fingerprint, ask_revoke_sig,
menu_revsig, menu_showphoto): --keyid-format conversion. (menu_addrevoker): Use print_pubkey_info() rather than duplicating code.
This commit is contained in:
parent
36a5e54e54
commit
618779fec2
@ -1,3 +1,10 @@
|
|||||||
|
2004-03-24 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* keyedit.c (sign_uids, show_key_and_fingerprint, ask_revoke_sig,
|
||||||
|
menu_revsig, menu_showphoto): --keyid-format conversion.
|
||||||
|
(menu_addrevoker): Use print_pubkey_info() rather than duplicating
|
||||||
|
code.
|
||||||
|
|
||||||
2004-03-19 David Shaw <dshaw@jabberwocky.com>
|
2004-03-19 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* trustdb.c (update_min_ownertrust, validate_keys): Do not use
|
* trustdb.c (update_min_ownertrust, validate_keys): Do not use
|
||||||
|
118
g10/keyedit.c
118
g10/keyedit.c
@ -636,12 +636,11 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
|
|||||||
* case we should allow to sign it again. */
|
* case we should allow to sign it again. */
|
||||||
if (!node->pkt->pkt.signature->flags.exportable && local)
|
if (!node->pkt->pkt.signature->flags.exportable && local)
|
||||||
tty_printf(_(
|
tty_printf(_(
|
||||||
"\"%s\" was already locally signed by key %08lX\n"),
|
"\"%s\" was already locally signed by key %s\n"),
|
||||||
user,(ulong)sk_keyid[1] );
|
user,keystr_from_sk(sk));
|
||||||
else
|
else
|
||||||
tty_printf(_(
|
tty_printf(_("\"%s\" was already signed by key %s\n"),
|
||||||
"\"%s\" was already signed by key %08lX\n"),
|
user,keystr_from_sk(sk));
|
||||||
user,(ulong)sk_keyid[1] );
|
|
||||||
|
|
||||||
if(opt.expert
|
if(opt.expert
|
||||||
&& cpr_get_answer_is_yes("sign_uid.dupe_okay",
|
&& cpr_get_answer_is_yes("sign_uid.dupe_okay",
|
||||||
@ -663,12 +662,14 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check whether any uids are left for signing */
|
/* check whether any uids are left for signing */
|
||||||
if( !count_uids_with_flag(keyblock, NODFLG_MARK_A) ) {
|
if( !count_uids_with_flag(keyblock, NODFLG_MARK_A) )
|
||||||
tty_printf(_("Nothing to sign with key %08lX\n"),
|
{
|
||||||
(ulong)sk_keyid[1] );
|
tty_printf(_("Nothing to sign with key %s\n"),keystr_from_sk(sk));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ask whether we really should sign these user id(s) */
|
/* Ask whether we really should sign these user id(s) */
|
||||||
tty_printf("\n");
|
tty_printf("\n");
|
||||||
show_key_with_all_names( keyblock, 1, 0, 1, 0, 0 );
|
show_key_with_all_names( keyblock, 1, 0, 1, 0, 0 );
|
||||||
@ -809,7 +810,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
|
|||||||
p = get_user_id( sk_keyid, &n );
|
p = get_user_id( sk_keyid, &n );
|
||||||
tty_print_utf8_string( p, n );
|
tty_print_utf8_string( p, n );
|
||||||
m_free(p); p = NULL;
|
m_free(p); p = NULL;
|
||||||
tty_printf("\" (%08lX)\n",(ulong)sk_keyid[1]);
|
tty_printf("\" (%s)\n",keystr_from_sk(sk));
|
||||||
|
|
||||||
if(selfsig)
|
if(selfsig)
|
||||||
{
|
{
|
||||||
@ -2257,27 +2258,30 @@ show_basic_key_info ( KBNODE keyblock )
|
|||||||
static void
|
static void
|
||||||
show_key_and_fingerprint( KBNODE keyblock )
|
show_key_and_fingerprint( KBNODE keyblock )
|
||||||
{
|
{
|
||||||
KBNODE node;
|
KBNODE node;
|
||||||
PKT_public_key *pk = NULL;
|
PKT_public_key *pk = NULL;
|
||||||
|
|
||||||
for( node = keyblock; node; node = node->next ) {
|
for( node = keyblock; node; node = node->next )
|
||||||
if( node->pkt->pkttype == PKT_PUBLIC_KEY ) {
|
{
|
||||||
pk = node->pkt->pkt.public_key;
|
if( node->pkt->pkttype == PKT_PUBLIC_KEY )
|
||||||
tty_printf("pub %4u%c/%08lX %s ",
|
{
|
||||||
nbits_from_pk( pk ),
|
pk = node->pkt->pkt.public_key;
|
||||||
pubkey_letter( pk->pubkey_algo ),
|
tty_printf("pub %4u%c/%s %s ",
|
||||||
(ulong)keyid_from_pk(pk,NULL),
|
nbits_from_pk( pk ),
|
||||||
datestr_from_pk(pk) );
|
pubkey_letter( pk->pubkey_algo ),
|
||||||
|
keystr_from_pk(pk),
|
||||||
|
datestr_from_pk(pk) );
|
||||||
}
|
}
|
||||||
else if( node->pkt->pkttype == PKT_USER_ID ) {
|
else if( node->pkt->pkttype == PKT_USER_ID )
|
||||||
PKT_user_id *uid = node->pkt->pkt.user_id;
|
{
|
||||||
tty_print_utf8_string( uid->name, uid->len );
|
PKT_user_id *uid = node->pkt->pkt.user_id;
|
||||||
break;
|
tty_print_utf8_string( uid->name, uid->len );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tty_printf("\n");
|
tty_printf("\n");
|
||||||
if( pk )
|
if( pk )
|
||||||
print_fingerprint( pk, NULL, 2 );
|
print_fingerprint( pk, NULL, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2666,9 +2670,6 @@ menu_addrevoker( KBNODE pub_keyblock, KBNODE sec_keyblock, int sensitive )
|
|||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
char *answer;
|
char *answer;
|
||||||
u32 keyid[2];
|
|
||||||
char *p;
|
|
||||||
size_t n;
|
|
||||||
|
|
||||||
if(revoker_pk)
|
if(revoker_pk)
|
||||||
free_public_key(revoker_pk);
|
free_public_key(revoker_pk);
|
||||||
@ -2753,17 +2754,7 @@ menu_addrevoker( KBNODE pub_keyblock, KBNODE sec_keyblock, int sensitive )
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
keyid_from_pk(revoker_pk,keyid);
|
print_pubkey_info(NULL,revoker_pk);
|
||||||
|
|
||||||
tty_printf("\npub %4u%c/%08lX %s ",
|
|
||||||
nbits_from_pk( revoker_pk ),
|
|
||||||
pubkey_letter( revoker_pk->pubkey_algo ),
|
|
||||||
(ulong)keyid[1], datestr_from_pk(revoker_pk) );
|
|
||||||
|
|
||||||
p = get_user_id( keyid, &n );
|
|
||||||
tty_print_utf8_string( p, n );
|
|
||||||
m_free(p);
|
|
||||||
tty_printf("\n");
|
|
||||||
print_fingerprint(revoker_pk,NULL,2);
|
print_fingerprint(revoker_pk,NULL,2);
|
||||||
tty_printf("\n");
|
tty_printf("\n");
|
||||||
|
|
||||||
@ -3452,11 +3443,11 @@ ask_revoke_sig( KBNODE keyblock, KBNODE node )
|
|||||||
unode->pkt->pkt.user_id->len );
|
unode->pkt->pkt.user_id->len );
|
||||||
|
|
||||||
if(sig->flags.exportable)
|
if(sig->flags.exportable)
|
||||||
tty_printf(_("\"\nsigned with your key %08lX at %s\n"),
|
tty_printf(_("\"\nsigned with your key %s at %s\n"),
|
||||||
(ulong)sig->keyid[1], datestr_from_sig(sig) );
|
keystr(sig->keyid), datestr_from_sig(sig) );
|
||||||
else
|
else
|
||||||
tty_printf(_("\"\nlocally signed with your key %08lX at %s\n"),
|
tty_printf(_("\"\nlocally signed with your key %s at %s\n"),
|
||||||
(ulong)sig->keyid[1], datestr_from_sig(sig) );
|
keystr(sig->keyid), datestr_from_sig(sig) );
|
||||||
|
|
||||||
if(sig->flags.expired)
|
if(sig->flags.expired)
|
||||||
{
|
{
|
||||||
@ -3510,20 +3501,23 @@ menu_revsig( KBNODE keyblock )
|
|||||||
}
|
}
|
||||||
else if( !skip && node->pkt->pkttype == PKT_SIGNATURE
|
else if( !skip && node->pkt->pkttype == PKT_SIGNATURE
|
||||||
&& ((sig = node->pkt->pkt.signature),
|
&& ((sig = node->pkt->pkt.signature),
|
||||||
!seckey_available(sig->keyid) ) ) {
|
!seckey_available(sig->keyid) ) )
|
||||||
if( (sig->sig_class&~3) == 0x10 ) {
|
{
|
||||||
tty_printf(_(" signed by %08lX at %s%s%s\n"),
|
if( (sig->sig_class&~3) == 0x10 )
|
||||||
(ulong)sig->keyid[1], datestr_from_sig(sig),
|
{
|
||||||
|
tty_printf(_(" signed by %s on %s%s%s\n"),
|
||||||
|
keystr(sig->keyid), datestr_from_sig(sig),
|
||||||
sig->flags.exportable?"":" (non-exportable)",
|
sig->flags.exportable?"":" (non-exportable)",
|
||||||
sig->flags.revocable?"":" (non-revocable)");
|
sig->flags.revocable?"":" (non-revocable)");
|
||||||
if(sig->flags.revocable)
|
if(sig->flags.revocable)
|
||||||
node->flag |= NODFLG_SELSIG;
|
node->flag |= NODFLG_SELSIG;
|
||||||
}
|
}
|
||||||
else if( sig->sig_class == 0x30 ) {
|
else if( sig->sig_class == 0x30 )
|
||||||
tty_printf(_(" revoked by %08lX at %s\n"),
|
{
|
||||||
(ulong)sig->keyid[1], datestr_from_sig(sig) );
|
tty_printf(_(" revoked by %s on %s\n"),
|
||||||
}
|
keystr(sig->keyid), datestr_from_sig(sig) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ask */
|
/* ask */
|
||||||
@ -3550,8 +3544,8 @@ menu_revsig( KBNODE keyblock )
|
|||||||
}
|
}
|
||||||
else if( node->pkt->pkttype == PKT_SIGNATURE ) {
|
else if( node->pkt->pkttype == PKT_SIGNATURE ) {
|
||||||
sig = node->pkt->pkt.signature;
|
sig = node->pkt->pkt.signature;
|
||||||
tty_printf(_(" signed by %08lX at %s%s\n"),
|
tty_printf(_(" signed by %s on %s%s\n"),
|
||||||
(ulong)sig->keyid[1], datestr_from_sig(sig),
|
keystr(sig->keyid), datestr_from_sig(sig),
|
||||||
sig->flags.exportable?"":_(" (non-exportable)") );
|
sig->flags.exportable?"":_(" (non-exportable)") );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3818,7 +3812,6 @@ menu_showphoto( KBNODE keyblock )
|
|||||||
int select_all = !count_selected_uids(keyblock);
|
int select_all = !count_selected_uids(keyblock);
|
||||||
int count=0;
|
int count=0;
|
||||||
PKT_public_key *pk=NULL;
|
PKT_public_key *pk=NULL;
|
||||||
u32 keyid[2];
|
|
||||||
|
|
||||||
/* Look for the public key first. We have to be really, really,
|
/* Look for the public key first. We have to be really, really,
|
||||||
explicit as to which photo this is, and what key it is a UID on
|
explicit as to which photo this is, and what key it is a UID on
|
||||||
@ -3827,10 +3820,7 @@ menu_showphoto( KBNODE keyblock )
|
|||||||
for( node = keyblock; node; node = node->next )
|
for( node = keyblock; node; node = node->next )
|
||||||
{
|
{
|
||||||
if( node->pkt->pkttype == PKT_PUBLIC_KEY )
|
if( node->pkt->pkttype == PKT_PUBLIC_KEY )
|
||||||
{
|
pk = node->pkt->pkt.public_key;
|
||||||
pk = node->pkt->pkt.public_key;
|
|
||||||
keyid_from_pk(pk, keyid);
|
|
||||||
}
|
|
||||||
else if( node->pkt->pkttype == PKT_USER_ID )
|
else if( node->pkt->pkttype == PKT_USER_ID )
|
||||||
{
|
{
|
||||||
PKT_user_id *uid = node->pkt->pkt.user_id;
|
PKT_user_id *uid = node->pkt->pkt.user_id;
|
||||||
@ -3850,9 +3840,9 @@ menu_showphoto( KBNODE keyblock )
|
|||||||
parse_image_header(&uid->attribs[i],&type,&size))
|
parse_image_header(&uid->attribs[i],&type,&size))
|
||||||
{
|
{
|
||||||
tty_printf(_("Displaying %s photo ID of size %ld for "
|
tty_printf(_("Displaying %s photo ID of size %ld for "
|
||||||
"key 0x%08lX (uid %d)\n"),
|
"key %s (uid %d)\n"),
|
||||||
image_type_to_string(type,1),
|
image_type_to_string(type,1),
|
||||||
(ulong)size,(ulong)keyid[1],count);
|
(ulong)size,keystr_from_pk(pk),count);
|
||||||
show_photos(&uid->attribs[i],1,pk,NULL);
|
show_photos(&uid->attribs[i],1,pk,NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user