xref: /minix3/crypto/external/bsd/openssl/dist/test/tverify.com (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambuc$! TVERIFY.COM
2*ebfedea0SLionel Sambuc$
3*ebfedea0SLionel Sambuc$	__arch = "VAX"
4*ebfedea0SLionel Sambuc$	if f$getsyi("cpu") .ge. 128 then -
5*ebfedea0SLionel Sambuc	   __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
6*ebfedea0SLionel Sambuc$	if __arch .eqs. "" then __arch = "UNK"
7*ebfedea0SLionel Sambuc$!
8*ebfedea0SLionel Sambuc$	if (p1 .eqs. "64") then __arch = __arch+ "_64"
9*ebfedea0SLionel Sambuc$!
10*ebfedea0SLionel Sambuc$	line_max = 255 ! Could be longer on modern non-VAX.
11*ebfedea0SLionel Sambuc$	temp_file_name = "certs_"+ f$getjpi( "", "PID")+ ".tmp"
12*ebfedea0SLionel Sambuc$	exe_dir = "sys$disk:[-.''__arch'.exe.apps]"
13*ebfedea0SLionel Sambuc$	cmd = "mcr ''exe_dir'openssl verify ""-CAfile"" ''temp_file_name'"
14*ebfedea0SLionel Sambuc$	cmd_len = f$length( cmd)
15*ebfedea0SLionel Sambuc$	pems = "[-.certs...]*.pem"
16*ebfedea0SLionel Sambuc$!
17*ebfedea0SLionel Sambuc$!	Concatenate all the certificate files.
18*ebfedea0SLionel Sambuc$!
19*ebfedea0SLionel Sambuc$	copy /concatenate 'pems' 'temp_file_name'
20*ebfedea0SLionel Sambuc$!
21*ebfedea0SLionel Sambuc$!	Loop through all the certificate files.
22*ebfedea0SLionel Sambuc$!
23*ebfedea0SLionel Sambuc$	args = ""
24*ebfedea0SLionel Sambuc$	old_f = ""
25*ebfedea0SLionel Sambuc$ loop_file:
26*ebfedea0SLionel Sambuc$	    f = f$search( pems)
27*ebfedea0SLionel Sambuc$	    if ((f .nes. "") .and. (f .nes. old_f))
28*ebfedea0SLionel Sambuc$	    then
29*ebfedea0SLionel Sambuc$	      old_f = f
30*ebfedea0SLionel Sambuc$!
31*ebfedea0SLionel Sambuc$!	      If this file name would over-extend the command line, then
32*ebfedea0SLionel Sambuc$!	      run the command now.
33*ebfedea0SLionel Sambuc$!
34*ebfedea0SLionel Sambuc$	      if (cmd_len+ f$length( args)+ 1+ f$length( f) .gt. line_max)
35*ebfedea0SLionel Sambuc$	      then
36*ebfedea0SLionel Sambuc$	         if (args .eqs. "") then goto disaster
37*ebfedea0SLionel Sambuc$	         'cmd''args'
38*ebfedea0SLionel Sambuc$	         args = ""
39*ebfedea0SLionel Sambuc$	      endif
40*ebfedea0SLionel Sambuc$!	      Add the next file to the argument list.
41*ebfedea0SLionel Sambuc$	      args = args+ " "+ f
42*ebfedea0SLionel Sambuc$	   else
43*ebfedea0SLionel Sambuc$!            No more files in the list
44*ebfedea0SLionel Sambuc$	      goto loop_file_end
45*ebfedea0SLionel Sambuc$	   endif
46*ebfedea0SLionel Sambuc$	goto loop_file
47*ebfedea0SLionel Sambuc$	loop_file_end:
48*ebfedea0SLionel Sambuc$!
49*ebfedea0SLionel Sambuc$!	Run the command for any left-over arguments.
50*ebfedea0SLionel Sambuc$!
51*ebfedea0SLionel Sambuc$	if (args .nes. "")
52*ebfedea0SLionel Sambuc$	then
53*ebfedea0SLionel Sambuc$	   'cmd''args'
54*ebfedea0SLionel Sambuc$	endif
55*ebfedea0SLionel Sambuc$!
56*ebfedea0SLionel Sambuc$!	Delete the temporary file.
57*ebfedea0SLionel Sambuc$!
58*ebfedea0SLionel Sambuc$	if (f$search( "''temp_file_name';*") .nes. "") then -
59*ebfedea0SLionel Sambuc	 delete 'temp_file_name';*
60*ebfedea0SLionel Sambuc$!
61*ebfedea0SLionel Sambuc$	exit
62*ebfedea0SLionel Sambuc$!
63*ebfedea0SLionel Sambuc$	disaster:
64*ebfedea0SLionel Sambuc$	write sys$output "   Command line too long.  Doomed."
65*ebfedea0SLionel Sambuc$!
66