gpgme-tool: Allow for symmetric encryption.
* src/gpgme-tool.c (gt_sign_encrypt): Pass NULL for recp if no recipients are given.
This commit is contained in:
parent
18254f88f8
commit
0c1de7abd5
@ -1911,11 +1911,14 @@ gt_sign_encrypt (gpgme_tool_t gt, gpgme_encrypt_flags_t flags,
|
|||||||
gpgme_data_t plain, gpgme_data_t cipher, int sign)
|
gpgme_data_t plain, gpgme_data_t cipher, int sign)
|
||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
|
gpgme_key_t *recp;
|
||||||
|
|
||||||
|
recp = gt->recipients_nr? gt->recipients : NULL;
|
||||||
|
|
||||||
if (sign)
|
if (sign)
|
||||||
err = gpgme_op_encrypt_sign (gt->ctx, gt->recipients, flags, plain, cipher);
|
err = gpgme_op_encrypt_sign (gt->ctx, recp, flags, plain, cipher);
|
||||||
else
|
else
|
||||||
err = gpgme_op_encrypt (gt->ctx, gt->recipients, flags, plain, cipher);
|
err = gpgme_op_encrypt (gt->ctx, recp, flags, plain, cipher);
|
||||||
|
|
||||||
gt_recipients_clear (gt);
|
gt_recipients_clear (gt);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user