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, 22 insertions, 56 deletions
diff --git a/src/lib/libssl/test/tverify.com b/src/lib/libssl/test/tverify.com
index 01431f4aac..021d701d79 100644
--- a/src/lib/libssl/test/tverify.com
+++ b/src/lib/libssl/test/tverify.com
@@ -1,63 +1,29 @@
1$! TVERIFY.COM 1$! TVERIFY.COM
2$ 2$
3$ __arch := VAX 3$ __arch := VAX
4$ if f$getsyi("cpu") .ge. 128 then - 4$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
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"
10$ exe_dir := sys$disk:[-.'__arch'.exe.apps] 5$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
11$ cmd = "mcr ''exe_dir'openssl verify ""-CAfile"" ''temp_file_name'" 6$
12$ cmd_len = f$length( cmd) 7$ copy/concatenate [-.certs]*.pem certs.tmp
13$ pems = "[-.certs...]*.pem" 8$
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 = ""
22$ old_f := 9$ old_f :=
23$ loop_file: 10$ loop_certs:
24$ f = f$search( pems) 11$ verify := NO
25$ if ((f .nes. "") .and. (f .nes. old_f)) 12$ more := YES
26$ then 13$ certs :=
27$ old_f = f 14$ loop_certs2:
28$! 15$ f = f$search("[-.certs]*.pem")
29$! If this file name would over-extend the command line, then 16$ if f .nes. "" .and. f .nes. old_f
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. "")
50$ then 17$ then
51$ 'cmd''args' 18$ certs = certs + " [-.certs]" + f$parse(f,,,"NAME") + ".pem"
19$ verify := YES
20$ if f$length(certs) .lt. 180 then goto loop_certs2
21$ else
22$ more := NO
52$ endif 23$ endif
53$! 24$ certs = certs - " "
54$! Delete the temporary file. 25$
55$! 26$ if verify then mcr 'exe_dir'openssl verify "-CAfile" certs.tmp 'certs'
56$ if (f$search( "''temp_file_name';*") .nes. "") then - 27$ if more then goto loop_certs
57 delete 'temp_file_name';* 28$
58$! 29$ delete certs.tmp;*
59$ exit
60$!
61$ disaster:
62$ write sys$output " Command line too long. Doomed."
63$!