summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
Diffstat (limited to 'regress')
-rw-r--r--regress/lib/libssl/Makefile37
-rw-r--r--regress/lib/libssl/testenc.sh7
2 files changed, 42 insertions, 2 deletions
diff --git a/regress/lib/libssl/Makefile b/regress/lib/libssl/Makefile
index 325bd9f7f2f..2939792f2ca 100644
--- a/regress/lib/libssl/Makefile
+++ b/regress/lib/libssl/Makefile
@@ -1,9 +1,44 @@
-# $OpenBSD: Makefile,v 1.5 2002/01/02 15:17:34 art Exp $
+# $OpenBSD: Makefile,v 1.6 2002/01/15 18:51:39 art Exp $
CLEANFILES+= testdsa.key testdsa.pem rsakey.pem rsacert.pem dsa512.pem
REGRESSTARGETS=ssl-enc ssl-dsa ssl-rsa
+OPENSSL=/usr/sbin/openssl
+CLEAR1=p
+CIPHER=cipher
+CLEAR2=clear
+
+${CLEAR1}: openssl.cnf
+ cat ${.CURDIR}/openssl.cnf > ${CLEAR1}
+
+CLEANFILES+=${CLEAR1}
+
+ENCTARGETS=rc4 des-cfb des-ede-cfb des-ede3-cfb des-ofb des-ede-ofb des-ede3-ofb
+ENCTARGETS+=des-ecb des-ede des-ede3 desx des-cbc des-ede-cbc des-ede3-cbc
+ENCTARGETS+=rc2-ecb rc2-cfb rc2-ofb rc2-cbc bf-ecb bf-cfb bf-ofb bf-cbc rc4
+ENCTARGETS+=cast5-ecb cast5-cfb cast5-ofb cast5-cbc
+
+.for ENC in ${ENCTARGETS}
+${CIPHER}.${ENC}: ${CLEAR1}
+ ${OPENSSL} ${ENC} -bufsize 113 -e -k test < ${CLEAR1} > ${CIPHER}.${ENC}
+${CIPHER}.${ENC}.b64: ${CLEAR1}
+ ${OPENSSL} ${ENC} -bufsize 113 -a -e -k test < ${CLEAR1} > ${CIPHER}.${ENC}.b64
+
+${CLEAR2}.${ENC}: ${CIPHER}.${ENC}
+ ${OPENSSL} ${ENC} -bufsize 157 -d -k test < ${CIPHER}.${ENC} > ${CLEAR2}.${ENC}
+${CLEAR2}.${ENC}.b64: ${CIPHER}.${ENC}.b64
+ ${OPENSSL} ${ENC} -bufsize 157 -a -d -k test < ${CIPHER}.${ENC}.b64 > ${CLEAR2}.${ENC}.b64
+
+ssl-enc-${ENC}: ${CLEAR1} ${CLEAR2}.${ENC}
+ cmp ${CLEAR1} ${CLEAR2}.${ENC}
+ssl-enc-${ENC}.b64: ${CLEAR1} ${CLEAR2}.${ENC}.b64
+ cmp ${CLEAR1} ${CLEAR2}.${ENC}.b64
+
+REGRESSTARGETS+=ssl-enc-${ENC} ssl-enc-${ENC}.b64
+CLEANFILES+=${CIPHER}.${ENC} ${CIPHER}.${ENC}.b64 ${CLEAR2}.${ENC} ${CLEAR2}.${ENC}.b64
+.endfor
+
ssl-enc:
sh ${.CURDIR}/testenc.sh ${.OBJDIR} ${.CURDIR}
ssl-dsa:
diff --git a/regress/lib/libssl/testenc.sh b/regress/lib/libssl/testenc.sh
index d1da3139d14..355e9cd923e 100644
--- a/regress/lib/libssl/testenc.sh
+++ b/regress/lib/libssl/testenc.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: testenc.sh,v 1.5 2001/01/29 02:05:48 niklas Exp $
+# $OpenBSD: testenc.sh,v 1.6 2002/01/15 18:51:39 art Exp $
testsrc=$2/openssl.cnf
@@ -31,6 +31,11 @@ else
/bin/rm $test.cipher $test.clear
fi
+/bin/rm -f $test
+exit 0
+
+# These tests are now done by the makefile.
+
for i in rc4 \
des-cfb des-ede-cfb des-ede3-cfb \
des-ofb des-ede-ofb des-ede3-ofb \