aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-08-31 10:02:02 +0000
committerWerner Koch <[email protected]>2023-08-31 10:02:02 +0000
commitd75b2a91517397261c2508dba058611f803c0733 (patch)
tree380b1f0e36039b170deb559f18dafbde737ab60f /src
parentqt: Allow specifying user IDs to use when refreshing keys via WKD (diff)
downloadgpgme-d75b2a91517397261c2508dba058611f803c0733.tar.gz
gpgme-d75b2a91517397261c2508dba058611f803c0733.zip
Support GPGME_ENCRYPT_ALWAYS_TRUST also for S/MIME.
* src/engine-gpgsm.c (gpgsm_encrypt): Send the always-trust options. * tests/run-encrypt.c: Add option --always-trust. -- Note that the run-encrypt test tool used to assume always-trust for OpenPGP since 1.7.0 This bug has also been fixed by introducing the explicit option. GnuPG-bug-id: 6559
Diffstat (limited to 'src')
-rw-r--r--src/engine-gpgsm.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/engine-gpgsm.c b/src/engine-gpgsm.c
index 8a8beb87..24b142c5 100644
--- a/src/engine-gpgsm.c
+++ b/src/engine-gpgsm.c
@@ -1255,7 +1255,7 @@ gpgsm_reset (void *engine)
/* IF we have an active connection we must send a reset because we
need to reset the list of signers. Note that RESET does not
- reset OPTION commands. */
+ reset all OPTION commands. */
return (gpgsm->assuan_ctx
? gpgsm_assuan_simple_command (gpgsm, "RESET", NULL, NULL)
: 0);
@@ -1547,6 +1547,17 @@ gpgsm_encrypt (void *engine, gpgme_key_t recp[], const char *recpstring,
return err;
}
+ if ((flags & GPGME_ENCRYPT_ALWAYS_TRUST))
+ {
+ /* Note that a RESET and the actual operation resets the
+ * always-trust option. To support older gnupg versions we
+ * ignore the unknown option error. */
+ err = gpgsm_assuan_simple_command (gpgsm,
+ "OPTION always-trust", NULL, NULL);
+ if (err && gpg_err_code (err) != GPG_ERR_UNKNOWN_OPTION)
+ return err;
+ }
+
err = send_input_size_hint (gpgsm, plain);
if (err)
return err;