aboutsummaryrefslogtreecommitdiff
path: root/secure/lib/libcrypto
diff options
context:
space:
mode:
Diffstat (limited to 'secure/lib/libcrypto')
-rw-r--r--secure/lib/libcrypto/Makefile3
-rw-r--r--secure/lib/libcrypto/Makefile.inc12
-rw-r--r--secure/lib/libcrypto/Makefile.version2
-rw-r--r--secure/lib/libcrypto/tests/Makefile5
-rwxr-xr-xsecure/lib/libcrypto/tests/libcrypto_test.sh40
5 files changed, 51 insertions, 11 deletions
diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile
index 5cb3f5a7c3fe..738de3479987 100644
--- a/secure/lib/libcrypto/Makefile
+++ b/secure/lib/libcrypto/Makefile
@@ -682,6 +682,9 @@ buildasm cleanasm:
${.TARGET:S/build/all/:S/asm$//}
.endfor
+HAS_TESTS= yes
+SUBDIR.${MK_TESTS}= tests
+
.include <bsd.lib.mk>
.if ${MACHINE} == "powerpc"
diff --git a/secure/lib/libcrypto/Makefile.inc b/secure/lib/libcrypto/Makefile.inc
index 4d5e9c68a1fe..5b281166df61 100644
--- a/secure/lib/libcrypto/Makefile.inc
+++ b/secure/lib/libcrypto/Makefile.inc
@@ -3,9 +3,6 @@
PACKAGE= openssl
LIB_PACKAGE=
-# OpenSSL version used for manual page generation
-.include "Makefile.version"
-
LCRYPTO_SRC= ${SRCTOP}/crypto/openssl
LCRYPTO_DOC= ${LCRYPTO_SRC}/doc
@@ -15,10 +12,7 @@ CFLAGS+= -I${LCRYPTO_SRC}/providers/common/include
CFLAGS+= -I${LCRYPTO_SRC}/providers/fips/include
CFLAGS+= -I${LCRYPTO_SRC}/providers/implementations/include
-.include "Makefile.common"
+.SUFFIXES: .pc
+.PATH.pc: ${LCRYPTO_SRC}/exporters
-.for pcfile in ${PCFILES}
-${pcfile}: ${pcfile}.in
- sed -e 's,@openssl_ver@,${OPENSSL_VER},g' ${.ALLSRC} > ${.TARGET}
-.endfor
-CLEANFILES+= ${PCFILES}
+.include "Makefile.common"
diff --git a/secure/lib/libcrypto/Makefile.version b/secure/lib/libcrypto/Makefile.version
deleted file mode 100644
index 81636b8adfe8..000000000000
--- a/secure/lib/libcrypto/Makefile.version
+++ /dev/null
@@ -1,2 +0,0 @@
-OPENSSL_VER= 3.5.4
-OPENSSL_DATE= 2025-09-30
diff --git a/secure/lib/libcrypto/tests/Makefile b/secure/lib/libcrypto/tests/Makefile
new file mode 100644
index 000000000000..d309a1b1100c
--- /dev/null
+++ b/secure/lib/libcrypto/tests/Makefile
@@ -0,0 +1,5 @@
+PACKAGE= tests
+
+ATF_TESTS_SH+= libcrypto_test
+
+.include <bsd.test.mk>
diff --git a/secure/lib/libcrypto/tests/libcrypto_test.sh b/secure/lib/libcrypto/tests/libcrypto_test.sh
new file mode 100755
index 000000000000..83ef1686089d
--- /dev/null
+++ b/secure/lib/libcrypto/tests/libcrypto_test.sh
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2025 Enji Cooper
+
+atf_test_case legacy_provider
+legacy_provider_head() {
+ atf_set "descr" "daemon should drop privileges"
+}
+legacy_provider_body() {
+ local passphrase="test"
+ local plaintext="test"
+
+ export OPENSSL_CONF="$PWD/openssl.conf"
+ cat > "$OPENSSL_CONF" <<EOF
+HOME = .
+
+openssl_conf = openssl_init
+
+[openssl_init]
+providers = provider_sect
+
+# List of providers to load
+[provider_sect]
+default = default_sect
+legacy = legacy_sect
+
+[default_sect]
+activate = 1
+
+[legacy_sect]
+activate = 1
+EOF
+
+ echo "$plaintext" | atf_check -s exit:0 -e empty -o not-empty \
+ openssl rc4 -e -k "$passphrase" -a -pbkdf2
+}
+
+atf_init_test_cases() {
+ atf_add_test_case legacy_provider
+}