mirror of https://github.com/ARMmbed/mbed-os.git
[M487] Check divisor is not zero in MODOP_DIV operation in ECP alter.
parent
17280372a7
commit
c9cc357734
|
@ -719,6 +719,11 @@ int mbedtls_internal_run_modop(mbedtls_mpi *r,
|
|||
return MBEDTLS_ERR_ECP_BAD_INPUT_DATA;
|
||||
}
|
||||
|
||||
/* Check divisor is not zero in MODOP_DIV operation */
|
||||
if (modop == MODOP_DIV && mbedtls_mpi_cmp_int(o2, 0) == 0) {
|
||||
return MBEDTLS_ERR_ECP_BAD_INPUT_DATA;
|
||||
}
|
||||
|
||||
int ret;
|
||||
bool ecc_done;
|
||||
|
||||
|
|
Loading…
Reference in New Issue