Files
cryptsetup/tests/fake_systemd_tpm_path.c
Ondrej Kozina 7aeb1c3aea Fix fake systemd tpm path symbol.
The prototype for the function in systemd has changed.
Otrherwise the tests abort with SEGFAULT.
2023-11-15 19:22:27 +00:00

18 lines
265 B
C

#include <string.h>
#include <stdlib.h>
/* systemd tpm2-util.h */
int tpm2_find_device_auto(char **ret);
extern int tpm2_find_device_auto(char **ret)
{
const char *path = getenv("TPM_PATH");
if (!path)
*ret = NULL;
else
*ret = strdup(path);
return 0;
}