diff options
| author | ryker <> | 1998-10-05 20:13:14 +0000 |
|---|---|---|
| committer | ryker <> | 1998-10-05 20:13:14 +0000 |
| commit | fe5d0717e2760d02faf23bf5a714f17b33ae4abb (patch) | |
| tree | 8d4ad346f10a36bdd90b503d222bda6b4ecd0037 /src/lib/libssl/test/testss | |
| parent | 75bf5ead4149b2b67781def7ace1ec720ae1753e (diff) | |
| parent | aeeae06a79815dc190061534d47236cec09f9e32 (diff) | |
| download | openbsd-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/testss | 89 | ||||
| -rw-r--r-- | src/lib/libssl/test/testssl | 40 |
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 | |||
| 3 | digest='-mdc2' | ||
| 4 | reqcmd="../apps/ssleay req" | ||
| 5 | x509cmd="../apps/ssleay x509 $digest" | ||
| 6 | verifycmd="../apps/ssleay verify" | ||
| 7 | |||
| 8 | CAkey="keyCA.ss" | ||
| 9 | CAcert="certCA.ss" | ||
| 10 | CAreq="reqCA.ss" | ||
| 11 | CAconf="CAss.cnf" | ||
| 12 | CAreq2="req2CA.ss" # temp | ||
| 13 | |||
| 14 | Uconf="Uss.cnf" | ||
| 15 | Ukey="keyU.ss" | ||
| 16 | Ureq="reqU.ss" | ||
| 17 | Ucert="certU.ss" | ||
| 18 | |||
| 19 | echo | ||
| 20 | echo "make a certificate request using 'req'" | ||
| 21 | $reqcmd -config $CAconf -out $CAreq -keyout $CAkey -new #>err.ss | ||
| 22 | if [ $? != 0 ]; then | ||
| 23 | echo "error using 'req' to generate a certificate request" | ||
| 24 | exit 1 | ||
| 25 | fi | ||
| 26 | echo | ||
| 27 | echo "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 | ||
| 29 | if [ $? != 0 ]; then | ||
| 30 | echo "error using 'x509' to self sign a certificate request" | ||
| 31 | exit 1 | ||
| 32 | fi | ||
| 33 | |||
| 34 | echo | ||
| 35 | echo "convert a certificate into a certificate request using 'x509'" | ||
| 36 | $x509cmd -in $CAcert -x509toreq -signkey $CAkey -out $CAreq2 >err.ss | ||
| 37 | if [ $? != 0 ]; then | ||
| 38 | echo "error using 'x509' convert a certificate to a certificate request" | ||
| 39 | exit 1 | ||
| 40 | fi | ||
| 41 | |||
| 42 | $reqcmd -verify -in $CAreq -noout | ||
| 43 | if [ $? != 0 ]; then | ||
| 44 | echo first generated request is invalid | ||
| 45 | exit 1 | ||
| 46 | fi | ||
| 47 | |||
| 48 | $reqcmd -verify -in $CAreq2 -noout | ||
| 49 | if [ $? != 0 ]; then | ||
| 50 | echo second generated request is invalid | ||
| 51 | exit 1 | ||
| 52 | fi | ||
| 53 | |||
| 54 | $verifycmd -CAfile $CAcert $CAcert | ||
| 55 | if [ $? != 0 ]; then | ||
| 56 | echo first generated cert is invalid | ||
| 57 | exit 1 | ||
| 58 | fi | ||
| 59 | |||
| 60 | echo | ||
| 61 | echo "make another certificate request using 'req'" | ||
| 62 | $reqcmd -config $Uconf -out $Ureq -keyout $Ukey -new >err.ss | ||
| 63 | if [ $? != 0 ]; then | ||
| 64 | echo "error using 'req' to generate a certificate request" | ||
| 65 | exit 1 | ||
| 66 | fi | ||
| 67 | |||
| 68 | echo | ||
| 69 | echo "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 | ||
| 71 | if [ $? != 0 ]; then | ||
| 72 | echo "error using 'x509' to sign a certificate request" | ||
| 73 | exit 1 | ||
| 74 | fi | ||
| 75 | |||
| 76 | $verifycmd -CAfile $CAcert $Ucert | ||
| 77 | echo | ||
| 78 | echo "Certificate details" | ||
| 79 | $x509cmd -subject -issuer -startdate -enddate -noout -in $Ucert | ||
| 80 | |||
| 81 | echo | ||
| 82 | echo The generated CA certificate is $CAcert | ||
| 83 | echo The generated CA private key is $CAkey | ||
| 84 | |||
| 85 | echo The generated user certificate is $Ucert | ||
| 86 | echo The generated user private key is $Ukey | ||
| 87 | |||
| 88 | /bin/rm err.ss | ||
| 89 | exit 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 | |||
| 3 | echo test sslv2 | ||
| 4 | ./ssltest -ssl2 || exit 1 | ||
| 5 | |||
| 6 | echo test sslv2 with server authentication | ||
| 7 | ./ssltest -ssl2 -server_auth -CApath ../certs || exit 1 | ||
| 8 | |||
| 9 | echo test sslv2 with client authentication | ||
| 10 | ./ssltest -ssl2 -client_auth -CApath ../certs || exit 1 | ||
| 11 | |||
| 12 | echo test sslv2 with both client and server authentication | ||
| 13 | ./ssltest -ssl2 -server_auth -client_auth -CApath ../certs || exit 1 | ||
| 14 | |||
| 15 | echo test sslv3 | ||
| 16 | ./ssltest -ssl3 || exit 1 | ||
| 17 | |||
| 18 | echo test sslv3 with server authentication | ||
| 19 | ./ssltest -ssl3 -server_auth -CApath ../certs || exit 1 | ||
| 20 | |||
| 21 | echo test sslv3 with client authentication | ||
| 22 | ./ssltest -ssl3 -client_auth -CApath ../certs || exit 1 | ||
| 23 | |||
| 24 | echo test sslv3 with both client and server authentication | ||
| 25 | ./ssltest -ssl3 -server_auth -client_auth -CApath ../certs || exit 1 | ||
| 26 | |||
| 27 | echo test sslv2/sslv3 | ||
| 28 | ./ssltest || exit 1 | ||
| 29 | |||
| 30 | echo test sslv2/sslv3 with server authentication | ||
| 31 | ./ssltest -server_auth -CApath ../certs || exit 1 | ||
| 32 | |||
| 33 | echo test sslv2/sslv3 with client authentication | ||
| 34 | ./ssltest -client_auth -CApath ../certs || exit 1 | ||
| 35 | |||
| 36 | echo test sslv2/sslv3 with both client and server authentication | ||
| 37 | ./ssltest -server_auth -client_auth -CApath ../certs || exit 1 | ||
| 38 | |||
| 39 | exit 0 | ||
| 40 | |||
