diff options
Diffstat (limited to 'providers')
-rw-r--r-- | providers/implementations/keymgmt/ec_kmgmt.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c index b23fab5fde..cecb8cef3e 100644 --- a/providers/implementations/keymgmt/ec_kmgmt.c +++ b/providers/implementations/keymgmt/ec_kmgmt.c @@ -158,10 +158,16 @@ int key_to_params(const EC_KEY *eckey, OSSL_PARAM_BLD *tmpl, goto err; } if (px != NULL || py != NULL) { - if (px != NULL) + if (px != NULL) { x = BN_CTX_get(bnctx); - if (py != NULL) + if (x == NULL) + goto err; + } + if (py != NULL) { y = BN_CTX_get(bnctx); + if (y == NULL) + goto err; + } if (!EC_POINT_get_affine_coordinates(ecg, pub_point, x, y, bnctx)) goto err; |