mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(mbedtls/port): Check signature hash length before using ECDSA hardware
This commit is contained in:
parent
a693c960d6
commit
f648fca1b9
@ -438,7 +438,7 @@ int __wrap_mbedtls_ecdsa_verify(mbedtls_ecp_group *grp,
|
|||||||
const mbedtls_mpi *r,
|
const mbedtls_mpi *r,
|
||||||
const mbedtls_mpi *s)
|
const mbedtls_mpi *s)
|
||||||
{
|
{
|
||||||
if (grp->id == MBEDTLS_ECP_DP_SECP192R1 || grp->id == MBEDTLS_ECP_DP_SECP256R1) {
|
if ((grp->id == MBEDTLS_ECP_DP_SECP192R1 || grp->id == MBEDTLS_ECP_DP_SECP256R1) && blen == ECDSA_SHA_LEN) {
|
||||||
return esp_ecdsa_verify(grp, buf, blen, Q, r, s);
|
return esp_ecdsa_verify(grp, buf, blen, Q, r, s);
|
||||||
} else {
|
} else {
|
||||||
return __real_mbedtls_ecdsa_verify(grp, buf, blen, Q, r, s);
|
return __real_mbedtls_ecdsa_verify(grp, buf, blen, Q, r, s);
|
||||||
|
Loading…
Reference in New Issue
Block a user