From 1660d4b7a65d9ad2ce0deaa19d35579ca4084ac5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 10:06:26 +0200 Subject: Adding upstream version 2:2.6.1. Signed-off-by: Daniel Baumann --- tests/fake_systemd_tpm_path.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/fake_systemd_tpm_path.c (limited to 'tests/fake_systemd_tpm_path.c') diff --git a/tests/fake_systemd_tpm_path.c b/tests/fake_systemd_tpm_path.c new file mode 100644 index 0000000..6d82989 --- /dev/null +++ b/tests/fake_systemd_tpm_path.c @@ -0,0 +1,17 @@ +#include +#include + +/* systemd tpm2-util.h */ +int tpm2_find_device_auto(int log_level, char **ret); + +extern int tpm2_find_device_auto(int log_level __attribute__((unused)), char **ret) +{ + const char *path = getenv("TPM_PATH"); + + if (!path) + *ret = NULL; + else + *ret = strdup(path); + + return 0; +} -- cgit v1.2.3