Skip to content

Commit cc891a3

Browse files
committed
Update otp_crypto.c
1 parent 4e4cb98 commit cc891a3

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
@@ -1717,7 +1717,11 @@ static term nif_crypto_sign(Context *ctx, int argc, term argv[])
17171717

17181718
size_t sig_raw_size = PSA_ECDSA_SIGNATURE_SIZE(psa_key_bits);
17191719
uint8_t *sig_raw = NULL;
1720+
#if MBEDTLS_VERSION_NUMBER >= 0x04000000
1721+
size_t sig_der_size = MBEDTLS_ECDSA_DER_MAX_SIG_LEN(psa_key_bits);
1722+
#else
17201723
size_t sig_der_size = MBEDTLS_ECDSA_MAX_SIG_LEN(psa_key_bits);
1724+
#endif
17211725
void *sig_der = NULL;
17221726
void *maybe_allocated_data = NULL;
17231727

0 commit comments

Comments
 (0)