{
int ok = 0;
BN_CTX *ctx = NULL;
- BIGNUM *priv_key = NULL, *order = NULL;
+ BIGNUM *priv_key = NULL;
+ const BIGNUM *order = NULL;
EC_POINT *pub_key = NULL;
- if ((order = BN_new()) == NULL)
- goto err;
if ((ctx = BN_CTX_new()) == NULL)
goto err;
} else
priv_key = eckey->priv_key;
- if (!EC_GROUP_get_order(eckey->group, order, ctx))
+ order = EC_GROUP_get0_order(eckey->group);
+ if (order == NULL)
goto err;
do
ok = 1;
err:
- BN_free(order);
if (eckey->pub_key == NULL)
EC_POINT_free(pub_key);
if (eckey->priv_key != priv_key)