summaryrefslogtreecommitdiff
path: root/src/lib/libssl/test/tverify.com
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/test/tverify.com')
-rw-r--r--src/lib/libssl/test/tverify.com78
1 files changed, 56 insertions, 22 deletions
diff --git a/src/lib/libssl/test/tverify.com b/src/lib/libssl/test/tverify.com
index 021d701d79..01431f4aac 100644
--- a/src/lib/libssl/test/tverify.com
+++ b/src/lib/libssl/test/tverify.com
@@ -1,29 +1,63 @@
1$! TVERIFY.COM 1$! TVERIFY.COM
2$ 2$
3$ __arch := VAX 3$ __arch := VAX
4$ if f$getsyi("cpu") .ge. 128 then __arch := AXP 4$ if f$getsyi("cpu") .ge. 128 then -
5 __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
6$ if __arch .eqs. "" then __arch := UNK
7$!
8$ line_max = 255 ! Could be longer on modern non-VAX.
9$ temp_file_name = "certs_"+ f$getjpi( "", "PID")+ ".tmp"
5$ exe_dir := sys$disk:[-.'__arch'.exe.apps] 10$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
6$ 11$ cmd = "mcr ''exe_dir'openssl verify ""-CAfile"" ''temp_file_name'"
7$ copy/concatenate [-.certs]*.pem certs.tmp 12$ cmd_len = f$length( cmd)
8$ 13$ pems = "[-.certs...]*.pem"
14$!
15$! Concatenate all the certificate files.
16$!
17$ copy /concatenate 'pems' 'temp_file_name'
18$!
19$! Loop through all the certificate files.
20$!
21$ args = ""
9$ old_f := 22$ old_f :=
10$ loop_certs: 23$ loop_file:
11$ verify := NO 24$ f = f$search( pems)
12$ more := YES 25$ if ((f .nes. "") .and. (f .nes. old_f))
13$ certs := 26$ then
14$ loop_certs2: 27$ old_f = f
15$ f = f$search("[-.certs]*.pem") 28$!
16$ if f .nes. "" .and. f .nes. old_f 29$! If this file name would over-extend the command line, then
30$! run the command now.
31$!
32$ if (cmd_len+ f$length( args)+ 1+ f$length( f) .gt. line_max)
33$ then
34$ if (args .eqs. "") then goto disaster
35$ 'cmd''args'
36$ args = ""
37$ endif
38$! Add the next file to the argument list.
39$ args = args+ " "+ f
40$ else
41$! No more files in the list
42$ goto loop_file_end
43$ endif
44$ goto loop_file
45$ loop_file_end:
46$!
47$! Run the command for any left-over arguments.
48$!
49$ if (args .nes. "")
17$ then 50$ then
18$ certs = certs + " [-.certs]" + f$parse(f,,,"NAME") + ".pem" 51$ 'cmd''args'
19$ verify := YES
20$ if f$length(certs) .lt. 180 then goto loop_certs2
21$ else
22$ more := NO
23$ endif 52$ endif
24$ certs = certs - " " 53$!
25$ 54$! Delete the temporary file.
26$ if verify then mcr 'exe_dir'openssl verify "-CAfile" certs.tmp 'certs' 55$!
27$ if more then goto loop_certs 56$ if (f$search( "''temp_file_name';*") .nes. "") then -
28$ 57 delete 'temp_file_name';*
29$ delete certs.tmp;* 58$!
59$ exit
60$!
61$ disaster:
62$ write sys$output " Command line too long. Doomed."
63$!