summaryrefslogtreecommitdiffstats
path: root/test/testss
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2004-12-28 00:21:35 +0000
committerRichard Levitte <levitte@openssl.org>2004-12-28 00:21:35 +0000
commit6951c23afd4e7951451a4d90023111a06e86589f (patch)
tree0eca84b83a120737ac41da268b6baba4484ded68 /test/testss
parentde421076a5e0cbf31268c8769f5ac0889bef79ba (diff)
Add functionality needed to process proxy certificates.
Diffstat (limited to 'test/testss')
-rw-r--r--test/testss76
1 files changed, 70 insertions, 6 deletions
diff --git a/test/testss b/test/testss
index 8d3557f356..e71510befa 100644
--- a/test/testss
+++ b/test/testss
@@ -17,6 +17,18 @@ Ukey="keyU.ss"
Ureq="reqU.ss"
Ucert="certU.ss"
+P1conf="P1ss.cnf"
+P1key="keyP1.ss"
+P1req="reqP1.ss"
+P1cert="certP1.ss"
+P1intermediate="tmp_intP1.ss"
+
+P2conf="P2ss.cnf"
+P2key="keyP2.ss"
+P2req="reqP2.ss"
+P2cert="certP2.ss"
+P2intermediate="tmp_intP2.ss"
+
echo
echo "make a certificate request using 'req'"
@@ -35,7 +47,7 @@ if [ $? != 0 ]; then
fi
echo
echo "convert the certificate request into a self signed certificate using 'x509'"
-$x509cmd -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey >err.ss
+$x509cmd -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey -extfile $CAconf -extensions v3_ca >err.ss
if [ $? != 0 ]; then
echo "error using 'x509' to self sign a certificate request"
exit 1
@@ -68,18 +80,18 @@ if [ $? != 0 ]; then
fi
echo
-echo "make another certificate request using 'req'"
+echo "make a user certificate request using 'req'"
$reqcmd -config $Uconf -out $Ureq -keyout $Ukey $req_new >err.ss
if [ $? != 0 ]; then
- echo "error using 'req' to generate a certificate request"
+ echo "error using 'req' to generate a user certificate request"
exit 1
fi
echo
-echo "sign certificate request with the just created CA via 'x509'"
-$x509cmd -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey >err.ss
+echo "sign user certificate request with the just created CA via 'x509'"
+$x509cmd -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey -extfile $Uconf -extensions v3_ee >err.ss
if [ $? != 0 ]; then
- echo "error using 'x509' to sign a certificate request"
+ echo "error using 'x509' to sign a user certificate request"
exit 1
fi
@@ -89,11 +101,63 @@ echo "Certificate details"
$x509cmd -subject -issuer -startdate -enddate -noout -in $Ucert
echo
+echo "make a proxy certificate request using 'req'"
+$reqcmd -config $P1conf -out $P1req -keyout $P1key $req_new >err.ss
+if [ $? != 0 ]; then
+ echo "error using 'req' to generate a proxy certificate request"
+ exit 1
+fi
+
+echo
+echo "sign proxy certificate request with the just created user certificate via 'x509'"
+$x509cmd -CAcreateserial -in $P1req -days 30 -req -out $P1cert -CA $Ucert -CAkey $Ukey -extfile $P1conf -extensions v3_proxy >err.ss
+if [ $? != 0 ]; then
+ echo "error using 'x509' to sign a proxy certificate request"
+ exit 1
+fi
+
+cat $Ucert > $P1intermediate
+$verifycmd -CAfile $CAcert -untrusted $P1intermediate $P1cert
+echo
+echo "Certificate details"
+$x509cmd -subject -issuer -startdate -enddate -noout -in $P1cert
+
+echo
+echo "make another proxy certificate request using 'req'"
+$reqcmd -config $P2conf -out $P2req -keyout $P2key $req_new >err.ss
+if [ $? != 0 ]; then
+ echo "error using 'req' to generate another proxy certificate request"
+ exit 1
+fi
+
+echo
+echo "sign second proxy certificate request with the first proxy certificate via 'x509'"
+$x509cmd -CAcreateserial -in $P2req -days 30 -req -out $P2cert -CA $P1cert -CAkey $P1key -extfile $P2conf -extensions v3_proxy >err.ss
+if [ $? != 0 ]; then
+ echo "error using 'x509' to sign a second proxy certificate request"
+ exit 1
+fi
+
+cat $Ucert $P1cert > $P2intermediate
+$verifycmd -CAfile $CAcert -untrusted $P2intermediate $P2cert
+echo
+echo "Certificate details"
+$x509cmd -subject -issuer -startdate -enddate -noout -in $P2cert
+
+echo
echo The generated CA certificate is $CAcert
echo The generated CA private key is $CAkey
echo The generated user certificate is $Ucert
echo The generated user private key is $Ukey
+echo The first generated proxy certificate is $P1cert
+echo The first generated proxy private key is $P1key
+
+echo The second generated proxy certificate is $P2cert
+echo The second generated proxy private key is $P2key
+
/bin/rm err.ss
+#/bin/rm $P1intermediate
+#/bin/rm $P2intermediate
exit 0