TPM (macOS): add support

This commit is contained in:
李通洲
2025-03-31 23:40:01 +08:00
parent 07c61f70d9
commit 031aa985f1
2 changed files with 32 additions and 1 deletions
+1 -1
View File
@@ -947,7 +947,7 @@ elseif(APPLE)
src/detection/terminalshell/terminalshell_linux.c
src/detection/terminalsize/terminalsize_linux.c
src/detection/theme/theme_nosupport.c
src/detection/tpm/tpm_nosupport.c
src/detection/tpm/tpm_apple.c
src/detection/uptime/uptime_bsd.c
src/detection/users/users_linux.c
src/detection/wallpaper/wallpaper_apple.m
+31
View File
@@ -0,0 +1,31 @@
#include "tpm.h"
#ifndef __aarch64__
#include "util/apple/cf_helpers.h"
#include <IOKit/IOKitLib.h>
#endif
const char* ffDetectTPM(FFTPMResult* result)
{
#ifdef __aarch64__
ffStrbufSetStatic(&result->version, "2.0");
ffStrbufSetStatic(&result->description, "Apple Silicon Security");
return NULL;
#else
FF_IOOBJECT_AUTO_RELEASE io_service_t t2Service = IOServiceGetMatchingService(
kIOMainPortDefault,
IOServiceMatching("AppleT2"));
if (t2Service) {
ffStrbufSetStatic(&result->version, "2.0");
ffStrbufSetStatic(&result->description, "Apple T2 Security Chip");
return NULL;
}
#endif
return "No Apple Security hardware detected";
}