From: Yu Watanabe Date: Sun, 26 Oct 2025 07:15:56 +0000 (+0900) Subject: resolvectl: return earlier from openpgp command when OpenSSL support is disabled X-Git-Tag: v259-rc1~186^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a47a403ca2f866c78270f89193a5b67d9b936119;p=thirdparty%2Fsystemd.git resolvectl: return earlier from openpgp command when OpenSSL support is disabled When OpenSSL is disabled, string_hashsum_sha256()/_sha224() in resolve_openpgp() will fail anyway. Let's return earlier. --- diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index 4e63565afeb..478e870a430 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -1014,6 +1014,7 @@ static int verb_service(int argc, char **argv, void *userdata) { return resolve_service(bus, argv[1], argv[2], argv[3]); } +#if HAVE_OPENSSL static int resolve_openpgp(sd_bus *bus, const char *address) { int r; @@ -1074,8 +1075,10 @@ static int resolve_openpgp(sd_bus *bus, const char *address) { arg_type ?: DNS_TYPE_OPENPGPKEY, /* warn_missing= */ true); } +#endif static int verb_openpgp(int argc, char **argv, void *userdata) { +#if HAVE_OPENSSL _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL; int r, ret = 0; @@ -1090,6 +1093,9 @@ static int verb_openpgp(int argc, char **argv, void *userdata) { RET_GATHER(ret, resolve_openpgp(bus, *p)); return ret; +#else + return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "OpenSSL support is disabled, cannot query Open PGP keys."); +#endif } static int resolve_tlsa(sd_bus *bus, const char *family, const char *address) {