summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2025-01-25 10:30:17 +0000
committertb <>2025-01-25 10:30:17 +0000
commit8667179224a6615ccfac232abd0df8d102fe93ee (patch)
tree92f52cc931dafb73b54b0f33fcc857aafeb8b5ad /src
parent8d5d61753b8836b73d881e913adbe5e305e7e132 (diff)
downloadopenbsd-8667179224a6615ccfac232abd0df8d102fe93ee.tar.gz
openbsd-8667179224a6615ccfac232abd0df8d102fe93ee.tar.bz2
openbsd-8667179224a6615ccfac232abd0df8d102fe93ee.zip
Simplify ecpk_print_explicit_parameters()
At this point the NID is always NID_X9_62_prime_field, so we can use SN_X9_62_prime_field directly rather than getting the field type from the method and then converting the nid to an sn with OBJ_nid2sn(). ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ec/eck_prn.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ec/eck_prn.c b/src/lib/libcrypto/ec/eck_prn.c
index 98e1a7e7bd..c40a64966a 100644
--- a/src/lib/libcrypto/ec/eck_prn.c
+++ b/src/lib/libcrypto/ec/eck_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eck_prn.c,v 1.40 2024/11/25 06:51:39 tb Exp $ */ 1/* $OpenBSD: eck_prn.c,v 1.41 2025/01/25 10:30:17 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -208,7 +208,6 @@ ecpk_print_explicit_parameters(BIO *bio, const EC_GROUP *group, int off)
208 const unsigned char *seed; 208 const unsigned char *seed;
209 size_t seed_len; 209 size_t seed_len;
210 point_conversion_form_t form; 210 point_conversion_form_t form;
211 int nid;
212 int ret = 0; 211 int ret = 0;
213 212
214 if ((ctx = BN_CTX_new()) == NULL) { 213 if ((ctx = BN_CTX_new()) == NULL) {
@@ -256,8 +255,7 @@ ecpk_print_explicit_parameters(BIO *bio, const EC_GROUP *group, int off)
256 if (!BIO_indent(bio, off, 128)) 255 if (!BIO_indent(bio, off, 128))
257 goto err; 256 goto err;
258 257
259 nid = ec_group_get_field_type(group); 258 if (BIO_printf(bio, "Field Type: %s\n", SN_X9_62_prime_field) <= 0)
260 if (BIO_printf(bio, "Field Type: %s\n", OBJ_nid2sn(nid)) <= 0)
261 goto err; 259 goto err;
262 260
263 if (!bn_printf(bio, p, off, "Prime:")) 261 if (!bn_printf(bio, p, off, "Prime:"))