diff options
| author | cvs2svn <admin@example.com> | 2002-05-15 02:29:23 +0000 |
|---|---|---|
| committer | cvs2svn <admin@example.com> | 2002-05-15 02:29:23 +0000 |
| commit | fd9566423b542798f5c8b06e68101a9ea5bb9885 (patch) | |
| tree | f2cc037857a260afc5aaaaaa6cf62d06923c6273 /src/lib/libssl/test/testss.com | |
| parent | 536c76cbb863bab152f19842ab88772c01e922c7 (diff) | |
| download | openbsd-fd9566423b542798f5c8b06e68101a9ea5bb9885.tar.gz openbsd-fd9566423b542798f5c8b06e68101a9ea5bb9885.tar.bz2 openbsd-fd9566423b542798f5c8b06e68101a9ea5bb9885.zip | |
This commit was manufactured by cvs2git to create branch 'openssl'.
Diffstat (limited to 'src/lib/libssl/test/testss.com')
| -rw-r--r-- | src/lib/libssl/test/testss.com | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/src/lib/libssl/test/testss.com b/src/lib/libssl/test/testss.com new file mode 100644 index 0000000000..ce2c4b43f6 --- /dev/null +++ b/src/lib/libssl/test/testss.com | |||
| @@ -0,0 +1,105 @@ | |||
| 1 | $! TESTSS.COM | ||
| 2 | $ | ||
| 3 | $ __arch := VAX | ||
| 4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
| 5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
| 6 | $ | ||
| 7 | $ digest="-mdc2" | ||
| 8 | $ reqcmd := mcr 'exe_dir'openssl req | ||
| 9 | $ x509cmd := mcr 'exe_dir'openssl x509 'digest' | ||
| 10 | $ verifycmd := mcr 'exe_dir'openssl verify | ||
| 11 | $ dummycnf := sys$disk:[-.apps]openssl-vms.cnf | ||
| 12 | $ | ||
| 13 | $ CAkey="""keyCA.ss""" | ||
| 14 | $ CAcert="""certCA.ss""" | ||
| 15 | $ CAreq="""reqCA.ss""" | ||
| 16 | $ CAconf="""CAss.cnf""" | ||
| 17 | $ CAreq2="""req2CA.ss""" ! temp | ||
| 18 | $ | ||
| 19 | $ Uconf="""Uss.cnf""" | ||
| 20 | $ Ukey="""keyU.ss""" | ||
| 21 | $ Ureq="""reqU.ss""" | ||
| 22 | $ Ucert="""certU.ss""" | ||
| 23 | $ | ||
| 24 | $ write sys$output "" | ||
| 25 | $ write sys$output "make a certificate request using 'req'" | ||
| 26 | $ 'reqcmd' -config 'CAconf' -out 'CAreq' -keyout 'CAkey' -new ! -out err.ss | ||
| 27 | $ if $severity .ne. 1 | ||
| 28 | $ then | ||
| 29 | $ write sys$output "error using 'req' to generate a certificate request" | ||
| 30 | $ exit 3 | ||
| 31 | $ endif | ||
| 32 | $ write sys$output "" | ||
| 33 | $ write sys$output "convert the certificate request into a self signed certificate using 'x509'" | ||
| 34 | $ define /user sys$output err.ss | ||
| 35 | $ 'x509cmd' "-CAcreateserial" -in 'CAreq' -days 30 -req -out 'CAcert' -signkey 'CAkey' | ||
| 36 | $ if $severity .ne. 1 | ||
| 37 | $ then | ||
| 38 | $ write sys$output "error using 'x509' to self sign a certificate request" | ||
| 39 | $ exit 3 | ||
| 40 | $ endif | ||
| 41 | $ | ||
| 42 | $ write sys$output "" | ||
| 43 | $ write sys$output "convert a certificate into a certificate request using 'x509'" | ||
| 44 | $ define /user sys$output err.ss | ||
| 45 | $ 'x509cmd' -in 'CAcert' -x509toreq -signkey 'CAkey' -out 'CAreq2' | ||
| 46 | $ if $severity .ne. 1 | ||
| 47 | $ then | ||
| 48 | $ write sys$output "error using 'x509' convert a certificate to a certificate request" | ||
| 49 | $ exit 3 | ||
| 50 | $ endif | ||
| 51 | $ | ||
| 52 | $ 'reqcmd' -config 'dummycnf' -verify -in 'CAreq' -noout | ||
| 53 | $ if $severity .ne. 1 | ||
| 54 | $ then | ||
| 55 | $ write sys$output "first generated request is invalid" | ||
| 56 | $ exit 3 | ||
| 57 | $ endif | ||
| 58 | $ | ||
| 59 | $ 'reqcmd' -config 'dummycnf' -verify -in 'CAreq2' -noout | ||
| 60 | $ if $severity .ne. 1 | ||
| 61 | $ then | ||
| 62 | $ write sys$output "second generated request is invalid" | ||
| 63 | $ exit 3 | ||
| 64 | $ endif | ||
| 65 | $ | ||
| 66 | $ 'verifycmd' "-CAfile" 'CAcert' 'CAcert' | ||
| 67 | $ if $severity .ne. 1 | ||
| 68 | $ then | ||
| 69 | $ write sys$output "first generated cert is invalid" | ||
| 70 | $ exit 3 | ||
| 71 | $ endif | ||
| 72 | $ | ||
| 73 | $ write sys$output "" | ||
| 74 | $ write sys$output "make another certificate request using 'req'" | ||
| 75 | $ define /user sys$output err.ss | ||
| 76 | $ 'reqcmd' -config 'Uconf' -out 'Ureq' -keyout 'Ukey' -new | ||
| 77 | $ if $severity .ne. 1 | ||
| 78 | $ then | ||
| 79 | $ write sys$output "error using 'req' to generate a certificate request" | ||
| 80 | $ exit 3 | ||
| 81 | $ endif | ||
| 82 | $ | ||
| 83 | $ write sys$output "" | ||
| 84 | $ write sys$output "sign certificate request with the just created CA via 'x509'" | ||
| 85 | $ define /user sys$output err.ss | ||
| 86 | $ 'x509cmd' "-CAcreateserial" -in 'Ureq' -days 30 -req -out 'Ucert' "-CA" 'CAcert' "-CAkey" 'CAkey' | ||
| 87 | $ if $severity .ne. 1 | ||
| 88 | $ then | ||
| 89 | $ write sys$output "error using 'x509' to sign a certificate request" | ||
| 90 | $ exit 3 | ||
| 91 | $ endif | ||
| 92 | $ | ||
| 93 | $ 'verifycmd' "-CAfile" 'CAcert' 'Ucert' | ||
| 94 | $ write sys$output "" | ||
| 95 | $ write sys$output "Certificate details" | ||
| 96 | $ 'x509cmd' -subject -issuer -startdate -enddate -noout -in 'Ucert' | ||
| 97 | $ | ||
| 98 | $ write sys$output "" | ||
| 99 | $ write sys$output "The generated CA certificate is ",CAcert | ||
| 100 | $ write sys$output "The generated CA private key is ",CAkey | ||
| 101 | $ | ||
| 102 | $ write sys$output "The generated user certificate is ",Ucert | ||
| 103 | $ write sys$output "The generated user private key is ",Ukey | ||
| 104 | $ | ||
| 105 | $ if f$search("err.ss;*") .nes. "" then delete err.ss;* | ||
