aboutsummaryrefslogtreecommitdiffstats
path: root/g10/mainproc.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1999-02-19 14:54:00 +0000
committerWerner Koch <[email protected]>1999-02-19 14:54:00 +0000
commita4ff45f634a5a7bfcee39bc8da50840231933d4a (patch)
treefa3b30311fa9737e50b067fd3e2c76a4f95e7946 /g10/mainproc.c
parentSee ChangeLog: Tue Feb 16 14:10:02 CET 1999 Werner Koch (diff)
downloadgnupg-a4ff45f634a5a7bfcee39bc8da50840231933d4a.tar.gz
gnupg-a4ff45f634a5a7bfcee39bc8da50840231933d4a.zip
See ChangeLog: Fri Feb 19 15:49:15 CET 1999 Werner Koch
Diffstat (limited to 'g10/mainproc.c')
-rw-r--r--g10/mainproc.c54
1 files changed, 37 insertions, 17 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c
index 0b3582c50..dace37a23 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -283,7 +283,10 @@ proc_plaintext( CTX c, PACKET *pkt )
md_enable( c->mfx.md, DIGEST_ALGO_SHA1 );
md_enable( c->mfx.md, DIGEST_ALGO_MD5 );
}
- /*md_start_debug( c->mfx.md, "verify" );*/
+ #if 0
+ #warning md_start_debug is enabled
+ md_start_debug( c->mfx.md, "verify" );
+ #endif
rc = handle_plaintext( pt, &c->mfx, c->sigs_only, clearsig );
if( rc == G10ERR_CREATE_FILE && !c->sigs_only) {
/* can't write output but we hash it anyway to
@@ -816,16 +819,6 @@ do_proc_packets( CTX c, IOBUF a )
}
-static void
-print_keyid( FILE *fp, u32 *keyid )
-{
- size_t n;
- char *p = get_user_id( keyid, &n );
- print_string( fp, p, n, opt.with_colons );
- m_free(p);
-}
-
-
static int
check_sig_and_print( CTX c, KBNODE node )
@@ -850,14 +843,41 @@ check_sig_and_print( CTX c, KBNODE node )
rc = do_check_sig(c, node, NULL );
}
if( !rc || rc == G10ERR_BAD_SIGN ) {
- char *us = get_long_user_id_string( sig->keyid );
+ KBNODE un, keyblock;
+ char *us;
+ int count=0;
+
+ keyblock = get_pubkeyblock( sig->keyid );
+
+ us = get_long_user_id_string( sig->keyid );
write_status_text( rc? STATUS_BADSIG : STATUS_GOODSIG, us );
m_free(us);
- log_info(rc? _("BAD signature from \"")
- : _("Good signature from \""));
- print_keyid( stderr, sig->keyid );
- putc('\"', stderr);
- putc('\n', stderr);
+
+ /* fixme: list only user ids which are valid and add information
+ * about the trustworthiness of each user id, sort them.
+ * Integrate this with check_signatures_trust(). */
+ for( un=keyblock; un; un = un->next ) {
+ if( un->pkt->pkttype != PKT_USER_ID )
+ continue;
+ if( !count++ )
+ log_info(rc? _("BAD signature from \"")
+ : _("Good signature from \""));
+ else
+ log_info( _(" aka \""));
+ print_string( stderr, un->pkt->pkt.user_id->name,
+ un->pkt->pkt.user_id->len, '\"' );
+ fputs("\"\n", stderr);
+ if( rc )
+ break; /* print only one id in this case */
+ }
+ if( !count ) { /* just in case that we have no userid */
+ log_info(rc? _("BAD signature from \"")
+ : _("Good signature from \""));
+ fputs("[?]\"\n", stderr );
+ }
+ release_kbnode( keyblock );
+
+
if( !rc && is_status_enabled() ) {
/* print a status response with the fingerprint */
PKT_public_key *pk = m_alloc_clear( sizeof *pk );