summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2025-08-26 16:18:15 +0000
committertb <>2025-08-26 16:18:15 +0000
commitff41d4a1a0047b7ca45864e52827d01de7a395c5 (patch)
tree869378e2df4c1d7940fc0ec297cda605aae60245 /src
parent522fa16a30ad59d315ce462ec496b4b5a9e05115 (diff)
downloadopenbsd-ff41d4a1a0047b7ca45864e52827d01de7a395c5.tar.gz
openbsd-ff41d4a1a0047b7ca45864e52827d01de7a395c5.tar.bz2
openbsd-ff41d4a1a0047b7ca45864e52827d01de7a395c5.zip
ec_asn1_test: d'oh. actually ensure all builtin curves are of prime order
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/ec/ec_asn1_test.c12
1 files 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 @@
1/* $OpenBSD: ec_asn1_test.c,v 1.37 2025/08/26 15:56:46 tb Exp $ */ 1/* $OpenBSD: ec_asn1_test.c,v 1.38 2025/08/26 16:18:15 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2017, 2021 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2017, 2021 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2024, 2025 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2024, 2025 Theo Buehler <tb@openbsd.org>
@@ -1034,7 +1034,7 @@ static int
1034ec_group_check_prime_order(EC_builtin_curve *curve, BN_CTX *ctx) 1034ec_group_check_prime_order(EC_builtin_curve *curve, BN_CTX *ctx)
1035{ 1035{
1036 EC_GROUP *group; 1036 EC_GROUP *group;
1037 BIGNUM *p; 1037 BIGNUM *order;
1038 int rv; 1038 int rv;
1039 int failed = 0; 1039 int failed = 0;
1040 1040
@@ -1043,13 +1043,13 @@ ec_group_check_prime_order(EC_builtin_curve *curve, BN_CTX *ctx)
1043 1043
1044 BN_CTX_start(ctx); 1044 BN_CTX_start(ctx);
1045 1045
1046 if ((p = BN_CTX_get(ctx)) == NULL) 1046 if ((order = BN_CTX_get(ctx)) == NULL)
1047 errx(1, "p = BN_CTX_get()"); 1047 errx(1, "order = BN_CTX_get()");
1048 1048
1049 if (!EC_GROUP_get_curve(group, p, NULL, NULL, ctx)) 1049 if (!EC_GROUP_get_order(group, order, ctx))
1050 errx(1, "EC_GROUP_get_curve"); 1050 errx(1, "EC_GROUP_get_curve");
1051 1051
1052 if ((rv = BN_is_prime_ex(p, 0, ctx, NULL)) != 1) { 1052 if ((rv = BN_is_prime_ex(order, 0, ctx, NULL)) != 1) {
1053 fprintf(stderr, "%s: nid %d: BN_is_prime_ex() returned %d, want 1\n", 1053 fprintf(stderr, "%s: nid %d: BN_is_prime_ex() returned %d, want 1\n",
1054 __func__, curve->nid, rv); 1054 __func__, curve->nid, rv);
1055 failed = 1; 1055 failed = 1;