summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-07-03 09:37:31 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-07-03 09:37:31 +0000
commit6e337358e477f85b882d4fdd3ebffea1a108ce7a (patch)
tree3447c74d15a8d82c0cd3e4ea77cfd637d408d2b0 /lib
parentc6e3c12d92daf8c6f76ae9e4a0fff9eb42ffa28a (diff)
Explicit parameter printing can also use get0_order()
ok beck jsing
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/ec/eck_prn.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libcrypto/ec/eck_prn.c b/lib/libcrypto/ec/eck_prn.c
index 25965ed962f..4b53ab3f668 100644
--- a/lib/libcrypto/ec/eck_prn.c
+++ b/lib/libcrypto/ec/eck_prn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eck_prn.c,v 1.25 2023/07/02 14:54:37 tb Exp $ */
+/* $OpenBSD: eck_prn.c,v 1.26 2023/07/03 09:37:30 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
@@ -69,6 +69,8 @@
#include <openssl/err.h>
#include <openssl/evp.h>
+#include "ec_local.h"
+
int
ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off)
{
@@ -200,7 +202,8 @@ static int
ecpk_print_explicit_parameters(BIO *bp, const EC_GROUP *group, int off)
{
BN_CTX *ctx = NULL;
- BIGNUM *p, *a, *b, *order, *cofactor;
+ const BIGNUM *order;
+ BIGNUM *p, *a, *b, *cofactor;
BIGNUM *gen = NULL;
const EC_POINT *generator;
const char *conversion_form;
@@ -226,8 +229,6 @@ ecpk_print_explicit_parameters(BIO *bp, const EC_GROUP *group, int off)
goto err;
if ((b = BN_CTX_get(ctx)) == NULL)
goto err;
- if ((order = BN_CTX_get(ctx)) == NULL)
- goto err;
if ((cofactor = BN_CTX_get(ctx)) == NULL)
goto err;
if ((gen = BN_CTX_get(ctx)) == NULL)
@@ -237,7 +238,7 @@ ecpk_print_explicit_parameters(BIO *bp, const EC_GROUP *group, int off)
ECerror(ERR_R_EC_LIB);
goto err;
}
- if (!EC_GROUP_get_order(group, order, NULL)) {
+ if ((order = EC_GROUP_get0_order(group)) == NULL) {
ECerror(ERR_R_EC_LIB);
goto err;
}