aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine-gpg.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/engine-gpg.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index 21ca02a8..34436007 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -2076,7 +2076,8 @@ gpg_add_algo_usage_expire (engine_gpg_t gpg,
/* This condition is only required to allow the use of gpg < 2.1.16 */
if (algo
|| (flags & (GPGME_CREATE_SIGN | GPGME_CREATE_ENCR
- | GPGME_CREATE_CERT | GPGME_CREATE_AUTH))
+ | GPGME_CREATE_CERT | GPGME_CREATE_AUTH
+ | GPGME_CREATE_NOEXPIRE))
|| expires)
{
err = add_arg (gpg, algo? algo : "default");
@@ -2090,11 +2091,18 @@ gpg_add_algo_usage_expire (engine_gpg_t gpg,
(flags & GPGME_CREATE_AUTH)? " auth":"");
err = add_arg (gpg, *tmpbuf? tmpbuf : "default");
}
- if (!err && expires)
+ if (!err)
{
- char tmpbuf[8+20];
- snprintf (tmpbuf, sizeof tmpbuf, "seconds=%lu", expires);
- err = add_arg (gpg, tmpbuf);
+ if (flags & GPGME_CREATE_NOEXPIRE)
+ err = add_arg (gpg, "never");
+ else if (expires == 0)
+ err = add_arg (gpg, "-");
+ else
+ {
+ char tmpbuf[8+20];
+ snprintf (tmpbuf, sizeof tmpbuf, "seconds=%lu", expires);
+ err = add_arg (gpg, tmpbuf);
+ }
}
}
else