diff --git a/include/os_id.h b/include/os_id.h index 791fff86e..4a74f70b8 100644 --- a/include/os_id.h +++ b/include/os_id.h @@ -22,12 +22,17 @@ SYSCALL unsigned int os_flags(void); SYSCALL unsigned int os_version(unsigned char *version PLENGTH(maxlength), unsigned int maxlength); /* Grab the SE serial number */ SYSCALL unsigned int os_serial(unsigned char *serial PLENGTH(maxlength), unsigned int maxlength); +/* 32-bytes data unique to SE */ +SYSCALL unsigned int os_factory_hash(unsigned char *buffer PLENGTH(maxlength), + unsigned int maxlength); + #ifdef HAVE_MCU_SERIAL_STORAGE /* Grab the SEPROXYHAL's MCU serial number */ SYSCALL unsigned int os_seph_serial(unsigned char *serial PLENGTH(maxlength), unsigned int maxlength); #endif // HAVE_MCU_SERIAL_STORAGE - /* Grab the SEPROXYHAL's feature set */ + +/* Grab the SEPROXYHAL's feature set */ SYSCALL unsigned int os_seph_features(void); /* Grab the SEPROXYHAL's version */ SYSCALL unsigned int os_seph_version(unsigned char *version PLENGTH(maxlength), diff --git a/include/syscalls.h b/include/syscalls.h index 8ad6c67a3..3b2b93ea3 100644 --- a/include/syscalls.h +++ b/include/syscalls.h @@ -158,6 +158,7 @@ #define SYSCALL_os_flags_ID 0x0000006a #define SYSCALL_os_version_ID 0x0200006b #define SYSCALL_os_serial_ID 0x0200006c +#define SYSCALL_os_factory_hash_ID 0x02000075 #define SYSCALL_os_seph_features_ID 0x0000006e #define SYSCALL_os_seph_version_ID 0x0200006f #define SYSCALL_os_bootloader_version_ID 0x02000073 diff --git a/src/syscalls.c b/src/syscalls.c index 5762b7ba8..7bfd95296 100644 --- a/src/syscalls.c +++ b/src/syscalls.c @@ -1536,6 +1536,14 @@ unsigned int os_serial(unsigned char *serial, unsigned int maxlength) return (unsigned int) SVC_Call(SYSCALL_os_serial_ID, parameters); } +unsigned int os_factory_hash(unsigned char *buffer, unsigned int maxlength) +{ + unsigned int parameters[2]; + parameters[0] = (unsigned int) buffer; + parameters[1] = (unsigned int) maxlength; + return (unsigned int) SVC_Call(SYSCALL_os_factory_hash_ID, parameters); +} + unsigned int os_seph_features(void) { unsigned int parameters[2];