summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2014-05-24 13:32:46 +0000
committerjsing <>2014-05-24 13:32:46 +0000
commitb1cf7548c4fb4c09ec9b0c68ae25e73ef8558ad0 (patch)
treeebc073b147392b35dd9397b327e8cce1da15ee6b /src
parent5e1ae80e3f98ab999ac233eec6f32cddbb914140 (diff)
downloadopenbsd-b1cf7548c4fb4c09ec9b0c68ae25e73ef8558ad0.tar.gz
openbsd-b1cf7548c4fb4c09ec9b0c68ae25e73ef8558ad0.tar.bz2
openbsd-b1cf7548c4fb4c09ec9b0c68ae25e73ef8558ad0.zip
Move the regress tests that are in lib/libssl to usr.sbin/openssl,
since they are really testing openssl(1) (although this also tests libcrypto and libssl), rather than actual parts of the libssl library. Discussed with miod@
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libssl/Makefile58
-rw-r--r--src/regress/lib/libssl/README6
-rw-r--r--src/regress/lib/libssl/openssl.cnf29
-rw-r--r--src/regress/lib/libssl/test_client.sh13
-rw-r--r--src/regress/lib/libssl/test_server.sh11
-rw-r--r--src/regress/lib/libssl/testdsa.sh29
-rw-r--r--src/regress/lib/libssl/testenc.sh70
-rw-r--r--src/regress/lib/libssl/testrsa.sh29
8 files changed, 0 insertions, 245 deletions
diff --git a/src/regress/lib/libssl/Makefile b/src/regress/lib/libssl/Makefile
deleted file mode 100644
index 20d2b9979d..0000000000
--- a/src/regress/lib/libssl/Makefile
+++ /dev/null
@@ -1,58 +0,0 @@
1# $OpenBSD: Makefile,v 1.16 2014/04/17 08:06:59 jsg Exp $
2
3CLEANFILES+= testdsa.key testdsa.pem rsakey.pem rsacert.pem dsa512.pem
4
5REGRESS_TARGETS=ssl-enc ssl-dsa ssl-rsa
6
7OPENSSL=/usr/sbin/openssl
8CLEAR1=p
9CIPHER=cipher
10CLEAR2=clear
11LIBCRYPTO=-lcrypto
12
13${CLEAR1}: openssl.cnf
14 cat ${.CURDIR}/openssl.cnf > ${CLEAR1}
15
16CLEANFILES+=${CLEAR1}
17
18ENCTARGETS=aes-128-cbc aes-128-cfb aes-128-cfb1 aes-128-cfb8
19ENCTARGETS+=aes-128-ecb aes-128-ofb aes-192-cbc aes-192-cfb
20ENCTARGETS+=aes-192-cfb1 aes-192-cfb8 aes-192-ecb aes-192-ofb
21ENCTARGETS+=aes-256-cbc aes-256-cfb aes-256-cfb1 aes-256-cfb8
22ENCTARGETS+=aes-256-ecb aes-256-ofb
23ENCTARGETS+=bf-cbc bf-cfb bf-ecb bf-ofb
24ENCTARGETS+=cast-cbc cast5-cbc cast5-cfb cast5-ecb cast5-ofb
25ENCTARGETS+=des-cbc des-cfb des-cfb8 des-ecb des-ede
26ENCTARGETS+=des-ede-cbc des-ede-cfb des-ede-ofb des-ede3
27ENCTARGETS+=des-ede3-cbc des-ede3-cfb des-ede3-ofb des-ofb desx-cbc
28ENCTARGETS+=rc2-40-cbc rc2-64-cbc rc2-cbc rc2-cfb rc2-ecb rc2-ofb
29ENCTARGETS+=rc4 rc4-40
30
31.for ENC in ${ENCTARGETS}
32${CIPHER}.${ENC}: ${CLEAR1}
33 ${OPENSSL} enc -${ENC} -bufsize 113 -e -k test < ${CLEAR1} > ${CIPHER}.${ENC}
34${CIPHER}.${ENC}.b64: ${CLEAR1}
35 ${OPENSSL} enc -${ENC} -bufsize 113 -a -e -k test < ${CLEAR1} > ${CIPHER}.${ENC}.b64
36
37${CLEAR2}.${ENC}: ${CIPHER}.${ENC}
38 ${OPENSSL} enc -${ENC} -bufsize 157 -d -k test < ${CIPHER}.${ENC} > ${CLEAR2}.${ENC}
39${CLEAR2}.${ENC}.b64: ${CIPHER}.${ENC}.b64
40 ${OPENSSL} enc -${ENC} -bufsize 157 -a -d -k test < ${CIPHER}.${ENC}.b64 > ${CLEAR2}.${ENC}.b64
41
42ssl-enc-${ENC}: ${CLEAR1} ${CLEAR2}.${ENC}
43 cmp ${CLEAR1} ${CLEAR2}.${ENC}
44ssl-enc-${ENC}.b64: ${CLEAR1} ${CLEAR2}.${ENC}.b64
45 cmp ${CLEAR1} ${CLEAR2}.${ENC}.b64
46
47REGRESS_TARGETS+=ssl-enc-${ENC} ssl-enc-${ENC}.b64
48CLEANFILES+=${CIPHER}.${ENC} ${CIPHER}.${ENC}.b64 ${CLEAR2}.${ENC} ${CLEAR2}.${ENC}.b64 .rnd
49.endfor
50
51ssl-enc:
52 sh ${.CURDIR}/testenc.sh ${.OBJDIR} ${.CURDIR}
53ssl-dsa:
54 sh ${.CURDIR}/testdsa.sh ${.OBJDIR} ${.CURDIR}
55ssl-rsa:
56 sh ${.CURDIR}/testrsa.sh ${.OBJDIR} ${.CURDIR}
57
58.include <bsd.regress.mk>
diff --git a/src/regress/lib/libssl/README b/src/regress/lib/libssl/README
deleted file mode 100644
index 878feca400..0000000000
--- a/src/regress/lib/libssl/README
+++ /dev/null
@@ -1,6 +0,0 @@
1testenc.sh tests encryption routines
2testdsa.sh tests DSA certificate generation
3test_server.sh starts a tls1 server using the above generated certificate
4test_client.sh starts a client to talk to the server.
5testrsa.sh tests RSA certificate generation
6
diff --git a/src/regress/lib/libssl/openssl.cnf b/src/regress/lib/libssl/openssl.cnf
deleted file mode 100644
index 9b6cf400c6..0000000000
--- a/src/regress/lib/libssl/openssl.cnf
+++ /dev/null
@@ -1,29 +0,0 @@
1# $OpenBSD: openssl.cnf,v 1.2 2001/01/29 02:05:46 niklas Exp $
2
3#
4# SSLeay example configuration file.
5# This is mostly being used for generation of certificate requests.
6#
7# hacked by iang to do DSA certs - Server
8
9RANDFILE = ./.rnd
10
11####################################################################
12[ req ]
13distinguished_name = req_distinguished_name
14encrypt_rsa_key = no
15
16[ req_distinguished_name ]
17countryName = Country Name (2 letter code)
18countryName_default = CA
19countryName_value = CA
20
21organizationName = Organization Name (eg, company)
22organizationName_value = Shake it Vera
23
240.commonName = Common Name (eg, YOUR name)
250.commonName_value = Wastelandus
26
271.commonName = Common Name (eg, YOUR name)
281.commonName_value = Maximus
29
diff --git a/src/regress/lib/libssl/test_client.sh b/src/regress/lib/libssl/test_client.sh
deleted file mode 100644
index 4f17fad80e..0000000000
--- a/src/regress/lib/libssl/test_client.sh
+++ /dev/null
@@ -1,13 +0,0 @@
1#!/bin/sh
2# $OpenBSD: test_client.sh,v 1.3 2001/01/29 02:05:48 niklas Exp $
3
4
5echo
6echo This starts a tls1 mode client to talk to the server run by
7echo ./testserver.sh. You should start the server first.
8echo
9echo type in this window after ssl negotiation and your output should
10echo be echoed by the server.
11echo
12echo
13/usr/sbin/openssl s_client -tls1
diff --git a/src/regress/lib/libssl/test_server.sh b/src/regress/lib/libssl/test_server.sh
deleted file mode 100644
index a9e2c84d4f..0000000000
--- a/src/regress/lib/libssl/test_server.sh
+++ /dev/null
@@ -1,11 +0,0 @@
1#!/bin/sh
2# $OpenBSD: test_server.sh,v 1.3 2001/01/29 02:05:48 niklas Exp $
3
4
5echo This starts a tls1 mode server using the DSA certificate in ./server.pem
6echo Run ./testclient.sh in another window and type at it, you should
7echo see the results of the ssl negotiation, and stuff you type in the client
8echo should echo in this window
9echo
10echo
11/usr/sbin/openssl s_server -tls1 -key testdsa.key -cert testdsa.pem
diff --git a/src/regress/lib/libssl/testdsa.sh b/src/regress/lib/libssl/testdsa.sh
deleted file mode 100644
index 48526eec11..0000000000
--- a/src/regress/lib/libssl/testdsa.sh
+++ /dev/null
@@ -1,29 +0,0 @@
1#!/bin/sh
2# $OpenBSD: testdsa.sh,v 1.4 2001/01/29 02:05:48 niklas Exp $
3
4
5#Test DSA certificate generation of openssl
6
7cd $1
8
9# Generate DSA paramter set
10openssl dsaparam 512 -out dsa512.pem
11if [ $? != 0 ]; then
12 exit 1;
13fi
14
15
16# Denerate a DSA certificate
17openssl req -config $2/openssl.cnf -x509 -newkey dsa:dsa512.pem -out testdsa.pem -keyout testdsa.key
18if [ $? != 0 ]; then
19 exit 1;
20fi
21
22
23# Now check the certificate
24openssl x509 -text -in testdsa.pem
25if [ $? != 0 ]; then
26 exit 1;
27fi
28
29exit 0
diff --git a/src/regress/lib/libssl/testenc.sh b/src/regress/lib/libssl/testenc.sh
deleted file mode 100644
index 355e9cd923..0000000000
--- a/src/regress/lib/libssl/testenc.sh
+++ /dev/null
@@ -1,70 +0,0 @@
1#!/bin/sh
2# $OpenBSD: testenc.sh,v 1.6 2002/01/15 18:51:39 art Exp $
3
4
5testsrc=$2/openssl.cnf
6test=$1/p
7cmd=/usr/sbin/openssl
8
9cd $1
10
11cat $testsrc >$test;
12
13echo cat
14$cmd enc < $test > $test.cipher
15$cmd enc < $test.cipher >$test.clear
16cmp $test $test.clear
17if [ $? != 0 ]
18then
19 exit 1
20else
21 /bin/rm $test.cipher $test.clear
22fi
23echo base64
24$cmd enc -a -e < $test > $test.cipher
25$cmd enc -a -d < $test.cipher >$test.clear
26cmp $test $test.clear
27if [ $? != 0 ]
28then
29 exit 1
30else
31 /bin/rm $test.cipher $test.clear
32fi
33
34/bin/rm -f $test
35exit 0
36
37# These tests are now done by the makefile.
38
39for i in rc4 \
40 des-cfb des-ede-cfb des-ede3-cfb \
41 des-ofb des-ede-ofb des-ede3-ofb \
42 des-ecb des-ede des-ede3 desx \
43 des-cbc des-ede-cbc des-ede3-cbc \
44 rc2-ecb rc2-cfb rc2-ofb rc2-cbc \
45 bf-ecb bf-cfb bf-ofb bf-cbc rc4 \
46 cast5-ecb cast5-cfb cast5-ofb cast5-cbc
47do
48 echo $i
49 $cmd $i -bufsize 113 -e -k test < $test > $test.$i.cipher
50 $cmd $i -bufsize 157 -d -k test < $test.$i.cipher >$test.$i.clear
51 cmp $test $test.$i.clear
52 if [ $? != 0 ]
53 then
54 exit 1
55 else
56 /bin/rm $test.$i.cipher $test.$i.clear
57 fi
58
59 echo $i base64
60 $cmd $i -bufsize 113 -a -e -k test < $test > $test.$i.cipher
61 $cmd $i -bufsize 157 -a -d -k test < $test.$i.cipher >$test.$i.clear
62 cmp $test $test.$i.clear
63 if [ $? != 0 ]
64 then
65 exit 1
66 else
67 /bin/rm $test.$i.cipher $test.$i.clear
68 fi
69done
70rm -f $test
diff --git a/src/regress/lib/libssl/testrsa.sh b/src/regress/lib/libssl/testrsa.sh
deleted file mode 100644
index 17c6abf7ce..0000000000
--- a/src/regress/lib/libssl/testrsa.sh
+++ /dev/null
@@ -1,29 +0,0 @@
1#!/bin/sh
2# $OpenBSD: testrsa.sh,v 1.6 2002/01/02 15:13:18 art Exp $
3
4
5#Test RSA certificate generation of openssl
6
7cd $1
8
9# Generate RSA private key
10openssl genrsa -out rsakey.pem
11if [ $? != 0 ]; then
12 exit 1;
13fi
14
15
16# Generate an RSA certificate
17openssl req -config $2/openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem
18if [ $? != 0 ]; then
19 exit 1;
20fi
21
22
23# Now check the certificate
24openssl x509 -text -in rsacert.pem
25if [ $? != 0 ]; then
26 exit 1;
27fi
28
29exit 0