From ff41d4a1a0047b7ca45864e52827d01de7a395c5 Mon Sep 17 00:00:00 2001 From: tb <> Date: Tue, 26 Aug 2025 16:18:15 +0000 Subject: ec_asn1_test: d'oh. actually ensure all builtin curves are of prime order --- src/regress/lib/libcrypto/ec/ec_asn1_test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/regress/lib/libcrypto/ec/ec_asn1_test.c b/src/regress/lib/libcrypto/ec/ec_asn1_test.c index 0215cd7ec2..c59325a0f7 100644 --- a/src/regress/lib/libcrypto/ec/ec_asn1_test.c +++ b/src/regress/lib/libcrypto/ec/ec_asn1_test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_asn1_test.c,v 1.37 2025/08/26 15:56:46 tb Exp $ */ +/* $OpenBSD: ec_asn1_test.c,v 1.38 2025/08/26 16:18:15 tb Exp $ */ /* * Copyright (c) 2017, 2021 Joel Sing * Copyright (c) 2024, 2025 Theo Buehler @@ -1034,7 +1034,7 @@ static int ec_group_check_prime_order(EC_builtin_curve *curve, BN_CTX *ctx) { EC_GROUP *group; - BIGNUM *p; + BIGNUM *order; int rv; int failed = 0; @@ -1043,13 +1043,13 @@ ec_group_check_prime_order(EC_builtin_curve *curve, BN_CTX *ctx) BN_CTX_start(ctx); - if ((p = BN_CTX_get(ctx)) == NULL) - errx(1, "p = BN_CTX_get()"); + if ((order = BN_CTX_get(ctx)) == NULL) + errx(1, "order = BN_CTX_get()"); - if (!EC_GROUP_get_curve(group, p, NULL, NULL, ctx)) + if (!EC_GROUP_get_order(group, order, ctx)) errx(1, "EC_GROUP_get_curve"); - if ((rv = BN_is_prime_ex(p, 0, ctx, NULL)) != 1) { + if ((rv = BN_is_prime_ex(order, 0, ctx, NULL)) != 1) { fprintf(stderr, "%s: nid %d: BN_is_prime_ex() returned %d, want 1\n", __func__, curve->nid, rv); failed = 1; -- cgit v1.2.3-55-g6feb