summaryrefslogtreecommitdiff
path: root/src/lib/libssl/test/testss
diff options
context:
space:
mode:
authorryker <>1998-10-05 20:13:14 +0000
committerryker <>1998-10-05 20:13:14 +0000
commitfe5d0717e2760d02faf23bf5a714f17b33ae4abb (patch)
tree8d4ad346f10a36bdd90b503d222bda6b4ecd0037 /src/lib/libssl/test/testss
parent75bf5ead4149b2b67781def7ace1ec720ae1753e (diff)
parentaeeae06a79815dc190061534d47236cec09f9e32 (diff)
downloadopenbsd-fe5d0717e2760d02faf23bf5a714f17b33ae4abb.tar.gz
openbsd-fe5d0717e2760d02faf23bf5a714f17b33ae4abb.tar.bz2
openbsd-fe5d0717e2760d02faf23bf5a714f17b33ae4abb.zip
This commit was generated by cvs2git to track changes on a CVS vendor
branch.
Diffstat (limited to '')
-rw-r--r--src/lib/libssl/test/testss89
-rw-r--r--src/lib/libssl/test/testssl40
2 files changed, 129 insertions, 0 deletions
diff --git a/src/lib/libssl/test/testss b/src/lib/libssl/test/testss
new file mode 100644
index 0000000000..a5aecf4694
--- /dev/null
+++ b/src/lib/libssl/test/testss
@@ -0,0 +1,89 @@
1#!/bin/sh
2
3digest='-mdc2'
4reqcmd="../apps/ssleay req"
5x509cmd="../apps/ssleay x509 $digest"
6verifycmd="../apps/ssleay verify"
7
8CAkey="keyCA.ss"
9CAcert="certCA.ss"
10CAreq="reqCA.ss"
11CAconf="CAss.cnf"
12CAreq2="req2CA.ss" # temp
13
14Uconf="Uss.cnf"
15Ukey="keyU.ss"
16Ureq="reqU.ss"
17Ucert="certU.ss"
18
19echo
20echo "make a certificate request using 'req'"
21$reqcmd -config $CAconf -out $CAreq -keyout $CAkey -new #>err.ss
22if [ $? != 0 ]; then
23 echo "error using 'req' to generate a certificate request"
24 exit 1
25fi
26echo
27echo "convert the certificate request into a self signed certificate using 'x509'"
28$x509cmd -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey >err.ss
29if [ $? != 0 ]; then
30 echo "error using 'x509' to self sign a certificate request"
31 exit 1
32fi
33
34echo
35echo "convert a certificate into a certificate request using 'x509'"
36$x509cmd -in $CAcert -x509toreq -signkey $CAkey -out $CAreq2 >err.ss
37if [ $? != 0 ]; then
38 echo "error using 'x509' convert a certificate to a certificate request"
39 exit 1
40fi
41
42$reqcmd -verify -in $CAreq -noout
43if [ $? != 0 ]; then
44 echo first generated request is invalid
45 exit 1
46fi
47
48$reqcmd -verify -in $CAreq2 -noout
49if [ $? != 0 ]; then
50 echo second generated request is invalid
51 exit 1
52fi
53
54$verifycmd -CAfile $CAcert $CAcert
55if [ $? != 0 ]; then
56 echo first generated cert is invalid
57 exit 1
58fi
59
60echo
61echo "make another certificate request using 'req'"
62$reqcmd -config $Uconf -out $Ureq -keyout $Ukey -new >err.ss
63if [ $? != 0 ]; then
64 echo "error using 'req' to generate a certificate request"
65 exit 1
66fi
67
68echo
69echo "sign certificate request with the just created CA via 'x509'"
70$x509cmd -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey >err.ss
71if [ $? != 0 ]; then
72 echo "error using 'x509' to sign a certificate request"
73 exit 1
74fi
75
76$verifycmd -CAfile $CAcert $Ucert
77echo
78echo "Certificate details"
79$x509cmd -subject -issuer -startdate -enddate -noout -in $Ucert
80
81echo
82echo The generated CA certificate is $CAcert
83echo The generated CA private key is $CAkey
84
85echo The generated user certificate is $Ucert
86echo The generated user private key is $Ukey
87
88/bin/rm err.ss
89exit 0
diff --git a/src/lib/libssl/test/testssl b/src/lib/libssl/test/testssl
new file mode 100644
index 0000000000..f115adb8e1
--- /dev/null
+++ b/src/lib/libssl/test/testssl
@@ -0,0 +1,40 @@
1#!/bin/sh
2
3echo test sslv2
4./ssltest -ssl2 || exit 1
5
6echo test sslv2 with server authentication
7./ssltest -ssl2 -server_auth -CApath ../certs || exit 1
8
9echo test sslv2 with client authentication
10./ssltest -ssl2 -client_auth -CApath ../certs || exit 1
11
12echo test sslv2 with both client and server authentication
13./ssltest -ssl2 -server_auth -client_auth -CApath ../certs || exit 1
14
15echo test sslv3
16./ssltest -ssl3 || exit 1
17
18echo test sslv3 with server authentication
19./ssltest -ssl3 -server_auth -CApath ../certs || exit 1
20
21echo test sslv3 with client authentication
22./ssltest -ssl3 -client_auth -CApath ../certs || exit 1
23
24echo test sslv3 with both client and server authentication
25./ssltest -ssl3 -server_auth -client_auth -CApath ../certs || exit 1
26
27echo test sslv2/sslv3
28./ssltest || exit 1
29
30echo test sslv2/sslv3 with server authentication
31./ssltest -server_auth -CApath ../certs || exit 1
32
33echo test sslv2/sslv3 with client authentication
34./ssltest -client_auth -CApath ../certs || exit 1
35
36echo test sslv2/sslv3 with both client and server authentication
37./ssltest -server_auth -client_auth -CApath ../certs || exit 1
38
39exit 0
40