From 1976afce932ada111d2ebcb39747fdd18d091465 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Thu, 28 Oct 2004 01:58:01 +0000 Subject: [PATCH] * delkey.c, export.c, keyedit.c, pkclist.c, revoke.c, skclist.c: Fix a few missed possible \"username\" quotes. --- g10/ChangeLog | 5 +++++ g10/delkey.c | 2 +- g10/export.c | 2 +- g10/keyedit.c | 23 +++++++++++++---------- g10/pkclist.c | 2 +- g10/revoke.c | 11 ++++++----- g10/skclist.c | 36 +++++++++++++++++++++--------------- 7 files changed, 48 insertions(+), 33 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 40e95a31d..7b1f6f652 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +2004-10-27 David Shaw + + * delkey.c, export.c, keyedit.c, pkclist.c, revoke.c, skclist.c: + Fix a few missed possible \"username\" quotes. + 2004-10-26 Werner Koch * app-openpgp.c (verify_chv3): The minimum length for CHV3 is diff --git a/g10/delkey.c b/g10/delkey.c index 23df62787..efb9a50d4 100644 --- a/g10/delkey.c +++ b/g10/delkey.c @@ -71,7 +71,7 @@ do_delete_key( const char *username, int secret, int *r_sec_avail ) || desc.mode == KEYDB_SEARCH_MODE_FPR20); rc = desc.mode? keydb_search (hd, &desc, 1):G10ERR_INV_USER_ID; if (rc) { - log_error (_("key `%s' not found: %s\n"), username, g10_errstr (rc)); + log_error (_("key \"%s\" not found: %s\n"), username, g10_errstr (rc)); write_status_text( STATUS_DELETE_PROBLEM, "1" ); goto leave; } diff --git a/g10/export.c b/g10/export.c index 1227b1f58..3731dab8f 100644 --- a/g10/export.c +++ b/g10/export.c @@ -159,7 +159,7 @@ do_export_stream( IOBUF out, STRLIST users, int secret, if (classify_user_id (sl->d, desc+ndesc)) ndesc++; else - log_error (_("key `%s' not found: %s\n"), + log_error (_("key \"%s\" not found: %s\n"), sl->d, g10_errstr (G10ERR_INV_USER_ID)); } diff --git a/g10/keyedit.c b/g10/keyedit.c index 0286e9706..0211a8bc8 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -1338,18 +1338,21 @@ keyedit_menu( const char *username, STRLIST locusr, afp[an++] = 0; rc = keydb_search_fpr (sec_kdbhd, afp); } - if (!rc) { + if (!rc) + { rc = keydb_get_keyblock (sec_kdbhd, &sec_keyblock); - if (rc) { - log_error (_("error reading secret keyblock `%s': %s\n"), - username, g10_errstr(rc)); - } - else { + if (rc) + { + log_error (_("error reading secret keyblock \"%s\": %s\n"), + username, g10_errstr(rc)); + } + else + { merge_keys_and_selfsig( sec_keyblock ); if( fix_keyblock( sec_keyblock ) ) - sec_modified++; - } - } + sec_modified++; + } + } if (rc) { sec_keyblock = NULL; @@ -2914,7 +2917,7 @@ menu_addrevoker( KBNODE pub_keyblock, KBNODE sec_keyblock, int sensitive ) rc=get_pubkey_byname(revoker_pk,answer,NULL,NULL,1); if(rc) { - log_error (_("key `%s' not found: %s\n"),answer,g10_errstr(rc)); + log_error (_("key \"%s\" not found: %s\n"),answer,g10_errstr(rc)); m_free(answer); continue; } diff --git a/g10/pkclist.c b/g10/pkclist.c index 36947e0f6..da0763903 100644 --- a/g10/pkclist.c +++ b/g10/pkclist.c @@ -900,7 +900,7 @@ build_pk_list( STRLIST rcpts, PK_LIST *ret_pk_list, unsigned use ) /* The default recipient may be disabled */ rc = get_pubkey_byname( pk, def_rec, NULL, NULL, 1 ); if( rc ) - log_error(_("unknown default recipient `%s'\n"), def_rec ); + log_error(_("unknown default recipient \"%s\"\n"), def_rec ); else if( !(rc=check_pubkey_algo2(pk->pubkey_algo, use)) ) { /* Mark any_recipients here since the default recipient would have been used if it wasn't already there. It diff --git a/g10/revoke.c b/g10/revoke.c index c99fd2709..58e1c518a 100644 --- a/g10/revoke.c +++ b/g10/revoke.c @@ -222,7 +222,7 @@ gen_desig_revoke( const char *uname ) classify_user_id (uname, &desc); rc = desc.mode? keydb_search (kdbhd, &desc, 1) : G10ERR_INV_USER_ID; if (rc) { - log_error (_("key `%s' not found: %s\n"),uname, g10_errstr (rc)); + log_error (_("key \"%s\" not found: %s\n"),uname, g10_errstr (rc)); goto leave; } @@ -372,7 +372,7 @@ gen_desig_revoke( const char *uname ) } if(!any) - log_error(_("no revocation keys found for `%s'\n"),uname); + log_error(_("no revocation keys found for \"%s\"\n"),uname); leave: if( pk ) @@ -425,11 +425,12 @@ gen_revoke( const char *uname ) kdbhd = keydb_new (1); classify_user_id (uname, &desc); rc = desc.mode? keydb_search (kdbhd, &desc, 1) : G10ERR_INV_USER_ID; - if (rc) { - log_error (_("secret key `%s' not found: %s\n"), + if (rc) + { + log_error (_("secret key \"%s\" not found: %s\n"), uname, g10_errstr (rc)); goto leave; - } + } rc = keydb_get_keyblock (kdbhd, &keyblock ); if( rc ) { diff --git a/g10/skclist.c b/g10/skclist.c index d20afc210..92c83e8a8 100644 --- a/g10/skclist.c +++ b/g10/skclist.c @@ -153,34 +153,40 @@ build_sk_list( STRLIST locusr, SK_LIST *ret_sk_list, * won't catch all duplicates because the user IDs may be * specified in different ways. */ - if ( is_duplicated_entry ( locusr_orig, locusr ) ) { - log_error(_("skipped `%s': duplicated\n"), locusr->d ); + if ( is_duplicated_entry ( locusr_orig, locusr ) ) + { + log_error(_("skipped \"%s\": duplicated\n"), locusr->d ); continue; - } + } sk = m_alloc_clear( sizeof *sk ); sk->req_usage = use; - if( (rc = get_seckey_byname( sk, locusr->d, 0 )) ) { + if( (rc = get_seckey_byname( sk, locusr->d, 0 )) ) + { free_secret_key( sk ); sk = NULL; - log_error(_("skipped `%s': %s\n"), locusr->d, g10_errstr(rc) ); - } + log_error(_("skipped \"%s\": %s\n"), + locusr->d, g10_errstr(rc) ); + } else if ( key_present_in_sk_list(sk_list, sk) == 0) { free_secret_key(sk); sk = NULL; log_info(_("skipped: secret key already present\n")); } - else if ( unlock && (rc = check_secret_key( sk, 0 )) ) { + else if ( unlock && (rc = check_secret_key( sk, 0 )) ) + { free_secret_key( sk ); sk = NULL; - log_error(_("skipped `%s': %s\n"), locusr->d, g10_errstr(rc) ); - } + log_error(_("skipped \"%s\": %s\n"), + locusr->d, g10_errstr(rc) ); + } 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(_("skipped `%s': this is a PGP generated " - "Elgamal key which is not secure for signatures!\n"), - locusr->d ); + && sk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) + { + log_info(_("skipped \"%s\": %s\n"),locusr->d, + _("this is a PGP generated Elgamal key which" + " is not secure for signatures!")); free_secret_key( sk ); sk = NULL; - } + } else if( random_is_faked() && !is_insecure( sk ) ) { log_info(_("key is not flagged as insecure - " "can't use it with the faked RNG!\n")); @@ -196,7 +202,7 @@ build_sk_list( STRLIST locusr, SK_LIST *ret_sk_list, } else { free_secret_key( sk ); sk = NULL; - log_error("skipped `%s': %s\n", locusr->d, g10_errstr(rc) ); + log_error("skipped \"%s\": %s\n", locusr->d, g10_errstr(rc) ); } } }