mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 09:28:05 +00:00
Upgrade to mbedtls v3.3.0
This commit is contained in:
parent
9be176e523
commit
7b62ca5327
1 changed files with 1 additions and 9 deletions
|
|
@ -382,7 +382,6 @@ int cmd_cipher_sym() {
|
|||
params =
|
||||
{ .p = enc, .len = enc_len, .tag = (MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE) };
|
||||
mbedtls_md_type_t md_type = MBEDTLS_MD_SHA1;
|
||||
mbedtls_md_context_t md_ctx;
|
||||
|
||||
int r = pkcs5_parse_pbkdf2_params(¶ms, &salt, &iterations, &keylen, &md_type);
|
||||
if (r != 0) {
|
||||
|
|
@ -390,13 +389,7 @@ int cmd_cipher_sym() {
|
|||
return SW_WRONG_DATA();
|
||||
}
|
||||
|
||||
mbedtls_md_init(&md_ctx);
|
||||
if (mbedtls_md_setup(&md_ctx, mbedtls_md_info_from_type(md_type), 1) != 0) {
|
||||
mbedtls_md_free(&md_ctx);
|
||||
mbedtls_platform_zeroize(kdata, sizeof(kdata));
|
||||
return SW_WRONG_DATA();
|
||||
}
|
||||
r = mbedtls_pkcs5_pbkdf2_hmac(&md_ctx,
|
||||
r = mbedtls_pkcs5_pbkdf2_hmac_ext(md_type,
|
||||
kdata,
|
||||
key_size,
|
||||
salt.p,
|
||||
|
|
@ -406,7 +399,6 @@ int cmd_cipher_sym() {
|
|||
apdu.ne < 65536 ? apdu.ne : 32),
|
||||
res_APDU);
|
||||
mbedtls_platform_zeroize(kdata, sizeof(kdata));
|
||||
mbedtls_md_free(&md_ctx);
|
||||
if (r != 0) {
|
||||
return SW_EXEC_ERROR();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue