diff options
Diffstat (limited to 'src/lib/libssl/test/testgen.com')
| -rw-r--r-- | src/lib/libssl/test/testgen.com | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/lib/libssl/test/testgen.com b/src/lib/libssl/test/testgen.com new file mode 100644 index 0000000000..5d28ebec72 --- /dev/null +++ b/src/lib/libssl/test/testgen.com | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | $! TETSGEN.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 | $ T := testcert | ||
| 8 | $ KEY = 512 | ||
| 9 | $ CA := [-.certs]testca.pem | ||
| 10 | $ | ||
| 11 | $ set noon | ||
| 12 | $ if f$search(T+".1;*") .nes. "" then delete 'T'.1;* | ||
| 13 | $ if f$search(T+".2;*") .nes. "" then delete 'T'.2;* | ||
| 14 | $ if f$search(T+".key;*") .nes. "" then delete 'T'.key;* | ||
| 15 | $ set on | ||
| 16 | $ | ||
| 17 | $ write sys$output "generating certificate request" | ||
| 18 | $ | ||
| 19 | $ append/new nl: .rnd | ||
| 20 | $ open/append random_file .rnd | ||
| 21 | $ write random_file "string to make the random number generator think it has entropy" | ||
| 22 | $ close random_file | ||
| 23 | $ | ||
| 24 | $ set noon | ||
| 25 | $ define/user sys$output nla0: | ||
| 26 | $ mcr 'exe_dir'openssl no-rsa | ||
| 27 | $ save_severity=$SEVERITY | ||
| 28 | $ set on | ||
| 29 | $ if save_severity | ||
| 30 | $ then | ||
| 31 | $ req_new="-newkey dsa:[-.apps]dsa512.pem" | ||
| 32 | $ else | ||
| 33 | $ req_new="-new" | ||
| 34 | $ write sys$output "There should be a 2 sequences of .'s and some +'s." | ||
| 35 | $ write sys$output "There should not be more that at most 80 per line" | ||
| 36 | $ endif | ||
| 37 | $ | ||
| 38 | $ write sys$output "This could take some time." | ||
| 39 | $ | ||
| 40 | $ mcr 'exe_dir'openssl req -config test.cnf 'req_new' -out testreq.pem | ||
| 41 | $ if $severity .ne. 1 | ||
| 42 | $ then | ||
| 43 | $ write sys$output "problems creating request" | ||
| 44 | $ exit 3 | ||
| 45 | $ endif | ||
| 46 | $ | ||
| 47 | $ mcr 'exe_dir'openssl req -config test.cnf -verify -in testreq.pem -noout | ||
| 48 | $ if $severity .ne. 1 | ||
| 49 | $ then | ||
| 50 | $ write sys$output "signature on req is wrong" | ||
| 51 | $ exit 3 | ||
| 52 | $ endif | ||
