mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-06 12:33:23 +01:00
* 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.
This commit is contained in:
parent
d41e6455a3
commit
f3687f6b6c
@ -1,5 +1,9 @@
|
|||||||
2004-10-10 David Shaw <dshaw@jabberwocky.com>
|
2004-10-10 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* 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.
|
* keygen.c (ask_key_flags): New.
|
||||||
(ask_algo): Call it here in --expert mode so we don't need to
|
(ask_algo): Call it here in --expert mode so we don't need to
|
||||||
specify each possible variation of RSA capabilities.
|
specify each possible variation of RSA capabilities.
|
||||||
|
@ -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");
|
log_info ("WARNING: such a key has already been stored on the card!\n");
|
||||||
tty_printf ("\n");
|
tty_printf ("\n");
|
||||||
if ( !cpr_get_answer_is_yes( "cardedit.genkeys.replace_key",
|
if ( !cpr_get_answer_is_yes( "cardedit.genkeys.replace_key",
|
||||||
_("Replace existing key? ")))
|
_("Replace existing key? (y/N) ")))
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -878,9 +878,21 @@ generate_card_keys (const char *serialno)
|
|||||||
if (get_info_for_key_operation (&info))
|
if (get_info_for_key_operation (&info))
|
||||||
return;
|
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
|
want_backup = !(cpr_get_answer_is_yes
|
||||||
( "cardedit.genkeys.backup_enc",
|
( "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))
|
if ( (info.fpr1valid && !fpr_is_zero (info.fpr1))
|
||||||
|| (info.fpr2valid && !fpr_is_zero (info.fpr2))
|
|| (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");
|
log_info ("NOTE: keys are already stored on the card!\n");
|
||||||
tty_printf ("\n");
|
tty_printf ("\n");
|
||||||
if ( !cpr_get_answer_is_yes( "cardedit.genkeys.replace_keys",
|
if ( !cpr_get_answer_is_yes( "cardedit.genkeys.replace_keys",
|
||||||
_("Replace existing keys? ")))
|
_("Replace existing keys? (y/N) ")))
|
||||||
{
|
{
|
||||||
agent_release_card_info (&info);
|
agent_release_card_info (&info);
|
||||||
return;
|
return;
|
||||||
|
@ -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"
|
yes = cpr_get_answer_is_yes( secret? "delete_key.secret.okay"
|
||||||
: "delete_key.okay",
|
: "delete_key.okay",
|
||||||
_("Delete this key from the keyring? "));
|
_("Delete this key from the keyring? (y/N) "));
|
||||||
if( !cpr_enabled() && secret && yes ) {
|
if( !cpr_enabled() && secret && yes ) {
|
||||||
/* I think it is not required to check a passphrase; if
|
/* I think it is not required to check a passphrase; if
|
||||||
* the user is so stupid as to let others access his secret keyring
|
* 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.
|
* basic texts about security.
|
||||||
*/
|
*/
|
||||||
yes = cpr_get_answer_is_yes("delete_key.secret.okay",
|
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 )
|
if( yes )
|
||||||
okay++;
|
okay++;
|
||||||
|
@ -964,7 +964,8 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
|
|||||||
|
|
||||||
if( opt.batch && opt.answer_yes )
|
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;
|
continue;
|
||||||
|
|
||||||
/* now we can sign the user ids */
|
/* now we can sign the user ids */
|
||||||
@ -1116,7 +1117,7 @@ change_passphrase( KBNODE keyblock )
|
|||||||
tty_printf(_( "You don't want a passphrase -"
|
tty_printf(_( "You don't want a passphrase -"
|
||||||
" this is probably a *bad* idea!\n\n"));
|
" this is probably a *bad* idea!\n\n"));
|
||||||
if( cpr_get_answer_is_yes("change_passwd.empty.okay",
|
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++;
|
changed++;
|
||||||
break;
|
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",
|
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"));
|
tty_printf(_("Hint: Select the user IDs to sign\n"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sign_uids( keyblock, locusr, &modified,
|
sign_uids( keyblock, locusr, &modified,
|
||||||
(cmd == cmdLSIGN) || (cmd == cmdNRLSIGN),
|
(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"));
|
tty_printf(_("You must select at least one user ID.\n"));
|
||||||
else if( real_uids_left(keyblock) < 1 )
|
else if( real_uids_left(keyblock) < 1 )
|
||||||
tty_printf(_("You can't delete the last user ID!\n"));
|
tty_printf(_("You can't delete the last user ID!\n"));
|
||||||
else if( cpr_get_answer_is_yes(
|
else if( cpr_get_answer_is_yes("keyedit.remove.uid.okay",
|
||||||
"keyedit.remove.uid.okay",
|
n1 > 1? _("Really remove all selected user IDs? (y/N) ")
|
||||||
n1 > 1? _("Really remove all selected user IDs? ")
|
: _("Really remove this user ID? (y/N) ")
|
||||||
: _("Really remove this user ID? ")
|
|
||||||
) ) {
|
) ) {
|
||||||
menu_deluid( keyblock, sec_keyblock );
|
menu_deluid( keyblock, sec_keyblock );
|
||||||
redisplay = 1;
|
redisplay = 1;
|
||||||
@ -1580,7 +1582,7 @@ keyedit_menu( const char *username, STRLIST locusr,
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if (cpr_get_answer_is_yes("keyedit.keytocard.use_primary",
|
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;
|
node = sec_keyblock;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@ -1615,8 +1617,8 @@ keyedit_menu( const char *username, STRLIST locusr,
|
|||||||
tty_printf(_("You must select at least one key.\n"));
|
tty_printf(_("You must select at least one key.\n"));
|
||||||
else if( !cpr_get_answer_is_yes( "keyedit.remove.subkey.okay",
|
else if( !cpr_get_answer_is_yes( "keyedit.remove.subkey.okay",
|
||||||
n1 > 1?
|
n1 > 1?
|
||||||
_("Do you really want to delete the selected keys? "):
|
_("Do you really want to delete the selected keys? (y/N) "):
|
||||||
_("Do you really want to delete this key? ")
|
_("Do you really want to delete this key? (y/N) ")
|
||||||
))
|
))
|
||||||
;
|
;
|
||||||
else {
|
else {
|
||||||
@ -1651,8 +1653,8 @@ keyedit_menu( const char *username, STRLIST locusr,
|
|||||||
tty_printf(_("You must select at least one user ID.\n"));
|
tty_printf(_("You must select at least one user ID.\n"));
|
||||||
else if( cpr_get_answer_is_yes(
|
else if( cpr_get_answer_is_yes(
|
||||||
"keyedit.revoke.uid.okay",
|
"keyedit.revoke.uid.okay",
|
||||||
n1 > 1? _("Really revoke all selected user IDs? ")
|
n1 > 1? _("Really revoke all selected user IDs? (y/N) ")
|
||||||
: _("Really revoke this user ID? ")
|
: _("Really revoke this user ID? (y/N) ")
|
||||||
) ) {
|
) ) {
|
||||||
if(menu_revuid(keyblock,sec_keyblock))
|
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(
|
else if( sec_keyblock && !cpr_get_answer_is_yes(
|
||||||
"keyedit.revoke.subkey.okay",
|
"keyedit.revoke.subkey.okay",
|
||||||
n1 > 1?
|
n1 > 1?
|
||||||
_("Do you really want to revoke the selected keys? "):
|
_("Do you really want to revoke the selected keys? (y/N) "):
|
||||||
_("Do you really want to revoke this key? ")
|
_("Do you really want to revoke this key? (y/N) ")
|
||||||
))
|
))
|
||||||
;
|
;
|
||||||
else {
|
else {
|
||||||
@ -1749,16 +1751,18 @@ keyedit_menu( const char *username, STRLIST locusr,
|
|||||||
}
|
}
|
||||||
if (cpr_get_answer_is_yes ("keyedit.updpref.okay",
|
if (cpr_get_answer_is_yes ("keyedit.updpref.okay",
|
||||||
count_selected_uids (keyblock)?
|
count_selected_uids (keyblock)?
|
||||||
_("Really update the preferences"
|
_("Really update the preferences"
|
||||||
" for the selected user IDs? "):
|
" for the selected user IDs? (y/N) "):
|
||||||
_("Really update the preferences? "))){
|
_("Really update the preferences? (y/N) ")))
|
||||||
|
{
|
||||||
|
|
||||||
if ( menu_set_preferences (keyblock, sec_keyblock) ) {
|
if ( menu_set_preferences (keyblock, sec_keyblock) )
|
||||||
merge_keys_and_selfsig (keyblock);
|
{
|
||||||
modified = 1;
|
merge_keys_and_selfsig (keyblock);
|
||||||
redisplay = 1;
|
modified = 1;
|
||||||
}
|
redisplay = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case cmdPREFKS:
|
case cmdPREFKS:
|
||||||
@ -1799,10 +1803,10 @@ keyedit_menu( const char *username, STRLIST locusr,
|
|||||||
if( !modified && !sec_modified )
|
if( !modified && !sec_modified )
|
||||||
goto leave;
|
goto leave;
|
||||||
if( !cpr_get_answer_is_yes("keyedit.save.okay",
|
if( !cpr_get_answer_is_yes("keyedit.save.okay",
|
||||||
_("Save changes? ")) ) {
|
_("Save changes? (y/N) ")) ) {
|
||||||
if( cpr_enabled()
|
if( cpr_enabled()
|
||||||
|| cpr_get_answer_is_yes("keyedit.cancel.okay",
|
|| cpr_get_answer_is_yes("keyedit.cancel.okay",
|
||||||
_("Quit without saving? ")) )
|
_("Quit without saving? (y/N) ")))
|
||||||
goto leave;
|
goto leave;
|
||||||
break;
|
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",
|
if(!cpr_get_answer_is_yes("keyedit.add_revoker.okay",
|
||||||
_("Are you sure you want to appoint this "
|
_("Are you sure you want to appoint this "
|
||||||
"key as a designated revoker? (y/N): ")))
|
"key as a designated revoker? (y/N) ")))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
free_public_key(revoker_pk);
|
free_public_key(revoker_pk);
|
||||||
|
11
g10/keygen.c
11
g10/keygen.c
@ -1400,12 +1400,13 @@ ask_keysize( int algo )
|
|||||||
_("Keysizes larger than 2048 are not suggested because\n"
|
_("Keysizes larger than 2048 are not suggested because\n"
|
||||||
"computations take REALLY long!\n"));
|
"computations take REALLY long!\n"));
|
||||||
if( cpr_get_answer_is_yes("keygen.size.huge.okay",_(
|
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 "
|
tty_printf(_("Okay, but keep in mind that your monitor "
|
||||||
"and keyboard radiation is also very vulnerable "
|
"and keyboard radiation is also very vulnerable "
|
||||||
"to attacks!\n"));
|
"to attacks!\n"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
@ -1529,7 +1530,7 @@ ask_expire_interval(int object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( cpr_enabled() || cpr_get_answer_is_yes("keygen.valid.okay",
|
if( cpr_enabled() || cpr_get_answer_is_yes("keygen.valid.okay",
|
||||||
_("Is this correct (y/n)? ")) )
|
_("Is this correct? (y/N) ")) )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_free(answer);
|
m_free(answer);
|
||||||
@ -2974,7 +2975,7 @@ generate_subkeypair( KBNODE pub_keyblock, KBNODE sec_keyblock )
|
|||||||
nbits = ask_keysize( algo );
|
nbits = ask_keysize( algo );
|
||||||
expire = ask_expire_interval(0);
|
expire = ask_expire_interval(0);
|
||||||
if( !cpr_enabled() && !cpr_get_answer_is_yes("keygen.sub.okay",
|
if( !cpr_enabled() && !cpr_get_answer_is_yes("keygen.sub.okay",
|
||||||
_("Really create? ") ) )
|
_("Really create? (y/N) ")))
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
if( passphrase ) {
|
if( passphrase ) {
|
||||||
@ -3096,7 +3097,7 @@ generate_card_subkeypair (KBNODE pub_keyblock, KBNODE sec_keyblock,
|
|||||||
else
|
else
|
||||||
use = PUBKEY_USAGE_AUTH;
|
use = PUBKEY_USAGE_AUTH;
|
||||||
if (!cpr_enabled() && !cpr_get_answer_is_yes("keygen.cardsub.okay",
|
if (!cpr_enabled() && !cpr_get_answer_is_yes("keygen.cardsub.okay",
|
||||||
_("Really create? ") ) )
|
_("Really create? (y/N) ")))
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
if (passphrase)
|
if (passphrase)
|
||||||
|
@ -83,7 +83,7 @@ overwrite_filep( const char *fname )
|
|||||||
|
|
||||||
tty_printf(_("File `%s' exists. "), fname);
|
tty_printf(_("File `%s' exists. "), fname);
|
||||||
if( cpr_get_answer_is_yes("openfile.overwrite.okay",
|
if( cpr_get_answer_is_yes("openfile.overwrite.okay",
|
||||||
_("Overwrite (y/N)? ")) )
|
_("Overwrite? (y/N) ")) )
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -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);
|
tty_printf( _("This JPEG is really large (%d bytes) !\n"),len);
|
||||||
if(!cpr_get_answer_is_yes("photoid.jpeg.size",
|
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);
|
iobuf_close(file);
|
||||||
continue;
|
continue;
|
||||||
|
@ -294,7 +294,7 @@ do_edit_ownertrust (PKT_public_key *pk, int mode,
|
|||||||
if (trust == TRUST_ULTIMATE
|
if (trust == TRUST_ULTIMATE
|
||||||
&& !cpr_get_answer_is_yes ("edit_ownertrust.set_ultimate.okay",
|
&& !cpr_get_answer_is_yes ("edit_ownertrust.set_ultimate.okay",
|
||||||
_("Do you really want to set this key"
|
_("Do you really want to set this key"
|
||||||
" to ultimate trust? ")))
|
" to ultimate trust? (y/N) ")))
|
||||||
; /* no */
|
; /* no */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -441,7 +441,7 @@ do_we_trust_pre( PKT_public_key *pk, unsigned int trustlevel )
|
|||||||
tty_printf("\n");
|
tty_printf("\n");
|
||||||
|
|
||||||
if( cpr_get_answer_is_yes("untrusted_key.override",
|
if( cpr_get_answer_is_yes("untrusted_key.override",
|
||||||
_("Use this key anyway? ")) )
|
_("Use this key anyway? (y/N) ")) )
|
||||||
rc = 1;
|
rc = 1;
|
||||||
|
|
||||||
/* Hmmm: Should we set a flag to tell the user about
|
/* Hmmm: Should we set a flag to tell the user about
|
||||||
|
@ -276,7 +276,7 @@ gen_desig_revoke( const char *uname )
|
|||||||
tty_printf("\n");
|
tty_printf("\n");
|
||||||
|
|
||||||
if( !cpr_get_answer_is_yes("gen_desig_revoke.okay",
|
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;
|
continue;
|
||||||
|
|
||||||
/* get the reason for the revocation (this is always v4) */
|
/* get the reason for the revocation (this is always v4) */
|
||||||
@ -473,10 +473,11 @@ gen_revoke( const char *uname )
|
|||||||
|
|
||||||
tty_printf("\n");
|
tty_printf("\n");
|
||||||
if( !cpr_get_answer_is_yes("gen_revoke.okay",
|
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;
|
rc = 0;
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sk->version>=4 || opt.force_v4_certs) {
|
if(sk->version>=4 || opt.force_v4_certs) {
|
||||||
/* get the reason for the revocation */
|
/* 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 );
|
tty_printf("%s\n", description );
|
||||||
|
|
||||||
} while( !cpr_get_answer_is_yes("ask_revocation_reason.okay",
|
} while( !cpr_get_answer_is_yes("ask_revocation_reason.okay",
|
||||||
_("Is this okay? ")) );
|
_("Is this okay? (y/N) ")) );
|
||||||
|
|
||||||
reason = m_alloc( sizeof *reason );
|
reason = m_alloc( sizeof *reason );
|
||||||
reason->code = code;
|
reason->code = code;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user