Skip to content

Commit 94c6a0c

Browse files
committed
Update otp_crypto.c
1 parent 31aee4a commit 94c6a0c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/libAtomVM/otp_crypto.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,11 @@ static term nif_crypto_sign(Context *ctx, int argc, term argv[])
14541454

14551455
size_t sig_raw_size = PSA_ECDSA_SIGNATURE_SIZE(psa_key_bits);
14561456
uint8_t *sig_raw = NULL;
1457+
#if MBEDTLS_VERSION_NUMBER >= 0x04000000
1458+
size_t sig_der_size = MBEDTLS_ECDSA_DER_MAX_SIG_LEN(psa_key_bits);
1459+
#else
14571460
size_t sig_der_size = MBEDTLS_ECDSA_MAX_SIG_LEN(psa_key_bits);
1461+
#endif
14581462
void *sig_der = NULL;
14591463
void *maybe_allocated_data = NULL;
14601464

0 commit comments

Comments
 (0)