diff options
author | jsing <> | 2014-05-24 13:32:46 +0000 |
---|---|---|
committer | jsing <> | 2014-05-24 13:32:46 +0000 |
commit | b1cf7548c4fb4c09ec9b0c68ae25e73ef8558ad0 (patch) | |
tree | ebc073b147392b35dd9397b327e8cce1da15ee6b /src | |
parent | 5e1ae80e3f98ab999ac233eec6f32cddbb914140 (diff) | |
download | openbsd-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/Makefile | 58 | ||||
-rw-r--r-- | src/regress/lib/libssl/README | 6 | ||||
-rw-r--r-- | src/regress/lib/libssl/openssl.cnf | 29 | ||||
-rw-r--r-- | src/regress/lib/libssl/test_client.sh | 13 | ||||
-rw-r--r-- | src/regress/lib/libssl/test_server.sh | 11 | ||||
-rw-r--r-- | src/regress/lib/libssl/testdsa.sh | 29 | ||||
-rw-r--r-- | src/regress/lib/libssl/testenc.sh | 70 | ||||
-rw-r--r-- | src/regress/lib/libssl/testrsa.sh | 29 |
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 | |||
3 | CLEANFILES+= testdsa.key testdsa.pem rsakey.pem rsacert.pem dsa512.pem | ||
4 | |||
5 | REGRESS_TARGETS=ssl-enc ssl-dsa ssl-rsa | ||
6 | |||
7 | OPENSSL=/usr/sbin/openssl | ||
8 | CLEAR1=p | ||
9 | CIPHER=cipher | ||
10 | CLEAR2=clear | ||
11 | LIBCRYPTO=-lcrypto | ||
12 | |||
13 | ${CLEAR1}: openssl.cnf | ||
14 | cat ${.CURDIR}/openssl.cnf > ${CLEAR1} | ||
15 | |||
16 | CLEANFILES+=${CLEAR1} | ||
17 | |||
18 | ENCTARGETS=aes-128-cbc aes-128-cfb aes-128-cfb1 aes-128-cfb8 | ||
19 | ENCTARGETS+=aes-128-ecb aes-128-ofb aes-192-cbc aes-192-cfb | ||
20 | ENCTARGETS+=aes-192-cfb1 aes-192-cfb8 aes-192-ecb aes-192-ofb | ||
21 | ENCTARGETS+=aes-256-cbc aes-256-cfb aes-256-cfb1 aes-256-cfb8 | ||
22 | ENCTARGETS+=aes-256-ecb aes-256-ofb | ||
23 | ENCTARGETS+=bf-cbc bf-cfb bf-ecb bf-ofb | ||
24 | ENCTARGETS+=cast-cbc cast5-cbc cast5-cfb cast5-ecb cast5-ofb | ||
25 | ENCTARGETS+=des-cbc des-cfb des-cfb8 des-ecb des-ede | ||
26 | ENCTARGETS+=des-ede-cbc des-ede-cfb des-ede-ofb des-ede3 | ||
27 | ENCTARGETS+=des-ede3-cbc des-ede3-cfb des-ede3-ofb des-ofb desx-cbc | ||
28 | ENCTARGETS+=rc2-40-cbc rc2-64-cbc rc2-cbc rc2-cfb rc2-ecb rc2-ofb | ||
29 | ENCTARGETS+=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 | |||
42 | ssl-enc-${ENC}: ${CLEAR1} ${CLEAR2}.${ENC} | ||
43 | cmp ${CLEAR1} ${CLEAR2}.${ENC} | ||
44 | ssl-enc-${ENC}.b64: ${CLEAR1} ${CLEAR2}.${ENC}.b64 | ||
45 | cmp ${CLEAR1} ${CLEAR2}.${ENC}.b64 | ||
46 | |||
47 | REGRESS_TARGETS+=ssl-enc-${ENC} ssl-enc-${ENC}.b64 | ||
48 | CLEANFILES+=${CIPHER}.${ENC} ${CIPHER}.${ENC}.b64 ${CLEAR2}.${ENC} ${CLEAR2}.${ENC}.b64 .rnd | ||
49 | .endfor | ||
50 | |||
51 | ssl-enc: | ||
52 | sh ${.CURDIR}/testenc.sh ${.OBJDIR} ${.CURDIR} | ||
53 | ssl-dsa: | ||
54 | sh ${.CURDIR}/testdsa.sh ${.OBJDIR} ${.CURDIR} | ||
55 | ssl-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 @@ | |||
1 | testenc.sh tests encryption routines | ||
2 | testdsa.sh tests DSA certificate generation | ||
3 | test_server.sh starts a tls1 server using the above generated certificate | ||
4 | test_client.sh starts a client to talk to the server. | ||
5 | testrsa.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 | |||
9 | RANDFILE = ./.rnd | ||
10 | |||
11 | #################################################################### | ||
12 | [ req ] | ||
13 | distinguished_name = req_distinguished_name | ||
14 | encrypt_rsa_key = no | ||
15 | |||
16 | [ req_distinguished_name ] | ||
17 | countryName = Country Name (2 letter code) | ||
18 | countryName_default = CA | ||
19 | countryName_value = CA | ||
20 | |||
21 | organizationName = Organization Name (eg, company) | ||
22 | organizationName_value = Shake it Vera | ||
23 | |||
24 | 0.commonName = Common Name (eg, YOUR name) | ||
25 | 0.commonName_value = Wastelandus | ||
26 | |||
27 | 1.commonName = Common Name (eg, YOUR name) | ||
28 | 1.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 | |||
5 | echo | ||
6 | echo This starts a tls1 mode client to talk to the server run by | ||
7 | echo ./testserver.sh. You should start the server first. | ||
8 | echo | ||
9 | echo type in this window after ssl negotiation and your output should | ||
10 | echo be echoed by the server. | ||
11 | echo | ||
12 | echo | ||
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 | |||
5 | echo This starts a tls1 mode server using the DSA certificate in ./server.pem | ||
6 | echo Run ./testclient.sh in another window and type at it, you should | ||
7 | echo see the results of the ssl negotiation, and stuff you type in the client | ||
8 | echo should echo in this window | ||
9 | echo | ||
10 | echo | ||
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 | |||
7 | cd $1 | ||
8 | |||
9 | # Generate DSA paramter set | ||
10 | openssl dsaparam 512 -out dsa512.pem | ||
11 | if [ $? != 0 ]; then | ||
12 | exit 1; | ||
13 | fi | ||
14 | |||
15 | |||
16 | # Denerate a DSA certificate | ||
17 | openssl req -config $2/openssl.cnf -x509 -newkey dsa:dsa512.pem -out testdsa.pem -keyout testdsa.key | ||
18 | if [ $? != 0 ]; then | ||
19 | exit 1; | ||
20 | fi | ||
21 | |||
22 | |||
23 | # Now check the certificate | ||
24 | openssl x509 -text -in testdsa.pem | ||
25 | if [ $? != 0 ]; then | ||
26 | exit 1; | ||
27 | fi | ||
28 | |||
29 | exit 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 | |||
5 | testsrc=$2/openssl.cnf | ||
6 | test=$1/p | ||
7 | cmd=/usr/sbin/openssl | ||
8 | |||
9 | cd $1 | ||
10 | |||
11 | cat $testsrc >$test; | ||
12 | |||
13 | echo cat | ||
14 | $cmd enc < $test > $test.cipher | ||
15 | $cmd enc < $test.cipher >$test.clear | ||
16 | cmp $test $test.clear | ||
17 | if [ $? != 0 ] | ||
18 | then | ||
19 | exit 1 | ||
20 | else | ||
21 | /bin/rm $test.cipher $test.clear | ||
22 | fi | ||
23 | echo base64 | ||
24 | $cmd enc -a -e < $test > $test.cipher | ||
25 | $cmd enc -a -d < $test.cipher >$test.clear | ||
26 | cmp $test $test.clear | ||
27 | if [ $? != 0 ] | ||
28 | then | ||
29 | exit 1 | ||
30 | else | ||
31 | /bin/rm $test.cipher $test.clear | ||
32 | fi | ||
33 | |||
34 | /bin/rm -f $test | ||
35 | exit 0 | ||
36 | |||
37 | # These tests are now done by the makefile. | ||
38 | |||
39 | for 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 | ||
47 | do | ||
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 | ||
69 | done | ||
70 | rm -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 | |||
7 | cd $1 | ||
8 | |||
9 | # Generate RSA private key | ||
10 | openssl genrsa -out rsakey.pem | ||
11 | if [ $? != 0 ]; then | ||
12 | exit 1; | ||
13 | fi | ||
14 | |||
15 | |||
16 | # Generate an RSA certificate | ||
17 | openssl req -config $2/openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem | ||
18 | if [ $? != 0 ]; then | ||
19 | exit 1; | ||
20 | fi | ||
21 | |||
22 | |||
23 | # Now check the certificate | ||
24 | openssl x509 -text -in rsacert.pem | ||
25 | if [ $? != 0 ]; then | ||
26 | exit 1; | ||
27 | fi | ||
28 | |||
29 | exit 0 | ||