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
commitaeeae06a79815dc190061534d47236cec09f9e32 (patch)
tree851692b9c2f9c04f077666855641900f19fdb217 /src/lib/libssl/test/testss
parenta4f79641824cbf9f60ca9d1168d1fcc46717a82a (diff)
downloadopenbsd-aeeae06a79815dc190061534d47236cec09f9e32.tar.gz
openbsd-aeeae06a79815dc190061534d47236cec09f9e32.tar.bz2
openbsd-aeeae06a79815dc190061534d47236cec09f9e32.zip
Import of SSLeay-0.9.0b with RSA and IDEA stubbed + OpenBSD build
functionality for shared libs. Note that routines such as sslv2_init and friends that use RSA will not work due to lack of RSA in this library. Needs documentation and help from ports for easy upgrade to full functionality where legally possible.
Diffstat (limited to 'src/lib/libssl/test/testss')
-rw-r--r--src/lib/libssl/test/testss89
1 files changed, 89 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