diff --git a/distrib/sets/lists/tests/mi b/distrib/sets/lists/tests/mi index 60091d49ad9a..e8f4dfbc4a11 100644 --- a/distrib/sets/lists/tests/mi +++ b/distrib/sets/lists/tests/mi @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.28 2009/02/13 05:20:26 jmmv Exp $ +# $NetBSD: mi,v 1.29 2009/02/13 20:58:13 jmmv Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -64,6 +64,37 @@ ./usr/libdata/debug/usr/tests/atf/units/t_text.debug tests-obsolete obsolete ./usr/libdata/debug/usr/tests/atf/units/t_user.debug tests-obsolete obsolete ./usr/libdata/debug/usr/tests/atf/units/t_utils.debug tests-obsolete obsolete +./usr/libdata/debug/usr/tests/crypto tests-crypto-debug +./usr/libdata/debug/usr/tests/crypto/libcrypto tests-crypto-debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_bftest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_bntest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_casttest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_conftest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_destest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_dhtest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_divtest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_dsatest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_ecdhtest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_ecdsatest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_ectest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_enginetest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_exptest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_ideatest.debug tests-crypto-debug debug,idea +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_hmactest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_lhashtest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_md2test.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_md4test.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_md5test.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_mdc2test.debug tests-crypto-debug debug,mdc2 +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_randtest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_rc2test.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_rc4test.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_rc5test.debug tests-crypto-debug debug,rc5 +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_ripemdtest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_rsatest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_sha1test.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_shatest.debug tests-crypto-debug debug +./usr/libdata/debug/usr/tests/crypto/libcrypto/h_x509v3test.debug tests-crypto-debug debug ./usr/libdata/debug/usr/tests/fs tests-fs-debug ./usr/libdata/debug/usr/tests/fs/puffs tests-fs-debug ./usr/libdata/debug/usr/tests/fs/puffs/h_have_puffs.debug tests-fs-debug debug @@ -355,6 +386,42 @@ ./usr/tests/atf/units/t_text tests-obsolete obsolete ./usr/tests/atf/units/t_user tests-obsolete obsolete ./usr/tests/atf/units/t_utils tests-obsolete obsolete +./usr/tests/crypto tests-crypto-tests +./usr/tests/crypto/Atffile tests-crypto-tests +./usr/tests/crypto/libcrypto tests-crypto-tests +./usr/tests/crypto/libcrypto/Atffile tests-crypto-tests +./usr/tests/crypto/libcrypto/d_conf.out tests-crypto-tests +./usr/tests/crypto/libcrypto/d_conf_ssleay.cnf tests-crypto-tests +./usr/tests/crypto/libcrypto/h_bftest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_bntest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_casttest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_conftest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_destest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_dhtest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_divtest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_dsatest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_ecdhtest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_ecdsatest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_ectest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_enginetest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_exptest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_hmactest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_ideatest tests-crypto-tests idea +./usr/tests/crypto/libcrypto/h_lhashtest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_md2test tests-crypto-tests +./usr/tests/crypto/libcrypto/h_md4test tests-crypto-tests +./usr/tests/crypto/libcrypto/h_md5test tests-crypto-tests +./usr/tests/crypto/libcrypto/h_mdc2test tests-crypto-tests mdc2 +./usr/tests/crypto/libcrypto/h_randtest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_rc2test tests-crypto-tests +./usr/tests/crypto/libcrypto/h_rc4test tests-crypto-tests +./usr/tests/crypto/libcrypto/h_rc5test tests-crypto-tests rc5 +./usr/tests/crypto/libcrypto/h_ripemdtest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_rsatest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_sha1test tests-crypto-tests +./usr/tests/crypto/libcrypto/h_shatest tests-crypto-tests +./usr/tests/crypto/libcrypto/h_x509v3test tests-crypto-tests +./usr/tests/crypto/libcrypto/t_libcrypto tests-crypto-tests ./usr/tests/fs tests-fs-tests ./usr/tests/fs/Atffile tests-fs-tests ./usr/tests/fs/h_funcs.subr tests-fs-tests diff --git a/etc/mtree/NetBSD.dist b/etc/mtree/NetBSD.dist index eccc16f01635..1519badc0299 100644 --- a/etc/mtree/NetBSD.dist +++ b/etc/mtree/NetBSD.dist @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist,v 1.390 2009/02/13 05:20:47 jmmv Exp $ +# $NetBSD: NetBSD.dist,v 1.391 2009/02/13 20:58:13 jmmv Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -542,6 +542,8 @@ ./usr/libdata/debug/usr/tests/atf/formats ./usr/libdata/debug/usr/tests/atf/test_programs ./usr/libdata/debug/usr/tests/atf/tools +./usr/libdata/debug/usr/tests/crypto +./usr/libdata/debug/usr/tests/crypto/libcrypto ./usr/libdata/debug/usr/tests/fs ./usr/libdata/debug/usr/tests/fs/puffs ./usr/libdata/debug/usr/tests/fs/tmpfs @@ -1400,6 +1402,8 @@ ./usr/tests/atf/formats ./usr/tests/atf/test_programs ./usr/tests/atf/tools +./usr/tests/crypto +./usr/tests/crypto/libcrypto ./usr/tests/fs ./usr/tests/fs/puffs ./usr/tests/fs/tmpfs diff --git a/tests/Makefile b/tests/Makefile index c7a77b8bd039..2ce6f73a5acc 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.12 2009/02/10 13:43:54 pooka Exp $ +# $NetBSD: Makefile,v 1.13 2009/02/13 20:58:13 jmmv Exp $ .include -SUBDIR= fs games net util syscall +SUBDIR= crypto fs games net util syscall .if ${MACHINE} != "evbppc" SUBDIR+= modules diff --git a/tests/crypto/Atffile b/tests/crypto/Atffile new file mode 100644 index 000000000000..bbf9dd3f1372 --- /dev/null +++ b/tests/crypto/Atffile @@ -0,0 +1,6 @@ +Content-Type: application/X-atf-atffile; version="1" +X-NetBSD-Id: "$NetBSD: Atffile,v 1.1 2009/02/13 20:58:13 jmmv Exp $" + +prop: test-suite = "NetBSD" + +tp-glob: * diff --git a/tests/crypto/Makefile b/tests/crypto/Makefile new file mode 100644 index 000000000000..2cfd75d34b32 --- /dev/null +++ b/tests/crypto/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +.include + +SUBDIR= libcrypto + +TESTSDIR= ${TESTSBASE}/crypto + +.include +.include diff --git a/tests/crypto/libcrypto/Atffile b/tests/crypto/libcrypto/Atffile new file mode 100644 index 000000000000..527cabce91c0 --- /dev/null +++ b/tests/crypto/libcrypto/Atffile @@ -0,0 +1,5 @@ +Content-Type: application/X-atf-atffile; version="1" + +prop: test-suite = "NetBSD" + +tp: t_libcrypto diff --git a/tests/crypto/libcrypto/Makefile b/tests/crypto/libcrypto/Makefile new file mode 100644 index 000000000000..d7d4a35af85d --- /dev/null +++ b/tests/crypto/libcrypto/Makefile @@ -0,0 +1,29 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +.include + +SUBDIR+=bf bn cast conf des dh dsa ec ecdh ecdsa engine hmac lhash \ + md2 md4 md5 rand rc2 rc4 ripemd rsa sha sha1 threads x509v3 + +.if ${MKCRYPTO_IDEA} != "no" +SUBDIR+=idea +.endif +.if ${MKCRYPTO_RC5} != "no" +SUBDIR+=rc5 +.endif +.if ${MKCRYPTO_MDC2} != "no" +SUBDIR+=mdc2 +.endif + +TESTSDIR= ${TESTSBASE}/crypto/libcrypto + +TESTS_SH= t_libcrypto + +CLEANFILES+= t_libcrypto.sh +t_libcrypto.sh: t_libcrypto.awk t_libcrypto.in + ${TOOL_AWK} -f ${.CURDIR}/t_libcrypto.awk ${.CURDIR}/t_libcrypto.in \ + >t_libcrypto.sh.tmp + mv t_libcrypto.sh.tmp t_libcrypto.sh + +.include +.include diff --git a/tests/crypto/libcrypto/Makefile.inc b/tests/crypto/libcrypto/Makefile.inc new file mode 100644 index 000000000000..2d32e78ab038 --- /dev/null +++ b/tests/crypto/libcrypto/Makefile.inc @@ -0,0 +1,28 @@ +# $NetBSD: Makefile.inc,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +.include + +TESTSDIR= ${TESTSBASE}/crypto/libcrypto + +.if defined(HELPER_NAME) +HELPER_SRCS?= ${HELPER_NAME}.c + +PROG= h_${HELPER_NAME} +SRCS= ${HELPER_SRCS} +MAN= # empty +BINDIR= ${TESTSDIR} + +NOATFFILE= yes + +DPADD+= ${LIBCRYPTO} ${LIBCRYPT} +LDADD+= -lcrypto -lcrypt + +CPPFLAGS+= -DOPENSSL_FIPS +CPPFLAGS+= -I${OPENSSLSRC} +CRYPTODIST= ${NETBSDSRCDIR}/crypto/dist +.include "${NETBSDSRCDIR}/crypto/Makefile.openssl" +.PATH: ${OPENSSLSRC}/crypto/${HELPER_DIR} + +.include +.include +.endif diff --git a/tests/crypto/libcrypto/bf/Makefile b/tests/crypto/libcrypto/bf/Makefile new file mode 100644 index 000000000000..b2822e4b44dd --- /dev/null +++ b/tests/crypto/libcrypto/bf/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +HELPER_NAME= bftest +HELPER_DIR= bf + +.include diff --git a/tests/crypto/libcrypto/bn/Makefile b/tests/crypto/libcrypto/bn/Makefile new file mode 100644 index 000000000000..6dff0be12aee --- /dev/null +++ b/tests/crypto/libcrypto/bn/Makefile @@ -0,0 +1,7 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +.include + +SUBDIR=bn div exp + +.include diff --git a/tests/crypto/libcrypto/bn/Makefile.inc b/tests/crypto/libcrypto/bn/Makefile.inc new file mode 100644 index 000000000000..814c64d4670b --- /dev/null +++ b/tests/crypto/libcrypto/bn/Makefile.inc @@ -0,0 +1,3 @@ +# $NetBSD: Makefile.inc,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +.include "../Makefile.inc" diff --git a/tests/crypto/libcrypto/bn/bn/Makefile b/tests/crypto/libcrypto/bn/bn/Makefile new file mode 100644 index 000000000000..c68c444f4c55 --- /dev/null +++ b/tests/crypto/libcrypto/bn/bn/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +HELPER_NAME= bntest +HELPER_DIR= bn + +.include diff --git a/tests/crypto/libcrypto/bn/div/Makefile b/tests/crypto/libcrypto/bn/div/Makefile new file mode 100644 index 000000000000..6d8789e26da9 --- /dev/null +++ b/tests/crypto/libcrypto/bn/div/Makefile @@ -0,0 +1,8 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +HELPER_NAME= divtest +HELPER_DIR= bn + +CFLAGS+= -g # XXX + +.include diff --git a/tests/crypto/libcrypto/bn/exp/Makefile b/tests/crypto/libcrypto/bn/exp/Makefile new file mode 100644 index 000000000000..36aadb643321 --- /dev/null +++ b/tests/crypto/libcrypto/bn/exp/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +HELPER_NAME= exptest +HELPER_DIR= bn + +.include diff --git a/tests/crypto/libcrypto/cast/Makefile b/tests/crypto/libcrypto/cast/Makefile new file mode 100644 index 000000000000..524c9df24791 --- /dev/null +++ b/tests/crypto/libcrypto/cast/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +HELPER_NAME= casttest +HELPER_DIR= cast + +.include diff --git a/tests/crypto/libcrypto/conf/Makefile b/tests/crypto/libcrypto/conf/Makefile new file mode 100644 index 000000000000..ece3ee620bfc --- /dev/null +++ b/tests/crypto/libcrypto/conf/Makefile @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +HELPER_NAME= conftest +HELPER_DIR= conf +HELPER_SRCS= test.c + +FILESDIR= ${TESTSDIR} +FILES= d_conf_ssleay.cnf +FILES+= d_conf.out + +.include diff --git a/tests/crypto/libcrypto/conf/d_conf.out b/tests/crypto/libcrypto/conf/d_conf.out new file mode 100644 index 000000000000..6bd76a2da5ff --- /dev/null +++ b/tests/crypto/libcrypto/conf/d_conf.out @@ -0,0 +1,94 @@ +num_items = 47 +num_nodes = 24 +num_alloc_nodes = 32 +num_expands = 16 +num_expand_reallocs = 1 +num_contracts = 0 +num_contract_reallocs = 0 +num_hash_calls = 60 +num_comp_calls = 5 +num_insert = 47 +num_replace = 0 +num_delete = 0 +num_no_delete = 0 +num_retrieve = 5 +num_retrieve_miss = 8 +num_hash_comps = 132 +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/conf/d_conf_ssleay.cnf b/tests/crypto/libcrypto/conf/d_conf_ssleay.cnf new file mode 100644 index 000000000000..3fdde34dd264 --- /dev/null +++ b/tests/crypto/libcrypto/conf/d_conf_ssleay.cnf @@ -0,0 +1,78 @@ +# +# This is a test configuration file for use in SSLeay etc... +# + +init = 5 +in\#it1 =10 +init2='10' +init3='10\'' +init4="10'" +init5='='10\'' again' + +SSLeay::version = 0.5.0 + +[genrsa] +default_bits = 512 +SSLEAY::version = 0.5.0 + +[gendh] +default_bits = 512 +def_generator = 2 + +[s_client] +cipher1 = DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5\ +cipher2 = 'DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5' +cipher3 = "DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5" +cipher4 = DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5 + +[ default ] +#cert_dir = $ENV::HOME/.ca_certs + +HOME = /tmp/eay + +tmp_cert_dir = $HOME/.ca_certs +tmp2_cert_dir = thisis$(HOME)stuff + +LOGNAME = Eric Young (home=$HOME) + +[ special ] + +#H=$HOME +#H=$default::HOME +#H=$ENV::HOME +# +# SSLeay example configuration file. +# This is mostly being used for generation of certificate requests. +# + +RANDFILE = $HOME/.rand + +[ req ] +default_bits = 512 +default_keyfile = privkey.pem + +Attribute_type_1 = countryName +Attribute_text_1 = Country Name (2 letter code) +Attribute_default_1 = AU + +Attribute_type_2 = stateOrProvinceName +Attribute_text_2 = State or Province Name (full name) +Attribute_default_2 = Queensland + +Attribute_type_3 = localityName +Attribute_text_3 = Locality Name (eg, city) + +Attribute_type_4 = organizationName +Attribute_text_4 = Organization Name (eg, company) +Attribute_default_4 = Mincom Pty Ltd + +Attribute_type_5 = organizationalUnitName +Attribute_text_5 = Organizational Unit Name (eg, section) +Attribute_default_5 = TR + +Attribute_type_6 = commonName +Attribute_text_6 = Common Name (eg, YOUR name) + +Attribute_type_7 = emailAddress +Attribute_text_7 = Email Address + diff --git a/tests/crypto/libcrypto/des/Makefile b/tests/crypto/libcrypto/des/Makefile new file mode 100644 index 000000000000..cacae2ff96aa --- /dev/null +++ b/tests/crypto/libcrypto/des/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +HELPER_NAME= destest +HELPER_DIR= des + +.include diff --git a/tests/crypto/libcrypto/dh/Makefile b/tests/crypto/libcrypto/dh/Makefile new file mode 100644 index 000000000000..86795aeeb5e0 --- /dev/null +++ b/tests/crypto/libcrypto/dh/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $ + +HELPER_NAME= dhtest +HELPER_DIR= dh + +.include diff --git a/tests/crypto/libcrypto/dsa/Makefile b/tests/crypto/libcrypto/dsa/Makefile new file mode 100644 index 000000000000..7e6e1998732f --- /dev/null +++ b/tests/crypto/libcrypto/dsa/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= dsatest +HELPER_DIR= dsa + +.include diff --git a/tests/crypto/libcrypto/ec/Makefile b/tests/crypto/libcrypto/ec/Makefile new file mode 100644 index 000000000000..627febfb8e39 --- /dev/null +++ b/tests/crypto/libcrypto/ec/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= ectest +HELPER_DIR= ec + +.include diff --git a/tests/crypto/libcrypto/ecdh/Makefile b/tests/crypto/libcrypto/ecdh/Makefile new file mode 100644 index 000000000000..70447470516e --- /dev/null +++ b/tests/crypto/libcrypto/ecdh/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= ecdhtest +HELPER_DIR= ecdh + +.include diff --git a/tests/crypto/libcrypto/ecdsa/Makefile b/tests/crypto/libcrypto/ecdsa/Makefile new file mode 100644 index 000000000000..9f396e74b75c --- /dev/null +++ b/tests/crypto/libcrypto/ecdsa/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= ecdsatest +HELPER_DIR= ecdsa + +.include diff --git a/tests/crypto/libcrypto/engine/Makefile b/tests/crypto/libcrypto/engine/Makefile new file mode 100644 index 000000000000..3162a63fb1d2 --- /dev/null +++ b/tests/crypto/libcrypto/engine/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= enginetest +HELPER_DIR= engine + +.include diff --git a/tests/crypto/libcrypto/hmac/Makefile b/tests/crypto/libcrypto/hmac/Makefile new file mode 100644 index 000000000000..72e43fc2e5e9 --- /dev/null +++ b/tests/crypto/libcrypto/hmac/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= hmactest +HELPER_DIR= hmac + +.include diff --git a/tests/crypto/libcrypto/idea/Makefile b/tests/crypto/libcrypto/idea/Makefile new file mode 100644 index 000000000000..d724e3959bb1 --- /dev/null +++ b/tests/crypto/libcrypto/idea/Makefile @@ -0,0 +1,8 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= ideatest +HELPER_DIR= idea + +LDADD+= -lcrypto_idea + +.include diff --git a/tests/crypto/libcrypto/lhash/Makefile b/tests/crypto/libcrypto/lhash/Makefile new file mode 100644 index 000000000000..d4827655eec6 --- /dev/null +++ b/tests/crypto/libcrypto/lhash/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= lhashtest +HELPER_DIR= lhash +HELPER_SRCS= lh_test.c + +CPPFLAGS+= -DMalloc=malloc +DPADD+= ${LIBCRYPTO} ${LIBCRYPT} + +.include diff --git a/tests/crypto/libcrypto/md2/Makefile b/tests/crypto/libcrypto/md2/Makefile new file mode 100644 index 000000000000..3dc771a781bb --- /dev/null +++ b/tests/crypto/libcrypto/md2/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= md2test +HELPER_DIR= md2 + +.include diff --git a/tests/crypto/libcrypto/md4/Makefile b/tests/crypto/libcrypto/md4/Makefile new file mode 100644 index 000000000000..f0f5b2b1456e --- /dev/null +++ b/tests/crypto/libcrypto/md4/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= md4test +HELPER_DIR= md4 + +.include diff --git a/tests/crypto/libcrypto/md5/Makefile b/tests/crypto/libcrypto/md5/Makefile new file mode 100644 index 000000000000..4cf1ca37eef1 --- /dev/null +++ b/tests/crypto/libcrypto/md5/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= md5test +HELPER_DIR= md5 + +.include diff --git a/tests/crypto/libcrypto/mdc2/Makefile b/tests/crypto/libcrypto/mdc2/Makefile new file mode 100644 index 000000000000..f61efc8e47a9 --- /dev/null +++ b/tests/crypto/libcrypto/mdc2/Makefile @@ -0,0 +1,9 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= mdc2test +HELPER_DIR= mdc2 + +LDADD+= -lcrypto_mdc2 +DPADD+= ${LIBCRYPTO_MDC2} + +.include diff --git a/tests/crypto/libcrypto/rand/Makefile b/tests/crypto/libcrypto/rand/Makefile new file mode 100644 index 000000000000..41822abfaf7d --- /dev/null +++ b/tests/crypto/libcrypto/rand/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= randtest +HELPER_DIR= rand + +.include diff --git a/tests/crypto/libcrypto/rc2/Makefile b/tests/crypto/libcrypto/rc2/Makefile new file mode 100644 index 000000000000..a9d0768610c5 --- /dev/null +++ b/tests/crypto/libcrypto/rc2/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= rc2test +HELPER_DIR= rc2 + +.include diff --git a/tests/crypto/libcrypto/rc4/Makefile b/tests/crypto/libcrypto/rc4/Makefile new file mode 100644 index 000000000000..c4ade83d6e5d --- /dev/null +++ b/tests/crypto/libcrypto/rc4/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= rc4test +HELPER_DIR= rc4 + +.include diff --git a/tests/crypto/libcrypto/rc5/Makefile b/tests/crypto/libcrypto/rc5/Makefile new file mode 100644 index 000000000000..8519acef3abb --- /dev/null +++ b/tests/crypto/libcrypto/rc5/Makefile @@ -0,0 +1,8 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= rc5test +HELPER_DIR= rc5 + +LDADD+= -lcrypto_rc5 + +.include diff --git a/tests/crypto/libcrypto/ripemd/Makefile b/tests/crypto/libcrypto/ripemd/Makefile new file mode 100644 index 000000000000..dd55aa90a7ef --- /dev/null +++ b/tests/crypto/libcrypto/ripemd/Makefile @@ -0,0 +1,7 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= ripemdtest +HELPER_DIR= ripemd +HELPER_SRCS= rmdtest.c + +.include diff --git a/tests/crypto/libcrypto/rsa/Makefile b/tests/crypto/libcrypto/rsa/Makefile new file mode 100644 index 000000000000..b7b630488870 --- /dev/null +++ b/tests/crypto/libcrypto/rsa/Makefile @@ -0,0 +1,7 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $ + +HELPER_NAME= rsatest +HELPER_DIR= rsa +HELPER_SRCS= rsa_test.c + +.include diff --git a/tests/crypto/libcrypto/sha/Makefile b/tests/crypto/libcrypto/sha/Makefile new file mode 100644 index 000000000000..bd87f1264a9a --- /dev/null +++ b/tests/crypto/libcrypto/sha/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:16 jmmv Exp $ + +HELPER_NAME= shatest +HELPER_DIR= sha + +.include diff --git a/tests/crypto/libcrypto/sha1/Makefile b/tests/crypto/libcrypto/sha1/Makefile new file mode 100644 index 000000000000..2809bb045ecd --- /dev/null +++ b/tests/crypto/libcrypto/sha1/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:16 jmmv Exp $ + +HELPER_NAME= sha1test +HELPER_DIR= sha + +.include diff --git a/tests/crypto/libcrypto/t_libcrypto.awk b/tests/crypto/libcrypto/t_libcrypto.awk new file mode 100644 index 000000000000..6659bc1b1a9e --- /dev/null +++ b/tests/crypto/libcrypto/t_libcrypto.awk @@ -0,0 +1,65 @@ +# $NetBSD: t_libcrypto.awk,v 1.1 2009/02/13 20:58:14 jmmv Exp $ +# +# Copyright (c) 2008 The NetBSD Foundation, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +BEGIN { + FS = ":"; +}; + +/^tc:/ { + printf "atf_test_case %s\n", $2; + printf "%s_head()\n", $2; + print "{" + printf " atf_set \"descr\" \"%s\"\n", $4; + print "}" + printf "%s_body()\n", $2; + print "{" + printf " h_check %s\n", $3; + print "}" + print "" + + tcs[count++] = $2; + + next +} + +/^atf_test_case / { + tcs[count++] = substr($1, 15); + + print + next +} + + +/^tc_list/ { + for (i = 0; i < count; i++) { + printf(" atf_add_test_case %s\n", tcs[i]); + } + + next +} + +{ print } diff --git a/tests/crypto/libcrypto/t_libcrypto.in b/tests/crypto/libcrypto/t_libcrypto.in new file mode 100644 index 000000000000..f3b4d999f24d --- /dev/null +++ b/tests/crypto/libcrypto/t_libcrypto.in @@ -0,0 +1,141 @@ +# $NetBSD: t_libcrypto.in,v 1.1 2009/02/13 20:58:14 jmmv Exp $ +# +# Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +h_check() +{ + atf_check -o ignore -e ignore "$(atf_get_srcdir)/$1" +} + +# Symmetric ciphers +tc:bf:h_bftest:Checks blowfish cipher +tc:cast:h_casttest:Checks CAST cipher +tc:des:h_destest:Checks DES cipher (libdes) +tc:rc2:h_rc2test:Checks RC2 cipher +tc:rc4:h_rc4test:Checks RC4 cipher + +atf_test_case idea +idea_head() +{ + atf_set "descr" "Checks IDEA cipher" +} +idea_body() +{ + [ -x "$(atf_get_srcdir)/h_ideatest" ] \ + || atf_skip "IDEA support not available; system built" \ + "with MKCRYPTO_IDEA=no" + h_check h_ideatest +} + +atf_test_case rc5 +rc5_head() +{ + atf_set "descr" "Checks RC5 cipher" +} +rc5_body() +{ + [ -x "$(atf_get_srcdir)/h_rc5test" ] \ + || atf_skip "RC5 support not available; system built" \ + "with MKCRYPTO_RC5=no" + h_check h_rc5test +} + +# Public key cryptography +tc:dsa:h_dsatest:Checks DSA cipher +tc:dh:h_dhtest:Checks Diffie-Hellman key agreement protocol +tc:rsa:h_rsatest:Checks RSA +tc:ec:h_ectest:Checks EC cipher +tc:ecdh:h_ecdhtest:Checks ECDH key agreement protocol +tc:ecdsa:h_ecdsatest:Checks ECDSA algorithm + +# Certificates +tc:x509v3:h_x509v3test:Checks x509v3 certificates + +# Authentication codes, hash functions +tc:hmac:h_hmactest:Checks HMAC message authentication code +tc:md2:h_md2test:Checks MD2 digest +tc:md4:h_md4test:Checks MD4 digest +tc:md5:h_md5test:Checks MD5 digest +tc:ripemd:h_ripemdtest:Checks RMD-160 digest +tc:sha:h_shatest:Checks SHA-1 digest + +atf_test_case mdc2 +mdc2_head() +{ + atf_set "descr" "Checks MDC2 digest" +} +mdc2_body() +{ + [ -x "$(atf_get_srcdir)/h_mdc2test" ] \ + || atf_skip "MDC2 support not available; system built" \ + "with MKCRYPTO_MDC2=no" + h_check h_mdc2test +} + +# Auxiliary +tc:engine:h_enginetest:Checks ENGINE framework +tc:rand:h_randtest:Checks pseudo-random number generator + +atf_test_case bn +bn_head() +{ + atf_set "descr" "Checks BIGNUM library" +} +bn_body() +{ + h_check h_bntest + h_check h_divtest + h_check h_exptest +} + +atf_test_case conf +conf_head() +{ + atf_set "descr" "Checks configuration modules" +} +conf_body() +{ + cp $(atf_get_srcdir)/d_conf_ssleay.cnf ssleay.cnf + + atf_check -o file:$(atf_get_srcdir)/d_conf.out \ + $(atf_get_srcdir)/h_conftest +} + +atf_test_case lhash +lhash_head() +{ + atf_set "descr" "Checks lhash - dynamic hash tables" +} +lhash_body() +{ + atf_check -o ignore -e ignore -x \ + "echo hoge | $(atf_get_srcdir)/h_lhashtest" +} + +atf_init_test_cases() +{ +tc_list +} diff --git a/tests/crypto/libcrypto/x509v3/Makefile b/tests/crypto/libcrypto/x509v3/Makefile new file mode 100644 index 000000000000..1ea8bf376273 --- /dev/null +++ b/tests/crypto/libcrypto/x509v3/Makefile @@ -0,0 +1,7 @@ +# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:16 jmmv Exp $ + +HELPER_NAME= x509v3test +HELPER_DIR= x509v3 +HELPER_SRCS= tabtest.c + +.include