diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/test/tests.com | 137 |
1 files changed, 90 insertions, 47 deletions
diff --git a/src/lib/libssl/test/tests.com b/src/lib/libssl/test/tests.com index 147b8aa838..07a3c7f16d 100644 --- a/src/lib/libssl/test/tests.com +++ b/src/lib/libssl/test/tests.com | |||
| @@ -19,15 +19,17 @@ $ then | |||
| 19 | $ tests = p1 | 19 | $ tests = p1 |
| 20 | $ else | 20 | $ else |
| 21 | $ tests := - | 21 | $ tests := - |
| 22 | test_des,test_idea,test_sha,test_md5,test_hmac,test_md2,test_mdc2,- | 22 | test_des,test_idea,test_sha,test_md4,test_md5,test_hmac,- |
| 23 | test_rc2,test_rc4,test_rc5,test_bf,test_cast,- | 23 | test_md2,test_mdc2,- |
| 24 | test_rand,test_bn,test_enc,test_x509,test_rsa,test_crl,test_sid,- | 24 | test_rmd,test_rc2,test_rc4,test_rc5,test_bf,test_cast,test_rd,- |
| 25 | test_reqgen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- | 25 | test_rand,test_bn,test_ec,test_enc,test_x509,test_rsa,test_crl,test_sid,- |
| 26 | test_ss,test_ssl,test_ca | 26 | test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- |
| 27 | test_ss,test_ca,test_engine,test_ssl,test_evp | ||
| 27 | $ endif | 28 | $ endif |
| 28 | $ tests = f$edit(tests,"COLLAPSE") | 29 | $ tests = f$edit(tests,"COLLAPSE") |
| 29 | $ | 30 | $ |
| 30 | $ BNTEST := bntest | 31 | $ BNTEST := bntest |
| 32 | $ ECTEST := ectest | ||
| 31 | $ EXPTEST := exptest | 33 | $ EXPTEST := exptest |
| 32 | $ IDEATEST := ideatest | 34 | $ IDEATEST := ideatest |
| 33 | $ SHATEST := shatest | 35 | $ SHATEST := shatest |
| @@ -35,6 +37,7 @@ $ SHA1TEST := sha1test | |||
| 35 | $ MDC2TEST := mdc2test | 37 | $ MDC2TEST := mdc2test |
| 36 | $ RMDTEST := rmdtest | 38 | $ RMDTEST := rmdtest |
| 37 | $ MD2TEST := md2test | 39 | $ MD2TEST := md2test |
| 40 | $ MD4TEST := md4test | ||
| 38 | $ MD5TEST := md5test | 41 | $ MD5TEST := md5test |
| 39 | $ HMACTEST := hmactest | 42 | $ HMACTEST := hmactest |
| 40 | $ RC2TEST := rc2test | 43 | $ RC2TEST := rc2test |
| @@ -48,61 +51,70 @@ $ DHTEST := dhtest | |||
| 48 | $ DSATEST := dsatest | 51 | $ DSATEST := dsatest |
| 49 | $ METHTEST := methtest | 52 | $ METHTEST := methtest |
| 50 | $ SSLTEST := ssltest | 53 | $ SSLTEST := ssltest |
| 51 | $ RSATEST := rsa_oaep_test | 54 | $ RSATEST := rsa_test |
| 55 | $ ENGINETEST := enginetest | ||
| 56 | $ EVPTEST := evp_test | ||
| 52 | $ | 57 | $ |
| 53 | $ tests_i = 0 | 58 | $ tests_i = 0 |
| 54 | $ loop_tests: | 59 | $ loop_tests: |
| 55 | $ tests_e = f$element(tests_i,",",tests) | 60 | $ tests_e = f$element(tests_i,",",tests) |
| 56 | $ tests_i = tests_i + 1 | 61 | $ tests_i = tests_i + 1 |
| 57 | $ if tests_e .eqs. "," then goto exit | 62 | $ if tests_e .eqs. "," then goto exit |
| 58 | $ goto 'tests_e' | 63 | $ gosub 'tests_e' |
| 64 | $ goto loop_tests | ||
| 59 | $ | 65 | $ |
| 66 | $ test_evp: | ||
| 67 | $ mcr 'texe_dir''evptest' evptests.txt | ||
| 68 | $ return | ||
| 60 | $ test_des: | 69 | $ test_des: |
| 61 | $ mcr 'texe_dir''destest' | 70 | $ mcr 'texe_dir''destest' |
| 62 | $ goto loop_tests | 71 | $ return |
| 63 | $ test_idea: | 72 | $ test_idea: |
| 64 | $ mcr 'texe_dir''ideatest' | 73 | $ mcr 'texe_dir''ideatest' |
| 65 | $ goto loop_tests | 74 | $ return |
| 66 | $ test_sha: | 75 | $ test_sha: |
| 67 | $ mcr 'texe_dir''shatest' | 76 | $ mcr 'texe_dir''shatest' |
| 68 | $ mcr 'texe_dir''sha1test' | 77 | $ mcr 'texe_dir''sha1test' |
| 69 | $ goto loop_tests | 78 | $ return |
| 70 | $ test_mdc2: | 79 | $ test_mdc2: |
| 71 | $ mcr 'texe_dir''mdc2test' | 80 | $ mcr 'texe_dir''mdc2test' |
| 72 | $ goto loop_tests | 81 | $ return |
| 73 | $ test_md5: | 82 | $ test_md5: |
| 74 | $ mcr 'texe_dir''md5test' | 83 | $ mcr 'texe_dir''md5test' |
| 75 | $ goto loop_tests | 84 | $ return |
| 85 | $ test_md4: | ||
| 86 | $ mcr 'texe_dir''md4test' | ||
| 87 | $ return | ||
| 76 | $ test_hmac: | 88 | $ test_hmac: |
| 77 | $ mcr 'texe_dir''hmactest' | 89 | $ mcr 'texe_dir''hmactest' |
| 78 | $ goto loop_tests | 90 | $ return |
| 79 | $ test_md2: | 91 | $ test_md2: |
| 80 | $ mcr 'texe_dir''md2test' | 92 | $ mcr 'texe_dir''md2test' |
| 81 | $ goto loop_tests | 93 | $ return |
| 82 | $ test_rmd: | 94 | $ test_rmd: |
| 83 | $ mcr 'texe_dir''rmdtest' | 95 | $ mcr 'texe_dir''rmdtest' |
| 84 | $ goto loop_tests | 96 | $ return |
| 85 | $ test_bf: | 97 | $ test_bf: |
| 86 | $ mcr 'texe_dir''bftest' | 98 | $ mcr 'texe_dir''bftest' |
| 87 | $ goto loop_tests | 99 | $ return |
| 88 | $ test_cast: | 100 | $ test_cast: |
| 89 | $ mcr 'texe_dir''casttest' | 101 | $ mcr 'texe_dir''casttest' |
| 90 | $ goto loop_tests | 102 | $ return |
| 91 | $ test_rc2: | 103 | $ test_rc2: |
| 92 | $ mcr 'texe_dir''rc2test' | 104 | $ mcr 'texe_dir''rc2test' |
| 93 | $ goto loop_tests | 105 | $ return |
| 94 | $ test_rc4: | 106 | $ test_rc4: |
| 95 | $ mcr 'texe_dir''rc4test' | 107 | $ mcr 'texe_dir''rc4test' |
| 96 | $ goto loop_tests | 108 | $ return |
| 97 | $ test_rc5: | 109 | $ test_rc5: |
| 98 | $ mcr 'texe_dir''rc5test' | 110 | $ mcr 'texe_dir''rc5test' |
| 99 | $ goto loop_tests | 111 | $ return |
| 100 | $ test_rand: | 112 | $ test_rand: |
| 101 | $ mcr 'texe_dir''randtest' | 113 | $ mcr 'texe_dir''randtest' |
| 102 | $ goto loop_tests | 114 | $ return |
| 103 | $ test_enc: | 115 | $ test_enc: |
| 104 | $ @testenc.com | 116 | $ @testenc.com |
| 105 | $ goto loop_tests | 117 | $ return |
| 106 | $ test_x509: | 118 | $ test_x509: |
| 107 | $ define sys$error nla0: | 119 | $ define sys$error nla0: |
| 108 | $ write sys$output "test normal x509v1 certificate" | 120 | $ write sys$output "test normal x509v1 certificate" |
| @@ -112,35 +124,35 @@ $ @tx509.com v3-cert1.pem | |||
| 112 | $ write sys$output "test second x509v3 certificate" | 124 | $ write sys$output "test second x509v3 certificate" |
| 113 | $ @tx509.com v3-cert2.pem | 125 | $ @tx509.com v3-cert2.pem |
| 114 | $ deassign sys$error | 126 | $ deassign sys$error |
| 115 | $ goto loop_tests | 127 | $ return |
| 116 | $ test_rsa: | 128 | $ test_rsa: |
| 117 | $ define sys$error nla0: | 129 | $ define sys$error nla0: |
| 118 | $ @trsa.com | 130 | $ @trsa.com |
| 119 | $ deassign sys$error | 131 | $ deassign sys$error |
| 120 | $ mcr 'texe_dir''rsatest' | 132 | $ mcr 'texe_dir''rsatest' |
| 121 | $ goto loop_tests | 133 | $ return |
| 122 | $ test_crl: | 134 | $ test_crl: |
| 123 | $ define sys$error nla0: | 135 | $ define sys$error nla0: |
| 124 | $ @tcrl.com | 136 | $ @tcrl.com |
| 125 | $ deassign sys$error | 137 | $ deassign sys$error |
| 126 | $ goto loop_tests | 138 | $ return |
| 127 | $ test_sid: | 139 | $ test_sid: |
| 128 | $ define sys$error nla0: | 140 | $ define sys$error nla0: |
| 129 | $ @tsid.com | 141 | $ @tsid.com |
| 130 | $ deassign sys$error | 142 | $ deassign sys$error |
| 131 | $ goto loop_tests | 143 | $ return |
| 132 | $ test_req: | 144 | $ test_req: |
| 133 | $ define sys$error nla0: | 145 | $ define sys$error nla0: |
| 134 | $ @treq.com | 146 | $ @treq.com |
| 135 | $ @treq.com testreq2.pem | 147 | $ @treq.com testreq2.pem |
| 136 | $ deassign sys$error | 148 | $ deassign sys$error |
| 137 | $ goto loop_tests | 149 | $ return |
| 138 | $ test_pkcs7: | 150 | $ test_pkcs7: |
| 139 | $ define sys$error nla0: | 151 | $ define sys$error nla0: |
| 140 | $ @tpkcs7.com | 152 | $ @tpkcs7.com |
| 141 | $ @tpkcs7d.com | 153 | $ @tpkcs7d.com |
| 142 | $ deassign sys$error | 154 | $ deassign sys$error |
| 143 | $ goto loop_tests | 155 | $ return |
| 144 | $ test_bn: | 156 | $ test_bn: |
| 145 | $ write sys$output "starting big number library test, could take a while..." | 157 | $ write sys$output "starting big number library test, could take a while..." |
| 146 | $ create bntest-vms.fdl | 158 | $ create bntest-vms.fdl |
| @@ -151,9 +163,7 @@ RECORD | |||
| 151 | $ create/fdl=bntest-vms.fdl bntest-vms.sh | 163 | $ create/fdl=bntest-vms.fdl bntest-vms.sh |
| 152 | $ open/append foo bntest-vms.sh | 164 | $ open/append foo bntest-vms.sh |
| 153 | $ type/output=foo: sys$input: | 165 | $ type/output=foo: sys$input: |
| 154 | << __FOO__ bc | awk '{ \ | 166 | << __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"' |
| 155 | if ($$0 != "0") {print "error"; exit(1); } \ | ||
| 156 | if (((NR+1)%64) == 0) print NR+1," tests done"; }' | ||
| 157 | $ define/user sys$output bntest-vms.tmp | 167 | $ define/user sys$output bntest-vms.tmp |
| 158 | $ mcr 'texe_dir''bntest' | 168 | $ mcr 'texe_dir''bntest' |
| 159 | $ copy bntest-vms.tmp foo: | 169 | $ copy bntest-vms.tmp foo: |
| @@ -161,41 +171,74 @@ $ delete bntest-vms.tmp;* | |||
| 161 | $ type/output=foo: sys$input: | 171 | $ type/output=foo: sys$input: |
| 162 | __FOO__ | 172 | __FOO__ |
| 163 | $ close foo | 173 | $ close foo |
| 164 | $ write sys$output "-- copy the [.test]bntest-vms.sh file to a Unix system and run it" | 174 | $ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and" |
| 165 | $ write sys$output "-- through sh or bash to verify that the bignum operations went well." | 175 | $ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations" |
| 176 | $ write sys$output "-- went well." | ||
| 166 | $ write sys$output "" | 177 | $ write sys$output "" |
| 167 | $ write sys$output "test a^b%c implementations" | 178 | $ write sys$output "test a^b%c implementations" |
| 168 | $ mcr 'texe_dir''exptest' | 179 | $ mcr 'texe_dir''exptest' |
| 169 | $ goto loop_tests | 180 | $ return |
| 181 | $ test_ec: | ||
| 182 | $ write sys$output "test elliptic curves" | ||
| 183 | $ mcr 'texe_dir''ectest' | ||
| 184 | $ return | ||
| 170 | $ test_verify: | 185 | $ test_verify: |
| 171 | $ write sys$output "The following command should have some OK's and some failures" | 186 | $ write sys$output "The following command should have some OK's and some failures" |
| 172 | $ write sys$output "There are definitly a few expired certificates" | 187 | $ write sys$output "There are definitly a few expired certificates" |
| 173 | $ @tverify.com | 188 | $ @tverify.com |
| 174 | $ goto loop_tests | 189 | $ return |
| 175 | $ test_dh: | 190 | $ test_dh: |
| 176 | $ write sys$output "Generate as set of DH parameters" | 191 | $ write sys$output "Generate a set of DH parameters" |
| 177 | $ mcr 'texe_dir''dhtest' | 192 | $ mcr 'texe_dir''dhtest' |
| 178 | $ goto loop_tests | 193 | $ return |
| 179 | $ test_dsa: | 194 | $ test_dsa: |
| 180 | $ write sys$output "Generate as set of DSA parameters" | 195 | $ write sys$output "Generate a set of DSA parameters" |
| 181 | $ mcr 'texe_dir''dsatest' | 196 | $ mcr 'texe_dir''dsatest' |
| 182 | $ goto loop_tests | 197 | $ return |
| 183 | $ test_reqgen: | 198 | $ test_gen: |
| 184 | $ write sys$output "Generate and verify a certificate request" | 199 | $ write sys$output "Generate and verify a certificate request" |
| 185 | $ @testgen.com | 200 | $ @testgen.com |
| 186 | $ goto loop_tests | 201 | $ return |
| 202 | $ maybe_test_ss: | ||
| 203 | $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT")) | ||
| 204 | $ if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then - | ||
| 205 | goto test_ss | ||
| 206 | $ if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then - | ||
| 207 | goto test_ss | ||
| 208 | $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then - | ||
| 209 | goto test_ss | ||
| 210 | $ return | ||
| 187 | $ test_ss: | 211 | $ test_ss: |
| 188 | $ write sys$output "Generate and certify a test certificate" | 212 | $ write sys$output "Generate and certify a test certificate" |
| 189 | $ @testss.com | 213 | $ @testss.com |
| 190 | $ goto loop_tests | 214 | $ return |
| 215 | $ test_engine: | ||
| 216 | $ write sys$output "Manipulate the ENGINE structures" | ||
| 217 | $ mcr 'texe_dir''enginetest' | ||
| 218 | $ return | ||
| 191 | $ test_ssl: | 219 | $ test_ssl: |
| 192 | $ write sys$output "test SSL protocol" | 220 | $ write sys$output "test SSL protocol" |
| 193 | $ @testssl.com | 221 | $ gosub maybe_test_ss |
| 194 | $ goto loop_tests | 222 | $ @testssl.com keyU.ss certU.ss certCA.ss |
| 223 | $ return | ||
| 195 | $ test_ca: | 224 | $ test_ca: |
| 196 | $ write sys$output "Generate and certify a test certificate via the 'ca' program" | 225 | $ set noon |
| 197 | $ @testca.com | 226 | $ define/user sys$output nla0: |
| 198 | $ goto loop_tests | 227 | $ mcr 'exe_dir'openssl no-rsa |
| 228 | $ save_severity=$SEVERITY | ||
| 229 | $ set on | ||
| 230 | $ if save_severity | ||
| 231 | $ then | ||
| 232 | $ write sys$output "skipping CA.com test -- requires RSA" | ||
| 233 | $ else | ||
| 234 | $ write sys$output "Generate and certify a test certificate via the 'ca' program" | ||
| 235 | $ @testca.com | ||
| 236 | $ endif | ||
| 237 | $ return | ||
| 238 | $ test_rd: | ||
| 239 | $ write sys$output "test Rijndael" | ||
| 240 | $ !mcr 'texe_dir''rdtest' | ||
| 241 | $ return | ||
| 199 | $ | 242 | $ |
| 200 | $ | 243 | $ |
| 201 | $ exit: | 244 | $ exit: |
