diff options
Diffstat (limited to 'g10')
-rw-r--r-- | g10/ChangeLog | 5 | ||||
-rw-r--r-- | g10/keygen.c | 4 | ||||
-rw-r--r-- | g10/passphrase.c | 15 |
3 files changed, 20 insertions, 4 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index e5bc8e837..6c8148e60 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +2007-01-31 Werner Koch <[email protected]> + + * passphrase.c (passphrase_get): Set the cancel flag on all error + from the agent. Fixes a bug reported by Tom Duerbusch. + 2007-01-30 Werner Koch <[email protected]> * status.c (write_status_begin_signing): New. diff --git a/g10/keygen.c b/g10/keygen.c index 2db4ab210..2adb4cc01 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -2446,9 +2446,9 @@ proc_parameter_file( struct para_data_s *para, const char *fname, /* make DEK and S2K from the Passphrase */ r = get_parameter( para, pPASSPHRASE ); if( r && *r->u.value ) { - /* we have a plain text passphrase - create a DEK from it. + /* We have a plain text passphrase - create a DEK from it. * It is a little bit ridiculous to keep it ih secure memory - * but becuase we do this alwasy, why not here */ + * but because we do this always, why not here */ STRING2KEY *s2k; DEK *dek; diff --git a/g10/passphrase.c b/g10/passphrase.c index f4015ef74..c3d42dc0e 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -377,7 +377,18 @@ passphrase_get ( u32 *keyid, int mode, const char *cacheid, *canceled = 1; } else - log_error (_("problem with the agent: %s\n"), gpg_strerror (rc)); + { + log_error (_("problem with the agent: %s\n"), gpg_strerror (rc)); + /* Due to limitations in the API of the upper layers they + consider an error as no passphrase entered. This works in + most cases but not during key creation where this should + definitely not happen and let it continue without requiring a + passphrase. Given that now all the upper layers handle a + cancel correctly, we simply set the cancel flag now for all + errors from the agent. */ + if (canceled) + *canceled = 1; + } #ifdef ENABLE_NLS if (orig_codeset) @@ -483,7 +494,7 @@ ask_passphrase (const char *description, /* Return a new DEK object Using the string-to-key sepcifier S2K. Use KEYID and PUBKEY_ALGO to prompt the user. Returns NULL is the user - selected to cancel the passphrase entry and it CANCELED is not + selected to cancel the passphrase entry and if CANCELED is not NULL, sets it to true. MODE 0: Allow cached passphrase |