X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=test%2Ftverify.com;h=d888344637ebdc569363d717c1706bcf5843b866;hp=f97e71478f011032fd9fa082f03318809cecb9d3;hb=e933f91f50108a43c0198cdc63ecdfdbc77b4d0d;hpb=7d7d2cbcb02206f3393681f2bce198e11e2e185b diff --git a/test/tverify.com b/test/tverify.com index f97e71478f..d888344637 100644 --- a/test/tverify.com +++ b/test/tverify.com @@ -1,26 +1,65 @@ $! TVERIFY.COM $ -$ __arch := VAX -$ if f$getsyi("cpu") .ge. 128 then __arch := AXP -$ exe_dir := sys$disk:[-.'__arch'.exe.apps] -$ -$ copy/concatenate [-.certs]*.pem certs.tmp -$ -$ old_f := -$ loop_certs: -$ c := NO -$ certs := -$ loop_certs2: -$ f = f$search("[-.certs]*.pem") -$ if f .nes. "" .and. f .nes. old_f +$ __arch = "VAX" +$ if f$getsyi("cpu") .ge. 128 then - + __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p1 .eqs. "64") then __arch = __arch+ "_64" +$! +$ line_max = 255 ! Could be longer on modern non-VAX. +$ temp_file_name = "certs_"+ f$getjpi( "", "PID")+ ".tmp" +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" +$ 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 = "" +$ old_f = "" +$ 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. "") $ then -$ certs = certs + " [-.certs]" + f$parse(f,,,"NAME") + ".pem" -$ if f$length(certs) .lt. 180 then goto loop_certs2 -$ c := YES +$ 'cmd''args' $ endif -$ certs = certs - " " -$ -$ mcr 'exe_dir'openssl verify "-CAfile" certs.tmp 'certs' -$ if c then goto loop_certs -$ -$ delete certs.tmp;* +$! +$! 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." +$!