Convert libcrypto tests to ATF. Original work done by Lukasz Strzygowski

in the GSoC 2008 atfify project.  Reorganization of files and build system
reworked by me.
This commit is contained in:
jmmv 2009-02-13 20:58:13 +00:00
parent a72a7c9806
commit fd2c7cbdc1
43 changed files with 736 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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 <bsd.own.mk>
SUBDIR= fs games net util syscall
SUBDIR= crypto fs games net util syscall
.if ${MACHINE} != "evbppc"
SUBDIR+= modules

6
tests/crypto/Atffile Normal file
View File

@ -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: *

10
tests/crypto/Makefile Normal file
View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $
.include <bsd.own.mk>
SUBDIR= libcrypto
TESTSDIR= ${TESTSBASE}/crypto
.include <bsd.test.mk>
.include <bsd.subdir.mk>

View File

@ -0,0 +1,5 @@
Content-Type: application/X-atf-atffile; version="1"
prop: test-suite = "NetBSD"
tp: t_libcrypto

View File

@ -0,0 +1,29 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $
.include <bsd.own.mk>
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 <bsd.subdir.mk>
.include <bsd.test.mk>

View File

@ -0,0 +1,28 @@
# $NetBSD: Makefile.inc,v 1.1 2009/02/13 20:58:14 jmmv Exp $
.include <bsd.own.mk>
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 <bsd.test.mk>
.include <bsd.prog.mk>
.endif

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $
HELPER_NAME= bftest
HELPER_DIR= bf
.include <bsd.init.mk>

View File

@ -0,0 +1,7 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $
.include <bsd.own.mk>
SUBDIR=bn div exp
.include <bsd.subdir.mk>

View File

@ -0,0 +1,3 @@
# $NetBSD: Makefile.inc,v 1.1 2009/02/13 20:58:14 jmmv Exp $
.include "../Makefile.inc"

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $
HELPER_NAME= bntest
HELPER_DIR= bn
.include <bsd.init.mk>

View File

@ -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 <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $
HELPER_NAME= exptest
HELPER_DIR= bn
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $
HELPER_NAME= casttest
HELPER_DIR= cast
.include <bsd.init.mk>

View File

@ -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 <bsd.init.mk>

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $
HELPER_NAME= destest
HELPER_DIR= des
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:14 jmmv Exp $
HELPER_NAME= dhtest
HELPER_DIR= dh
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $
HELPER_NAME= dsatest
HELPER_DIR= dsa
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $
HELPER_NAME= ectest
HELPER_DIR= ec
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $
HELPER_NAME= ecdhtest
HELPER_DIR= ecdh
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $
HELPER_NAME= ecdsatest
HELPER_DIR= ecdsa
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $
HELPER_NAME= enginetest
HELPER_DIR= engine
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $
HELPER_NAME= hmactest
HELPER_DIR= hmac
.include <bsd.init.mk>

View File

@ -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 <bsd.init.mk>

View File

@ -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 <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $
HELPER_NAME= md2test
HELPER_DIR= md2
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $
HELPER_NAME= md4test
HELPER_DIR= md4
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $
HELPER_NAME= md5test
HELPER_DIR= md5
.include <bsd.init.mk>

View File

@ -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 <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $
HELPER_NAME= randtest
HELPER_DIR= rand
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $
HELPER_NAME= rc2test
HELPER_DIR= rc2
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:15 jmmv Exp $
HELPER_NAME= rc4test
HELPER_DIR= rc4
.include <bsd.init.mk>

View File

@ -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 <bsd.init.mk>

View File

@ -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 <bsd.init.mk>

View File

@ -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 <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:16 jmmv Exp $
HELPER_NAME= shatest
HELPER_DIR= sha
.include <bsd.init.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2009/02/13 20:58:16 jmmv Exp $
HELPER_NAME= sha1test
HELPER_DIR= sha
.include <bsd.init.mk>

View File

@ -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 }

View File

@ -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
}

View File

@ -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 <bsd.init.mk>