diff options
author | Dan Streetman <ddstreet@ieee.org> | 2023-01-20 18:42:52 +0100 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-02-16 10:02:58 +0100 |
commit | 0d7009d35df2fef494b1df67f5caa55e85dd8970 (patch) | |
tree | f37e65ba78daf8afb4935abb5a4a8e4d459fb4cd /src | |
parent | mkosi: Enable debug logging in CI (diff) | |
download | systemd-0d7009d35df2fef494b1df67f5caa55e85dd8970.tar.xz systemd-0d7009d35df2fef494b1df67f5caa55e85dd8970.zip |
tpm2: fix build failure without openssl
Diffstat (limited to '')
-rw-r--r-- | src/shared/tpm2-util.c | 9 |
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 |