Fixed buffer overflow, and also NULL pointer dereference, in ECDSA signature handling.

This commit is contained in:
Thomas Pornin 2016-11-21 20:11:21 +01:00
parent ccd43452e6
commit e8ccee8bcd
5 changed files with 80 additions and 3 deletions

View file

@ -47,6 +47,13 @@ br_ecdsa_i31_vrfy_raw(const br_ec_impl *impl,
size_t nlen, rlen, ulen;
uint32_t n0i, res;
/*
* If the curve is not supported, then report an error.
*/
if (((impl->supported_curves >> pk->curve) & 1) == 0) {
return 0;
}
/*
* Get the curve parameters (generator and order).
*/