mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Merge pull request #2445 from JacobBarthelmeh/SanityChecks
sanity check on resulting ecc size
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user