From: Dan Streetman Date: Fri, 20 Jan 2023 17:42:52 +0000 (-0500) Subject: tpm2: fix build failure without openssl X-Git-Tag: v254-rc1~1269 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d7009d35df2fef494b1df67f5caa55e85dd8970;p=thirdparty%2Fsystemd.git tpm2: fix build failure without openssl --- diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c index 259f280e0fc..4345b951068 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