diff --git a/src/encrypt-sign.c b/src/encrypt-sign.c index 4f484e90..af6de63e 100644 --- a/src/encrypt-sign.c +++ b/src/encrypt-sign.c @@ -72,7 +72,7 @@ encrypt_sign_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t recp[], if (err) return err; - symmetric = !recp; + symmetric = !recp || (flags & GPGME_ENCRYPT_SYMMETRIC); if (!plain) return gpg_error (GPG_ERR_NO_DATA); diff --git a/src/encrypt.c b/src/encrypt.c index 307c862b..40236544 100644 --- a/src/encrypt.c +++ b/src/encrypt.c @@ -228,8 +228,7 @@ encrypt_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t recp[], if (err) return err; - if (!recp) - symmetric = 1; + symmetric = !recp || (flags & GPGME_ENCRYPT_SYMMETRIC); if (!plain) return gpg_error (GPG_ERR_NO_DATA);