mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* mainproc.c (proc_symkey_enc): Take care of a canceled passphrase
prompt.
This commit is contained in:
parent
8e17d6437d
commit
d0b9ff171d
4 changed files with 27 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
2005-09-20 Werner Koch <wk@g10code.com>
|
||||
|
||||
* mainproc.c (proc_symkey_enc): Take care of a canceled passphrase
|
||||
prompt.
|
||||
|
||||
2005-09-19 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* keylist.c (reorder_keyblock, do_reorder_keyblock): Reorder
|
||||
|
|
|
@ -327,7 +327,22 @@ proc_symkey_enc( CTX c, PACKET *pkt )
|
|||
}
|
||||
else
|
||||
{
|
||||
c->dek=passphrase_to_dek(NULL, 0, algo, &enc->s2k, 0, NULL, NULL);
|
||||
int canceled;
|
||||
|
||||
c->dek = passphrase_to_dek (NULL, 0, algo, &enc->s2k, 0,
|
||||
NULL, &canceled);
|
||||
if (canceled)
|
||||
{
|
||||
/* For unknown reasons passphrase_to_dek does only
|
||||
return NULL if a new passphrase has been requested
|
||||
and has not been repeated correctly. Thus even
|
||||
with a cancel requested (by means of the gpg-agent)
|
||||
it won't return NULL but an empty passphrase. We
|
||||
take the most conservative approach for now and
|
||||
work around it right here. */
|
||||
xfree (c->dek);
|
||||
c->dek = NULL;
|
||||
}
|
||||
|
||||
if(c->dek)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue