diff options
Diffstat (limited to 'g10')
-rw-r--r-- | g10/ChangeLog | 21 | ||||
-rw-r--r-- | g10/g10.c | 4 | ||||
-rw-r--r-- | g10/keylist.c | 16 | ||||
-rw-r--r-- | g10/options.h | 1 | ||||
-rw-r--r-- | g10/passphrase.c | 27 | ||||
-rw-r--r-- | g10/sig-check.c | 9 | ||||
-rw-r--r-- | g10/status.c | 10 | ||||
-rw-r--r-- | g10/status.h | 2 |
8 files changed, 75 insertions, 15 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index 84dd695eb..e1c3c4a24 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,7 +1,26 @@ +2001-01-11 Werner Koch <[email protected]> + + * sig-check.c (do_check): Print the signature key expire message + only in verbose mode and added the keyID. + +2001-01-09 Werner Koch <[email protected]> + + * status.c, status.h: New status USERID_HINT. + (write_status_text): Replace LF and CR int text by C-escape sequence. + + * passphrase.c (passphrase_to_dek): Fixed the NEED_PASSPHRASE + output. It does now always print 2 keyIDs. Emit the new + USERID_HINT. + +2001-01-08 Werner Koch <[email protected]> + + * g10.c, options.h: New option --no-expensive-trust-checks. + * keylist.c (list_keyblock): Act on this option. + 2001-01-04 Werner Koch <[email protected]> * g10.c (main): Set homedir only in the pre-parsing phase and - replaces backslashes in the W32 version. + replace backslashes in the W32 version. 2001-01-03 Werner Koch <[email protected]> @@ -200,6 +200,7 @@ enum cmd_and_opt_values { aNull = 0, oMergeOnly, oTryAllSecrets, oTrustedKey, + oNoExpensiveTrustChecks, oEmu3DESS2KBug, /* will be removed in 1.1 */ oEmuMDEncodeBug, aTest }; @@ -393,6 +394,7 @@ static ARGPARSE_OPTS opts[] = { { oAllowSecretKeyImport, "allow-secret-key-import", 0, "@" }, { oTryAllSecrets, "try-all-secrets", 0, "@" }, { oEnableSpecialFilenames, "enable-special-filenames", 0, "@" }, + { oNoExpensiveTrustChecks, "no-expensive-trust-checks", 0, "@" }, { oEmu3DESS2KBug, "emulate-3des-s2k-bug", 0, "@"}, { oEmuMDEncodeBug, "emulate-md-encode-bug", 0, "@"}, {0} }; @@ -972,6 +974,8 @@ main( int argc, char **argv ) case oEnableSpecialFilenames: iobuf_enable_special_filenames (1); break; + case oNoExpensiveTrustChecks: opt.no_expensive_trust_checks=1; break; + default : pargs.err = configfp? 1:2; break; } } diff --git a/g10/keylist.c b/g10/keylist.c index 32012f422..9408b2782 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -280,7 +280,7 @@ list_keyblock( KBNODE keyblock, int secret ) sk = NULL; keyid_from_pk( pk, keyid ); if( opt.with_colons ) { - if ( opt.fast_list_mode ) { + if ( opt.fast_list_mode || opt.no_expensive_trust_checks ) { fputs( "pub::", stdout ); trustletter = 0; } @@ -299,7 +299,8 @@ list_keyblock( KBNODE keyblock, int secret ) if( pk->local_id ) printf("%lu", pk->local_id ); putchar(':'); - if( pk->local_id && !opt.fast_list_mode ) + if( pk->local_id && !opt.fast_list_mode + && !opt.no_expensive_trust_checks ) putchar( get_ownertrust_info( pk->local_id ) ); putchar(':'); } @@ -313,7 +314,10 @@ list_keyblock( KBNODE keyblock, int secret ) for( kbctx=NULL; (node=walk_kbnode( keyblock, &kbctx, 0)) ; ) { if( node->pkt->pkttype == PKT_USER_ID && !opt.fast_list_mode ) { if( any ) { - if ( opt.with_colons ) { + if ( opt.with_colons && opt.no_expensive_trust_checks ) { + printf("uid:::::::::"); + } + else if ( opt.with_colons ) { byte namehash[20]; if( pk && !ulti_hack ) { @@ -371,7 +375,7 @@ list_keyblock( KBNODE keyblock, int secret ) keyid_from_pk( pk2, keyid2 ); if( opt.with_colons ) { - if ( opt.fast_list_mode ) { + if ( opt.fast_list_mode || opt.no_expensive_trust_checks ) { fputs( "sub::", stdout ); } else { @@ -439,7 +443,7 @@ list_keyblock( KBNODE keyblock, int secret ) else if( opt.list_sigs && node->pkt->pkttype == PKT_SIGNATURE ) { PKT_signature *sig = node->pkt->pkt.signature; int sigrc; - char *sigstr; + char *sigstr; if( !any ) { /* no user id, (maybe a revocation follows)*/ if( sig->sig_class == 0x20 ) @@ -484,7 +488,7 @@ list_keyblock( KBNODE keyblock, int secret ) rc = 0; sigrc = ' '; } - fputs( sigstr, stdout ); + fputs( sigstr, stdout ); if( opt.with_colons ) { putchar(':'); if( sigrc != ' ' ) diff --git a/g10/options.h b/g10/options.h index 55c2a18fa..407ed3423 100644 --- a/g10/options.h +++ b/g10/options.h @@ -99,6 +99,7 @@ struct { int merge_only; int allow_secret_key_import; int try_all_secrets; + int no_expensive_trust_checks; } opt; diff --git a/g10/passphrase.c b/g10/passphrase.c index c3260b69d..67db368e4 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -521,12 +521,29 @@ passphrase_to_dek( u32 *keyid, int pubkey_algo, if( !next_pw && is_status_enabled() ) { char buf[50]; + if( keyid ) { - sprintf( buf, "%08lX%08lX", (ulong)keyid[0], (ulong)keyid[1] ); - if( keyid[2] && keyid[3] && keyid[0] != keyid[2] - && keyid[1] != keyid[3] ) - sprintf( buf+strlen(buf), " %08lX%08lX %d 0", - (ulong)keyid[2], (ulong)keyid[3], pubkey_algo ); + u32 used_kid[2]; + char *us; + + if( keyid[2] && keyid[3] ) { + used_kid[0] = keyid[2]; + used_kid[1] = keyid[3]; + } + else { + used_kid[0] = keyid[0]; + used_kid[1] = keyid[1]; + } + + us = get_long_user_id_string( keyid ); + write_status_text( STATUS_USERID_HINT, us ); + m_free(us); + + sprintf( buf, "%08lX%08lX %08lX%08lX %d 0", + (ulong)keyid[0], (ulong)keyid[1], + (ulong)used_kid[0], (ulong)used_kid[1], + pubkey_algo ); + write_status_text( STATUS_NEED_PASSPHRASE, buf ); } else { diff --git a/g10/sig-check.c b/g10/sig-check.c index 67efad019..686cf09ff 100644 --- a/g10/sig-check.c +++ b/g10/sig-check.c @@ -321,8 +321,13 @@ do_check( PKT_public_key *pk, PKT_signature *sig, MD_HANDLE digest, } if( pk->expiredate && pk->expiredate < cur_time ) { - log_info(_("NOTE: signature key expired %s\n"), - asctimestamp( pk->expiredate ) ); + if (opt.verbose) { + u32 tmp_kid[2]; + + keyid_from_pk( pk, tmp_kid ); + log_info(_("NOTE: signature key %08lX expired %s\n"), + (ulong)tmp_kid[1], asctimestamp( pk->expiredate ) ); + } write_status(STATUS_SIGEXPIRED); *r_expired = 1; } diff --git a/g10/status.c b/g10/status.c index d2da0b662..1a778ce41 100644 --- a/g10/status.c +++ b/g10/status.c @@ -137,6 +137,7 @@ get_status_string ( int no ) case STATUS_BEGIN_STREAM : s = "BEGIN_STREAM"; break; case STATUS_END_STREAM : s = "END_STREAM"; break; case STATUS_KEY_CREATED : s = "KEY_CREATED"; break; + case STATUS_USERID_HINT : s = "USERID_HINT"; break; default: s = "?"; break; } return s; @@ -194,7 +195,14 @@ write_status_text ( int no, const char *text) fputs ( get_status_string (no), statusfp ); if( text ) { putc ( ' ', statusfp ); - fputs ( text, statusfp ); + for (; *text; text++) { + if (*text == '\n') + fputs ( "\\n", statusfp ); + else if (*text == '\r') + fputs ( "\\r", statusfp ); + else + putc ( *(const byte *)text, statusfp ); + } } putc ('\n',statusfp); fflush (statusfp); diff --git a/g10/status.h b/g10/status.h index bc8ac5f0a..75ee385d3 100644 --- a/g10/status.h +++ b/g10/status.h @@ -88,6 +88,8 @@ #define STATUS_BEGIN_STREAM 56 #define STATUS_END_STREAM 57 #define STATUS_KEY_CREATED 58 +#define STATUS_USERID_HINT 59 + /*-- status.c --*/ void set_status_fd ( int fd ); |