aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/engine-gpg.c7
-rw-r--r--src/gpgme.h.in1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index 5e663e16..969abab6 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -3164,6 +3164,13 @@ gpg_keysign (void *engine, gpgme_key_t key, const char *userid,
else
err = add_arg (gpg, "--quick-sign-key");
+ /* The force flag as only an effect with recent gpg versions; if the
+ * gpg version is too old, the signature will simply not be created.
+ * I think this is better than bailing out. */
+ if (!err && (flags & GPGME_KEYSIGN_FORCE)
+ && have_gpg_version (gpg, "2.2.28"))
+ err = add_arg (gpg, "--force-sign-key");
+
if (!err)
err = append_args_from_signers (gpg, ctx);
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index 9e98816d..0a90c8d2 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -1905,6 +1905,7 @@ gpgme_error_t gpgme_op_delete_ext (gpgme_ctx_t ctx, const gpgme_key_t key,
#define GPGME_KEYSIGN_LOCAL (1 << 7) /* Create a local signature. */
#define GPGME_KEYSIGN_LFSEP (1 << 8) /* Indicate LF separated user ids. */
#define GPGME_KEYSIGN_NOEXPIRE (1 << 9) /* Force no expiration. */
+#define GPGME_KEYSIGN_FORCE (1 << 10) /* Force creation. */
/* Sign the USERID of KEY using the current set of signers. */