tpm2-setup: call DLOPEN_TPM2 to add dependency and fail immediately if not present

tpm2-setup requires both libcrypto and the tpm2-tss libraries, but so
far it only directly dlopen'ed libcrypto, with a clear error on startup
if missing, and a dependency added via dlopen notes.
Do the same for the tpm2-tss dlopens, to get a clear error and the
required dependencies.

(cherry picked from commit a7aa25bb25)
This commit is contained in:
Luca Boccassi
2026-06-22 22:48:53 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent 8104f94b51
commit 0d2e337b2a

View File

@@ -573,6 +573,10 @@ static int run(int argc, char *argv[]) {
if (r < 0)
return r;
r = DLOPEN_TPM2(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
if (r < 0)
return r;
umask(0022);
/* Execute both jobs, and then return unlisted errors preferably, and listed errors