diff options
| author | tb <> | 2025-03-08 20:09:35 +0000 | 
|---|---|---|
| committer | tb <> | 2025-03-08 20:09:35 +0000 | 
| commit | 67cdfdb4f1b329b365b11b76151fa6774bc44b8f (patch) | |
| tree | ec2975cc43acc4967580fa59ba675dfc4df8189c /src/regress/lib | |
| parent | 9def5ea03c06af476f3a1addd0012e3b499f2c8a (diff) | |
| download | openbsd-67cdfdb4f1b329b365b11b76151fa6774bc44b8f.tar.gz openbsd-67cdfdb4f1b329b365b11b76151fa6774bc44b8f.tar.bz2 openbsd-67cdfdb4f1b329b365b11b76151fa6774bc44b8f.zip | |
ec_asn1_test: Prepare for upcoming bump
Linking statically, pull in ec_local.h and provide a prototype for
EC_GROUP_new(), which will be removed from the public API.
Diffstat (limited to 'src/regress/lib')
| -rw-r--r-- | src/regress/lib/libcrypto/ec/Makefile | 7 | ||||
| -rw-r--r-- | src/regress/lib/libcrypto/ec/ec_asn1_test.c | 12 | 
2 files changed, 11 insertions, 8 deletions
| diff --git a/src/regress/lib/libcrypto/ec/Makefile b/src/regress/lib/libcrypto/ec/Makefile index 59311ef79d..b21eacb4bc 100644 --- a/src/regress/lib/libcrypto/ec/Makefile +++ b/src/regress/lib/libcrypto/ec/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.10 2025/01/21 16:47:52 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.11 2025/03/08 20:09:35 tb Exp $ | 
| 2 | 2 | ||
| 3 | .ifdef EOPENSSL33 | 3 | .ifdef EOPENSSL33 | 
| 4 | LDADD += -Wl,-rpath,/usr/local/lib/eopenssl33 -L/usr/local/lib/eopenssl33 | 4 | LDADD += -Wl,-rpath,/usr/local/lib/eopenssl33 -L/usr/local/lib/eopenssl33 | 
| @@ -10,6 +10,11 @@ PROGS += ectest | |||
| 10 | PROGS += ec_asn1_test | 10 | PROGS += ec_asn1_test | 
| 11 | PROGS += ec_point_conversion | 11 | PROGS += ec_point_conversion | 
| 12 | 12 | ||
| 13 | LDADD_ec_asn1_test += ${CRYPTO_INT} | ||
| 14 | |||
| 15 | CFLAGS += -I${.CURDIR}/../../../../lib/libcrypto/bn | ||
| 16 | CFLAGS += -I${.CURDIR}/../../../../lib/libcrypto/ec | ||
| 17 | |||
| 13 | LDADD = -lcrypto | 18 | LDADD = -lcrypto | 
| 14 | DPADD = ${LIBCRYPTO} | 19 | DPADD = ${LIBCRYPTO} | 
| 15 | WARNINGS = Yes | 20 | WARNINGS = Yes | 
| diff --git a/src/regress/lib/libcrypto/ec/ec_asn1_test.c b/src/regress/lib/libcrypto/ec/ec_asn1_test.c index 558179277a..03358e69ca 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.31 2024/12/24 18:32:31 tb Exp $ */ | 1 | /* $OpenBSD: ec_asn1_test.c,v 1.32 2025/03/08 20:09:35 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 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2024 Theo Buehler <tb@openbsd.org> | 
| @@ -24,6 +24,10 @@ | |||
| 24 | #include <openssl/err.h> | 24 | #include <openssl/err.h> | 
| 25 | #include <openssl/objects.h> | 25 | #include <openssl/objects.h> | 
| 26 | 26 | ||
| 27 | #include "ec_local.h" | ||
| 28 | |||
| 29 | EC_GROUP *EC_GROUP_new(const EC_METHOD *); | ||
| 30 | |||
| 27 | /* set to 0 if/when we are going to enforce 0 <= a,b < p. */ | 31 | /* set to 0 if/when we are going to enforce 0 <= a,b < p. */ | 
| 28 | #define NEGATIVE_CURVE_COEFFICIENTS_ALLOWED 1 | 32 | #define NEGATIVE_CURVE_COEFFICIENTS_ALLOWED 1 | 
| 29 | 33 | ||
| @@ -328,12 +332,6 @@ ec_group_roundtrip_curve(const EC_GROUP *group, const char *descr, int nid) | |||
| 328 | goto err; | 332 | goto err; | 
| 329 | } | 333 | } | 
| 330 | 334 | ||
| 331 | if (EC_GROUP_method_of(group) == EC_GFp_mont_method()) { | ||
| 332 | if (EC_GROUP_cmp(group, new_group, NULL) != 0) { | ||
| 333 | fprintf(stderr, "FAIL: %s %d groups mismatch\n", descr, nid); | ||
| 334 | goto err; | ||
| 335 | } | ||
| 336 | } | ||
| 337 | if (EC_GROUP_get_asn1_flag(group) != EC_GROUP_get_asn1_flag(new_group)) { | 335 | if (EC_GROUP_get_asn1_flag(group) != EC_GROUP_get_asn1_flag(new_group)) { | 
| 338 | fprintf(stderr, "FAIL: %s %d asn1_flag %x != %x\n", descr, nid, | 336 | fprintf(stderr, "FAIL: %s %d asn1_flag %x != %x\n", descr, nid, | 
| 339 | EC_GROUP_get_asn1_flag(group), | 337 | EC_GROUP_get_asn1_flag(group), | 
