summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-07-03 09:37:30 +0000
committertb <>2023-07-03 09:37:30 +0000
commit58ba5121ee4dbdd1a52e6e00ba1bbfb412fb8dee (patch)
treea6753b54a4f7e3e3c8959324966f6b3472948d7d
parent9f08e6cd150eca26dd5b43911f79cc495fb6d0cd (diff)
downloadopenbsd-58ba5121ee4dbdd1a52e6e00ba1bbfb412fb8dee.tar.gz
openbsd-58ba5121ee4dbdd1a52e6e00ba1bbfb412fb8dee.tar.bz2
openbsd-58ba5121ee4dbdd1a52e6e00ba1bbfb412fb8dee.zip
Explicit parameter printing can also use get0_order()
ok beck jsing
-rw-r--r--src/lib/libcrypto/ec/eck_prn.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/libcrypto/ec/eck_prn.c b/src/lib/libcrypto/ec/eck_prn.c
index 25965ed962..4b53ab3f66 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.25 2023/07/02 14:54:37 tb Exp $ */ 1/* $OpenBSD: eck_prn.c,v 1.26 2023/07/03 09:37:30 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -69,6 +69,8 @@
69#include <openssl/err.h> 69#include <openssl/err.h>
70#include <openssl/evp.h> 70#include <openssl/evp.h>
71 71
72#include "ec_local.h"
73
72int 74int
73ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off) 75ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off)
74{ 76{
@@ -200,7 +202,8 @@ static int
200ecpk_print_explicit_parameters(BIO *bp, const EC_GROUP *group, int off) 202ecpk_print_explicit_parameters(BIO *bp, const EC_GROUP *group, int off)
201{ 203{
202 BN_CTX *ctx = NULL; 204 BN_CTX *ctx = NULL;
203 BIGNUM *p, *a, *b, *order, *cofactor; 205 const BIGNUM *order;
206 BIGNUM *p, *a, *b, *cofactor;
204 BIGNUM *gen = NULL; 207 BIGNUM *gen = NULL;
205 const EC_POINT *generator; 208 const EC_POINT *generator;
206 const char *conversion_form; 209 const char *conversion_form;
@@ -226,8 +229,6 @@ ecpk_print_explicit_parameters(BIO *bp, const EC_GROUP *group, int off)
226 goto err; 229 goto err;
227 if ((b = BN_CTX_get(ctx)) == NULL) 230 if ((b = BN_CTX_get(ctx)) == NULL)
228 goto err; 231 goto err;
229 if ((order = BN_CTX_get(ctx)) == NULL)
230 goto err;
231 if ((cofactor = BN_CTX_get(ctx)) == NULL) 232 if ((cofactor = BN_CTX_get(ctx)) == NULL)
232 goto err; 233 goto err;
233 if ((gen = BN_CTX_get(ctx)) == NULL) 234 if ((gen = BN_CTX_get(ctx)) == NULL)
@@ -237,7 +238,7 @@ ecpk_print_explicit_parameters(BIO *bp, const EC_GROUP *group, int off)
237 ECerror(ERR_R_EC_LIB); 238 ECerror(ERR_R_EC_LIB);
238 goto err; 239 goto err;
239 } 240 }
240 if (!EC_GROUP_get_order(group, order, NULL)) { 241 if ((order = EC_GROUP_get0_order(group)) == NULL) {
241 ECerror(ERR_R_EC_LIB); 242 ECerror(ERR_R_EC_LIB);
242 goto err; 243 goto err;
243 } 244 }