Skip to content

Commit 87b0224

Browse files
Add a syscall to get the master public key identifier
1 parent cb0d0f5 commit 87b0224

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

include/os_seed.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,6 @@ WARN_UNUSED_RESULT static inline cx_err_t os_derive_eip2333_no_throw(
298298
// return BOLOS_TRUE if the seed has been generated, return BOLOS_FALSE otherwise.
299299
SYSCALL bolos_bool_t os_perso_seed_cookie(unsigned char *seed_cookie PLENGTH(CX_SHA512_SIZE));
300300
#endif // HAVE_SEED_COOKIE
301+
302+
SYSCALL bolos_err_t os_perso_get_master_key_identifier(uint8_t *identifier,
303+
size_t identifier_length);

include/syscalls.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@
139139
#define SYSCALL_os_perso_seed_cookie_ID 0x010000a8
140140
#endif // HAVE_SEED_COOKIE
141141

142+
#define SYSCALL_os_perso_get_master_key_identifier_ID 0x02000055
143+
142144
#define SYSCALL_ENDORSEMENT_get_code_hash_ID 0x01000055
143145
#define SYSCALL_ENDORSEMENT_get_public_key_ID 0x03000056
144146
#define SYSCALL_ENDORSEMENT_get_public_key_certificate_ID 0x03000057

src/syscalls.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,14 @@ bolos_bool_t os_perso_seed_cookie(unsigned char *seed_cookie)
13701370
}
13711371
#endif // HAVE_SEED_COOKIE
13721372

1373+
bolos_err_t os_perso_get_master_key_identifier(uint8_t *identifier, size_t identifier_length)
1374+
{
1375+
unsigned int parameters[2];
1376+
parameters[0] = (unsigned int) identifier;
1377+
parameters[1] = (unsigned int) identifier_length;
1378+
return (bolos_err_t) SVC_Call(SYSCALL_os_perso_get_master_key_identifier_ID, parameters);
1379+
}
1380+
13731381
#if defined(HAVE_LEDGER_PKI)
13741382
bolos_err_t os_pki_load_certificate(uint8_t expected_key_usage,
13751383
uint8_t *certificate,

0 commit comments

Comments
 (0)