summaryrefslogtreecommitdiffstats
path: root/providers/implementations/encode_decode
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-11-02 12:46:38 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-12-07 17:15:39 +1000
commitc1131e6a0e4a9a9734559f7a58b278c027d76711 (patch)
treec92144dd2d3011967640830a8c9e643ec87a0afe /providers/implementations/encode_decode
parentabdd3fa04f3401c4a542257fdd803ff4c4daf8ef (diff)
Deprecate EC_POINT_bn2point and EC_POINT_point2bn.
Fixes #10366 The one place that actually used was in the legacy printing of ecparams. This has been replaced by the pointtobuf variant. The ecparam app was using one of these functions - this line has just been removed as another PR will remove all the code generated lines.. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13294)
Diffstat (limited to 'providers/implementations/encode_decode')
-rw-r--r--providers/implementations/encode_decode/encode_key2text.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/providers/implementations/encode_decode/encode_key2text.c b/providers/implementations/encode_decode/encode_key2text.c
index 4d33d869ed..2ac5046bf3 100644
--- a/providers/implementations/encode_decode/encode_key2text.c
+++ b/providers/implementations/encode_decode/encode_key2text.c
@@ -378,18 +378,17 @@ static int ec_param_explicit_curve_to_text(BIO *out, const EC_GROUP *group,
static int ec_param_explicit_gen_to_text(BIO *out, const EC_GROUP *group,
BN_CTX *ctx)
{
+ int ret;
+ size_t buflen;
+ point_conversion_form_t form;
const EC_POINT *point = NULL;
- BIGNUM *gen = NULL;
const char *glabel = NULL;
- point_conversion_form_t form;
+ unsigned char *buf = NULL;
form = EC_GROUP_get_point_conversion_form(group);
point = EC_GROUP_get0_generator(group);
- gen = BN_CTX_get(ctx);
- if (gen == NULL
- || point == NULL
- || EC_POINT_point2bn(group, point, form, gen, ctx) == NULL)
+ if (point == NULL)
return 0;
switch (form) {
@@ -405,7 +404,14 @@ static int ec_param_explicit_gen_to_text(BIO *out, const EC_GROUP *group,
default:
return 0;
}
- return print_labeled_bignum(out, glabel, gen);
+
+ buflen = EC_POINT_point2buf(group, point, form, &buf, ctx);
+ if (buflen == 0)
+ return 0;
+
+ ret = print_labeled_buf(out, glabel, buf, buflen);
+ OPENSSL_clear_free(buf, buflen);
+ return ret;
}
/* Print explicit parameters */