Merge pull request #2445 from JacobBarthelmeh/SanityChecks

sanity check on resulting ecc size
This commit is contained in:
toddouska
2019-10-11 10:53:20 -07:00
committed by GitHub

View File

@ -3592,7 +3592,7 @@ static int wc_ecc_shared_secret_gen_sync(ecc_key* private_key, ecc_point* point,
private_key->heap);
if (err == MP_OKAY) {
x = mp_unsigned_bin_size(curve->prime);
if (*outlen < x) {
if (*outlen < x || (int)x < mp_unsigned_bin_size(result->x)) {
err = BUFFER_E;
}
}