1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

* passphrase.c (passphrase_to_dek): Add tryagain_text arg to be

used with the agent.  Changed all callers.
(agent_get_passphrase): Likewise and send it to the agent
* seckey-cert.c (do_check): New arg tryagain_text.
(check_secret_key): Pass the string to do_check.
* keygen.c (ask_passphrase): Set the error text is required.
* keyedit.c (change_passphrase): Ditto.
* passphrase.c (agent_open): Disable opt.use_agent in case of a
problem with the agent.
(agent_get_passphrase): Ditto.
(passphrase_clear_cache): Ditto.
This commit is contained in:
Werner Koch 2002-01-20 18:33:04 +00:00
parent 1e7350da8e
commit 5a92c6052f
10 changed files with 101 additions and 30 deletions

View file

@ -1184,6 +1184,7 @@ ask_passphrase( STRING2KEY **ret_s2k )
{
DEK *dek = NULL;
STRING2KEY *s2k;
const char *errtext = NULL;
tty_printf(_("You need a Passphrase to protect your secret key.\n\n") );
@ -1191,9 +1192,10 @@ ask_passphrase( STRING2KEY **ret_s2k )
for(;;) {
s2k->mode = opt.s2k_mode;
s2k->hash_algo = opt.s2k_digest_algo;
dek = passphrase_to_dek( NULL, 0, opt.s2k_cipher_algo, s2k, 2 );
dek = passphrase_to_dek( NULL, 0, opt.s2k_cipher_algo, s2k,2,errtext);
if( !dek ) {
tty_printf(_("passphrase not correctly repeated; try again.\n"));
errtext = _("passphrase not correctly repeated; try again");
tty_printf(_("%s.\n"), errtext);
}
else if( !dek->keylen ) {
m_free(dek); dek = NULL;
@ -1448,7 +1450,7 @@ proc_parameter_file( struct para_data_s *para, const char *fname,
s2k->mode = opt.s2k_mode;
s2k->hash_algo = opt.s2k_digest_algo;
set_next_passphrase( r->u.value );
dek = passphrase_to_dek( NULL, 0, opt.s2k_cipher_algo, s2k, 2 );
dek = passphrase_to_dek( NULL, 0, opt.s2k_cipher_algo, s2k, 2, NULL );
set_next_passphrase( NULL );
assert( dek );
memset( r->u.value, 0, strlen(r->u.value) );
@ -2080,7 +2082,7 @@ generate_subkeypair( KBNODE pub_keyblock, KBNODE sec_keyblock )
s2k->mode = opt.s2k_mode;
s2k->hash_algo = opt.s2k_digest_algo;
set_next_passphrase( passphrase );
dek = passphrase_to_dek( NULL, 0, opt.s2k_cipher_algo, s2k, 2 );
dek = passphrase_to_dek( NULL, 0, opt.s2k_cipher_algo, s2k, 2, NULL );
}
rc = do_create( algo, nbits, pub_keyblock, sec_keyblock,