core: Fix passphrase cb for mixed sym encrypt

* src/encrypt.c (encrypt_start): Handle SYMMETRIC flag.
* src/encrypt-sign.c (encrypt_sign_start): Ditto.

--
This causes the passphrace command handler to be properly
registered which in turn will result in the passphrase
callback beeing called.
This commit is contained in:
Andre Heinecke 2016-09-06 16:28:45 +02:00
parent ab3fbdbd05
commit efe7e11dfa
2 changed files with 2 additions and 3 deletions

View File

@ -72,7 +72,7 @@ encrypt_sign_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t recp[],
if (err) if (err)
return err; return err;
symmetric = !recp; symmetric = !recp || (flags & GPGME_ENCRYPT_SYMMETRIC);
if (!plain) if (!plain)
return gpg_error (GPG_ERR_NO_DATA); return gpg_error (GPG_ERR_NO_DATA);

View File

@ -228,8 +228,7 @@ encrypt_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t recp[],
if (err) if (err)
return err; return err;
if (!recp) symmetric = !recp || (flags & GPGME_ENCRYPT_SYMMETRIC);
symmetric = 1;
if (!plain) if (!plain)
return gpg_error (GPG_ERR_NO_DATA); return gpg_error (GPG_ERR_NO_DATA);