summaryrefslogtreecommitdiffstats
path: root/src/shared/tpm2-util.c
diff options
context:
space:
mode:
authorDan Streetman <ddstreet@ieee.org>2023-01-20 18:42:52 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2023-02-16 10:02:58 +0100
commit0d7009d35df2fef494b1df67f5caa55e85dd8970 (patch)
treef37e65ba78daf8afb4935abb5a4a8e4d459fb4cd /src/shared/tpm2-util.c
parentmkosi: Enable debug logging in CI (diff)
downloadsystemd-0d7009d35df2fef494b1df67f5caa55e85dd8970.tar.xz
systemd-0d7009d35df2fef494b1df67f5caa55e85dd8970.zip
tpm2: fix build failure without openssl
Diffstat (limited to '')
-rw-r--r--src/shared/tpm2-util.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c
index 259f280e0f..4345b95106 100644
--- a/src/shared/tpm2-util.c
+++ b/src/shared/tpm2-util.c
@@ -761,6 +761,7 @@ int tpm2_get_good_pcr_banks_strv(
uint32_t pcr_mask,
char ***ret) {
+#if HAVE_OPENSSL
_cleanup_free_ TPMI_ALG_HASH *algs = NULL;
_cleanup_strv_free_ char **l = NULL;
int n_algs;
@@ -797,6 +798,9 @@ int tpm2_get_good_pcr_banks_strv(
*ret = TAKE_PTR(l);
return 0;
+#else /* HAVE_OPENSSL */
+ return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "OpenSSL support is disabled.");
+#endif
}
static void hash_pin(const char *pin, size_t len, TPM2B_AUTH *auth) {
@@ -1979,9 +1983,8 @@ int tpm2_extend_bytes(
sym_Tss2_RC_Decode(rc));
return 0;
-#else
- return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),
- "OpenSSL not supported on this build.");
+#else /* HAVE_OPENSSL */
+ return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "OpenSSL support is disabled.");
#endif
}
#endif