diff --git a/g10/ChangeLog b/g10/ChangeLog index 2f333f5c4..6af768e4d 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,5 +1,9 @@ 2004-10-10 David Shaw + * card-util.c, keyedit.c, openfile.c, pkclist.c, delkey.c, + keygen.c, photoid.c, revoke.c: Some yes-or-no prompts end in + "(y/n)". Some don't. Consistently use y/n everywhere. + * keygen.c (ask_key_flags): New. (ask_algo): Call it here in --expert mode so we don't need to specify each possible variation of RSA capabilities. diff --git a/g10/card-util.c b/g10/card-util.c index 0ded216e2..7314ee478 100644 --- a/g10/card-util.c +++ b/g10/card-util.c @@ -860,7 +860,7 @@ replace_existing_key_p (struct agent_card_info_s *info, int keyno) log_info ("WARNING: such a key has already been stored on the card!\n"); tty_printf ("\n"); if ( !cpr_get_answer_is_yes( "cardedit.genkeys.replace_key", - _("Replace existing key? "))) + _("Replace existing key? (y/N) "))) return -1; } return 0; @@ -878,9 +878,21 @@ generate_card_keys (const char *serialno) if (get_info_for_key_operation (&info)) return; +#if GNUPG_MAJOR_VERSION == 1 + { + char *answer=cpr_get("cardedit.genkeys.backup_enc", + _("Make off-card backup of encryption key? (Y/n) ")); + + want_backup=answer_is_yes_no_default(answer,1); + cpr_kill_prompt(); + m_free(answer); + } +#else + /* Does 1.9 have answer_is_yes_no_default() ? */ want_backup = !(cpr_get_answer_is_yes ( "cardedit.genkeys.backup_enc", - _("Inhibit creation of encryption key backup? "))); + _("Inhibit off-card backup of encryption key? (y/N) "))); +#endif if ( (info.fpr1valid && !fpr_is_zero (info.fpr1)) || (info.fpr2valid && !fpr_is_zero (info.fpr2)) @@ -890,7 +902,7 @@ generate_card_keys (const char *serialno) log_info ("NOTE: keys are already stored on the card!\n"); tty_printf ("\n"); if ( !cpr_get_answer_is_yes( "cardedit.genkeys.replace_keys", - _("Replace existing keys? "))) + _("Replace existing keys? (y/N) "))) { agent_release_card_info (&info); return; diff --git a/g10/delkey.c b/g10/delkey.c index 44e50f3b5..23df62787 100644 --- a/g10/delkey.c +++ b/g10/delkey.c @@ -136,7 +136,7 @@ do_delete_key( const char *username, int secret, int *r_sec_avail ) yes = cpr_get_answer_is_yes( secret? "delete_key.secret.okay" : "delete_key.okay", - _("Delete this key from the keyring? ")); + _("Delete this key from the keyring? (y/N) ")); if( !cpr_enabled() && secret && yes ) { /* I think it is not required to check a passphrase; if * the user is so stupid as to let others access his secret keyring @@ -144,7 +144,7 @@ do_delete_key( const char *username, int secret, int *r_sec_avail ) * basic texts about security. */ yes = cpr_get_answer_is_yes("delete_key.secret.okay", - _("This is a secret key! - really delete? ")); + _("This is a secret key! - really delete? (y/N) ")); } if( yes ) okay++; diff --git a/g10/keyedit.c b/g10/keyedit.c index b081e4c60..43a683da5 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -964,7 +964,8 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified, if( opt.batch && opt.answer_yes ) ; - else if( !cpr_get_answer_is_yes("sign_uid.okay", _("Really sign? ")) ) + else if( !cpr_get_answer_is_yes("sign_uid.okay", + _("Really sign? (y/N) ")) ) continue; /* now we can sign the user ids */ @@ -1116,7 +1117,7 @@ change_passphrase( KBNODE keyblock ) tty_printf(_( "You don't want a passphrase -" " this is probably a *bad* idea!\n\n")); if( cpr_get_answer_is_yes("change_passwd.empty.okay", - _("Do you really want to do this? "))) + _("Do you really want to do this? (y/N) "))) { changed++; break; @@ -1474,13 +1475,15 @@ keyedit_menu( const char *username, STRLIST locusr, } } - if( count_uids(keyblock) > 1 && !count_selected_uids(keyblock) ) { + if( count_uids(keyblock) > 1 && !count_selected_uids(keyblock) ) + { if( !cpr_get_answer_is_yes("keyedit.sign_all.okay", - _("Really sign all user IDs? ")) ) { + _("Really sign all user IDs? (y/N) "))) + { tty_printf(_("Hint: Select the user IDs to sign\n")); break; - } - } + } + } sign_uids( keyblock, locusr, &modified, (cmd == cmdLSIGN) || (cmd == cmdNRLSIGN), @@ -1527,10 +1530,9 @@ keyedit_menu( const char *username, STRLIST locusr, tty_printf(_("You must select at least one user ID.\n")); else if( real_uids_left(keyblock) < 1 ) tty_printf(_("You can't delete the last user ID!\n")); - else if( cpr_get_answer_is_yes( - "keyedit.remove.uid.okay", - n1 > 1? _("Really remove all selected user IDs? ") - : _("Really remove this user ID? ") + else if( cpr_get_answer_is_yes("keyedit.remove.uid.okay", + n1 > 1? _("Really remove all selected user IDs? (y/N) ") + : _("Really remove this user ID? (y/N) ") ) ) { menu_deluid( keyblock, sec_keyblock ); redisplay = 1; @@ -1580,7 +1582,7 @@ keyedit_menu( const char *username, STRLIST locusr, { case 0: if (cpr_get_answer_is_yes("keyedit.keytocard.use_primary", - _("Really move the primary key? "))) + _("Really move the primary key? (y/N) "))) node = sec_keyblock; break; case 1: @@ -1615,8 +1617,8 @@ keyedit_menu( const char *username, STRLIST locusr, tty_printf(_("You must select at least one key.\n")); else if( !cpr_get_answer_is_yes( "keyedit.remove.subkey.okay", n1 > 1? - _("Do you really want to delete the selected keys? "): - _("Do you really want to delete this key? ") + _("Do you really want to delete the selected keys? (y/N) "): + _("Do you really want to delete this key? (y/N) ") )) ; else { @@ -1651,8 +1653,8 @@ keyedit_menu( const char *username, STRLIST locusr, tty_printf(_("You must select at least one user ID.\n")); else if( cpr_get_answer_is_yes( "keyedit.revoke.uid.okay", - n1 > 1? _("Really revoke all selected user IDs? ") - : _("Really revoke this user ID? ") + n1 > 1? _("Really revoke all selected user IDs? (y/N) ") + : _("Really revoke this user ID? (y/N) ") ) ) { if(menu_revuid(keyblock,sec_keyblock)) { @@ -1671,8 +1673,8 @@ keyedit_menu( const char *username, STRLIST locusr, else if( sec_keyblock && !cpr_get_answer_is_yes( "keyedit.revoke.subkey.okay", n1 > 1? - _("Do you really want to revoke the selected keys? "): - _("Do you really want to revoke this key? ") + _("Do you really want to revoke the selected keys? (y/N) "): + _("Do you really want to revoke this key? (y/N) ") )) ; else { @@ -1749,16 +1751,18 @@ keyedit_menu( const char *username, STRLIST locusr, } if (cpr_get_answer_is_yes ("keyedit.updpref.okay", count_selected_uids (keyblock)? - _("Really update the preferences" - " for the selected user IDs? "): - _("Really update the preferences? "))){ + _("Really update the preferences" + " for the selected user IDs? (y/N) "): + _("Really update the preferences? (y/N) "))) + { - if ( menu_set_preferences (keyblock, sec_keyblock) ) { - merge_keys_and_selfsig (keyblock); - modified = 1; - redisplay = 1; - } - } + if ( menu_set_preferences (keyblock, sec_keyblock) ) + { + merge_keys_and_selfsig (keyblock); + modified = 1; + redisplay = 1; + } + } break; case cmdPREFKS: @@ -1799,10 +1803,10 @@ keyedit_menu( const char *username, STRLIST locusr, if( !modified && !sec_modified ) goto leave; if( !cpr_get_answer_is_yes("keyedit.save.okay", - _("Save changes? ")) ) { + _("Save changes? (y/N) ")) ) { if( cpr_enabled() || cpr_get_answer_is_yes("keyedit.cancel.okay", - _("Quit without saving? ")) ) + _("Quit without saving? (y/N) "))) goto leave; break; } @@ -2960,7 +2964,7 @@ menu_addrevoker( KBNODE pub_keyblock, KBNODE sec_keyblock, int sensitive ) 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): "))) + "key as a designated revoker? (y/N) "))) continue; free_public_key(revoker_pk); diff --git a/g10/keygen.c b/g10/keygen.c index bbda8753c..05ad85b28 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -1400,12 +1400,13 @@ ask_keysize( int algo ) _("Keysizes larger than 2048 are not suggested because\n" "computations take REALLY long!\n")); if( cpr_get_answer_is_yes("keygen.size.huge.okay",_( - "Are you sure that you want this keysize? ")) ) { + "Are you sure that you want this keysize? (y/N) ")) ) + { tty_printf(_("Okay, but keep in mind that your monitor " "and keyboard radiation is also very vulnerable " "to attacks!\n")); break; - } + } } else break; @@ -1529,7 +1530,7 @@ ask_expire_interval(int object) } if( cpr_enabled() || cpr_get_answer_is_yes("keygen.valid.okay", - _("Is this correct (y/n)? ")) ) + _("Is this correct? (y/N) ")) ) break; } m_free(answer); @@ -2974,7 +2975,7 @@ generate_subkeypair( KBNODE pub_keyblock, KBNODE sec_keyblock ) nbits = ask_keysize( algo ); expire = ask_expire_interval(0); if( !cpr_enabled() && !cpr_get_answer_is_yes("keygen.sub.okay", - _("Really create? ") ) ) + _("Really create? (y/N) "))) goto leave; if( passphrase ) { @@ -3096,7 +3097,7 @@ generate_card_subkeypair (KBNODE pub_keyblock, KBNODE sec_keyblock, else use = PUBKEY_USAGE_AUTH; if (!cpr_enabled() && !cpr_get_answer_is_yes("keygen.cardsub.okay", - _("Really create? ") ) ) + _("Really create? (y/N) "))) goto leave; if (passphrase) diff --git a/g10/openfile.c b/g10/openfile.c index 6f4541e80..b3f6e436b 100644 --- a/g10/openfile.c +++ b/g10/openfile.c @@ -83,7 +83,7 @@ overwrite_filep( const char *fname ) tty_printf(_("File `%s' exists. "), fname); if( cpr_get_answer_is_yes("openfile.overwrite.okay", - _("Overwrite (y/N)? ")) ) + _("Overwrite? (y/N) ")) ) return 1; return 0; } diff --git a/g10/photoid.c b/g10/photoid.c index 876543af3..2e9993595 100644 --- a/g10/photoid.c +++ b/g10/photoid.c @@ -95,7 +95,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk) { tty_printf( _("This JPEG is really large (%d bytes) !\n"),len); if(!cpr_get_answer_is_yes("photoid.jpeg.size", - _("Are you sure you want to use it (y/N)? "))) + _("Are you sure you want to use it? (y/N) "))) { iobuf_close(file); continue; diff --git a/g10/pkclist.c b/g10/pkclist.c index e8e0b86ae..8d869cd61 100644 --- a/g10/pkclist.c +++ b/g10/pkclist.c @@ -294,7 +294,7 @@ do_edit_ownertrust (PKT_public_key *pk, int mode, if (trust == TRUST_ULTIMATE && !cpr_get_answer_is_yes ("edit_ownertrust.set_ultimate.okay", _("Do you really want to set this key" - " to ultimate trust? "))) + " to ultimate trust? (y/N) "))) ; /* no */ else { @@ -441,7 +441,7 @@ do_we_trust_pre( PKT_public_key *pk, unsigned int trustlevel ) tty_printf("\n"); if( cpr_get_answer_is_yes("untrusted_key.override", - _("Use this key anyway? ")) ) + _("Use this key anyway? (y/N) ")) ) rc = 1; /* Hmmm: Should we set a flag to tell the user about diff --git a/g10/revoke.c b/g10/revoke.c index b973ff6cc..c99fd2709 100644 --- a/g10/revoke.c +++ b/g10/revoke.c @@ -276,7 +276,7 @@ gen_desig_revoke( const char *uname ) tty_printf("\n"); if( !cpr_get_answer_is_yes("gen_desig_revoke.okay", - _("Create a revocation certificate for this key? ")) ) + _("Create a designated revocation certificate for this key? (y/N) "))) continue; /* get the reason for the revocation (this is always v4) */ @@ -473,10 +473,11 @@ gen_revoke( const char *uname ) tty_printf("\n"); if( !cpr_get_answer_is_yes("gen_revoke.okay", - _("Create a revocation certificate for this key? ")) ){ + _("Create a revocation certificate for this key? (y/N) ")) ) + { rc = 0; goto leave; - } + } if(sk->version>=4 || opt.force_v4_certs) { /* get the reason for the revocation */ @@ -673,7 +674,7 @@ ask_revocation_reason( int key_rev, int cert_rev, int hint ) tty_printf("%s\n", description ); } while( !cpr_get_answer_is_yes("ask_revocation_reason.okay", - _("Is this okay? ")) ); + _("Is this okay? (y/N) ")) ); reason = m_alloc( sizeof *reason ); reason->code = code;