Skip to content

Commit 35d1830

Browse files
Merge pull request #814 from LedgerHQ/abo_CERT_module
CERT: Refactoring of custom CA elements
2 parents 870e1a9 + 9a0ce16 commit 35d1830

File tree

3 files changed

+7
-36
lines changed

3 files changed

+7
-36
lines changed

include/os_customca.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

include/syscalls.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,12 @@
201201
#define SYSCALL_os_dashboard_mbx_ID 0x02000150
202202

203203
#ifdef HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS
204-
#define SYSCALL_os_bolos_custom_ca_get_info_ID 0x01000CA0
205-
#define SYSCALL_os_bolos_custom_ca_revoke_ID 0x00000CA1
204+
#define SYSCALL_CERT_get_ID 0x01000CA0
205+
#define SYSCALL_CERT_erase_ID 0x00000CA1
206206
#endif // HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS
207207

208208
#define SYSCALL_os_bolos_endorsement_revoke_ID 0x010001ED
209209

210-
#ifdef HAVE_BOLOS_CUSTOMCA
211-
#define SYSCALL_os_customca_verify_ID 0x03000090
212-
#endif // HAVE_BOLOS_CUSTOMCA
213-
214210
#ifdef HAVE_AEM_PIN
215211
#define SYSCALL_os_aem_set_pin_ID 0x02000139
216212
#define SYSCALL_os_aem_unset_pin_ID 0x0000013a

src/syscalls.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,17 +1730,6 @@ void os_registry_delete_all_apps(void)
17301730
return;
17311731
}
17321732

1733-
#ifdef HAVE_BOLOS_CUSTOMCA
1734-
unsigned int os_customca_verify(unsigned char *hash, unsigned char *sign, unsigned int sign_length)
1735-
{
1736-
unsigned int parameters[3];
1737-
parameters[0] = (unsigned int) hash;
1738-
parameters[1] = (unsigned int) sign;
1739-
parameters[2] = (unsigned int) sign_length;
1740-
return (unsigned int) SVC_Call(SYSCALL_os_customca_verify_ID, parameters);
1741-
}
1742-
#endif // HAVE_BOLOS_CUSTOMCA
1743-
17441733
void os_sched_exec(unsigned int app_idx)
17451734
{
17461735
unsigned int parameters[2];
@@ -1921,19 +1910,20 @@ unsigned int os_deny_protected_flash(void)
19211910
}
19221911

19231912
#ifdef HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS
1924-
bolos_bool_t os_bolos_custom_ca_get_info(customca_data_t *custom_ca)
1913+
1914+
bolos_bool_t CERT_get(CERT_info_t *custom_ca)
19251915
{
19261916
unsigned int parameters[2];
19271917
parameters[0] = (unsigned int) custom_ca;
1928-
bolos_bool_t ret = (bolos_bool_t) SVC_Call(SYSCALL_os_bolos_custom_ca_get_info_ID, parameters);
1918+
bolos_bool_t ret = (bolos_bool_t) SVC_Call(SYSCALL_CERT_get_ID, parameters);
19291919
return ret;
19301920
}
19311921

1932-
void os_bolos_custom_ca_revoke(void)
1922+
void CERT_erase(void)
19331923
{
19341924
unsigned int parameters[1];
19351925
parameters[0] = 0;
1936-
SVC_Call(SYSCALL_os_bolos_custom_ca_revoke_ID, parameters);
1926+
SVC_Call(SYSCALL_CERT_erase_ID, parameters);
19371927
return;
19381928
}
19391929
#endif // HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS

0 commit comments

Comments
 (0)