From 5cf9c2f1f26b71ce74f75de262e5d1b4d18f02de Mon Sep 17 00:00:00 2001 From: David Shaw Date: Sun, 27 Apr 2003 04:10:04 +0000 Subject: [PATCH] * mainproc.c (check_sig_and_print): Show sig class when verifying a sig with --verbose on, and add version, pk and hash algorithms and sig class to VALIDSIG. * g10.c (main): Add --no-textmode. * export.c (do_export_stream), keyedit.c (show_key_with_all_names, menu_addrevoker), mainproc.c (check_sig_and_print), photoid.c (show_photos), trustdb.c (get_validity, reset_trust_records, validate_keys): Make some strings translatable. --- g10/ChangeLog | 13 +++++++++++++ g10/export.c | 4 ++-- g10/g10.c | 3 +++ g10/keyedit.c | 18 +++++++++--------- g10/mainproc.c | 22 +++++++++++++++------- g10/photoid.c | 2 +- g10/trustdb.c | 6 +++--- 7 files changed, 46 insertions(+), 22 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 362586c4d..8223fb015 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,16 @@ +2003-04-27 David Shaw + + * mainproc.c (check_sig_and_print): Show sig class when verifying + a sig with --verbose on, and add version, pk and hash algorithms + and sig class to VALIDSIG. + + * g10.c (main): Add --no-textmode. + + * export.c (do_export_stream), keyedit.c (show_key_with_all_names, + menu_addrevoker), mainproc.c (check_sig_and_print), photoid.c + (show_photos), trustdb.c (get_validity, reset_trust_records, + validate_keys): Make some strings translatable. + 2003-04-26 David Shaw * mainproc.c (check_sig_and_print): Show digest algorithm when diff --git a/g10/export.c b/g10/export.c index 1ec841dab..dc702fea6 100644 --- a/g10/export.c +++ b/g10/export.c @@ -318,8 +318,8 @@ do_export_stream( IOBUF out, STRLIST users, int secret, node->pkt->pkt.secret_key->protect.sha1chk) { /* I hope this warning doesn't confuse people. */ - log_info("WARNING: secret key %08lX does not have a " - "simple SK checksum\n",(ulong)sk_keyid[1]); + log_info(_("WARNING: secret key %08lX does not have a " + "simple SK checksum\n"),(ulong)sk_keyid[1]); sha1_warned=1; } diff --git a/g10/g10.c b/g10/g10.c index 7e7170f16..3cfdfb765 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -128,6 +128,7 @@ enum cmd_and_opt_values { aNull = 0, aRefreshKeys, oTextmode, + oNoTextmode, oExpert, oNoExpert, oAskSigExpire, @@ -382,6 +383,7 @@ static ARGPARSE_OPTS opts[] = { { oCompress, NULL, 1, N_("|N|set compress level N (0 disables)") }, { oTextmodeShort, NULL, 0, "@"}, { oTextmode, "textmode", 0, N_("use canonical text mode")}, + { oNoTextmode, "no-textmode", 0, "@"}, { oExpert, "expert", 0, "@"}, { oNoExpert, "no-expert", 0, "@"}, { oAskSigExpire, "ask-sig-expire", 0, "@"}, @@ -1529,6 +1531,7 @@ main( int argc, char **argv ) break; case oTextmodeShort: opt.textmode = 2; break; case oTextmode: opt.textmode=1; break; + case oNoTextmode: opt.textmode=0; break; case oExpert: opt.expert = 1; break; case oNoExpert: opt.expert = 0; break; case oAskSigExpire: opt.ask_sig_expire = 1; break; diff --git a/g10/keyedit.c b/g10/keyedit.c index 3373ebe5b..baaf937c6 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -1915,9 +1915,9 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker, else tty_printf("(%d) ", i); if ( uid->is_revoked ) - tty_printf ("[revoked] "); + tty_printf (_("[revoked] ")); if ( uid->is_expired ) - tty_printf ("[expired] "); + tty_printf (_("[expired] ")); tty_print_utf8_string( uid->name, uid->len ); tty_printf("\n"); if( with_prefs ) @@ -2327,9 +2327,9 @@ menu_delkey( KBNODE pub_keyblock, KBNODE sec_keyblock ) if( sec_keyblock ) commit_kbnode( &sec_keyblock ); - /* No need to set update_trust here since signing keys no longer - are used to certify other keys, so there is no change in trust - when revoking/removing them */ + /* No need to set update_trust here since signing keys are no + longer used to certify other keys, so there is no change in + trust when revoking/removing them */ } @@ -2441,14 +2441,14 @@ menu_addrevoker( KBNODE pub_keyblock, KBNODE sec_keyblock, int sensitive ) print_fingerprint(revoker_pk,NULL,2); tty_printf("\n"); - tty_printf("WARNING: appointing a key as a designated revoker " - "cannot be undone!\n"); + tty_printf(_("WARNING: appointing a key as a designated revoker " + "cannot be undone!\n")); tty_printf("\n"); if(!cpr_get_answer_is_yes("keyedit.add_revoker.okay", - "Are you sure you want to appoint this " - "key as a designated revoker? (y/N): ")) + _("Are you sure you want to appoint this " + "key as a designated revoker? (y/N): "))) continue; revkey.class=0x80; diff --git a/g10/mainproc.c b/g10/mainproc.c index 1217cda18..ecc4aa3af 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -1442,7 +1442,7 @@ check_sig_and_print( CTX c, KBNODE node ) if( !get_pubkey( pk, sig->keyid ) ) { byte array[MAX_FINGERPRINT_LEN], *p; - char buf[MAX_FINGERPRINT_LEN*4+73], *bufp; + char buf[MAX_FINGERPRINT_LEN*4+90], *bufp; size_t i, n; bufp = buf; @@ -1450,10 +1450,15 @@ check_sig_and_print( CTX c, KBNODE node ) p = array; for(i=0; i < n ; i++, p++, bufp += 2) sprintf(bufp, "%02X", *p ); - sprintf(bufp, " %s %lu %lu ", + /* TODO: Replace the reserved '0' in the field below + with bits for status flags (policy url, notation, + etc.). Remember to make the buffer larger to + match! */ + sprintf(bufp, " %s %lu %lu %d 0 %d %d %02X ", strtimestamp( sig->timestamp ), - (ulong)sig->timestamp, - (ulong)sig->expiredate ); + (ulong)sig->timestamp,(ulong)sig->expiredate, + sig->version,sig->pubkey_algo,sig->digest_algo, + sig->sig_class); bufp = bufp + strlen (bufp); if (!pk->is_primary) { u32 akid[2]; @@ -1483,14 +1488,17 @@ check_sig_and_print( CTX c, KBNODE node ) if(sig->flags.expired) { - log_info("Signature expired %s\n",asctimestamp(sig->expiredate)); + log_info(_("Signature expired %s\n"), + asctimestamp(sig->expiredate)); rc=G10ERR_GENERAL; /* need a better error here? */ } else if(sig->expiredate) - log_info("Signature expires %s\n",asctimestamp(sig->expiredate)); + log_info(_("Signature expires %s\n"),asctimestamp(sig->expiredate)); if(opt.verbose) - log_info(_("digest algorithm %s\n"), + log_info(_("%s signature, digest algorithm %s\n"), + sig->sig_class==0x00?_("binary"): + sig->sig_class==0x01?_("textmode"):_("unknown"), digest_algo_to_string(sig->digest_algo)); if( rc ) diff --git a/g10/photoid.c b/g10/photoid.c index fe74e8fb7..9a8bdefd7 100644 --- a/g10/photoid.c +++ b/g10/photoid.c @@ -328,6 +328,6 @@ void show_photos(const struct user_attribute *attrs, return; fail: - log_error("unable to display photo ID!\n"); + log_error(_("unable to display photo ID!\n")); #endif } diff --git a/g10/trustdb.c b/g10/trustdb.c index f92c91c54..5f27b973c 100644 --- a/g10/trustdb.c +++ b/g10/trustdb.c @@ -817,7 +817,7 @@ get_validity (PKT_public_key *pk, PKT_user_id *uid) if (opt.no_auto_check_trustdb) { pending_check_trustdb = 1; - log_info ("please do a --check-trustdb\n"); + log_info (_("please do a --check-trustdb\n")); } else { @@ -1533,7 +1533,7 @@ reset_trust_records (KEYDB_HANDLE hd, KeyHashTable exclude) log_error ("keydb_search_next failed: %s\n", g10_errstr(rc)); } if (opt.verbose) - log_info ("%d keys processed (%d validity counts cleared)\n", + log_info (_("%d keys processed (%d validity counts cleared)\n"), count, nreset); } @@ -1587,7 +1587,7 @@ validate_keys (int interactive) * here when needed */ if (!utk_list) { - log_info ("no ultimately trusted keys found\n"); + log_info (_("no ultimately trusted keys found\n")); goto leave; }