From: Dan Streetman Date: Fri, 5 May 2023 23:53:32 +0000 (-0400) Subject: tpm: remove external calls to dlopen_tpm2() X-Git-Tag: v254-rc1~323^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9944909e68e06d903d828aeca4a48abc6285f74e;p=thirdparty%2Fsystemd.git tpm: remove external calls to dlopen_tpm2() The calls outside tpm2-util.c are redundant, as tpm2_context_new() is always called immediately after, which then calls dlopen_tpm2(). --- diff --git a/src/boot/pcrphase.c b/src/boot/pcrphase.c index afa474c8834..98db82696c2 100644 --- a/src/boot/pcrphase.c +++ b/src/boot/pcrphase.c @@ -341,10 +341,6 @@ static int run(int argc, char *argv[]) { return EXIT_SUCCESS; } - r = dlopen_tpm2(); - if (r < 0) - return log_error_errno(r, "Failed to load TPM2 libraries: %m"); - _cleanup_tpm2_context_ Tpm2Context *c = NULL; r = tpm2_context_new(arg_tpm2_device, &c); if (r < 0) diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index d94cb00e696..3dadf83d627 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -832,10 +832,6 @@ static int measure_volume_key( } #if HAVE_TPM2 - r = dlopen_tpm2(); - if (r < 0) - return log_error_errno(r, "Failed to load TPM2 libraries: %m"); - _cleanup_tpm2_context_ Tpm2Context *c = NULL; r = tpm2_context_new(arg_tpm2_device, &c); if (r < 0)