diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 08:06:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 08:06:26 +0000 |
commit | 1660d4b7a65d9ad2ce0deaa19d35579ca4084ac5 (patch) | |
tree | 6cf8220b628ebd2ccfc1375dd6516c6996e9abcc /tests/fake_systemd_tpm_path.c | |
parent | Initial commit. (diff) | |
download | cryptsetup-upstream.tar.xz cryptsetup-upstream.zip |
Adding upstream version 2:2.6.1.upstream/2%2.6.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/fake_systemd_tpm_path.c')
-rw-r--r-- | tests/fake_systemd_tpm_path.c | 17 |
1 files changed, 17 insertions, 0 deletions
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 <string.h> +#include <stdlib.h> + +/* 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; +} |