From 15ae7da74bc403d19df8d3ca3c0176b7dac98e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Wed, 14 May 2025 11:16:28 +0200 Subject: Treat empty algorithm the same way as unset algorithm * src/engine-gpg.c (gpg_add_algo_usage_expire): Add "default" as algorithm argument if algo is NULL or an empty string. -- --- src/engine-gpg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/engine-gpg.c b/src/engine-gpg.c index 483eda74..b3399027 100644 --- a/src/engine-gpg.c +++ b/src/engine-gpg.c @@ -2885,13 +2885,13 @@ gpg_add_algo_usage_expire (engine_gpg_t gpg, gpg_error_t err; /* This condition is only required to allow the use of gpg < 2.1.16 */ - if (algo + if ((algo && *algo) || (flags & (GPGME_CREATE_SIGN | GPGME_CREATE_ENCR | GPGME_CREATE_CERT | GPGME_CREATE_AUTH | GPGME_CREATE_GROUP | GPGME_CREATE_NOEXPIRE)) || expires) { - err = add_arg (gpg, algo? algo : "default"); + err = add_arg (gpg, (algo && *algo)? algo : "default"); if (!err) { char tmpbuf[6*5+1]; -- cgit v1.2.3