Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CERT: Refactoring of custom CA elements #814

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions include/os_customca.h

This file was deleted.

8 changes: 2 additions & 6 deletions include/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,12 @@
#define SYSCALL_os_dashboard_mbx_ID 0x02000150

#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
#define SYSCALL_CERT_get_ID 0x01000CA0
#define SYSCALL_CERT_erase_ID 0x00000CA1
#endif // HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS

#define SYSCALL_os_bolos_endorsement_revoke_ID 0x010001ED

#ifdef HAVE_BOLOS_CUSTOMCA
#define SYSCALL_os_customca_verify_ID 0x03000090
#endif // HAVE_BOLOS_CUSTOMCA

#ifdef HAVE_AEM_PIN
#define SYSCALL_os_aem_set_pin_ID 0x02000139
#define SYSCALL_os_aem_unset_pin_ID 0x0000013a
Expand Down
20 changes: 5 additions & 15 deletions src/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1730,17 +1730,6 @@ void os_registry_delete_all_apps(void)
return;
}

#ifdef HAVE_BOLOS_CUSTOMCA
unsigned int os_customca_verify(unsigned char *hash, unsigned char *sign, unsigned int sign_length)
{
unsigned int parameters[3];
parameters[0] = (unsigned int) hash;
parameters[1] = (unsigned int) sign;
parameters[2] = (unsigned int) sign_length;
return (unsigned int) SVC_Call(SYSCALL_os_customca_verify_ID, parameters);
}
#endif // HAVE_BOLOS_CUSTOMCA

void os_sched_exec(unsigned int app_idx)
{
unsigned int parameters[2];
Expand Down Expand Up @@ -1921,19 +1910,20 @@ unsigned int os_deny_protected_flash(void)
}

#ifdef HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS
bolos_bool_t os_bolos_custom_ca_get_info(customca_data_t *custom_ca)

bolos_bool_t CERT_get(CERT_info_t *custom_ca)
{
unsigned int parameters[2];
parameters[0] = (unsigned int) custom_ca;
bolos_bool_t ret = (bolos_bool_t) SVC_Call(SYSCALL_os_bolos_custom_ca_get_info_ID, parameters);
bolos_bool_t ret = (bolos_bool_t) SVC_Call(SYSCALL_CERT_get_ID, parameters);
return ret;
}

void os_bolos_custom_ca_revoke(void)
void CERT_erase(void)
{
unsigned int parameters[1];
parameters[0] = 0;
SVC_Call(SYSCALL_os_bolos_custom_ca_revoke_ID, parameters);
SVC_Call(SYSCALL_CERT_erase_ID, parameters);
return;
}
#endif // HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS
Expand Down
Loading