1999-05-13 11:37:32 +00:00
|
|
|
$! TVERIFY.COM
|
|
|
|
$
|
|
|
|
$ __arch := VAX
|
2009-05-15 16:37:29 +00:00
|
|
|
$ if f$getsyi("cpu") .ge. 128 then -
|
2009-08-25 07:17:12 +00:00
|
|
|
__arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
|
2009-05-15 16:37:29 +00:00
|
|
|
$ if __arch .eqs. "" then __arch := UNK
|
|
|
|
$!
|
|
|
|
$ line_max = 255 ! Could be longer on modern non-VAX.
|
|
|
|
$ temp_file_name = "certs_"+ f$getjpi( "", "PID")+ ".tmp"
|
1999-05-13 11:37:32 +00:00
|
|
|
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
|
2009-05-15 16:37:29 +00:00
|
|
|
$ cmd = "mcr ''exe_dir'openssl verify ""-CAfile"" ''temp_file_name'"
|
|
|
|
$ cmd_len = f$length( cmd)
|
|
|
|
$ pems = "[-.certs...]*.pem"
|
|
|
|
$!
|
|
|
|
$! Concatenate all the certificate files.
|
|
|
|
$!
|
|
|
|
$ copy /concatenate 'pems' 'temp_file_name'
|
|
|
|
$!
|
|
|
|
$! Loop through all the certificate files.
|
|
|
|
$!
|
|
|
|
$ args = ""
|
1999-05-13 11:37:32 +00:00
|
|
|
$ old_f :=
|
2009-05-15 16:37:29 +00:00
|
|
|
$ loop_file:
|
|
|
|
$ f = f$search( pems)
|
|
|
|
$ if ((f .nes. "") .and. (f .nes. old_f))
|
|
|
|
$ then
|
|
|
|
$ old_f = f
|
|
|
|
$!
|
|
|
|
$! If this file name would over-extend the command line, then
|
|
|
|
$! run the command now.
|
|
|
|
$!
|
|
|
|
$ if (cmd_len+ f$length( args)+ 1+ f$length( f) .gt. line_max)
|
|
|
|
$ then
|
|
|
|
$ if (args .eqs. "") then goto disaster
|
|
|
|
$ 'cmd''args'
|
|
|
|
$ args = ""
|
|
|
|
$ endif
|
|
|
|
$! Add the next file to the argument list.
|
|
|
|
$ args = args+ " "+ f
|
|
|
|
$ else
|
|
|
|
$! No more files in the list
|
|
|
|
$ goto loop_file_end
|
|
|
|
$ endif
|
|
|
|
$ goto loop_file
|
|
|
|
$ loop_file_end:
|
|
|
|
$!
|
|
|
|
$! Run the command for any left-over arguments.
|
|
|
|
$!
|
|
|
|
$ if (args .nes. "")
|
1999-05-13 11:37:32 +00:00
|
|
|
$ then
|
2009-05-15 16:37:29 +00:00
|
|
|
$ 'cmd''args'
|
1999-05-13 11:37:32 +00:00
|
|
|
$ endif
|
2009-05-15 16:37:29 +00:00
|
|
|
$!
|
|
|
|
$! Delete the temporary file.
|
|
|
|
$!
|
|
|
|
$ if (f$search( "''temp_file_name';*") .nes. "") then -
|
|
|
|
delete 'temp_file_name';*
|
|
|
|
$!
|
|
|
|
$ exit
|
|
|
|
$!
|
|
|
|
$ disaster:
|
|
|
|
$ write sys$output " Command line too long. Doomed."
|
|
|
|
$!
|