]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tpm: remove external calls to dlopen_tpm2()
authorDan Streetman <ddstreet@ieee.org>
Fri, 5 May 2023 23:53:32 +0000 (19:53 -0400)
committerDan Streetman <ddstreet@ieee.org>
Wed, 31 May 2023 13:23:21 +0000 (09:23 -0400)
The calls outside tpm2-util.c are redundant, as tpm2_context_new()
is always called immediately after, which then calls dlopen_tpm2().

src/boot/pcrphase.c
src/cryptsetup/cryptsetup.c

index afa474c88342b987ff6669cb5d56759dc7d3b525..98db82696c2ca0fb4f8c7573b0270fc759bba9e5 100644 (file)
@@ -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)
index d94cb00e696b8ee2c70f9bc80757b0b37a47a2bd..3dadf83d627b1e857ef41e2ad38dcdf8f55385e7 100644 (file)
@@ -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)