From 6ab8378c00828a4ec6919afc3710a75e93ba0502 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Thu, 28 Oct 2004 22:09:09 +0000 Subject: [PATCH] * skclist.c (build_sk_list): Don't need to warn about PGP-generated Elgamal signing keys since we no longer support any Elgamal signing keys. * sign.c (sign_file, clearsign_file): Use "writing to" instead of "writing to file" to match other strings. * pkclist.c (check_signatures_trust): Fix typo. Noted by Moray Allan. This is Debian bug #278708. * passphrase.c (ask_passphrase, passphrase_to_dek): "password" -> "passphrase". * keyedit.c (show_key_with_all_names): Show designated revoker as part of translatable string. --- g10/ChangeLog | 18 ++++++++++++++++++ g10/keyedit.c | 48 +++++++++++++++++++++++++++--------------------- g10/passphrase.c | 9 +++++---- g10/pkclist.c | 2 +- g10/sign.c | 16 +++++++++------- g10/skclist.c | 35 +++++++++++++++++------------------ 6 files changed, 77 insertions(+), 51 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 2dadee08f..208e9d144 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,21 @@ +2004-10-28 David Shaw + + * skclist.c (build_sk_list): Don't need to warn about + PGP-generated Elgamal signing keys since we no longer support any + Elgamal signing keys. + + * sign.c (sign_file, clearsign_file): Use "writing to" instead of + "writing to file" to match other strings. + + * pkclist.c (check_signatures_trust): Fix typo. Noted by Moray + Allan. This is Debian bug #278708. + + * passphrase.c (ask_passphrase, passphrase_to_dek): "password" -> + "passphrase". + + * keyedit.c (show_key_with_all_names): Show designated revoker as + part of translatable string. + 2004-10-28 Werner Koch * Makefile.am (other_libs): New. Also include LIBICONV. Noted by diff --git a/g10/keyedit.c b/g10/keyedit.c index 637b84015..f1ececba9 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -1309,7 +1309,7 @@ keyedit_menu( const char *username, STRLIST locusr, if ( opt.command_fd != -1 ) ; - else if( opt.batch && !have_commands ) + else if( opt.batch && !have_commands ) { log_error(_("can't do this in batch mode\n")); goto leave; @@ -2226,29 +2226,35 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker, primary=pk; } - if(with_revoker) { + if(with_revoker) + { if( !pk->revkey && pk->numrevkeys ) - BUG(); + BUG(); else - for(i=0;inumrevkeys;i++) { - u32 r_keyid[2]; - char *user; - const char *algo= - pubkey_algo_to_string(pk->revkey[i].algid); + for(i=0;inumrevkeys;i++) + { + u32 r_keyid[2]; + char *user; + const char *algo= + pubkey_algo_to_string(pk->revkey[i].algid); - keyid_from_fingerprint(pk->revkey[i].fpr, - MAX_FINGERPRINT_LEN,r_keyid); - - user=get_user_id_string (r_keyid); - tty_printf (_("This key may be revoked by %s key "), - algo?algo:"?"); - tty_print_utf8_string (user, strlen (user)); - if ((pk->revkey[i].class&0x40)) - tty_printf (_(" (sensitive)")); - tty_printf ("\n"); - m_free(user); - } - } + keyid_from_fingerprint(pk->revkey[i].fpr, + MAX_FINGERPRINT_LEN,r_keyid); + + user=get_user_id_string_native(r_keyid); + tty_printf(_("This key may be revoked by %s key %s"), + algo?algo:"?",user); + + if(pk->revkey[i].class&0x40) + { + tty_printf(" "); + tty_printf(_("(sensitive)")); + } + + tty_printf ("\n"); + m_free(user); + } + } keyid_from_pk(pk,NULL); tty_printf("%s%c %4u%c/%s ", diff --git a/g10/passphrase.c b/g10/passphrase.c index 3f6c7d3b9..c7102586d 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -1050,7 +1050,7 @@ ask_passphrase (const char *description, } else if (opt.batch) { - log_error(_("can't query password in batch mode\n")); + log_error(_("can't query passphrase in batch mode\n")); pw = NULL; } else { @@ -1207,10 +1207,11 @@ passphrase_to_dek( u32 *keyid, int pubkey_algo, pw = m_alloc_secure( strlen(fd_passwd)+1 ); strcpy( pw, fd_passwd ); } - else if( opt.batch ) { - log_error(_("can't query password in batch mode\n")); + else if( opt.batch ) + { + log_error(_("can't query passphrase in batch mode\n")); pw = m_strdup( "" ); /* return an empty passphrase */ - } + } else { /* Read the passphrase from the tty or the command-fd. */ pw = cpr_get_hidden("passphrase.enter", _("Enter passphrase: ") ); diff --git a/g10/pkclist.c b/g10/pkclist.c index da0763903..088d6ec63 100644 --- a/g10/pkclist.c +++ b/g10/pkclist.c @@ -518,7 +518,7 @@ check_signatures_trust( PKT_signature *sig ) " designated revoker!\n")); else log_info(_("WARNING: This key has been revoked by its owner!\n")); - log_info(_(" This could mean that the signature is forgery.\n")); + log_info(_(" This could mean that the signature is forged.\n")); show_revocation_reason( pk, 0 ); } else if ((trustlevel & TRUST_FLAG_SUB_REVOKED) ) diff --git a/g10/sign.c b/g10/sign.c index 5a0b0ed67..ee0d99f39 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -774,13 +774,14 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr, } else out = iobuf_create( outfile ); - if( !out ) { + if( !out ) + { log_error(_("can't create `%s': %s\n"), outfile, strerror(errno) ); rc = G10ERR_CREATE_FILE; goto leave; - } + } else if( opt.verbose ) - log_info(_("writing to file `%s'\n"), outfile ); + log_info(_("writing to `%s'\n"), outfile ); } else if( (rc = open_outfile( fname, opt.armor? 1: detached? 2:0, &out ))) goto leave; @@ -910,7 +911,7 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr, if( !inp ) { log_error(_("can't open `%s': %s\n"), - sl->d, strerror(errno) ); + sl->d,strerror(errno)); rc = G10ERR_OPEN_FILE; goto leave; } @@ -1031,13 +1032,14 @@ clearsign_file( const char *fname, STRLIST locusr, const char *outfile ) } else out = iobuf_create( outfile ); - if( !out ) { + if( !out ) + { log_error(_("can't create `%s': %s\n"), outfile, strerror(errno) ); rc = G10ERR_CREATE_FILE; goto leave; - } + } else if( opt.verbose ) - log_info(_("writing to file `%s'\n"), outfile ); + log_info(_("writing to `%s'\n"), outfile ); } else if( (rc = open_outfile( fname, 1, &out )) ) goto leave; diff --git a/g10/skclist.c b/g10/skclist.c index 92c83e8a8..69157d8e7 100644 --- a/g10/skclist.c +++ b/g10/skclist.c @@ -107,42 +107,41 @@ build_sk_list( STRLIST locusr, SK_LIST *ret_sk_list, SK_LIST sk_list = NULL; int rc; - if( !locusr ) { /* use the default one */ + if( !locusr ) + { /* use the default one */ PKT_secret_key *sk; sk = m_alloc_clear( sizeof *sk ); sk->req_usage = use; if( (rc = get_seckey_byname( sk, NULL, unlock )) ) { - free_secret_key( sk ); sk = NULL; - log_error("no default secret key: %s\n", g10_errstr(rc) ); + free_secret_key( sk ); sk = NULL; + log_error("no default secret key: %s\n", g10_errstr(rc) ); } - else if( !(rc=check_pubkey_algo2(sk->pubkey_algo, use)) ) { + else if( !(rc=check_pubkey_algo2(sk->pubkey_algo, use)) ) + { SK_LIST r; - if( sk->version == 4 && (use & PUBKEY_USAGE_SIG) - && sk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) { - log_info("this is a PGP generated " - "Elgamal key which is NOT secure for signatures!\n"); - free_secret_key( sk ); sk = NULL; - } - else if( random_is_faked() && !is_insecure( sk ) ) { + if( random_is_faked() && !is_insecure( sk ) ) + { log_info(_("key is not flagged as insecure - " "can't use it with the faked RNG!\n")); free_secret_key( sk ); sk = NULL; - } - else { + } + else + { r = m_alloc( sizeof *r ); r->sk = sk; sk = NULL; r->next = sk_list; r->mark = 0; sk_list = r; - } - } - else { + } + } + else + { free_secret_key( sk ); sk = NULL; log_error("invalid default secret key: %s\n", g10_errstr(rc) ); - } - } + } + } else { STRLIST locusr_orig = locusr; for(; locusr; locusr = locusr->next ) {