1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-04-11 22:01:08 +02:00

* keyedit.c (show_key_with_all_names): Display warning if a user tries to

show prefs on a v3 key with a v3 selfsig.

* kbnode.c (dump_kbnode): Show if a uid is expired.

* import.c (merge_blocks, import_revoke_cert): Show user ID receiving a
revocation certificate.

* free-packet.c (cmp_user_ids): Properly compare attribute ids.
This commit is contained in:
David Shaw 2002-06-14 18:39:07 +00:00
parent ecc02567a6
commit 08d65bc8ca
5 changed files with 45 additions and 15 deletions

View File

@ -1,5 +1,15 @@
2002-06-14 David Shaw <dshaw@jabberwocky.com> 2002-06-14 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (show_key_with_all_names): Display warning if a user
tries to show prefs on a v3 key with a v3 selfsig.
* kbnode.c (dump_kbnode): Show if a uid is expired.
* import.c (merge_blocks, import_revoke_cert): Show user ID
receiving a revocation certificate.
* free-packet.c (cmp_user_ids): Properly compare attribute ids.
* pkclist.c (expand_groups): Maintain the strlist flags while * pkclist.c (expand_groups): Maintain the strlist flags while
expanding. Members of an expansion inherit their flags from the expanding. Members of an expansion inherit their flags from the
expansion key. expansion key.

View File

@ -513,21 +513,30 @@ cmp_signatures( PKT_signature *a, PKT_signature *b )
} }
/**************** /****************
* Returns: true if the user ids do not match * Returns: true if the user ids do not match
*/ */
int int
cmp_user_ids( PKT_user_id *a, PKT_user_id *b ) cmp_user_ids( PKT_user_id *a, PKT_user_id *b )
{ {
int res; int res=1;
if ( a == b ) if( a == b )
return 0; return 0;
res = a->len - b->len; if( a->attrib_data && b->attrib_data )
if( !res ) {
res = memcmp( a->name, b->name, a->len ); res = a->attrib_len - b->attrib_len;
if( !res )
res = memcmp( a->attrib_data, b->attrib_data, a->attrib_len );
}
else if( !a->attrib_data && !b->attrib_data )
{
res = a->len - b->len;
if( !res )
res = memcmp( a->name, b->name, a->len );
}
return res; return res;
} }

View File

@ -795,9 +795,12 @@ import_revoke_cert( const char *fname, KBNODE node, struct stats_s *stats )
keydb_get_resource_name (hd), g10_errstr(rc) ); keydb_get_resource_name (hd), g10_errstr(rc) );
keydb_release (hd); hd = NULL; keydb_release (hd); hd = NULL;
/* we are ready */ /* we are ready */
if( !opt.quiet ) if( !opt.quiet ) {
log_info( _("key %08lX: revocation certificate imported\n"), char *p=get_user_id_native(keyid);
(ulong)keyid[1]); log_info( _("key %08lX: \"%s\" revocation certificate imported\n"),
(ulong)keyid[1],p);
m_free(p);
}
stats->n_revoc++; stats->n_revoc++;
revalidation_mark (); revalidation_mark ();
@ -1202,12 +1205,14 @@ merge_blocks( const char *fname, KBNODE keyblock_orig, KBNODE keyblock,
} }
} }
if( !found ) { if( !found ) {
char *p=get_user_id_native(keyid);
KBNODE n2 = clone_kbnode(node); KBNODE n2 = clone_kbnode(node);
insert_kbnode( keyblock_orig, n2, 0 ); insert_kbnode( keyblock_orig, n2, 0 );
n2->flag |= 1; n2->flag |= 1;
++*n_sigs; ++*n_sigs;
log_info( _("key %08lX: revocation certificate added\n"), log_info(_("key %08lX: \"%s\" revocation certificate added\n"),
(ulong)keyid[1]); (ulong)keyid[1],p);
m_free(p);
} }
} }
} }

View File

@ -365,8 +365,8 @@ dump_kbnode( KBNODE node )
PKT_user_id *uid = node->pkt->pkt.user_id; PKT_user_id *uid = node->pkt->pkt.user_id;
fputs(" \"", stderr); fputs(" \"", stderr);
print_string( stderr, uid->name, uid->len, 0 ); print_string( stderr, uid->name, uid->len, 0 );
fprintf (stderr, "\" .%c%c%c\n", fprintf (stderr, "\" %c%c%c%c\n",
/* we don't have a expired flag */ uid->is_expired? 'e':'.',
uid->is_revoked? 'r':'.', uid->is_revoked? 'r':'.',
uid->created? 'v':'.', uid->created? 'v':'.',
uid->is_primary? 'p':'.' ); uid->is_primary? 'p':'.' );

View File

@ -1821,8 +1821,14 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker,
tty_printf ("[revoked] "); tty_printf ("[revoked] ");
tty_print_utf8_string( uid->name, uid->len ); tty_print_utf8_string( uid->name, uid->len );
tty_printf("\n"); tty_printf("\n");
if( with_prefs && (pk_version>3 || uid->selfsigversion>3)) if( with_prefs )
show_prefs (uid, with_prefs == 2); {
if(pk_version>3 || uid->selfsigversion>3)
show_prefs (uid, with_prefs == 2);
else
tty_printf(_("There are no preferences on a "
"PGP 2.x-style key.\n"));
}
} }
} }
} }