openssl/test/tests.com

274 lines
6.6 KiB
Text
Raw Normal View History

$! TESTS.COM -- Performs the necessary tests
$!
$! P1 tests to be performed. Empty means all.
$
$ __proc = f$element(0,";",f$environment("procedure"))
$ __here = f$parse(f$parse("A.;",__proc) - "A.;","[]A.;") - "A.;"
$ __save_default = f$environment("default")
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then -
__arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$ texe_dir := sys$disk:[-.'__arch'.exe.test]
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$ set default '__here'
$
$ on control_y then goto exit
$ on error then goto exit
$
$ if p1 .nes. ""
$ then
$ tests = p1
$ else
$! NOTE: This list reflects the list of dependencies following the
$! "alltests" target in Makefile. This should make it easy to see
$! if there's a difference that needs to be taken care of.
$ tests := -
test_des,test_idea,test_sha,test_md4,test_md5,test_hmac,-
test_md2,test_mdc2,-
test_rmd,test_rc2,test_rc4,test_rc5,test_bf,test_cast,test_rd,-
2002-08-10 01:35:10 +00:00
test_rand,test_bn,test_ec,test_ecdsa,test_ecdh,-
test_enc,test_x509,test_rsa,test_crl,test_sid,-
2000-01-16 02:11:19 +00:00
test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,-
2008-12-22 09:30:09 +00:00
test_ss,test_ca,test_engine,test_evp,test_ssl,test_ige,test_jpake
$ endif
$ tests = f$edit(tests,"COLLAPSE")
$
$ BNTEST := bntest
$ ECTEST := ectest
$ ECDSATEST := ecdsatest
2002-08-10 01:35:10 +00:00
$ ECDHTEST := ecdhtest
$ EXPTEST := exptest
$ IDEATEST := ideatest
$ SHATEST := shatest
$ SHA1TEST := sha1test
$ MDC2TEST := mdc2test
$ RMDTEST := rmdtest
$ MD2TEST := md2test
$ MD4TEST := md4test
$ MD5TEST := md5test
$ HMACTEST := hmactest
$ RC2TEST := rc2test
$ RC4TEST := rc4test
$ RC5TEST := rc5test
$ BFTEST := bftest
$ CASTTEST := casttest
$ DESTEST := destest
$ RANDTEST := randtest
$ DHTEST := dhtest
$ DSATEST := dsatest
$ METHTEST := methtest
$ SSLTEST := ssltest
$ RSATEST := rsa_test
$ ENGINETEST := enginetest
2001-09-27 16:07:36 +00:00
$ EVPTEST := evp_test
2008-12-22 09:30:09 +00:00
$ IGETEST := igetest
$ JPAKETEST := jpaketest
$
$ tests_i = 0
$ loop_tests:
$ tests_e = f$element(tests_i,",",tests)
$ tests_i = tests_i + 1
$ if tests_e .eqs. "," then goto exit
2000-03-13 22:27:52 +00:00
$ gosub 'tests_e'
$ goto loop_tests
$
2001-09-27 16:07:36 +00:00
$ test_evp:
$ mcr 'texe_dir''evptest' evptests.txt
$ return
$ test_des:
$ mcr 'texe_dir''destest'
2000-03-13 22:27:52 +00:00
$ return
$ test_idea:
$ mcr 'texe_dir''ideatest'
2000-03-13 22:27:52 +00:00
$ return
$ test_sha:
$ mcr 'texe_dir''shatest'
$ mcr 'texe_dir''sha1test'
2000-03-13 22:27:52 +00:00
$ return
$ test_mdc2:
$ mcr 'texe_dir''mdc2test'
2000-03-13 22:27:52 +00:00
$ return
$ test_md5:
$ mcr 'texe_dir''md5test'
2000-03-13 22:27:52 +00:00
$ return
$ test_md4:
$ mcr 'texe_dir''md4test'
$ return
$ test_hmac:
$ mcr 'texe_dir''hmactest'
2000-03-13 22:27:52 +00:00
$ return
$ test_md2:
$ mcr 'texe_dir''md2test'
2000-03-13 22:27:52 +00:00
$ return
$ test_rmd:
$ mcr 'texe_dir''rmdtest'
2000-03-13 22:27:52 +00:00
$ return
$ test_bf:
$ mcr 'texe_dir''bftest'
2000-03-13 22:27:52 +00:00
$ return
$ test_cast:
$ mcr 'texe_dir''casttest'
2000-03-13 22:27:52 +00:00
$ return
$ test_rc2:
$ mcr 'texe_dir''rc2test'
2000-03-13 22:27:52 +00:00
$ return
$ test_rc4:
$ mcr 'texe_dir''rc4test'
2000-03-13 22:27:52 +00:00
$ return
$ test_rc5:
$ mcr 'texe_dir''rc5test'
2000-03-13 22:27:52 +00:00
$ return
$ test_rand:
$ mcr 'texe_dir''randtest'
2000-03-13 22:27:52 +00:00
$ return
$ test_enc:
$ @testenc.com
2000-03-13 22:27:52 +00:00
$ return
$ test_x509:
$ define sys$error nla0:
$ write sys$output "test normal x509v1 certificate"
$ @tx509.com
$ write sys$output "test first x509v3 certificate"
$ @tx509.com v3-cert1.pem
$ write sys$output "test second x509v3 certificate"
$ @tx509.com v3-cert2.pem
$ deassign sys$error
2000-03-13 22:27:52 +00:00
$ return
$ test_rsa:
$ define sys$error nla0:
$ @trsa.com
$ deassign sys$error
$ mcr 'texe_dir''rsatest'
2000-03-13 22:27:52 +00:00
$ return
$ test_crl:
$ define sys$error nla0:
$ @tcrl.com
$ deassign sys$error
2000-03-13 22:27:52 +00:00
$ return
$ test_sid:
$ define sys$error nla0:
$ @tsid.com
$ deassign sys$error
2000-03-13 22:27:52 +00:00
$ return
$ test_req:
$ define sys$error nla0:
$ @treq.com
$ @treq.com testreq2.pem
$ deassign sys$error
2000-03-13 22:27:52 +00:00
$ return
$ test_pkcs7:
$ define sys$error nla0:
$ @tpkcs7.com
$ @tpkcs7d.com
$ deassign sys$error
2000-03-13 22:27:52 +00:00
$ return
$ test_bn:
$ write sys$output "starting big number library test, could take a while..."
$ create bntest-vms.fdl
FILE
ORGANIZATION sequential
RECORD
FORMAT stream_lf
$ create/fdl=bntest-vms.fdl bntest-vms.sh
$ open/append foo bntest-vms.sh
$ type/output=foo: sys$input:
2001-03-08 21:12:58 +00:00
<< __FOO__ sh -c "`sh ./bctest`" | perl -e '$i=0; while (<STDIN>) {if (/^test (.*)/) {print STDERR "\nverify $1";} elsif (!/^0$/) {die "\nFailed! bc: $_";} else {print STDERR "."; $i++;}} print STDERR "\n$i tests passed\n"'
$ define/user sys$output bntest-vms.tmp
$ mcr 'texe_dir''bntest'
$ copy bntest-vms.tmp foo:
$ delete bntest-vms.tmp;*
$ type/output=foo: sys$input:
__FOO__
$ close foo
2001-03-08 21:12:58 +00:00
$ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and"
$ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations"
$ write sys$output "-- went well."
$ write sys$output ""
$ write sys$output "test a^b%c implementations"
$ mcr 'texe_dir''exptest'
2000-03-13 22:27:52 +00:00
$ return
$ test_ec:
2001-03-08 17:22:38 +00:00
$ write sys$output "test elliptic curves"
$ mcr 'texe_dir''ectest'
$ return
2002-08-10 01:35:10 +00:00
$ test_ecdsa:
$ write sys$output "test ecdsa"
$ mcr 'texe_dir''ecdsatest'
$ return
2002-08-10 01:35:10 +00:00
$ test_ecdh:
$ write sys$output "test ecdh"
$ mcr 'texe_dir''ecdhtest'
$ return
$ test_verify:
$ write sys$output "The following command should have some OK's and some failures"
$ write sys$output "There are definitly a few expired certificates"
$ @tverify.com
2000-03-13 22:27:52 +00:00
$ return
$ test_dh:
2000-01-30 13:44:08 +00:00
$ write sys$output "Generate a set of DH parameters"
$ mcr 'texe_dir''dhtest'
2000-03-13 22:27:52 +00:00
$ return
$ test_dsa:
2000-01-30 13:44:08 +00:00
$ write sys$output "Generate a set of DSA parameters"
$ mcr 'texe_dir''dsatest'
2000-03-13 22:27:52 +00:00
$ return
2000-01-16 02:11:19 +00:00
$ test_gen:
$ write sys$output "Generate and verify a certificate request"
$ @testgen.com
2000-03-13 22:27:52 +00:00
$ return
$ maybe_test_ss:
$ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT"))
$ if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then -
goto test_ss
$ if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then -
goto test_ss
$ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then -
goto test_ss
$ return
$ test_ss:
$ write sys$output "Generate and certify a test certificate"
$ @testss.com
2000-03-13 22:27:52 +00:00
$ return
$ test_engine:
$ write sys$output "Manipulate the ENGINE structures"
$ mcr 'texe_dir''enginetest'
$ return
$ test_ssl:
$ write sys$output "test SSL protocol"
2000-03-13 22:27:52 +00:00
$ gosub maybe_test_ss
$ @testssl.com keyU.ss certU.ss certCA.ss
$ return
$ test_ca:
2000-03-13 22:27:52 +00:00
$ set noon
$ define/user sys$output nla0:
$ mcr 'exe_dir'openssl no-rsa
$ save_severity=$SEVERITY
$ set on
$ if save_severity
$ then
$ write sys$output "skipping CA.com test -- requires RSA"
$ else
$ write sys$output "Generate and certify a test certificate via the 'ca' program"
$ @testca.com
$ endif
$ return
$ test_rd:
$ write sys$output "test Rijndael"
$ !mcr 'texe_dir''rdtest'
$ return
2008-12-22 09:30:09 +00:00
$ test_ige:
$ write sys$output "Test IGE mode"
$ mcr 'texe_dir''igetest'
$ return
$ test_jpake:
$ write sys$output "Test JPAKE"
$ mcr 'texe_dir''jpaketest'
$ return
$
$
$ exit:
$ set default '__save_default'
$ exit