Skip to content

Commit

Permalink
Rename HAVE_CUSTOM_CA_SETTINGS to HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS
Browse files Browse the repository at this point in the history
Add HAVE_ENDORSEMENT_DETAILS_IN_SETTINGS compil flag
  • Loading branch information
PhilippeBonnaz committed Jul 6, 2023
1 parent 6eab565 commit a8e4e62
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions include/os_endorsement.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ SYSCALL unsigned int os_endorsement_key1_get_app_secret(unsigned char* buffer PL
SYSCALL unsigned int os_endorsement_key1_sign_data(unsigned char* src PLENGTH(srcLength), unsigned int srcLength, unsigned char* signature PLENGTH(ENDORSEMENT_MAX_ASN1_LENGTH));
SYSCALL unsigned int os_endorsement_key2_derive_sign_data(unsigned char* src PLENGTH(srcLength), unsigned int srcLength, unsigned char* signature PLENGTH(ENDORSEMENT_MAX_ASN1_LENGTH));

#if (defined(HAVE_BOLOS_NOTWIPED_ENDORSEMENT) && defined(HAVE_ENDORSEMENTS_DISPLAY))
#ifdef HAVE_ENDORSEMENT_DETAILS_IN_SETTINGS
SYSCALL unsigned int os_endorsement_get_metadata(unsigned char index, unsigned char* buffer PLENGTH(8));
#endif // (defined(HAVE_BOLOS_NOTWIPED_ENDORSEMENT) && defined(HAVE_ENDORSEMENTS_DISPLAY))
#endif // HAVE_ENDORSEMENT_DETAILS_IN_SETTINGS
11 changes: 7 additions & 4 deletions include/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,14 @@
#define SYSCALL_os_allow_protected_ram_ID 0x00000092
#define SYSCALL_os_deny_protected_ram_ID 0x00000093

#ifdef HAVE_CUSTOM_CA_SETTINGS
#ifdef HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS
#define SYSCALL_os_bolos_custom_ca_get_info_ID 0x01000CA0
#define SYSCALL_os_bolos_custom_ca_revoke_ID 0x00000CA1
#endif // HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS

#ifdef HAVE_ENDORSEMENT_DETAILS_IN_SETTINGS
#define SYSCALL_os_bolos_endorsement_revoke_ID 0x010001ED
#endif // HAVE_CUSTOM_CA_SETTINGS
#endif

#ifndef HAVE_BOLOS_NO_CUSTOMCA
#define SYSCALL_os_customca_verify_ID 0x03000090
Expand All @@ -222,9 +225,9 @@
#define SYSCALL_os_aem_is_pin_validated_ID 0x00000147
#endif // HAVE_AEM_PIN

#if (defined(HAVE_BOLOS_NOTWIPED_ENDORSEMENT) && defined(HAVE_ENDORSEMENTS_DISPLAY))
#ifdef HAVE_ENDORSEMENT_DETAILS_IN_SETTINGS
#define SYSCALL_os_endorsement_get_metadata_ID 0x02000138
#endif // (defined(HAVE_BOLOS_NOTWIPED_ENDORSEMENT) && defined(HAVE_ENDORSEMENTS_DISPLAY))
#endif // HAVE_ENDORSEMENT_DETAILS_IN_SETTINGS

#if defined(HAVE_VAULT_RECOVERY_ALGO)
#define SYSCALL_os_perso_derive_and_prepare_seed_ID 0x02000137
Expand Down
10 changes: 6 additions & 4 deletions src/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@ unsigned int os_deny_protected_flash( void ) {
return (unsigned int) SVC_Call(SYSCALL_os_deny_protected_flash_ID, parameters);
}

#ifdef HAVE_CUSTOM_CA_SETTINGS
#ifdef HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS
bolos_bool_t os_bolos_custom_ca_get_info(customca_data_t *custom_ca) {
unsigned int parameters[2];
parameters[0] = (unsigned int) custom_ca;
Expand All @@ -1570,14 +1570,16 @@ void os_bolos_custom_ca_revoke(void) {
SVC_Call(SYSCALL_os_bolos_custom_ca_revoke_ID, parameters);
return;
}
#endif //HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS

#ifdef HAVE_ENDORSEMENT_DETAILS_IN_SETTINGS
bolos_bool_t os_bolos_endorsement_revoke(uint8_t slot) {
unsigned int parameters[1];
parameters[0] = (unsigned int) slot;
bolos_bool_t ret = SVC_Call(SYSCALL_os_bolos_endorsement_revoke_ID, parameters);
return ret;
}
#endif //HAVE_CUSTOM_CA_SETTINGS
#endif

#ifdef HAVE_MCU_SERIAL_STORAGE
unsigned int os_seph_serial ( unsigned char * serial, unsigned int maxlength ) {
Expand Down Expand Up @@ -1778,14 +1780,14 @@ bolos_bool_t os_aem_is_pin_validated ( void ) {
}
#endif // HAVE_AEM_PIN

#if (defined(HAVE_BOLOS_NOTWIPED_ENDORSEMENT) && defined(HAVE_ENDORSEMENTS_DISPLAY))
#ifdef HAVE_ENDORSEMENT_DETAILS_IN_SETTINGS
unsigned int os_endorsement_get_metadata ( unsigned char index, unsigned char * buffer ) {
unsigned int parameters[2];
parameters[0] = (unsigned int)index;
parameters[1] = (unsigned int)buffer;
return (unsigned int) SVC_Call(SYSCALL_os_endorsement_get_metadata_ID, parameters);
}
#endif // (defined(HAVE_BOLOS_NOTWIPED_ENDORSEMENT) && defined(HAVE_ENDORSEMENTS_DISPLAY))
#endif // HAVE_ENDORSEMENT_DETAILS_IN_SETTINGS

#if defined(HAVE_LANGUAGE_PACK)
void list_language_packs(UX_LOC_LANGUAGE_PACK_INFO *packs) {
Expand Down

0 comments on commit a8e4e62

Please sign in to comment.