mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 09:28:05 +00:00
Fix crash in mbedtls 3.6
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
237e687c3b
commit
dc979194fa
1 changed files with 3 additions and 2 deletions
|
|
@ -513,9 +513,10 @@ int store_keys(void *key_ctx, int type, uint8_t key_id) {
|
|||
}
|
||||
else if (type & PICO_KEYS_KEY_EC) {
|
||||
mbedtls_ecdsa_context *ecdsa = (mbedtls_ecdsa_context *) key_ctx;
|
||||
size_t olen = 0;
|
||||
kdata[0] = ecdsa->grp.id & 0xff;
|
||||
mbedtls_ecp_write_key_ext(ecdsa, (size_t *)&key_size, kdata + 1, sizeof(kdata) - 1);
|
||||
key_size++;
|
||||
mbedtls_ecp_write_key_ext(ecdsa, &olen, kdata + 1, sizeof(kdata) - 1);
|
||||
key_size = olen + 1;
|
||||
}
|
||||
else if (type & PICO_KEYS_KEY_AES) {
|
||||
if (type == PICO_KEYS_KEY_AES_128) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue