Functional VMS changes submitted by sms@antinode.info (Steven M. Schweda).

Thank you\!
(note: not tested for now, a few nightly builds should give indications though)
This commit is contained in:
Richard Levitte
2009-05-15 16:37:29 +00:00
parent 085cb7cac0
commit 48f48d96ce
33 changed files with 677 additions and 469 deletions

View File

@@ -12,9 +12,9 @@ $! "test" programs for the different types of encryption for OpenSSL.
$! It was written so it would try to determine what "C" compiler to
$! use or you can specify which "C" compiler to use.
$!
$! The test "executeables" will be placed in a directory called
$! [.xxx.EXE.TEST] where "xxx" denotes AXP or VAX depending on your machines
$! architecture.
$! The test "executables" will be placed in a directory called
$! [.xxx.EXE.TEST] where "xxx" denotes ALPHA, IA64, or VAX, depending
$! on your machine architecture.
$!
$! Specify DEBUG or NODEBUG P1 to compile with or without debugger
$! information.
@@ -42,27 +42,36 @@ $! (That is, If Wee Need To Link To One.)
$!
$ TCPIP_LIB = ""
$!
$! Check Which Architecture We Are Using.
$! Check What Architecture We Are Using.
$!
$ IF (F$GETSYI("CPU").GE.128)
$ IF (F$GETSYI("CPU").LT.128)
$ THEN
$!
$! The Architecture Is AXP.
$!
$ ARCH := AXP
$!
$! Else...
$!
$ ELSE
$!
$! The Architecture Is VAX.
$!
$ ARCH := VAX
$!
$! Else...
$!
$ ELSE
$!
$! The Architecture Is Alpha, IA64 or whatever comes in the future.
$!
$ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
$ IF (ARCH .EQS. "") THEN ARCH = "UNK"
$!
$! End The Architecture Check.
$!
$ ENDIF
$!
$! Define The OBJ Directory.
$!
$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.TEST]
$!
$! Define The EXE Directory.
$!
$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.TEST]
$!
$! Check To Make Sure We Have Valid Command Line Parameters.
$!
$ GOSUB CHECK_OPTIONS
@@ -83,10 +92,6 @@ $! Define The SSL We Are To Use.
$!
$ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL.OLB
$!
$! Define The OBJ Directory.
$!
$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.TEST]
$!
$! Check To See If The Architecture Specific OBJ Directory Exists.
$!
$ IF (F$PARSE(OBJ_DIR).EQS."")
@@ -100,10 +105,6 @@ $! End The Architecture Specific OBJ Directory Check.
$!
$ ENDIF
$!
$! Define The EXE Directory.
$!
$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.TEST]
$!
$! Check To See If The Architecture Specific EXE Directory Exists.
$!
$ IF (F$PARSE(EXE_DIR).EQS."")
@@ -126,6 +127,9 @@ $!
$ GOSUB CHECK_OPT_FILE
$!
$! Define The TEST Files.
$! NOTE: Some might think this list ugly. However, it's made this way to
$! reflect the EXE variable in Makefile as closely as possible,
$! thereby making it fairly easy to verify that the lists are the same.
$!
$ TEST_FILES = "BNTEST,ECTEST,ECDSATEST,ECDHTEST,IDEATEST,"+ -
"MD2TEST,MD4TEST,MD5TEST,HMACTEST,"+ -
@@ -327,7 +331,7 @@ $!
$ IF (F$SEARCH(OPT_FILE).EQS."")
$ THEN
$!
$! Figure Out If We Need An AXP Or A VAX Linker Option File.
$! Figure Out If We Need A non-VAX Or A VAX Linker Option File.
$!
$ IF (ARCH.EQS."VAX")
$ THEN
@@ -347,19 +351,19 @@ $! Else...
$!
$ ELSE
$!
$! Create The AXP Linker Option File.
$! Create The non-VAX Linker Option File.
$!
$ CREATE 'OPT_FILE'
$DECK
!
! Default System Options File For AXP To Link Agianst
! Default System Options File For non-VAX To Link Agianst
! The Sharable C Runtime Library.
!
SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
SYS$SHARE:CMA$OPEN_RTL/SHARE
$EOD
$!
$! End The VAX/AXP DEC C Option File Check.
$! End The DEC C Option File Check.
$!
$ ENDIF
$!
@@ -511,7 +515,7 @@ $ ELSE
$!
$! Check To See If We Have VAXC Or DECC.
$!
$ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
$ IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
$ THEN
$!
$! Looks Like DECC, Set To Use DECC.
@@ -621,7 +625,7 @@ $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
$!
$! Define The Linker Options File Name.
$!
$ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT"
$ OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT"
$!
$! End DECC Check.
$!
@@ -643,9 +647,9 @@ $!
$! Compile Using VAXC.
$!
$ CC = "CC"
$ IF ARCH.EQS."AXP"
$ IF ARCH.NES."VAX"
$ THEN
$ WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
$ WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
$ EXIT
$ ENDIF
$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
@@ -659,7 +663,7 @@ $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
$!
$! Define The Linker Options File Name.
$!
$ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT"
$ OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT"
$!
$! End VAXC Check
$!
@@ -685,7 +689,7 @@ $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
$!
$! Define The Linker Options File Name.
$!
$ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT"
$ OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT"
$!
$! End The GNU C Check.
$!

View File

@@ -1,7 +1,9 @@
$! TCRL.COM -- Tests crl keys
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$ cmd := mcr 'exe_dir'openssl crl

View File

@@ -1,8 +1,9 @@
$! TESTCA.COM
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$
$ openssl := mcr 'exe_dir'openssl
$

View File

@@ -1,8 +1,9 @@
$! TESTENC.COM -- Test encoding and decoding
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$
$ testsrc := makefile.
$ test := p.txt

View File

@@ -1,8 +1,9 @@
$! TETSGEN.COM
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$
$ T := testcert
$ KEY = 512

View File

@@ -6,7 +6,9 @@ $ __proc = f$element(0,";",f$environment("procedure"))
$ __here = f$parse(f$parse("A.;",__proc) - "A.;","[]A.;") - "A.;"
$ __save_default = f$environment("default")
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$ texe_dir := sys$disk:[-.'__arch'.exe.test]
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
@@ -18,6 +20,9 @@ $ if p1 .nes. ""
$ then
$ tests = p1
$ else
$! NOTE: This list reflects the list of dependencies following the
$! "alltests" target in Makefile. This should make it easy to see
$! if there's a difference that needs to be taken care of.
$ tests := -
test_des,test_idea,test_sha,test_md4,test_md5,test_hmac,-
test_md2,test_mdc2,-

View File

@@ -1,7 +1,9 @@
$! TESTSS.COM
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$ digest="-md5"

View File

@@ -1,7 +1,9 @@
$! TESTSSL.COM
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$ texe_dir := sys$disk:[-.'__arch'.exe.test]
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$

View File

@@ -1,7 +1,9 @@
$! TPKCS7.COM -- Tests pkcs7 keys
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$ cmd := mcr 'exe_dir'openssl pkcs7

View File

@@ -1,7 +1,9 @@
$! TPKCS7.COM -- Tests pkcs7 keys
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$ cmd := mcr 'exe_dir'openssl pkcs7

View File

@@ -1,7 +1,9 @@
$! TREQ.COM -- Tests req keys
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$ cmd := mcr 'exe_dir'openssl req -config [-.apps]openssl-vms.cnf

View File

@@ -1,7 +1,9 @@
$! TRSA.COM -- Tests rsa keys
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$ set noon

View File

@@ -1,7 +1,9 @@
$! TSID.COM -- Tests sid keys
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$ cmd := mcr 'exe_dir'openssl sess_id

View File

@@ -1,29 +1,63 @@
$! TVERIFY.COM
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$!
$ 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]
$
$ copy/concatenate [-.certs]*.pem certs.tmp
$
$ 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_certs:
$ verify := NO
$ more := YES
$ certs :=
$ loop_certs2:
$ f = f$search("[-.certs]*.pem")
$ if f .nes. "" .and. f .nes. 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"
$ verify := YES
$ if f$length(certs) .lt. 180 then goto loop_certs2
$ else
$ more := NO
$ 'cmd''args'
$ endif
$ certs = certs - " "
$
$ if verify then mcr 'exe_dir'openssl verify "-CAfile" certs.tmp 'certs'
$ if more 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."
$!

View File

@@ -1,7 +1,9 @@
$! TX509.COM -- Tests x509 certificates
$
$ __arch := VAX
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
$ if f$getsyi("cpu") .ge. 128 then -
__arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if __arch .eqs. "" then __arch := UNK
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$ cmd := mcr 'exe_dir'openssl x509