diff options
Diffstat (limited to 'src/lib/libssl/test/tests.com')
| -rw-r--r-- | src/lib/libssl/test/tests.com | 167 |
1 files changed, 117 insertions, 50 deletions
diff --git a/src/lib/libssl/test/tests.com b/src/lib/libssl/test/tests.com index d151cd3955..373dd16eac 100644 --- a/src/lib/libssl/test/tests.com +++ b/src/lib/libssl/test/tests.com | |||
| @@ -1,22 +1,43 @@ | |||
| 1 | $! TESTS.COM -- Performs the necessary tests | 1 | $! TESTS.COM -- Performs the necessary tests |
| 2 | $! | 2 | $! |
| 3 | $! P1 tests to be performed. Empty means all. | 3 | $! P1 tests to be performed. Empty means all. |
| 4 | $ | 4 | $! P2 Pointer size: "", "32", or "64". |
| 5 | $! | ||
| 6 | $! Announce/identify. | ||
| 7 | $! | ||
| 8 | $ proc = f$environment( "procedure") | ||
| 9 | $ write sys$output "@@@ "+ - | ||
| 10 | f$parse( proc, , , "name")+ f$parse( proc, , , "type") | ||
| 11 | $! | ||
| 5 | $ __proc = f$element(0,";",f$environment("procedure")) | 12 | $ __proc = f$element(0,";",f$environment("procedure")) |
| 6 | $ __here = f$parse(f$parse("A.;",__proc) - "A.;","[]A.;") - "A.;" | 13 | $ __here = f$parse(f$parse("A.;",__proc) - "A.;","[]A.;") - "A.;" |
| 7 | $ __save_default = f$environment("default") | 14 | $ __save_default = f$environment("default") |
| 8 | $ __arch := VAX | 15 | $ __arch = "VAX" |
| 9 | $ if f$getsyi("cpu") .ge. 128 then - | 16 | $ if f$getsyi("cpu") .ge. 128 then - |
| 10 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | 17 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") |
| 11 | $ if __arch .eqs. "" then __arch := UNK | 18 | $ if __arch .eqs. "" then __arch = "UNK" |
| 12 | $ texe_dir := sys$disk:[-.'__arch'.exe.test] | 19 | $! |
| 13 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | 20 | $ __archd = __arch |
| 14 | $ | 21 | $ pointer_size = "" |
| 15 | $ sslroot = f$parse("sys$disk:[-.apps];",,,,"syntax_only") - "].;"+ ".]" | 22 | $ if (p2 .eq. "64") |
| 16 | $ define /translation_attributes = concealed sslroot 'sslroot' | 23 | $ then |
| 24 | $ pointer_size = "64" | ||
| 25 | $ __archd = __arch+ "_64" | ||
| 26 | $ endif | ||
| 27 | $! | ||
| 28 | $ texe_dir := sys$disk:[-.'__archd'.exe.test] | ||
| 29 | $ exe_dir := sys$disk:[-.'__archd'.exe.apps] | ||
| 17 | $ | 30 | $ |
| 18 | $ set default '__here' | 31 | $ set default '__here' |
| 19 | $ | 32 | $ |
| 33 | $ ROOT = F$PARSE("sys$disk:[-]A.;0",,,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0" | ||
| 34 | $ ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY") | ||
| 35 | $ ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") - | ||
| 36 | - ".][000000" - "[000000." - "][" - "[" - "]" | ||
| 37 | $ ROOT = ROOT_DEV + "[" + ROOT_DIR | ||
| 38 | $ DEFINE/NOLOG SSLROOT 'ROOT'.APPS.] /TRANS=CONC | ||
| 39 | $ openssl_conf := sslroot:[000000]openssl-vms.cnf | ||
| 40 | $ | ||
| 20 | $ on control_y then goto exit | 41 | $ on control_y then goto exit |
| 21 | $ on error then goto exit | 42 | $ on error then goto exit |
| 22 | $ | 43 | $ |
| @@ -70,17 +91,19 @@ $ ENGINETEST := enginetest | |||
| 70 | $ EVPTEST := evp_test | 91 | $ EVPTEST := evp_test |
| 71 | $ IGETEST := igetest | 92 | $ IGETEST := igetest |
| 72 | $ JPAKETEST := jpaketest | 93 | $ JPAKETEST := jpaketest |
| 73 | $ | 94 | $ ASN1TEST := asn1test |
| 95 | $! | ||
| 74 | $ tests_i = 0 | 96 | $ tests_i = 0 |
| 75 | $ loop_tests: | 97 | $ loop_tests: |
| 76 | $ tests_e = f$element(tests_i,",",tests) | 98 | $ tests_e = f$element(tests_i,",",tests) |
| 77 | $ tests_i = tests_i + 1 | 99 | $ tests_i = tests_i + 1 |
| 78 | $ if tests_e .eqs. "," then goto exit | 100 | $ if tests_e .eqs. "," then goto exit |
| 101 | $ write sys$output "---> ''tests_e'" | ||
| 79 | $ gosub 'tests_e' | 102 | $ gosub 'tests_e' |
| 80 | $ goto loop_tests | 103 | $ goto loop_tests |
| 81 | $ | 104 | $ |
| 82 | $ test_evp: | 105 | $ test_evp: |
| 83 | $ mcr 'texe_dir''evptest' evptests.txt | 106 | $ mcr 'texe_dir''evptest' 'ROOT'.CRYPTO.EVP]evptests.txt |
| 84 | $ return | 107 | $ return |
| 85 | $ test_des: | 108 | $ test_des: |
| 86 | $ mcr 'texe_dir''destest' | 109 | $ mcr 'texe_dir''destest' |
| @@ -132,68 +155,109 @@ $ test_rand: | |||
| 132 | $ mcr 'texe_dir''randtest' | 155 | $ mcr 'texe_dir''randtest' |
| 133 | $ return | 156 | $ return |
| 134 | $ test_enc: | 157 | $ test_enc: |
| 135 | $ @testenc.com | 158 | $ @testenc.com 'pointer_size' |
| 136 | $ return | 159 | $ return |
| 137 | $ test_x509: | 160 | $ test_x509: |
| 138 | $ define sys$error nla0: | 161 | $ set noon |
| 162 | $ define sys$error test_x509.err | ||
| 139 | $ write sys$output "test normal x509v1 certificate" | 163 | $ write sys$output "test normal x509v1 certificate" |
| 140 | $ @tx509.com | 164 | $ @tx509.com "" 'pointer_size' |
| 141 | $ write sys$output "test first x509v3 certificate" | 165 | $ write sys$output "test first x509v3 certificate" |
| 142 | $ @tx509.com v3-cert1.pem | 166 | $ @tx509.com v3-cert1.pem 'pointer_size' |
| 143 | $ write sys$output "test second x509v3 certificate" | 167 | $ write sys$output "test second x509v3 certificate" |
| 144 | $ @tx509.com v3-cert2.pem | 168 | $ @tx509.com v3-cert2.pem 'pointer_size' |
| 145 | $ deassign sys$error | 169 | $ deassign sys$error |
| 170 | $ set on | ||
| 146 | $ return | 171 | $ return |
| 147 | $ test_rsa: | 172 | $ test_rsa: |
| 148 | $ define sys$error nla0: | 173 | $ set noon |
| 149 | $ @trsa.com | 174 | $ define sys$error test_rsa.err |
| 175 | $ @trsa.com "" 'pointer_size' | ||
| 150 | $ deassign sys$error | 176 | $ deassign sys$error |
| 151 | $ mcr 'texe_dir''rsatest' | 177 | $ mcr 'texe_dir''rsatest' |
| 178 | $ set on | ||
| 152 | $ return | 179 | $ return |
| 153 | $ test_crl: | 180 | $ test_crl: |
| 154 | $ define sys$error nla0: | 181 | $ set noon |
| 155 | $ @tcrl.com | 182 | $ define sys$error test_crl.err |
| 183 | $ @tcrl.com "" 'pointer_size' | ||
| 156 | $ deassign sys$error | 184 | $ deassign sys$error |
| 185 | $ set on | ||
| 157 | $ return | 186 | $ return |
| 158 | $ test_sid: | 187 | $ test_sid: |
| 159 | $ define sys$error nla0: | 188 | $ set noon |
| 160 | $ @tsid.com | 189 | $ define sys$error test_sid.err |
| 190 | $ @tsid.com "" 'pointer_size' | ||
| 161 | $ deassign sys$error | 191 | $ deassign sys$error |
| 192 | $ set on | ||
| 162 | $ return | 193 | $ return |
| 163 | $ test_req: | 194 | $ test_req: |
| 164 | $ define sys$error nla0: | 195 | $ set noon |
| 165 | $ @treq.com | 196 | $ define sys$error test_req.err |
| 166 | $ @treq.com testreq2.pem | 197 | $ @treq.com "" 'pointer_size' |
| 198 | $ @treq.com testreq2.pem 'pointer_size' | ||
| 167 | $ deassign sys$error | 199 | $ deassign sys$error |
| 200 | $ set on | ||
| 168 | $ return | 201 | $ return |
| 169 | $ test_pkcs7: | 202 | $ test_pkcs7: |
| 170 | $ define sys$error nla0: | 203 | $ set noon |
| 171 | $ @tpkcs7.com | 204 | $ define sys$error test_pkcs7.err |
| 172 | $ @tpkcs7d.com | 205 | $ @tpkcs7.com "" 'pointer_size' |
| 206 | $ @tpkcs7d.com "" 'pointer_size' | ||
| 173 | $ deassign sys$error | 207 | $ deassign sys$error |
| 208 | $ set on | ||
| 174 | $ return | 209 | $ return |
| 175 | $ test_bn: | 210 | $ test_bn: |
| 176 | $ write sys$output "starting big number library test, could take a while..." | 211 | $ write sys$output - |
| 177 | $ create bntest-vms.fdl | 212 | "starting big number library test, could take a while..." |
| 213 | $ set noon | ||
| 214 | $ define sys$error test_bn.err | ||
| 215 | $ define sys$output test_bn.out | ||
| 216 | $ @ bctest.com | ||
| 217 | $ status = $status | ||
| 218 | $ deassign sys$error | ||
| 219 | $ deassign sys$output | ||
| 220 | $ set on | ||
| 221 | $ if (status) | ||
| 222 | $ then | ||
| 223 | $ create /fdl = sys$input bntest-vms.tmp | ||
| 224 | FILE | ||
| 225 | ORGANIZATION sequential | ||
| 226 | RECORD | ||
| 227 | FORMAT stream_lf | ||
| 228 | $ define /user_mode sys$output bntest-vms.tmp | ||
| 229 | $ mcr 'texe_dir''bntest' | ||
| 230 | $ define /user_mode sys$input bntest-vms.tmp | ||
| 231 | $ define /user_mode sys$output bntest-vms.out | ||
| 232 | $ bc | ||
| 233 | $ @ bntest.com bntest-vms.out | ||
| 234 | $ status = $status | ||
| 235 | $ if (status) | ||
| 236 | $ then | ||
| 237 | $ delete bntest-vms.out;* | ||
| 238 | $ delete bntest-vms.tmp;* | ||
| 239 | $ endif | ||
| 240 | $ else | ||
| 241 | $ create /fdl = sys$input bntest-vms.sh | ||
| 178 | FILE | 242 | FILE |
| 179 | ORGANIZATION sequential | 243 | ORGANIZATION sequential |
| 180 | RECORD | 244 | RECORD |
| 181 | FORMAT stream_lf | 245 | FORMAT stream_lf |
| 182 | $ create/fdl=bntest-vms.fdl bntest-vms.sh | 246 | $ open /append bntest_file bntest-vms.sh |
| 183 | $ open/append foo bntest-vms.sh | 247 | $ type /output = bntest_file sys$input: |
| 184 | $ type/output=foo: sys$input: | ||
| 185 | << __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"' | 248 | << __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"' |
| 186 | $ define/user sys$output bntest-vms.tmp | 249 | $ define /user_mode sys$output bntest-vms.tmp |
| 187 | $ mcr 'texe_dir''bntest' | 250 | $ mcr 'texe_dir''bntest' |
| 188 | $ copy bntest-vms.tmp foo: | 251 | $ copy bntest-vms.tmp bntest_file |
| 189 | $ delete bntest-vms.tmp;* | 252 | $ delete bntest-vms.tmp;* |
| 190 | $ type/output=foo: sys$input: | 253 | $ type /output = bntest_file sys$input: |
| 191 | __FOO__ | 254 | __FOO__ |
| 192 | $ close foo | 255 | $ close bntest_file |
| 193 | $ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and" | 256 | $ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and" |
| 194 | $ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations" | 257 | $ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations" |
| 195 | $ write sys$output "-- went well." | 258 | $ write sys$output "-- went well." |
| 196 | $ write sys$output "" | 259 | $ write sys$output "" |
| 260 | $ endif | ||
| 197 | $ write sys$output "test a^b%c implementations" | 261 | $ write sys$output "test a^b%c implementations" |
| 198 | $ mcr 'texe_dir''exptest' | 262 | $ mcr 'texe_dir''exptest' |
| 199 | $ return | 263 | $ return |
| @@ -212,7 +276,7 @@ $ return | |||
| 212 | $ test_verify: | 276 | $ test_verify: |
| 213 | $ write sys$output "The following command should have some OK's and some failures" | 277 | $ write sys$output "The following command should have some OK's and some failures" |
| 214 | $ write sys$output "There are definitly a few expired certificates" | 278 | $ write sys$output "There are definitly a few expired certificates" |
| 215 | $ @tverify.com | 279 | $ @tverify.com 'pointer_size' |
| 216 | $ return | 280 | $ return |
| 217 | $ test_dh: | 281 | $ test_dh: |
| 218 | $ write sys$output "Generate a set of DH parameters" | 282 | $ write sys$output "Generate a set of DH parameters" |
| @@ -224,7 +288,7 @@ $ mcr 'texe_dir''dsatest' | |||
| 224 | $ return | 288 | $ return |
| 225 | $ test_gen: | 289 | $ test_gen: |
| 226 | $ write sys$output "Generate and verify a certificate request" | 290 | $ write sys$output "Generate and verify a certificate request" |
| 227 | $ @testgen.com | 291 | $ @testgen.com 'pointer_size' |
| 228 | $ return | 292 | $ return |
| 229 | $ maybe_test_ss: | 293 | $ maybe_test_ss: |
| 230 | $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT")) | 294 | $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT")) |
| @@ -237,7 +301,7 @@ $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then - | |||
| 237 | $ return | 301 | $ return |
| 238 | $ test_ss: | 302 | $ test_ss: |
| 239 | $ write sys$output "Generate and certify a test certificate" | 303 | $ write sys$output "Generate and certify a test certificate" |
| 240 | $ @testss.com | 304 | $ @testss.com 'pointer_size' |
| 241 | $ return | 305 | $ return |
| 242 | $ test_engine: | 306 | $ test_engine: |
| 243 | $ write sys$output "Manipulate the ENGINE structures" | 307 | $ write sys$output "Manipulate the ENGINE structures" |
| @@ -246,11 +310,11 @@ $ return | |||
| 246 | $ test_ssl: | 310 | $ test_ssl: |
| 247 | $ write sys$output "test SSL protocol" | 311 | $ write sys$output "test SSL protocol" |
| 248 | $ gosub maybe_test_ss | 312 | $ gosub maybe_test_ss |
| 249 | $ @testssl.com keyU.ss certU.ss certCA.ss | 313 | $ @testssl.com keyU.ss certU.ss certCA.ss 'pointer_size' |
| 250 | $ return | 314 | $ return |
| 251 | $ test_ca: | 315 | $ test_ca: |
| 252 | $ set noon | 316 | $ set noon |
| 253 | $ define/user sys$output nla0: | 317 | $ define /user_mode sys$output test_ca.out |
| 254 | $ mcr 'exe_dir'openssl no-rsa | 318 | $ mcr 'exe_dir'openssl no-rsa |
| 255 | $ save_severity=$SEVERITY | 319 | $ save_severity=$SEVERITY |
| 256 | $ set on | 320 | $ set on |
| @@ -259,7 +323,7 @@ $ then | |||
| 259 | $ write sys$output "skipping CA.com test -- requires RSA" | 323 | $ write sys$output "skipping CA.com test -- requires RSA" |
| 260 | $ else | 324 | $ else |
| 261 | $ write sys$output "Generate and certify a test certificate via the 'ca' program" | 325 | $ write sys$output "Generate and certify a test certificate via the 'ca' program" |
| 262 | $ @testca.com | 326 | $ @testca.com 'pointer_size' |
| 263 | $ endif | 327 | $ endif |
| 264 | $ return | 328 | $ return |
| 265 | $ test_aes: | 329 | $ test_aes: |
| @@ -268,7 +332,7 @@ $! !mcr 'texe_dir''aestest' | |||
| 268 | $ return | 332 | $ return |
| 269 | $ test_tsa: | 333 | $ test_tsa: |
| 270 | $ set noon | 334 | $ set noon |
| 271 | $ define/user sys$output nla0: | 335 | $ define /user_mode sys$output nla0: |
| 272 | $ mcr 'exe_dir'openssl no-rsa | 336 | $ mcr 'exe_dir'openssl no-rsa |
| 273 | $ save_severity=$SEVERITY | 337 | $ save_severity=$SEVERITY |
| 274 | $ set on | 338 | $ set on |
| @@ -276,7 +340,7 @@ $ if save_severity | |||
| 276 | $ then | 340 | $ then |
| 277 | $ write sys$output "skipping testtsa.com test -- requires RSA" | 341 | $ write sys$output "skipping testtsa.com test -- requires RSA" |
| 278 | $ else | 342 | $ else |
| 279 | $ @testtsa.com | 343 | $ @testtsa.com "" "" "" 'pointer_size' |
| 280 | $ endif | 344 | $ endif |
| 281 | $ return | 345 | $ return |
| 282 | $ test_ige: | 346 | $ test_ige: |
| @@ -289,11 +353,14 @@ $ mcr 'texe_dir''jpaketest' | |||
| 289 | $ return | 353 | $ return |
| 290 | $ test_cms: | 354 | $ test_cms: |
| 291 | $ write sys$output "CMS consistency test" | 355 | $ write sys$output "CMS consistency test" |
| 356 | $ ! Define the logical name used to find openssl.exe in the perl script. | ||
| 357 | $ define /user_mode osslx 'exe_dir' | ||
| 292 | $ perl CMS-TEST.PL | 358 | $ perl CMS-TEST.PL |
| 293 | $ return | 359 | $ return |
| 294 | $ | 360 | $ |
| 295 | $ | 361 | $ |
| 296 | $ exit: | 362 | $ exit: |
| 363 | $ mcr 'exe_dir'openssl version -a | ||
| 297 | $ set default '__save_default' | 364 | $ set default '__save_default' |
| 298 | $ deassign sslroot | 365 | $ deassign sslroot |
| 299 | $ exit | 366 | $ exit |
