summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2023-05-08 17:46:06 +0000
committerchristos <christos@NetBSD.org>2023-05-08 17:46:06 +0000
commit643a378d0845d91b4cb7cb96f6f4b607ebd351ea (patch)
tree00f8d549b2352cd5db35decc27313965df0fe992
parent2d0deb7acd93f659de77d8c1cd9d7b7a7d7b0d4e (diff)
make tests support both 1.x and 3.x.
Lot of work needed to add all the 3.x tests, but that can wait until all is switched
-rw-r--r--tests/crypto/libcrypto/Makefile10
-rw-r--r--tests/crypto/libcrypto/Makefile.inc4
-rw-r--r--tests/crypto/libcrypto/conf/Makefile13
-rw-r--r--tests/crypto/libcrypto/conf/d_conf-1x.out (renamed from tests/crypto/libcrypto/conf/d_conf.out)0
-rw-r--r--tests/crypto/libcrypto/conf/d_conf-3x.out94
-rw-r--r--tests/crypto/libcrypto/dh/Makefile3
-rw-r--r--tests/crypto/libcrypto/evp/Makefile78
-rw-r--r--tests/crypto/libcrypto/t_hashes.sh4
-rw-r--r--tests/crypto/libcrypto/t_libcrypto.sh21
-rw-r--r--tests/crypto/libcrypto/t_pubkey.sh6
-rw-r--r--tests/crypto/libcrypto/threads/Makefile10
11 files changed, 220 insertions, 23 deletions
diff --git a/tests/crypto/libcrypto/Makefile b/tests/crypto/libcrypto/Makefile
index 24827e60d0d..4866893d73b 100644
--- a/tests/crypto/libcrypto/Makefile
+++ b/tests/crypto/libcrypto/Makefile
@@ -1,9 +1,13 @@
-# $NetBSD: Makefile,v 1.14 2018/09/23 13:34:57 christos Exp $
+# $NetBSD: Makefile,v 1.15 2023/05/08 17:46:06 christos Exp $
.include <bsd.own.mk>
-SUBDIR+=bf bn cast conf des dh dsa ec ecdh ecdsa engine evp hmac \
- md2 rc2 rc4 rsa srp threads
+SUBDIR+=bf bn cast conf des dh dsa ec engine evp hmac \
+ rc2 rc4 rsa srp threads
+
+.if ${HAVE_OPENSSL} <= 11
+SUBDIR+= ecdh ecdsa md2
+.endif
SUBDIR+=idea mdc2
SUBDIR+=rc5
diff --git a/tests/crypto/libcrypto/Makefile.inc b/tests/crypto/libcrypto/Makefile.inc
index 29c1f5d4f80..b849db20e91 100644
--- a/tests/crypto/libcrypto/Makefile.inc
+++ b/tests/crypto/libcrypto/Makefile.inc
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.10 2018/09/28 23:40:45 christos Exp $
+# $NetBSD: Makefile.inc,v 1.11 2023/05/08 17:46:06 christos Exp $
.include <bsd.own.mk>
.include "../Makefile.inc"
@@ -14,11 +14,13 @@ MAN= # empty
BINDIR= ${TESTSDIR}
CWARNFLAGS.clang+= -Wno-format
+CWARNFLAGS+=-Wno-error=deprecated-declarations
CPPFLAGS+= -DOPENSSL_FIPS
CPPFLAGS+= -I${OPENSSLSRC} -I${OPENSSLSRC}/crypto
CPPFLAGS+= -I${OPENSSLSRC}/include -I${OPENSSLSRC}/../include
CPPFLAGS+= -I${OPENSSLSRC}/crypto/include
+CPPFLAGS+= -I${OPENSSLSRC}/apps/include
CRYPTODIST= ${NETBSDSRCDIR}/crypto
.include "${NETBSDSRCDIR}/crypto/Makefile.openssl"
.if ${HAVE_OPENSSL} != 10
diff --git a/tests/crypto/libcrypto/conf/Makefile b/tests/crypto/libcrypto/conf/Makefile
index ece3ee620bf..0999be8a374 100644
--- a/tests/crypto/libcrypto/conf/Makefile
+++ b/tests/crypto/libcrypto/conf/Makefile
@@ -1,4 +1,6 @@
-# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $
+# $NetBSD: Makefile,v 1.2 2023/05/08 17:46:06 christos Exp $
+
+.include <bsd.own.mk>
HELPER_NAME= conftest
HELPER_DIR= conf
@@ -6,6 +8,13 @@ HELPER_SRCS= test.c
FILESDIR= ${TESTSDIR}
FILES= d_conf_ssleay.cnf
-FILES+= d_conf.out
+.if ${HAVE_OPENSSL} <= 11
+FILES+= d_conf-1x.out
+FILESNAME_d_conf-1x.out= d_conf.out
+.else
+FILES+= d_conf-3x.out
+FILESNAME_d_conf_ssleay.out= ssleay.out
+FILESNAME_d_conf-3x.out= d_conf.out
+.endif
.include <bsd.init.mk>
diff --git a/tests/crypto/libcrypto/conf/d_conf.out b/tests/crypto/libcrypto/conf/d_conf-1x.out
index 6bd76a2da5f..6bd76a2da5f 100644
--- a/tests/crypto/libcrypto/conf/d_conf.out
+++ b/tests/crypto/libcrypto/conf/d_conf-1x.out
diff --git a/tests/crypto/libcrypto/conf/d_conf-3x.out b/tests/crypto/libcrypto/conf/d_conf-3x.out
new file mode 100644
index 00000000000..96c13588eca
--- /dev/null
+++ b/tests/crypto/libcrypto/conf/d_conf-3x.out
@@ -0,0 +1,94 @@
+num_items = 47
+num_nodes = 24
+num_alloc_nodes = 32
+num_expands = 0
+num_expand_reallocs = 0
+num_contracts = 0
+num_contract_reallocs = 0
+num_hash_calls = 0
+num_comp_calls = 0
+num_insert = 0
+num_replace = 0
+num_delete = 0
+num_no_delete = 0
+num_retrieve = 0
+num_retrieve_miss = 0
+num_hash_comps = 0
+node 0 -> 4
+node 1 -> 1
+node 2 -> 1
+node 3 -> 4
+node 4 -> 0
+node 5 -> 2
+node 6 -> 1
+node 7 -> 1
+node 8 -> 6
+node 9 -> 2
+node 10 -> 1
+node 11 -> 1
+node 12 -> 3
+node 13 -> 1
+node 14 -> 4
+node 15 -> 3
+node 16 -> 5
+node 17 -> 0
+node 18 -> 2
+node 19 -> 0
+node 20 -> 2
+node 21 -> 2
+node 22 -> 0
+node 23 -> 1
+20 nodes used out of 24
+47 items
+load 1.95 actual load 2.35
+init2=10
+cipher1=NULL
+s_client:cipher1=DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5cipher2 = DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+---------------------------- DUMP ------------------------
+[req] Attribute_text_7=Email Address
+[req] Attribute_text_2=State or Province Name (full name)
+[default] tmp_cert_dir=/tmp/eay/.ca_certs
+[req] Attribute_text_1=Country Name (2 letter code)
+[[genrsa]]
+[req] Attribute_default_5=TR
+[req] Attribute_text_6=Common Name (eg, YOUR name)
+[req] Attribute_default_1=AU
+[[req]]
+[[special]]
+[[gendh]]
+[req] Attribute_text_3=Locality Name (eg, city)
+[req] Attribute_type_1=countryName
+[default] init5==10' again
+[req] Attribute_type_3=localityName
+[s_client] cipher3=DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+[default] in\#it1=10
+[req] Attribute_text_4=Organization Name (eg, company)
+[req] Attribute_type_7=emailAddress
+[gendh] def_generator=2
+[default] HOME=/tmp/eay
+[s_client] cipher4=DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+[default] init=5
+[SSLeay] version=0.5.0
+[req] Attribute_type_4=organizationName
+[default] tmp2_cert_dir=thisis/tmp/eaystuff
+[req] Attribute_type_5=organizationalUnitName
+[[SSLEAY]]
+[default] init4=10'
+[[default]]
+[default] LOGNAME=Eric Young (home=/tmp/eay)
+[special] RANDFILE=/tmp/eay/.rand
+[req] default_keyfile=privkey.pem
+[req] Attribute_default_4=Mincom Pty Ltd
+[req] Attribute_default_2=Queensland
+[gendh] default_bits=512
+[req] default_bits=512
+[default] init2=10
+[SSLEAY] version=0.5.0
+[s_client] cipher1=DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5cipher2 = DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
+[req] Attribute_text_5=Organizational Unit Name (eg, section)
+[req] Attribute_type_2=stateOrProvinceName
+[genrsa] default_bits=512
+[default] init3=10'
+[[SSLeay]]
+[[s_client]]
+[req] Attribute_type_6=commonName
diff --git a/tests/crypto/libcrypto/dh/Makefile b/tests/crypto/libcrypto/dh/Makefile
index 86795aeeb5e..367b7e12f61 100644
--- a/tests/crypto/libcrypto/dh/Makefile
+++ b/tests/crypto/libcrypto/dh/Makefile
@@ -1,5 +1,6 @@
-# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $
+# $NetBSD: Makefile,v 1.2 2023/05/08 17:46:06 christos Exp $
+PROGDPLIBSSTATIC=yes
HELPER_NAME= dhtest
HELPER_DIR= dh
diff --git a/tests/crypto/libcrypto/evp/Makefile b/tests/crypto/libcrypto/evp/Makefile
index 5be20df6a1b..9adbfad2582 100644
--- a/tests/crypto/libcrypto/evp/Makefile
+++ b/tests/crypto/libcrypto/evp/Makefile
@@ -1,9 +1,11 @@
-# $NetBSD: Makefile,v 1.2 2018/09/23 13:34:57 christos Exp $
+# $NetBSD: Makefile,v 1.3 2023/05/08 17:46:06 christos Exp $
+.include <bsd.own.mk>
HELPER_NAME= evp_test
HELPER_DIR= evp
-FILES= \
+.if ${HAVE_OPENSSL} <= 11
+FILES+= \
evpcase.txt \
evpciph.txt \
evpdigest.txt \
@@ -13,6 +15,78 @@ evpmac.txt \
evppbe.txt \
evppkey.txt \
evppkey_ecc.txt
+.else
+FILES+= \
+evpciph_aes_ccm_cavs.txt \
+evpciph_aes_common.txt \
+evpciph_aes_cts.txt \
+evpciph_aes_ocb.txt \
+evpciph_aes_siv.txt \
+evpciph_aes_stitched.txt \
+evpciph_aes_wrap.txt \
+evpciph_aria.txt \
+evpciph_bf.txt \
+evpciph_camellia.txt \
+evpciph_camellia_cts.txt \
+evpciph_cast5.txt \
+evpciph_chacha.txt \
+evpciph_des.txt \
+evpciph_des3_common.txt \
+evpciph_idea.txt \
+evpciph_rc2.txt \
+evpciph_rc4.txt \
+evpciph_rc4_stitched.txt \
+evpciph_rc5.txt \
+evpciph_seed.txt \
+evpciph_sm4.txt \
+evpencod.txt \
+evpkdf_hkdf.txt \
+evpkdf_krb5.txt \
+evpkdf_pbkdf1.txt \
+evpkdf_pbkdf2.txt \
+evpkdf_scrypt.txt \
+evpkdf_ss.txt \
+evpkdf_ssh.txt \
+evpkdf_tls11_prf.txt \
+evpkdf_tls12_prf.txt \
+evpkdf_tls13_kdf.txt \
+evpkdf_x942.txt \
+evpkdf_x942_des.txt \
+evpkdf_x963.txt \
+evpmac_blake.txt \
+evpmac_cmac_des.txt \
+evpmac_common.txt \
+evpmac_poly1305.txt \
+evpmac_siphash.txt \
+evpmac_sm3.txt \
+evpmd_blake.txt \
+evpmd_md.txt \
+evpmd_mdc2.txt \
+evpmd_ripemd.txt \
+evpmd_sha.txt \
+evpmd_sm3.txt \
+evpmd_whirlpool.txt \
+evppbe_pbkdf2.txt \
+evppbe_pkcs12.txt \
+evppbe_scrypt.txt \
+evppkey_brainpool.txt \
+evppkey_dh.txt \
+evppkey_dsa.txt \
+evppkey_ecc.txt \
+evppkey_ecdh.txt \
+evppkey_ecdsa.txt \
+evppkey_ecx.txt \
+evppkey_ffdhe.txt \
+evppkey_kas.txt \
+evppkey_kdf_hkdf.txt \
+evppkey_kdf_scrypt.txt \
+evppkey_kdf_tls1_prf.txt \
+evppkey_mismatch.txt \
+evppkey_rsa.txt \
+evppkey_rsa_common.txt \
+evppkey_sm2.txt \
+evprand.txt
+.endif
.include <bsd.init.mk>
.PATH: ${OPENSSLSRC}/test/recipes/30-test_evp_data
diff --git a/tests/crypto/libcrypto/t_hashes.sh b/tests/crypto/libcrypto/t_hashes.sh
index a4f2baaf7c3..1cfe4e28c3e 100644
--- a/tests/crypto/libcrypto/t_hashes.sh
+++ b/tests/crypto/libcrypto/t_hashes.sh
@@ -1,4 +1,4 @@
-# $NetBSD: t_hashes.sh,v 1.4 2018/09/24 16:25:24 christos Exp $
+# $NetBSD: t_hashes.sh,v 1.5 2023/05/08 17:46:06 christos Exp $
#
# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -58,6 +58,6 @@ mdc2_body()
atf_init_test_cases()
{
atf_add_test_case hmac
- atf_add_test_case md2
+# atf_add_test_case md2
atf_add_test_case mdc2
}
diff --git a/tests/crypto/libcrypto/t_libcrypto.sh b/tests/crypto/libcrypto/t_libcrypto.sh
index 828a61b380c..364329de30d 100644
--- a/tests/crypto/libcrypto/t_libcrypto.sh
+++ b/tests/crypto/libcrypto/t_libcrypto.sh
@@ -1,4 +1,4 @@
-# $NetBSD: t_libcrypto.sh,v 1.8 2022/06/10 05:59:12 martin Exp $
+# $NetBSD: t_libcrypto.sh,v 1.9 2023/05/08 17:46:06 christos Exp $
#
# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -32,7 +32,8 @@ engine_head()
}
engine_body()
{
- atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_enginetest"
+ atf_check -o ignore -e ignore "$(atf_get_srcdir)/h_enginetest" \
+ "$(atf_get_srcdir)/d_server.pem"
}
atf_test_case bn
@@ -68,11 +69,17 @@ threads_head()
}
threads_body()
{
- $(atf_get_srcdir)/h_threadstest \
- -cert $(atf_get_srcdir)/d_server.pem \
- -ccert $(atf_get_srcdir)/d_client.pem \
- 2>&1 | tee out
- atf_check -s eq:1 -o empty -e empty grep :error: out
+ local s=$(atf_get_srcdir)
+ if [ -f "$s/rsakey.pem" ]; then
+ atf_check -o ignore -e ignore "$s/h_threadstest" \
+ -config "$s/default.cnf" "$s"
+ else
+ "$s/h_threadstest" \
+ -cert "$s/d_server.pem" \
+ -ccert "$s/d_client.pem" \
+ 2>&1 | tee out
+ atf_check -s eq:1 -o empty -e empty grep :error: out
+ fi
}
atf_init_test_cases()
diff --git a/tests/crypto/libcrypto/t_pubkey.sh b/tests/crypto/libcrypto/t_pubkey.sh
index 3842fd04b43..f3d429af278 100644
--- a/tests/crypto/libcrypto/t_pubkey.sh
+++ b/tests/crypto/libcrypto/t_pubkey.sh
@@ -1,4 +1,4 @@
-# $NetBSD: t_pubkey.sh,v 1.6 2019/06/16 10:45:50 gson Exp $
+# $NetBSD: t_pubkey.sh,v 1.7 2023/05/08 17:46:06 christos Exp $
#
# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -104,7 +104,7 @@ atf_init_test_cases()
atf_add_test_case dh
atf_add_test_case rsa
atf_add_test_case ec
- atf_add_test_case ecdh
- atf_add_test_case ecdsa
+# atf_add_test_case ecdh
+# atf_add_test_case ecdsa
atf_add_test_case srp
}
diff --git a/tests/crypto/libcrypto/threads/Makefile b/tests/crypto/libcrypto/threads/Makefile
index ce390213514..3eeff2cdf86 100644
--- a/tests/crypto/libcrypto/threads/Makefile
+++ b/tests/crypto/libcrypto/threads/Makefile
@@ -1,5 +1,7 @@
-# $NetBSD: Makefile,v 1.5 2018/02/09 03:20:21 christos Exp $
+# $NetBSD: Makefile,v 1.6 2023/05/08 17:46:06 christos Exp $
+.include <bsd.own.mk>
+PROGDPLIBSSTATIC=yes
HELPER_NAME= threadstest
HELPER_DIR= threads
@@ -14,10 +16,14 @@ FILES= server.pem
FILESNAME_server.pem= d_server.pem
FILES+= client.pem
FILESNAME_client.pem= d_client.pem
-
+.if ${HAVE_OPENSSL} > 11
+FILES+=rsakey.pem
+FILES+=default.cnf
+.endif
HELPER_SRCS= ${${HAVE_OPENSSL} == 10 :? mttest.c : threadstest.c}
.include <bsd.init.mk>
.PATH: ${OPENSSLSRC}/apps
+.PATH: ${OPENSSLSRC}/test/recipes/90-test_threads_data