mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-06-04 20:48:53 -04:00
fw: Remove TK1_SYSCALL_REG_MGMT
Validate preload API access using the fixed, pre-calculated app digest instead of letting an app register itself as a management app.
This commit is contained in:
parent
5308544064
commit
0ece0c00f1
8 changed files with 30 additions and 120 deletions
|
@ -39,26 +39,14 @@
|
|||
#define ADDR_PRE_LOADED_APP_0 (ADDR_PARTITION_TABLE + SIZE_PARTITION_TABLE)
|
||||
#define SIZE_PRE_LOADED_APP 0x20000UL // 128KiB
|
||||
|
||||
// Pre-loaded app present and authenticated
|
||||
#define PRE_LOADED_STATUS_AUTH 0x01
|
||||
// Pre-loaded app present but not yet authenticated
|
||||
#define PRE_LOADED_STATUS_PRESENT 0x02
|
||||
|
||||
#define ADDR_STORAGE_AREA (ADDR_PRE_LOADED_APP_0 + (N_PRELOADED_APP * SIZE_PRE_LOADED_APP))
|
||||
#define SIZE_STORAGE_AREA 0x20000UL // 128KiB
|
||||
#define N_STORAGE_AREA 4
|
||||
|
||||
#define EMPTY_AREA
|
||||
|
||||
/* Partition Table */
|
||||
/*- Table header */
|
||||
/* - 1 bytes Version */
|
||||
/**/
|
||||
/*- Management device app */
|
||||
/* - Status. */
|
||||
/* - 16 byte random nonce. */
|
||||
/* - 16 byte authentication digest. */
|
||||
/**/
|
||||
/*- Pre-loaded device app 1 */
|
||||
/* - 4 bytes length. */
|
||||
/* - 32 bytes digest. */
|
||||
|
@ -81,11 +69,6 @@ struct auth_metadata {
|
|||
uint8_t authentication_digest[16];
|
||||
} __attribute__((packed));
|
||||
|
||||
struct management_app_metadata {
|
||||
uint8_t status;
|
||||
struct auth_metadata auth;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct pre_loaded_app_metadata {
|
||||
uint32_t size;
|
||||
uint8_t digest[32];
|
||||
|
@ -105,7 +88,6 @@ struct table_header {
|
|||
|
||||
struct partition_table {
|
||||
struct table_header header;
|
||||
struct management_app_metadata mgmt_app_data;
|
||||
struct pre_loaded_app_metadata pre_app_data[N_PRELOADED_APP];
|
||||
struct app_storage_area app_storage[N_STORAGE_AREA];
|
||||
} __attribute__((packed));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue