TPM (FreeBSD): add support

This commit is contained in:
Carter Li
2024-09-26 10:39:03 +08:00
committed by 李通洲
parent 87f2e69162
commit 8295f66320
2 changed files with 18 additions and 1 deletions
+1 -1
View File
@@ -641,7 +641,7 @@ elseif(FreeBSD)
src/detection/terminalshell/terminalshell_linux.c
src/detection/terminalsize/terminalsize_linux.c
src/detection/theme/theme_linux.c
src/detection/tpm/tpm_nosupport.c
src/detection/tpm/tpm_bsd.c
src/detection/uptime/uptime_bsd.c
src/detection/users/users_linux.c
src/detection/wallpaper/wallpaper_linux.c
+17
View File
@@ -0,0 +1,17 @@
#include "tpm.h"
#include "common/sysctl.h"
const char* ffDetectTPM(FFTPMResult* result)
{
if (ffSysctlGetString("dev.tpmcrb.0.%desc", &result->description) != NULL)
return "TPM device is not found or TPM kernel module is not loaded";
if (ffStrbufContainS(&result->description, "2.0"))
ffStrbufSetStatic(&result->version, "2.0");
else if (ffStrbufContainS(&result->description, "1.2"))
ffStrbufSetStatic(&result->version, "1.2");
else
ffStrbufSetStatic(&result->version, "unknown");
return "Not supported on this platform";
}