diff options
author | Yi Li <yi1.li@intel.com> | 2023-05-05 11:30:05 +0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-05-12 10:32:06 +0200 |
commit | 91070877adb905f51eb4b19b730d42fc257bae13 (patch) | |
tree | 2c05344c445d57646e4bf03d790c5674deaa88ac /providers | |
parent | 9a271795f84eb5402ce1ecfbcfd21392ad1560d0 (diff) | |
download | openssl-new-91070877adb905f51eb4b19b730d42fc257bae13.tar.gz |
provider: return error if buf too small when getting ec pubkey param
Fixes #20889
There was an incorrect value passed to EC_POINT_point2oct() for the
buffer size of the param passed-in.
Added testcases.
Signed-off-by: Yi Li <yi1.li@intel.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20890)
Diffstat (limited to 'providers')
-rw-r--r-- | providers/implementations/keymgmt/ec_kmgmt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c index e79a50df42..d9c585cd3b 100644 --- a/providers/implementations/keymgmt/ec_kmgmt.c +++ b/providers/implementations/keymgmt/ec_kmgmt.c @@ -745,7 +745,7 @@ int common_get_params(void *key, OSSL_PARAM params[], int sm2) } p->return_size = EC_POINT_point2oct(ecg, ecp, POINT_CONVERSION_UNCOMPRESSED, - p->data, p->return_size, bnctx); + p->data, p->data_size, bnctx); if (p->return_size == 0) goto err; } |