Skip to content

Commit 5ae9088

Browse files
committed
ec tests: allow linking against eopenssl
1 parent eb720dc commit 5ae9088

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

regress/lib/libcrypto/ec/Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# $OpenBSD: Makefile,v 1.8 2023/04/17 20:41:02 tb Exp $
1+
# $OpenBSD: Makefile,v 1.9 2024/11/04 09:51:51 tb Exp $
2+
3+
.ifdef EOPENSSL33
4+
LDADD += -Wl,-rpath,/usr/local/lib/eopenssl33 -L/usr/local/lib/eopenssl33
5+
CFLAGS += -I/usr/local/include/eopenssl33/
6+
CFLAGS += -DOPENSSL_SUPPRESS_DEPRECATED
7+
.endif
28

39
PROGS += ectest
410
PROGS += ec_asn1_test

regress/lib/libcrypto/ec/ec_asn1_test.c

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: ec_asn1_test.c,v 1.26 2024/11/02 13:42:49 tb Exp $ */
1+
/* $OpenBSD: ec_asn1_test.c,v 1.27 2024/11/04 09:51:51 tb Exp $ */
22
/*
33
* Copyright (c) 2017, 2021 Joel Sing <[email protected]>
44
* Copyright (c) 2024 Theo Buehler <[email protected]>
@@ -16,6 +16,8 @@
1616
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1717
*/
1818

19+
#include <sys/resource.h>
20+
1921
#include <err.h>
2022
#include <string.h>
2123

@@ -884,7 +886,9 @@ ec_group_non_builtin_curve(const struct curve *curve, const EC_METHOD *method,
884886
EC_GROUP *group = NULL, *new_group = NULL;
885887
const unsigned char *pder;
886888
unsigned char *der = NULL;
889+
#ifndef OPENSSL_SUPPRESS_DEPRECATED
887890
long error;
891+
#endif
888892
int der_len = 0;
889893
int failed = 1;
890894

@@ -952,14 +956,15 @@ ec_group_non_builtin_curve(const struct curve *curve, const EC_METHOD *method,
952956
}
953957
EC_GROUP_free(new_group);
954958
new_group = NULL;
955-
959+
#ifndef OPENSSL_SUPPRESS_DEPRECATED
956960
error = ERR_get_error();
957961
if (!curve->known_named_curve &&
958962
ERR_GET_REASON(error) != EC_R_UNKNOWN_GROUP) {
959963
fprintf(stderr, "FAIL: %s unexpected error: want %d, got %d\n",
960964
curve->descr, EC_R_UNKNOWN_GROUP, ERR_GET_REASON(error));
961965
goto err;
962966
}
967+
#endif
963968

964969
ERR_clear_error();
965970

@@ -971,12 +976,14 @@ ec_group_non_builtin_curve(const struct curve *curve, const EC_METHOD *method,
971976
goto err;
972977
}
973978

979+
#ifndef OPENSSL_SUPPRESS_DEPRECATED
974980
error = ERR_peek_last_error();
975981
if (ERR_GET_REASON(error) != EC_R_PKPARAMETERS2GROUP_FAILURE) {
976982
fprintf(stderr, "FAIL: %s unexpected error: want %d, got %d\n",
977983
curve->descr, EC_R_UNKNOWN_GROUP, ERR_GET_REASON(error));
978984
goto err;
979985
}
986+
#endif
980987

981988
failed = 0;
982989

0 commit comments

Comments
 (0)