summaryrefslogtreecommitdiff
path: root/regress/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-11-04 09:51:52 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-11-04 09:51:52 +0000
commit37f2520348132ae61da01c44e12f03b47862eaaa (patch)
treec46da7d2f38e5782f306d21cb9e5bee93925589b /regress/lib
parentf4b08bad0e99ce29e154268b2c9f4bd0ae08e132 (diff)
ec tests: allow linking against eopenssl
Diffstat (limited to 'regress/lib')
-rw-r--r--regress/lib/libcrypto/ec/Makefile8
-rw-r--r--regress/lib/libcrypto/ec/ec_asn1_test.c11
2 files changed, 16 insertions, 3 deletions
diff --git a/regress/lib/libcrypto/ec/Makefile b/regress/lib/libcrypto/ec/Makefile
index 0826b44a25d..20d2a90318e 100644
--- a/regress/lib/libcrypto/ec/Makefile
+++ b/regress/lib/libcrypto/ec/Makefile
@@ -1,4 +1,10 @@
-# $OpenBSD: Makefile,v 1.8 2023/04/17 20:41:02 tb Exp $
+# $OpenBSD: Makefile,v 1.9 2024/11/04 09:51:51 tb Exp $
+
+.ifdef EOPENSSL33
+LDADD += -Wl,-rpath,/usr/local/lib/eopenssl33 -L/usr/local/lib/eopenssl33
+CFLAGS += -I/usr/local/include/eopenssl33/
+CFLAGS += -DOPENSSL_SUPPRESS_DEPRECATED
+.endif
PROGS += ectest
PROGS += ec_asn1_test
diff --git a/regress/lib/libcrypto/ec/ec_asn1_test.c b/regress/lib/libcrypto/ec/ec_asn1_test.c
index 5902ee3d3be..539d00b7b52 100644
--- a/regress/lib/libcrypto/ec/ec_asn1_test.c
+++ b/regress/lib/libcrypto/ec/ec_asn1_test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_asn1_test.c,v 1.26 2024/11/02 13:42:49 tb Exp $ */
+/* $OpenBSD: ec_asn1_test.c,v 1.27 2024/11/04 09:51:51 tb Exp $ */
/*
* Copyright (c) 2017, 2021 Joel Sing <jsing@openbsd.org>
* Copyright (c) 2024 Theo Buehler <tb@openbsd.org>
@@ -16,6 +16,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/resource.h>
+
#include <err.h>
#include <string.h>
@@ -884,7 +886,9 @@ ec_group_non_builtin_curve(const struct curve *curve, const EC_METHOD *method,
EC_GROUP *group = NULL, *new_group = NULL;
const unsigned char *pder;
unsigned char *der = NULL;
+#ifndef OPENSSL_SUPPRESS_DEPRECATED
long error;
+#endif
int der_len = 0;
int failed = 1;
@@ -952,7 +956,7 @@ ec_group_non_builtin_curve(const struct curve *curve, const EC_METHOD *method,
}
EC_GROUP_free(new_group);
new_group = NULL;
-
+#ifndef OPENSSL_SUPPRESS_DEPRECATED
error = ERR_get_error();
if (!curve->known_named_curve &&
ERR_GET_REASON(error) != EC_R_UNKNOWN_GROUP) {
@@ -960,6 +964,7 @@ ec_group_non_builtin_curve(const struct curve *curve, const EC_METHOD *method,
curve->descr, EC_R_UNKNOWN_GROUP, ERR_GET_REASON(error));
goto err;
}
+#endif
ERR_clear_error();
@@ -971,12 +976,14 @@ ec_group_non_builtin_curve(const struct curve *curve, const EC_METHOD *method,
goto err;
}
+#ifndef OPENSSL_SUPPRESS_DEPRECATED
error = ERR_peek_last_error();
if (ERR_GET_REASON(error) != EC_R_PKPARAMETERS2GROUP_FAILURE) {
fprintf(stderr, "FAIL: %s unexpected error: want %d, got %d\n",
curve->descr, EC_R_UNKNOWN_GROUP, ERR_GET_REASON(error));
goto err;
}
+#endif
failed = 0;