aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine-gpg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine-gpg.c')
-rw-r--r--src/engine-gpg.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index 969abab6..b51ea173 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -1961,6 +1961,27 @@ append_args_from_sig_notations (engine_gpg_t gpg, gpgme_ctx_t ctx /* FIXME */,
static gpgme_error_t
+append_args_from_cert_expire (engine_gpg_t gpg, gpgme_ctx_t ctx)
+{
+ gpgme_error_t err;
+
+ if (ctx->cert_expire)
+ {
+ /* Override ask-cert-expire set in the configuration, so that the specified
+ * default is actually used. */
+ err = add_arg (gpg, "--no-ask-cert-expire");
+ if (!err)
+ err = add_arg (gpg, "--default-cert-expire");
+ if (!err)
+ err = add_arg (gpg, ctx->cert_expire);
+ }
+ else
+ err = 0;
+ return err;
+}
+
+
+static gpgme_error_t
gpg_edit (void *engine, int type, gpgme_key_t key, gpgme_data_t out,
gpgme_ctx_t ctx /* FIXME */)
{
@@ -1976,6 +1997,8 @@ gpg_edit (void *engine, int type, gpgme_key_t key, gpgme_data_t out,
if (!err)
err = append_args_from_sig_notations (gpg, ctx, NOTATION_FLAG_CERT);
if (!err)
+ err = append_args_from_cert_expire (gpg, ctx);
+ if (!err)
err = add_arg (gpg, type == 0 ? "--edit-key" : "--card-edit");
if (!err)
err = add_data (gpg, out, 1, 1);