From 2d842a90f828967f759e70b2e5b33beda91a9b18 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sat, 19 Mar 2011 09:44:53 +0000 Subject: [PATCH] Apply all the changes submitted by Steven M. Schweda --- VMS/install-vms.com | 67 +++++++ VMS/install.com | 79 -------- VMS/mkshared.com | 242 ++++++++++++++--------- VMS/openssl_startup.com | 108 +++++++++++ VMS/openssl_undo.com | 20 ++ apps/CA.com | 2 +- apps/apps.c | 6 + apps/enc.c | 4 + apps/install-apps.com | 107 +++++++++++ apps/install.com | 65 ------- apps/makeapps.com | 275 +++++++++++++++++---------- apps/openssl.c | 26 +++ apps/vms_decc_init.c | 188 ++++++++++++++++++ crypto/LPdir_vms.c | 49 +++-- crypto/bio/b_sock.c | 25 ++- crypto/bio/bss_log.c | 32 +++- crypto/bn/bn.h | 18 ++ crypto/bn/bn_mont.c | 2 +- crypto/bn/bn_nist.c | 64 ++++--- crypto/crypto-lib.com | 320 ++++++++++++++++++++----------- crypto/dso/dso_vms.c | 177 +++++++++-------- crypto/install-crypto.com | 196 +++++++++++++++++++ crypto/install.com | 150 --------------- crypto/o_time.c | 22 ++- crypto/rand/rand_vms.c | 16 +- crypto/rand/randfile.c | 2 + crypto/vms_rms.h | 51 +++++ engines/makeengines.com | 290 ++++++++++++++++++---------- install.com | 219 ++++++++++++--------- makevms.com | 390 ++++++++++++++++++++++++-------------- ssl/install-ssl.com | 136 +++++++++++++ ssl/install.com | 90 --------- ssl/ssl-lib.com | 261 +++++++++++++++---------- test/bntest.com | 7 + test/cms-test.pl | 4 +- test/maketests.com | 260 +++++++++++++++---------- test/tcrl.com | 13 +- test/testca.com | 8 +- test/testenc.com | 13 +- test/testgen.com | 22 ++- test/tests.com | 103 ++++++---- test/testss.com | 17 +- test/testssl.com | 20 +- test/testtsa.com | 61 +++--- test/tpkcs7.com | 13 +- test/tpkcs7d.com | 13 +- test/treq.com | 13 +- test/trsa.com | 13 +- test/tsid.com | 13 +- test/tverify.com | 10 +- test/tx509.com | 13 +- util/libeay.num | 1 + 52 files changed, 2814 insertions(+), 1502 deletions(-) create mode 100755 VMS/install-vms.com delete mode 100644 VMS/install.com create mode 100755 VMS/openssl_startup.com create mode 100755 VMS/openssl_undo.com create mode 100755 apps/install-apps.com delete mode 100644 apps/install.com create mode 100755 apps/vms_decc_init.c create mode 100755 crypto/install-crypto.com delete mode 100644 crypto/install.com create mode 100755 crypto/vms_rms.h create mode 100755 ssl/install-ssl.com delete mode 100644 ssl/install.com diff --git a/VMS/install-vms.com b/VMS/install-vms.com new file mode 100755 index 0000000000..7da8b2153b --- /dev/null +++ b/VMS/install-vms.com @@ -0,0 +1,67 @@ +$! install-vms.com -- Installs the files in a given directory tree +$! +$! Author: Richard Levitte +$! Time of creation: 23-MAY-1998 19:22 +$! +$! P1 root of the directory tree +$! +$! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") +$! +$ on error then goto tidy +$ on control_c then goto tidy +$! +$ if p1 .eqs. "" +$ then +$ write sys$output "First argument missing." +$ write sys$output - + "Should be the directory where you want things installed." +$ exit +$ endif +$ +$ if (f$getsyi( "cpu") .lt. 128) +$ then +$ arch = "VAX" +$ else +$ arch = f$edit( f$getsyi( "arch_name"), "upcase") +$ if (arch .eqs. "") then arch = "UNK" +$ endif +$ +$ root = f$parse( P1, "[]A.;0", , , "SYNTAX_ONLY, NO_CONCEAL")- "A.;0" +$ root_dev = f$parse( root, , , "device", "syntax_only") +$ root_dir = f$parse( root, , , "directory", "syntax_only") - - + "[000000." - "][" - "[" - "]" +$ root = root_dev + "[" + root_dir +$ +$ define /nolog wrk_sslroot 'root'.] /translation_attributes = concealed +$ define /nolog wrk_sslinclude wrk_sslroot:[include] +$ +$ if f$parse( "wrk_sslroot:[000000]") .eqs. "" then - + create /directory /log wrk_sslroot:[000000] +$ if f$parse( "wrk_sslinclude:") .eqs. "" then - + create /directory /log wrk_sslinclude: +$ if f$parse( "wrk_sslroot:[vms]") .eqs. "" then - + create /directory /log wrk_sslroot:[vms] +$! +$ copy /log /protection = world:re openssl_startup.com wrk_sslroot:[vms] +$ copy /log /protection = world:re openssl_undo.com wrk_sslroot:[vms] +$ copy /log /protection = world:re openssl_utils.com wrk_sslroot:[vms] +$! +$ tidy: +$! +$ call deass wrk_sslroot +$ call deass wrk_sslinclude +$! +$ exit +$! +$ deass: subroutine +$ if (f$trnlnm( p1, "LNM$PROCESS") .nes. "") +$ then +$ deassign /process 'p1' +$ endif +$ endsubroutine +$! diff --git a/VMS/install.com b/VMS/install.com deleted file mode 100644 index 9c9c0e1e27..0000000000 --- a/VMS/install.com +++ /dev/null @@ -1,79 +0,0 @@ -$! INSTALL.COM -- Installs the files in a given directory tree -$! -$! Author: Richard Levitte -$! Time of creation: 23-MAY-1998 19:22 -$! -$! P1 root of the directory tree -$! -$ IF P1 .EQS. "" -$ THEN -$ WRITE SYS$OUTPUT "First argument missing." -$ WRITE SYS$OUTPUT "Should be the directory where you want things installed." -$ EXIT -$ ENDIF -$ -$ IF (F$GETSYI("CPU").LT.128) -$ THEN -$ ARCH := VAX -$ ELSE -$ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE") -$ IF (ARCH .EQS. "") THEN ARCH = "UNK" -$ ENDIF -$ -$ ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0" -$ ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY") -$ ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") - - - "[000000." - "][" - "[" - "]" -$ ROOT = ROOT_DEV + "[" + ROOT_DIR -$ -$ DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC -$ DEFINE/NOLOG WRK_SSLINCLUDE WRK_SSLROOT:[INCLUDE] -$ -$ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLROOT:[000000] -$ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLINCLUDE: -$ IF F$PARSE("WRK_SSLROOT:[VMS]") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLROOT:[VMS] -$ -$ IF F$SEARCH("WRK_SSLINCLUDE:vms_idhacks.h") .NES. "" THEN - - DELETE WRK_SSLINCLUDE:vms_idhacks.h;* -$ -$ OPEN/WRITE SF WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM -$ WRITE SYS$OUTPUT "%OPEN-I-CREATED, ",F$SEARCH("WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM")," created." -$ WRITE SF "$! Startup file for Openssl" -$ WRITE SF "$!" -$ WRITE SF "$! Do not edit this file, as it will be regenerated during next installation." -$ WRITE SF "$! Instead, add or change SSLROOT:[VMS]OPENSSL_SYSTARTUP.COM" -$ WRITE SF "$!" -$ WRITE SF "$! P1 a qualifier to DEFINE. For example ""/SYSTEM"" to get the logical names" -$ WRITE SF "$! defined in the system logical name table." -$ WRITE SF "$!" -$ WRITE SF "$ IF (F$GETSYI(""CPU"").LT.128)" -$ WRITE SF "$ THEN" -$ WRITE SF "$ ARCH := VAX" -$ WRITE SF "$ ELSE" -$ WRITE SF "$ ARCH = F$EDIT( F$GETSYI( ""ARCH_NAME""), ""UPCASE"")" -$ WRITE SF "$ IF (ARCH .EQS. """") THEN ARCH = ""UNK""" -$ WRITE SF "$ ENDIF" -$ WRITE SF "$ DEFINE/NOLOG'P1 SSLROOT ",ROOT,".] /TRANS=CONC" -$ WRITE SF "$ DEFINE/NOLOG'P1 SSLLIB SSLROOT:['ARCH'_LIB]" -$ WRITE SF "$ DEFINE/NOLOG'P1 SSLINCLUDE SSLROOT:[INCLUDE]" -$ WRITE SF "$ DEFINE/NOLOG'P1 SSLEXE SSLROOT:['ARCH'_EXE]" -$ WRITE SF "$ DEFINE/NOLOG'P1 SSLCERTS SSLROOT:[CERTS]" -$ WRITE SF "$ DEFINE/NOLOG'P1 SSLPRIVATE SSLROOT:[PRIVATE]" -$ WRITE SF "$" -$ WRITE SF "$! This is program can include " -$ WRITE SF "$ DEFINE/NOLOG'P1 OPENSSL SSLINCLUDE:" -$ WRITE SF "$" -$ WRITE SF "$ IF F$SEARCH(""SSLROOT:[VMS]OPENSSL_SYSTARTUP.COM"") .NES."""" THEN -" -$ WRITE SF " @SSLROOT:[VMS]OPENSSL_SYSTARTUP.COM" -$ WRITE SF "$" -$ WRITE SF "$ EXIT" -$ CLOSE SF -$ SET FILE/PROT=WORLD:RE WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM -$ -$ COPY OPENSSL_UTILS.COM WRK_SSLROOT:[VMS]/LOG -$ SET FILE/PROT=WORLD:RE WRK_SSLROOT:[VMS]OPENSSL_UTILS.COM -$ -$ EXIT diff --git a/VMS/mkshared.com b/VMS/mkshared.com index 2f9167eeaa..d92a823f0b 100644 --- a/VMS/mkshared.com +++ b/VMS/mkshared.com @@ -1,101 +1,159 @@ -$! MKSHARED.COM -- script to created shareable images on VMS +$! MKSHARED.COM -- Create shareable images. $! -$! No command line parameters. This should be run at the start of the source -$! tree (the same directory where one finds INSTALL.VMS). +$! P1: "64" for 64-bit pointers. $! -$! Input: [.UTIL]LIBEAY.NUM,[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB -$! [.UTIL]SSLEAY.NUM,[.xxx.EXE.SSL]LIBSSL.OLB -$! Output: [.xxx.EXE.CRYPTO]LIBCRYPTO.OPT,.MAP,.EXE -$! [.xxx.EXE.SSL]LIBSSL.OPT,.MAP,.EXE +$! P2: Zlib object library path (optional). +$! +$! Input: [.UTIL]LIBEAY.NUM,[.xxx.EXE.CRYPTO]SSL_LIBCRYPTO[32].OLB +$! [.UTIL]SSLEAY.NUM,[.xxx.EXE.SSL]SSL_LIBSSL[32].OLB +$! Output: [.xxx.EXE.CRYPTO]SSL_LIBCRYPTO_SHR[32].OPT,.MAP,.EXE +$! [.xxx.EXE.SSL]SSL_LIBSSL_SRH[32].OPT,.MAP,.EXE $! $! So far, tests have only been made on VMS for Alpha. VAX will come in time. $! =========================================================================== -$ +$! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") +$! +$! Save the original default device:[directory]. +$! +$ def_orig = f$environment( "default") +$ on error then goto tidy +$ on control_c then goto tidy +$! +$! SET DEFAULT to the main kit directory. +$! +$ proc = f$environment("procedure") +$ proc = f$parse( "A.;", proc)- "A.;" +$ set default 'proc' +$ set default [-] +$! $! ----- Prepare info for processing: version number and file info $ gosub read_version_info $ if libver .eqs. "" $ then $ write sys$error "ERROR: Couldn't find any library version info..." -$ exit +$ go to tidy: $ endif $ -$ if (f$getsyi("cpu").lt.128) +$ if (f$getsyi("cpu") .lt. 128) $ then -$ arch := VAX +$ arch_vax = 1 +$ arch = "VAX" $ else -$ arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") -$ if (arch .eqs. "") then arch = "UNK" +$ arch_vax = 0 +$ arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") +$ if (arch .eqs. "") then arch = "UNK" $ endif -$ -$ if arch .nes. "VAX" +$! +$ archd = arch +$ lib32 = "32" +$ shr = "SHR32" +$! +$ if (p1 .nes. "") $ then -$ arch_vax = 0 -$ libid = "Crypto" -$ libnum = "[.UTIL]LIBEAY.NUM" -$ libdir = "[.''ARCH'.EXE.CRYPTO]" -$ libolb = "''libdir'LIBCRYPTO.OLB" -$ libopt = "''libdir'LIBCRYPTO.OPT" -$ libmap = "''libdir'LIBCRYPTO.MAP" -$ libgoal= "''libdir'LIBCRYPTO.EXE" -$ libref = "" -$ if f$search(libdir+libolb) .nes. "" then gosub create_nonvax_shr -$ libid = "SSL" -$ libnum = "[.UTIL]SSLEAY.NUM" -$ libdir = "[.''ARCH'.EXE.SSL]" -$ libolb = "''libdir'LIBSSL.OLB" -$ libopt = "''libdir'LIBSSL.OPT" -$ libmap = "''libdir'LIBSSL.MAP" -$ libgoal= "''libdir'LIBSSL.EXE" -$ libref = "[.''ARCH'.EXE.CRYPTO]LIBCRYPTO.EXE" -$ if f$search(libdir+libolb) .nes. "" then gosub create_nonvax_shr -$ arch_vax = 0 +$ if (p1 .eqs. "64") +$ then +$ archd = arch+ "_64" +$ lib32 = "" +$ shr = "SHR" +$ else +$ if (p1 .nes. "32") +$ then +$ write sys$output "Second argument invalid." +$ write sys$output "It should be "32", "64", or nothing." +$ exit +$ endif +$ endif +$ endif +$! +$ ZLIB = p2 +$ zlib_lib = "" +$ if (ZLIB .nes. "") +$ then +$ file2 = f$parse( ZLIB, "libz.olb", , , "syntax_only") +$ if (f$search( file2) .eqs. "") +$ then +$ write sys$output "" +$ write sys$output "The Option ", ZLIB, " Is Invalid." +$ write sys$output " Can't find library: ''file2'" +$ write sys$output "" +$ goto tidy +$ endif +$ zlib_lib = ", ''file2' /library" +$ endif +$! +$ if (arch_vax) +$ then +$ libtit = "CRYPTO_TRANSFER_VECTOR" $ libid = "Crypto" $ libnum = "[.UTIL]LIBEAY.NUM" -$ libdir = "[.''ARCH'.EXE.CRYPTO]" -$ libolb = "''libdir'LIBCRYPTO32.OLB" -$ libopt = "''libdir'LIBCRYPTO32.OPT" -$ libmap = "''libdir'LIBCRYPTO32.MAP" -$ libgoal= "''libdir'LIBCRYPTO32.EXE" +$ libdir = "[.''ARCHD'.EXE.CRYPTO]" +$ libmar = "''libdir'SSL_LIBCRYPTO_''shr'.MAR" +$ libolb = "''libdir'SSL_LIBCRYPTO''lib32'.OLB" +$ libopt = "''libdir'SSL_LIBCRYPTO_''shr'.OPT" +$ libobj = "''libdir'SSL_LIBCRYPTO_''shr'.OBJ" +$ libmap = "''libdir'SSL_LIBCRYPTO_''shr'.MAP" +$ libgoal= "''libdir'SSL_LIBCRYPTO_''shr'.EXE" $ libref = "" -$ if f$search(libdir+libolb) .nes. "" then gosub create_nonvax_shr +$ libvec = "LIBCRYPTO" +$ if f$search( libolb) .nes. "" then gosub create_vax_shr +$ libtit = "SSL_TRANSFER_VECTOR" $ libid = "SSL" $ libnum = "[.UTIL]SSLEAY.NUM" -$ libdir = "[.''ARCH'.EXE.SSL]" -$ libolb = "''libdir'LIBSSL32.OLB" -$ libopt = "''libdir'LIBSSL32.OPT" -$ libmap = "''libdir'LIBSSL32.MAP" -$ libgoal= "''libdir'LIBSSL32.EXE" -$ libref = "[.''ARCH'.EXE.CRYPTO]LIBCRYPTO32.EXE" -$ if f$search(libdir+libolb) .nes. "" then gosub create_nonvax_shr +$ libdir = "[.''ARCHD'.EXE.SSL]" +$ libmar = "''libdir'SSL_LIBSSL_''shr'.MAR" +$ libolb = "''libdir'SSL_LIBSSL''lib32'.OLB" +$ libopt = "''libdir'SSL_LIBSSL_''shr'.OPT" +$ libobj = "''libdir'SSL_LIBSSL_''shr'.OBJ" +$ libmap = "''libdir'SSL_LIBSSL_''shr'.MAP" +$ libgoal= "''libdir'SSL_LIBSSL_''shr'.EXE" +$ libref = "[.''ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO_''shr'.EXE" +$ libvec = "LIBSSL" +$ if f$search( libolb) .nes. "" then gosub create_vax_shr $ else -$ arch_vax = 1 -$ libtit = "CRYPTO_TRANSFER_VECTOR" $ libid = "Crypto" $ libnum = "[.UTIL]LIBEAY.NUM" -$ libdir = "[.''ARCH'.EXE.CRYPTO]" -$ libmar = "''libdir'LIBCRYPTO.MAR" -$ libolb = "''libdir'LIBCRYPTO.OLB" -$ libopt = "''libdir'LIBCRYPTO.OPT" -$ libobj = "''libdir'LIBCRYPTO.OBJ" -$ libmap = "''libdir'LIBCRYPTO.MAP" -$ libgoal= "''libdir'LIBCRYPTO.EXE" +$ libdir = "[.''ARCHD'.EXE.CRYPTO]" +$ libolb = "''libdir'SSL_LIBCRYPTO''lib32'.OLB" +$ libopt = "''libdir'SSL_LIBCRYPTO_''shr'.OPT" +$ libmap = "''libdir'SSL_LIBCRYPTO_''shr'.MAP" +$ libgoal= "''libdir'SSL_LIBCRYPTO_''shr'.EXE" $ libref = "" -$ libvec = "LIBCRYPTO" -$ if f$search(libdir+libolb) .nes. "" then gosub create_vax_shr -$ libtit = "SSL_TRANSFER_VECTOR" +$ if f$search( libolb) .nes. "" then gosub create_nonvax_shr $ libid = "SSL" $ libnum = "[.UTIL]SSLEAY.NUM" -$ libdir = "[.''ARCH'.EXE.SSL]" -$ libmar = "''libdir'LIBSSL.MAR" -$ libolb = "''libdir'LIBSSL.OLB" -$ libopt = "''libdir'LIBSSL.OPT" -$ libobj = "''libdir'LIBSSL.OBJ" -$ libmap = "''libdir'LIBSSL.MAP" -$ libgoal= "''libdir'LIBSSL.EXE" -$ libref = "[.''ARCH'.EXE.CRYPTO]LIBCRYPTO.EXE" -$ libvec = "LIBSSL" -$ if f$search(libdir+libolb) .nes. "" then gosub create_vax_shr +$ libdir = "[.''ARCHD'.EXE.SSL]" +$ libolb = "''libdir'SSL_LIBSSL''lib32'.OLB" +$ libopt = "''libdir'SSL_LIBSSL_''shr'.OPT" +$ libmap = "''libdir'SSL_LIBSSL_''shr'.MAP" +$ libgoal= "''libdir'SSL_LIBSSL_''shr'.EXE" +$ libref = "[.''ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO_''shr'.EXE" +$ if f$search( libolb) .nes. "" then gosub create_nonvax_shr $ endif +$! +$ tidy: +$! +$! Close any open files. +$! +$ if (f$trnlnm( "libnum", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then - + close libnum +$! +$ if (f$trnlnm( "mar", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then - + close mar +$! +$ if (f$trnlnm( "opt", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then - + close opt +$! +$ if (f$trnlnm( "vf", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then - + close vf +$! +$! Restore the original default device:[directory]. +$! +$ set default 'def_orig' $ exit $ $! ----- Subroutines to build the shareable libraries @@ -130,9 +188,9 @@ $! ----- Subroutines for non-VAX $! ----- $! The creator routine $ create_nonvax_shr: -$ open/write opt 'libopt' +$ open /write opt 'libopt' $ write opt "identification=""",libid," ",libverstr,"""" -$ write opt libolb,"/lib" +$ write opt libolb, " /library" $ if libref .nes. "" then write opt libref,"/SHARE" $ write opt "SYMBOL_VECTOR=(-" $ libfirstentry := true @@ -143,7 +201,8 @@ $ gosub read_func_num $ write opt ")" $ write opt "GSMATCH=",libvmatch,",",libver $ close opt -$ link/map='libmap'/full/share='libgoal' 'libopt'/option +$ link /map = 'libmap' /full /share = 'libgoal' 'libopt' /options - + 'zlib_lib' $ return $ $! The record writer routine @@ -177,7 +236,7 @@ $! ----- Subroutines for VAX $! ----- $! The creator routine $ create_vax_shr: -$ open/write mar 'libmar' +$ open /write mar 'libmar' $ type sys$input:/out=mar: ; ; Transfer vector for VAX shareable image @@ -212,10 +271,10 @@ $! libwriter := write_vax_vtransfer_entry $! gosub read_func_num $ write mar " .END" $ close mar -$ open/write opt 'libopt' +$ open /write opt 'libopt' $ write opt "identification=""",libid," ",libverstr,"""" $ write opt libobj -$ write opt libolb,"/lib" +$ write opt libolb, " /library" $ if libref .nes. "" then write opt libref,"/SHARE" $ type sys$input:/out=opt: ! @@ -234,7 +293,8 @@ $ libwriter := write_vax_psect_attr $ gosub read_func_num $ close opt $ macro/obj='libobj' 'libmar' -$ link/map='libmap'/full/share='libgoal' 'libopt'/option +$ link /map = 'libmap' /full /share = 'libgoal' 'libopt' /options - + 'zlib_lib' $ return $ $! The record writer routine for VAX functions @@ -256,9 +316,9 @@ $ return $ $! ----- Common subroutines $! ----- -$! The .num file reader. This one has great responsability. +$! The .num file reader. This one has great responsibility. $ read_func_num: -$ open libnum 'libnum' +$ open /read libnum 'libnum' $ goto read_nums $ $ read_nums: @@ -266,27 +326,28 @@ $ libentrynum=0 $ liblastentry:=false $ entrycount=0 $ loop: -$ read/end=loop_end/err=loop_end libnum line -$ entrynum=f$int(f$element(1," ",f$edit(line,"COMPRESS,TRIM"))) -$ entryinfo=f$element(2," ",f$edit(line,"COMPRESS,TRIM")) -$ curentry=f$element(0," ",f$edit(line,"COMPRESS,TRIM")) -$ info_exist=f$element(0,":",entryinfo) -$ info_platforms=","+f$element(1,":",entryinfo)+"," -$ info_kind=f$element(2,":",entryinfo) -$ info_algorithms=","+f$element(3,":",entryinfo)+"," +$ read /end=loop_end /err=loop_end libnum line +$ lin = f$edit( line, "COMPRESS,TRIM") +$ entrynum = f$int(f$element( 1, " ", lin)) +$ entryinfo = f$element( 2, " ", lin) +$ curentry = f$element( 0, " ", lin) +$ info_exist = f$element( 0, ":", entryinfo) +$ info_platforms = ","+ f$element(1, ":", entryinfo)+ "," +$ info_kind = f$element( 2, ":", entryinfo) +$ info_algorithms = ","+ f$element( 3, ":", entryinfo)+ "," $ if info_exist .eqs. "NOEXIST" then goto loop $ truesum = 0 $ falsesum = 0 $ negatives = 1 $ plat_i = 0 $ loop1: -$ plat_entry = f$element(plat_i,",",info_platforms) +$ plat_entry = f$element( plat_i, ",", info_platforms) $ plat_i = plat_i + 1 $ if plat_entry .eqs. "" then goto loop1 $ if plat_entry .nes. "," $ then $ if f$extract(0,1,plat_entry) .nes. "!" then negatives = 0 -$ if f$getsyi("CPU") .lt. 128 +$ if (arch_vax) $ then $ if plat_entry .eqs. "EXPORT_VAR_AS_FUNCTION" then - $ truesum = truesum + 1 @@ -295,6 +356,7 @@ $ falsesum = falsesum + 1 $ endif $! $ if ((plat_entry .eqs. "VMS") .or. - + ((plat_entry .eqs. "ZLIB") .and. (ZLIB .nes. "")) .or. - (arch_vax .and. (plat_entry .eqs. "VMSVAX"))) then - truesum = truesum + 1 $! @@ -364,7 +426,7 @@ $ $! The version number reader $ read_version_info: $ libver = "" -$ open/read vf [.CRYPTO]OPENSSLV.H +$ open /read vf [.CRYPTO]OPENSSLV.H $ loop_rvi: $ read/err=endloop_rvi/end=endloop_rvi vf rvi_line $ if rvi_line - "SHLIB_VERSION_NUMBER """ .eqs. rvi_line then - diff --git a/VMS/openssl_startup.com b/VMS/openssl_startup.com new file mode 100755 index 0000000000..04bbbde886 --- /dev/null +++ b/VMS/openssl_startup.com @@ -0,0 +1,108 @@ +$! +$! Startup file for OpenSSL 1.x. +$! +$! 2011-03-05 SMS. +$! +$! This procedure must reside in the OpenSSL installation directory. +$! It will fail if it is copied to a different location. +$! +$! P1 qualifier(s) for DEFINE. For example, "/SYSTEM" to get the +$! logical names defined in the system logical name table. +$! +$! P2 "64", to use executables which were built with 64-bit pointers. +$! +$! Good (default) and bad status values. +$! +$ status = %x00010001 ! RMS$_NORMAL, normal successful completion. +$ rms_e_fnf = %x00018292 ! RMS$_FNF, file not found. +$! +$! Prepare for problems. +$! +$ orig_dev_dir = f$environment( "DEFAULT") +$ on control_y then goto clean_up +$ on error then goto clean_up +$! +$! Determine hardware architecture. +$! +$ if (f$getsyi( "cpu") .lt. 128) +$ then +$ arch_name = "VAX" +$ else +$ arch_name = f$edit( f$getsyi( "arch_name"), "upcase") +$ if (arch_name .eqs. "") then arch_name = "UNK" +$ endif +$! +$ if (p2 .eqs. "64") +$ then +$ arch_name_exe = arch_name+ "_64" +$ else +$ arch_name_exe = arch_name +$ endif +$! +$! Derive the OpenSSL installation device:[directory] from the location +$! of this command procedure. +$! +$ proc = f$environment( "procedure") +$ proc_dev_dir = f$parse( "A.;", proc, , , "no_conceal") - "A.;" +$ proc_dev = f$parse( proc_dev_dir, , , "device", "syntax_only") +$ proc_dir = f$parse( proc_dev_dir, , , "directory", "syntax_only") - - + ".][000000"- "[000000."- "]["- "["- "]" +$ proc_dev_dir = proc_dev+ "["+ proc_dir+ "]" +$ set default 'proc_dev_dir' +$ set default [-] +$ ossl_dev_dir = f$environment( "default") +$! +$! Check existence of expected directories (to see if this procedure has +$! been moved away from its proper place). +$! +$ if ((f$search( "certs.dir;1") .eqs. "") .or. - + (f$search( "include.dir;1") .eqs. "") .or. - + (f$search( "private.dir;1") .eqs. "") .or. - + (f$search( "vms.dir;1") .eqs. "")) +$ then +$ write sys$output - + " Can't find expected common OpenSSL directories in:" +$ write sys$output " ''ossl_dev_dir'" +$ status = rms_e_fnf +$ goto clean_up +$ endif +$! +$ if ((f$search( "''arch_name_exe'_exe.dir;1") .eqs. "") .or. - + (f$search( "''arch_name'_lib.dir;1") .eqs. "")) +$ then +$ write sys$output - + " Can't find expected architecture-specific OpenSSL directories in:" +$ write sys$output " ''ossl_dev_dir'" +$ status = rms_e_fnf +$ goto clean_up +$ endif +$! +$! All seems well (enough). Define the OpenSSL logical names. +$! +$ ossl_root = ossl_dev_dir- "]"+ ".]" +$ define /translation_attributes = concealed /nolog'p1 SSLROOT 'ossl_root' +$ define /nolog 'p1' SSLCERTS sslroot:[certs] +$ define /nolog 'p1' SSLINCLUDE sslroot:[include] +$ define /nolog 'p1' SSLPRIVATE sslroot:[private] +$ define /nolog 'p1' SSLEXE sslroot:['arch_name_exe'_exe] +$ define /nolog 'p1' SSLLIB sslroot:['arch_name'_lib] +$! +$! Defining OPENSSL lets a C program use "#include ": +$ define /nolog 'p1' OPENSSL SSLINCLUDE: +$! +$! Run a site-specific procedure, if it exists. +$! +$ if f$search( "sslroot:[vms]openssl_systartup.com") .nes."" then - + @ sslroot:[vms]openssl_systartup.com +$! +$! Restore the original default dev:[dir] (if known). +$! +$ clean_up: +$! +$ if (f$type( orig_dev_dir) .nes. "") +$ then +$ set default 'orig_dev_dir' +$ endif +$! +$ EXIT 'status' +$! diff --git a/VMS/openssl_undo.com b/VMS/openssl_undo.com new file mode 100755 index 0000000000..d1623a3160 --- /dev/null +++ b/VMS/openssl_undo.com @@ -0,0 +1,20 @@ +$! +$! Deassign OpenSSL logical names. +$! +$ call deass "OPENSSL" "''p1'" +$ call deass "SSLCERTS" "''p1'" +$ call deass "SSLEXE" "''p1'" +$ call deass "SSLINCLUDE" "''p1'" +$ call deass "SSLLIB" "''p1'" +$ call deass "SSLPRIVATE" "''p1'" +$ call deass "SSLROOT" "''p1'" +$! +$ exit +$! +$deass: subroutine +$ if (f$trnlnm( p1) .nes. "") +$ then +$ deassign 'p2' 'p1' +$ endif +$ endsubroutine +$! diff --git a/apps/CA.com b/apps/CA.com index 69b7bb3fd8..00266db521 100644 --- a/apps/CA.com +++ b/apps/CA.com @@ -114,7 +114,7 @@ $! $ IF F$SEARCH(CATOP+".private"+CAKEY) .EQS. "" $ THEN $ READ '__INPUT' FILE - - /PROMPT="CA certificate filename (or enter to create)" + /PROMPT="CA certificate filename (or enter to create): " $ IF (FILE .NES. "") .AND. (F$SEARCH(FILE) .NES. "") $ THEN $ COPY 'FILE' 'CATOP'.private'CAKEY' diff --git a/apps/apps.c b/apps/apps.c index c2797711ae..feb7ed46e6 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -798,7 +798,9 @@ X509 *load_cert(BIO *err, const char *file, int format, if (file == NULL) { #ifdef _IONBF +# ifndef OPENSSL_NO_SETVBUF_IONBF setvbuf(stdin, NULL, _IONBF, 0); +# endif /* ndef OPENSSL_NO_SETVBUF_IONBF */ #endif BIO_set_fp(cert,stdin,BIO_NOCLOSE); } @@ -899,7 +901,9 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin, if (file == NULL && maybe_stdin) { #ifdef _IONBF +# ifndef OPENSSL_NO_SETVBUF_IONBF setvbuf(stdin, NULL, _IONBF, 0); +# endif /* ndef OPENSSL_NO_SETVBUF_IONBF */ #endif BIO_set_fp(key,stdin,BIO_NOCLOSE); } @@ -988,7 +992,9 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin, if (file == NULL && maybe_stdin) { #ifdef _IONBF +# ifndef OPENSSL_NO_SETVBUF_IONBF setvbuf(stdin, NULL, _IONBF, 0); +# endif /* ndef OPENSSL_NO_SETVBUF_IONBF */ #endif BIO_set_fp(key,stdin,BIO_NOCLOSE); } diff --git a/apps/enc.c b/apps/enc.c index c28d8b1948..076225c4cb 100644 --- a/apps/enc.c +++ b/apps/enc.c @@ -393,8 +393,10 @@ bad: if (inf == NULL) { +#ifndef OPENSSL_NO_SETVBUF_IONBF if (bufsize != NULL) setvbuf(stdin, (char *)NULL, _IONBF, 0); +#endif /* ndef OPENSSL_NO_SETVBUF_IONBF */ BIO_set_fp(in,stdin,BIO_NOCLOSE); } else @@ -447,8 +449,10 @@ bad: if (outf == NULL) { BIO_set_fp(out,stdout,BIO_NOCLOSE); +#ifndef OPENSSL_NO_SETVBUF_IONBF if (bufsize != NULL) setvbuf(stdout, (char *)NULL, _IONBF, 0); +#endif /* ndef OPENSSL_NO_SETVBUF_IONBF */ #ifdef OPENSSL_SYS_VMS { BIO *tmpbio = BIO_new(BIO_f_linebuffer()); diff --git a/apps/install-apps.com b/apps/install-apps.com new file mode 100755 index 0000000000..7a553aa12e --- /dev/null +++ b/apps/install-apps.com @@ -0,0 +1,107 @@ +$! INSTALL.COM -- Installs the files in a given directory tree +$! +$! Author: Richard Levitte +$! Time of creation: 22-MAY-1998 10:13 +$! +$! P1 root of the directory tree +$! P2 "64" for 64-bit pointers. +$! +$! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") +$! +$ on error then goto tidy +$ on control_c then goto tidy +$! +$ if (p1 .eqs. "") +$ then +$ write sys$output "First argument missing." +$ write sys$output - + "It should be the directory where you want things installed." +$ exit +$ endif +$! +$ if (f$getsyi("cpu") .lt. 128) +$ then +$ arch = "VAX" +$ else +$ arch = f$edit( f$getsyi( "arch_name"), "upcase") +$ if (arch .eqs. "") then arch = "UNK" +$ endif +$! +$ archd = arch +$! +$ if (p2 .nes. "") +$ then +$ if (p2 .eqs. "64") +$ then +$ archd = arch+ "_64" +$ else +$ if (p2 .nes. "32") +$ then +$ write sys$output "Second argument invalid." +$ write sys$output "It should be "32", "64", or nothing." +$ exit +$ endif +$ endif +$ endif +$! +$ root = f$parse( p1, "[]A.;0", , , "syntax_only, no_conceal") - "A.;0" +$ root_dev = f$parse(root,,,"device","syntax_only") +$ root_dir = f$parse(root,,,"directory","syntax_only") - - + "[000000." - "][" - "[" - "]" +$ root = root_dev + "[" + root_dir +$! +$ define /nolog wrk_sslroot 'root'.] /trans=conc +$ define /nolog wrk_sslxexe wrk_sslroot:['archd'_exe] +$! +$ if f$parse("wrk_sslroot:[000000]") .eqs. "" then - + create /directory /log wrk_sslroot:[000000] +$ if f$parse("wrk_sslxexe:") .eqs. "" then - + create /directory /log wrk_sslxexe: +$! +$ exe := openssl +$! +$ exe_dir := [-.'archd'.exe.apps] +$! +$! Executables. +$! +$ i = 0 +$ loop_exe: +$ e = f$edit(f$element( i, ",", exe), "trim") +$ i = i + 1 +$ if e .eqs. "," then goto loop_exe_end +$ set noon +$ file = exe_dir+ e+ ".exe" +$ if f$search( file) .nes. "" +$ then +$ copy /protection = w:re 'file' wrk_sslxexe: /log +$ endif +$ set on +$ goto loop_exe +$ loop_exe_end: +$! +$! Miscellaneous. +$! +$ set noon +$ copy /protection = w:re ca.com wrk_sslxexe:ca.com /log +$ copy /protection = w:re openssl-vms.cnf wrk_sslroot:[000000]openssl.cnf /log +$ set on +$! +$ tidy: +$! +$ call deass wrk_sslroot +$ call deass wrk_sslxexe +$! +$ exit +$! +$ deass: subroutine +$ if (f$trnlnm( p1, "LNM$PROCESS") .nes. "") +$ then +$ deassign /process 'p1' +$ endif +$ endsubroutine +$! diff --git a/apps/install.com b/apps/install.com deleted file mode 100644 index c5821b40e3..0000000000 --- a/apps/install.com +++ /dev/null @@ -1,65 +0,0 @@ -$! INSTALL.COM -- Installs the files in a given directory tree -$! -$! Author: Richard Levitte -$! Time of creation: 22-MAY-1998 10:13 -$! -$! P1 root of the directory tree -$! -$ -$ IF P1 .EQS. "" -$ THEN -$ WRITE SYS$OUTPUT "First argument missing." -$ WRITE SYS$OUTPUT - - "Should be the directory where you want things installed." -$ EXIT -$ ENDIF -$ -$ IF (F$GETSYI("CPU").LT.128) -$ THEN -$ ARCH := VAX -$ ELSE -$ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE") -$ IF (ARCH .EQS. "") THEN ARCH = "UNK" -$ ENDIF -$ -$ ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0" -$ ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY") -$ ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") - - - "[000000." - "][" - "[" - "]" -$ ROOT = ROOT_DEV + "[" + ROOT_DIR -$ -$ DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC -$ DEFINE/NOLOG WRK_SSLEXE WRK_SSLROOT:['ARCH'_EXE] -$ -$ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLROOT:[000000] -$ IF F$PARSE("WRK_SSLEXE:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLEXE: -$ -$ EXE := openssl -$ -$ EXE_DIR := [-.'ARCH'.EXE.APPS] -$ -$ I = 0 -$ LOOP_EXE: -$ E = F$EDIT(F$ELEMENT(I, ",", EXE),"TRIM") -$ I = I + 1 -$ IF E .EQS. "," THEN GOTO LOOP_EXE_END -$ SET NOON -$ IF F$SEARCH(EXE_DIR+E+".EXE") .NES. "" -$ THEN -$ COPY 'EXE_DIR''E'.EXE WRK_SSLEXE:'E'.EXE/log -$ SET FILE/PROT=W:RE WRK_SSLEXE:'E'.EXE -$ ENDIF -$ SET ON -$ GOTO LOOP_EXE -$ LOOP_EXE_END: -$ -$ SET NOON -$ COPY CA.COM WRK_SSLEXE:CA.COM/LOG -$ SET FILE/PROT=W:RE WRK_SSLEXE:CA.COM -$ COPY OPENSSL-VMS.CNF WRK_SSLROOT:[000000]OPENSSL.CNF/LOG -$ SET FILE/PROT=W:R WRK_SSLROOT:[000000]OPENSSL.CNF -$ SET ON -$ -$ EXIT diff --git a/apps/makeapps.com b/apps/makeapps.com index 7a728e6a5e..4b33f68af0 100644 --- a/apps/makeapps.com +++ b/apps/makeapps.com @@ -39,18 +39,31 @@ $! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) $! $! P5, if defined, sets a choice of programs to compile. $! -$! For 64 bit architectures (Alpha and IA64), specify the pointer size as P6. -$! For 32 bit architectures (VAX), P6 is ignored. -$! Currently supported values are: +$! P6, if defined, specifies the C pointer size. Ignored on VAX. +$! Supported values are: $! -$! 32 To ge a library compiled with /POINTER_SIZE=32 -$! 64 To ge a library compiled with /POINTER_SIZE=64 +$! "" Compile with default (/NOPOINTER_SIZE) +$! 32 Compile with /POINTER_SIZE=32 (SHORT) +$! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV]) $! +$! P7, if defined, specifies a directory where ZLIB files (zlib.h, +$! libz.olb) may be found. Optionally, a non-default object library +$! name may be included ("dev:[dir]libz_64.olb", for example). +$! +$! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") +$! +$ on control_c then goto exit $! $! Define A TCP/IP Library That We Will Need To Link To. $! (That Is, If We Need To Link To One.) $! $ TCPIP_LIB = "" +$ ZLIB_LIB = "" $! $! Check What Architecture We Are Using. $! @@ -74,29 +87,45 @@ $! End The Architecture Check. $! $ ENDIF $! +$ ARCHD = ARCH +$ LIB32 = "32" +$ OPT_FILE = "" +$ POINTER_SIZE = "" +$! $! Define what programs should be compiled $! $ PROGRAMS := OPENSSL $! +$! Check To Make Sure We Have Valid Command Line Parameters. +$! +$ GOSUB CHECK_OPTIONS +$! $! Define The CRYPTO Library. $! -$ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO'LIB32'.OLB +$ CRYPTO_LIB := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO'LIB32'.OLB $! $! Define The SSL Library. $! -$ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL'LIB32'.OLB +$ SSL_LIB := SYS$DISK:[-.'ARCHD'.EXE.SSL]SSL_LIBSSL'LIB32'.OLB $! -$! Define The OBJ Directory. +$! Define The OBJ and EXE Directories. $! -$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.APPS] +$ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.APPS] +$ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.APPS] $! -$! Define The EXE Directory. +$! Specify the destination directory in any /MAP option. $! -$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.APPS] +$ if (LINKMAP .eqs. "MAP") +$ then +$ LINKMAP = LINKMAP+ "=''EXE_DIR'" +$ endif $! -$! Check To Make Sure We Have Valid Command Line Parameters. +$! Add the location prefix to the linker options file name. $! -$ GOSUB CHECK_OPTIONS +$ if (OPT_FILE .nes. "") +$ then +$ OPT_FILE = EXE_DIR+ OPT_FILE +$ endif $! $! Initialise logical names and such $! @@ -104,7 +133,7 @@ $ GOSUB INITIALISE $! $! Tell The User What Kind of Machine We Run On. $! -$ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine." +$ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'" $! $! Check To See If The OBJ Directory Exists. $! @@ -152,6 +181,9 @@ $ LIB_OPENSSL = "VERIFY,ASN1PARS,REQ,DGST,DH,DHPARAM,ENC,PASSWD,GENDH,ERRSTR,"+- "S_TIME,APPS,S_CB,S_SOCKET,APP_RAND,VERSION,SESS_ID,"+- "CIPHERS,NSEQ,PKCS12,PKCS8,PKEY,PKEYPARAM,PKEYUTL,"+ - "SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS" +$! +$ LIB_OPENSSL = LIB_OPENSSL+ ",VMS_DECC_INIT" +$! $ TCPIP_PROGRAMS = ",," $ IF COMPILER .EQS. "VAXC" THEN - TCPIP_PROGRAMS = ",OPENSSL," @@ -209,7 +241,7 @@ $ LIB_COUNTER = -1 $! $! Create a .OPT file for the object files $! -$ OPEN/WRITE OBJECTS 'EXE_DIR''CURRENT_APP'.OPT +$ OPEN /WRITE OBJECTS 'EXE_DIR''CURRENT_APP'.OPT $! $! Top Of The File Loop. $! @@ -296,34 +328,18 @@ $ GOTO NEXT_APP $ ENDIF $! $! Link The Program. -$! Check To See If We Are To Link With A Specific TCP/IP Library. $! $ ON WARNING THEN GOTO NEXT_APP $! -$ IF (TCPIP_LIB.NES."") -$ THEN -$! $! Don't Link With The RSAREF Routines And TCP/IP Library. $! -$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' - - 'EXE_DIR''CURRENT_APP'.OPT/OPTION, - - 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, - - 'TCPIP_LIB','OPT_FILE'/OPTION -$! -$! Else... -$! -$ ELSE -$! -$! Don't Link With The RSAREF Routines And Link With A TCP/IP Library. -$! -$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' - - 'EXE_DIR''CURRENT_APP'.OPT/OPTION, - - 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, - - 'OPT_FILE'/OPTION -$! -$! End The TCP/IP Library Check. -$! -$ ENDIF +$ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' /EXE='EXE_FILE' - + 'EXE_DIR''CURRENT_APP'.OPT /OPTIONS, - + 'SSL_LIB' /LIBRARY, - + 'CRYPTO_LIB' /LIBRARY - + 'TCPIP_LIB' - + 'ZLIB_LIB' - + ,'OPT_FILE' /OPTIONS $! $! Go Back And Do It Again. $! @@ -358,7 +374,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable VAX C Runtime Library. ! SYS$SHARE:VAXCRTL.EXE/SHARE @@ -387,7 +403,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable C Runtime Library. ! GNU_CC:[000000]GCCLIB/LIBRARY @@ -422,7 +438,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable DEC C Runtime Library. ! SYS$SHARE:DECC$SHR.EXE/SHARE @@ -437,7 +453,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File For non-VAX To Link Agianst +! Default System Options File For non-VAX To Link Against ! The Sharable C Runtime Library. ! SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE @@ -521,14 +537,15 @@ $! $ IF (P1.EQS."NODEBUG") $ THEN $! -$! P1 Is NODEBUG, So Compile Without Debugger Information. +$! P1 Is NODEBUG, So Compile Without Debugger Information. $! -$ DEBUGGER = "NODEBUG" -$ TRACEBACK = "NOTRACEBACK" -$ GCC_OPTIMIZE = "OPTIMIZE" -$ CC_OPTIMIZE = "OPTIMIZE" -$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." -$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." +$ DEBUGGER = "NODEBUG" +$ LINKMAP = "NOMAP" +$ TRACEBACK = "NOTRACEBACK" +$ GCC_OPTIMIZE = "OPTIMIZE" +$ CC_OPTIMIZE = "OPTIMIZE" +$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." +$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." $! $! Else... $! @@ -542,6 +559,7 @@ $! $! Compile With Debugger Information. $! $ DEBUGGER = "DEBUG" +$ LINKMAP = "MAP" $ TRACEBACK = "TRACEBACK" $ GCC_OPTIMIZE = "NOOPTIMIZE" $ CC_OPTIMIZE = "NOOPTIMIZE" @@ -549,7 +567,7 @@ $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile." $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." $ ELSE $! -$! Tell The User Entered An Invalid Option.. +$! Tell The User Entered An Invalid Option. $! $ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:" @@ -570,58 +588,49 @@ $! End The P1 Check. $! $ ENDIF $! -$! Check To See If P6 Is Blank. +$! Check P6 (POINTER_SIZE). $! -$ IF (P6.EQS."") +$ IF (P6 .NES. "") .AND. (ARCH .NES. "VAX") $ THEN -$ POINTER_SIZE = "" -$ ELSE -$! -$! Check is P6 Is Valid $! -$ IF (P6.EQS."32") +$ IF (P6 .EQS. "32") $ THEN $ POINTER_SIZE = "/POINTER_SIZE=32" -$ IF ARCH .EQS. "VAX" -$ THEN -$ LIB32 = "" -$ ELSE -$ LIB32 = "32" -$ ENDIF $ ELSE -$ IF (P6.EQS."64") +$ IF (P6 .EQS. "64") $ THEN +$ POINTER_SIZE = "/POINTER_SIZE=64=ARGV" +$ ARCHD = ARCH+ "_64" $ LIB32 = "" -$ IF ARCH .EQS. "VAX" -$ THEN -$ POINTER_SIZE = "/POINTER_SIZE=32" -$ ELSE -$ POINTER_SIZE = "/POINTER_SIZE=64" -$ ENDIF $ ELSE $! -$! Tell The User Entered An Invalid Option.. +$! Tell The User Entered An Invalid Option. $! $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT "The Option ",P6," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "The Option ", P6, - + " Is Invalid. The Valid Options Are:" $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT " 32 : Compile with 32 bit pointer size" -$ WRITE SYS$OUTPUT " 64 : Compile with 64 bit pointer size" +$ WRITE SYS$OUTPUT " """" : Compile with default (short) pointers." +$ WRITE SYS$OUTPUT " 32 : Compile with 32-bit (short) pointers." +$ WRITE SYS$OUTPUT " 64 : Compile with 64-bit (long) pointers." $ WRITE SYS$OUTPUT "" -$! +$! $! Time To EXIT. $! -$ GOTO TIDY -$! -$! End The Valid Arguement Check. +$ EXIT $! $ ENDIF +$! $ ENDIF $! -$! End The P6 Check. +$! End The P6 (POINTER_SIZE) Check. $! $ ENDIF $! +$! Set basic C compiler /INCLUDE directories. +$! +$ CC_INCLUDES = "SYS$DISK:[-],SYS$DISK:[-.CRYPTO]" +$! $! Check To See If P2 Is Blank. $! $ IF (P2.EQS."") @@ -726,7 +735,60 @@ $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR" $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS $! -$! Check To See If The User Entered A Valid Paramter. +$! Check To See If We Have A ZLIB Option. +$! +$ ZLIB = P7 +$ IF (ZLIB .NES. "") +$ THEN +$! +$! Check for expected ZLIB files. +$! +$ err = 0 +$ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY") +$ if (f$search( file1) .eqs. "") +$ then +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." +$ WRITE SYS$OUTPUT " Can't find header: ''file1'" +$ err = 1 +$ endif +$ file1 = f$parse( "A.;", ZLIB)- "A.;" +$! +$ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY") +$ if (f$search( file2) .eqs. "") +$ then +$ if (err .eq. 0) +$ then +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." +$ endif +$ WRITE SYS$OUTPUT " Can't find library: ''file2'" +$ WRITE SYS$OUTPUT "" +$ err = err+ 2 +$ endif +$ if (err .eq. 1) +$ then +$ WRITE SYS$OUTPUT "" +$ endif +$! +$ if (err .ne. 0) +$ then +$ EXIT +$ endif +$! +$ CCDEFS = """ZLIB=1"", "+ CCDEFS +$ CC_INCLUDES = CC_INCLUDES+ ", "+ file1 +$ ZLIB_LIB = ", ''file2' /library" +$! +$! Print info +$! +$ WRITE SYS$OUTPUT "ZLIB library spec: ", file2 +$! +$! End The ZLIB Check. +$! +$ ENDIF +$! +$! Check To See If The User Entered A Valid Parameter. $! $ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC") $ THEN @@ -749,13 +811,13 @@ $! $ CC = "CC" $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - THEN CC = "CC/DECC" -$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89''POINTER_SIZE'" + - - "/NOLIST/PREFIX=ALL" + - - "/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS +$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=RELAXED"+ - + "''POINTER_SIZE'/NOLIST/PREFIX=ALL" + - + "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT" +$ OPT_FILE = "VAX_DECC_OPTIONS.OPT" $! $! End DECC Check. $! @@ -783,7 +845,7 @@ $ EXIT $ ENDIF $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - - "/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS + "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS $ CCDEFS = CCDEFS + ",""VAXC""" $! $! Define As SYS$COMMON:[SYSLIB] @@ -792,7 +854,7 @@ $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT" +$ OPT_FILE = "VAX_VAXC_OPTIONS.OPT" $! $! End VAXC Check $! @@ -815,11 +877,11 @@ $! Use GNU C... $! $ IF F$TYPE(GCC) .EQS. "" THEN GCC := GCC $ CC = GCC+"/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - - "/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS + "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT" +$ OPT_FILE = "VAX_GNUC_OPTIONS.OPT" $! $! End The GNU C Check. $! @@ -861,7 +923,7 @@ $ THEN $! $! Set the library to use SOCKETSHR $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS" $! $! Done with SOCKETSHR $! @@ -887,13 +949,13 @@ $ THEN $! $! Set the library to use UCX. $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS" $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" $ THEN -$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS" $ ELSE $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - - TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT" + TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS" $ ENDIF $! $! Done with UCX @@ -907,7 +969,7 @@ $ THEN $! $! Set the library to use TCPIP. $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS" $! $! Done with TCPIP $! @@ -932,7 +994,7 @@ $ CCDEFS = CCDEFS + ",TCPIP_TYPE_''P3'" $! $! Print info $! -$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB +$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- "," $! $! Else The User Entered An Invalid Argument. $! @@ -1034,7 +1096,7 @@ $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]" $! $! Set up the logical name OPENSSL to point at the include directory $! -$ DEFINE OPENSSL/NOLOG '__INCLUDE' +$ DEFINE OPENSSL /NOLOG '__INCLUDE' $! $! Done $! @@ -1042,15 +1104,24 @@ $ RETURN $! $ CLEANUP: $! -$! Restore the logical name OPENSSL if it had a value +$! Restore the saved logical name OPENSSL, if it had a value. $! -$ IF __SAVE_OPENSSL .EQS. "" -$ THEN -$ DEASSIGN OPENSSL -$ ELSE -$ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL' -$ ENDIF +$ if (f$type( __SAVE_OPENSSL) .nes. "") +$ then +$ IF __SAVE_OPENSSL .EQS. "" +$ THEN +$ DEASSIGN OPENSSL +$ ELSE +$ DEFINE /NOLOG OPENSSL '__SAVE_OPENSSL' +$ ENDIF +$ endif +$! +$! Close any open files. +$! +$ if (f$trnlnm( "objects", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then - + close objects $! $! Done $! $ RETURN +$! diff --git a/apps/openssl.c b/apps/openssl.c index 851e639735..7dbb7ac32a 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -410,7 +410,33 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[]) } if (fp != NULL) { +#if defined( OPENSSL_SYS_VMS) && !defined( VMS_TRUST_ARGV) + /* 2011-03-08 SMS. + * "HP C V7.3-009 on OpenVMS Alpha V8.3" with 64-bit + * pointers (at least) may not NULL-terminate argv[] + * as expected. If necessary, use a (properly) + * NULL-terminated duplicate of argv[]. + */ + char **argv2 = NULL; + + if (argv[ argc] != NULL) + { + argv2 = OPENSSL_malloc( (argc+ 1)* sizeof( char *)); + if (argv2 == NULL) + { ret = -1; goto end; } + memcpy( argv2, argv, (argc* sizeof( char *))); + argv2[ argc] = NULL; + argv = argv2; + } +#endif ret=fp->func(argc,argv); +#if defined( OPENSSL_SYS_VMS) && !defined( VMS_TRUST_ARGV) + /* Free any duplicate argv[] storage. */ + if (argv2 != NULL) + { + OPENSSL_free( argv2); + } +#endif } else if ((strncmp(argv[0],"no-",3)) == 0) { diff --git a/apps/vms_decc_init.c b/apps/vms_decc_init.c new file mode 100755 index 0000000000..f512c8f1bc --- /dev/null +++ b/apps/vms_decc_init.c @@ -0,0 +1,188 @@ +#if defined( __VMS) && !defined( OPENSSL_NO_DECC_INIT) && \ + defined( __DECC) && !defined( __VAX) && (__CRTL_VER >= 70301000) +# define USE_DECC_INIT 1 +#endif + +#ifdef USE_DECC_INIT + +/* + * 2010-04-26 SMS. + * + *---------------------------------------------------------------------- + * + * decc_init() + * + * On non-VAX systems, uses LIB$INITIALIZE to set a collection of C + * RTL features without using the DECC$* logical name method. + * + *---------------------------------------------------------------------- + */ + +#include +#include +#include + + +/* Global storage. */ + +/* Flag to sense if decc_init() was called. */ + +int decc_init_done = -1; + + +/* Structure to hold a DECC$* feature name and its desired value. */ + +typedef struct +{ + char *name; + int value; +} decc_feat_t; + + +/* Array of DECC$* feature names and their desired values. + * Note: DECC$ARGV_PARSE_STYLE is the urgent one. + */ + +decc_feat_t decc_feat_array[] = +{ + /* Preserve command-line case with SET PROCESS/PARSE_STYLE=EXTENDED */ + { "DECC$ARGV_PARSE_STYLE", 1 }, + + /* Preserve case for file names on ODS5 disks. */ + { "DECC$EFS_CASE_PRESERVE", 1 }, + + /* Enable multiple dots (and most characters) in ODS5 file names, + * while preserving VMS-ness of ";version". + */ + { "DECC$EFS_CHARSET", 1 }, + + /* List terminator. */ + { (char *)NULL, 0 } +}; + + +/* LIB$INITIALIZE initialization function. */ + +static void decc_init( void) +{ + char *openssl_debug_decc_init; + int verbose = 0; + int feat_index; + int feat_value; + int feat_value_max; + int feat_value_min; + int i; + int sts; + + /* Get debug option. */ + openssl_debug_decc_init = getenv( "OPENSSL_DEBUG_DECC_INIT"); + if (openssl_debug_decc_init != NULL) + { + verbose = strtol( openssl_debug_decc_init, NULL, 10); + if (verbose <= 0) + { + verbose = 1; + } + } + + /* Set the global flag to indicate that LIB$INITIALIZE worked. */ + decc_init_done = 1; + + /* Loop through all items in the decc_feat_array[]. */ + + for (i = 0; decc_feat_array[ i].name != NULL; i++) + { + /* Get the feature index. */ + feat_index = decc$feature_get_index( decc_feat_array[ i].name); + if (feat_index >= 0) + { + /* Valid item. Collect its properties. */ + feat_value = decc$feature_get_value( feat_index, 1); + feat_value_min = decc$feature_get_value( feat_index, 2); + feat_value_max = decc$feature_get_value( feat_index, 3); + + /* Check the validity of our desired value. */ + if ((decc_feat_array[ i].value >= feat_value_min) && + (decc_feat_array[ i].value <= feat_value_max)) + { + /* Valid value. Set it if necessary. */ + if (feat_value != decc_feat_array[ i].value) + { + sts = decc$feature_set_value( feat_index, + 1, + decc_feat_array[ i].value); + + if (verbose > 1) + { + fprintf( stderr, " %s = %d, sts = %d.\n", + decc_feat_array[ i].name, + decc_feat_array[ i].value, + sts); + } + } + } + else + { + /* Invalid DECC feature value. */ + fprintf( stderr, + " INVALID DECC$FEATURE VALUE, %d: %d <= %s <= %d.\n", + feat_value, + feat_value_min, decc_feat_array[ i].name, feat_value_max); + } + } + else + { + /* Invalid DECC feature name. */ + fprintf( stderr, + " UNKNOWN DECC$FEATURE: %s.\n", decc_feat_array[ i].name); + } + } + + if (verbose > 0) + { + fprintf( stderr, " DECC_INIT complete.\n"); + } +} + +/* Get "decc_init()" into a valid, loaded LIB$INITIALIZE PSECT. */ + +#pragma nostandard + +/* Establish the LIB$INITIALIZE PSECTs, with proper alignment and + * other attributes. Note that "nopic" is significant only on VAX. + */ +#pragma extern_model save + +#if __INITIAL_POINTER_SIZE == 64 +# define PSECT_ALIGN 3 +#else +# define PSECT_ALIGN 2 +#endif + +#pragma extern_model strict_refdef "LIB$INITIALIZ" PSECT_ALIGN, nopic, nowrt +const int spare[ 8] = { 0 }; + +#pragma extern_model strict_refdef "LIB$INITIALIZE" PSECT_ALIGN, nopic, nowrt +void (*const x_decc_init)() = decc_init; + +#pragma extern_model restore + +/* Fake reference to ensure loading the LIB$INITIALIZE PSECT. */ + +#pragma extern_model save + +int LIB$INITIALIZE( void); + +#pragma extern_model strict_refdef +int dmy_lib$initialize = (int) LIB$INITIALIZE; + +#pragma extern_model restore + +#pragma standard + +#else /* def USE_DECC_INIT */ + +/* Dummy code to avoid a %CC-W-EMPTYFILE complaint. */ +int decc_init_dummy( void); + +#endif /* def USE_DECC_INIT */ diff --git a/crypto/LPdir_vms.c b/crypto/LPdir_vms.c index 85b427a623..7613bd254e 100644 --- a/crypto/LPdir_vms.c +++ b/crypto/LPdir_vms.c @@ -40,22 +40,18 @@ #ifndef LPDIR_H #include "LPdir.h" #endif +#include "vms_rms.h" -/* Because some compiler options hide this macor */ +/* Some compiler options hide EVMSERR. */ #ifndef EVMSERR -#define EVMSERR 65535 /* error for non-translatable VMS errors */ +# define EVMSERR 65535 /* error for non-translatable VMS errors */ #endif struct LP_dir_context_st { unsigned long VMS_context; -#ifdef NAML$C_MAXRSS - char filespec[NAML$C_MAXRSS+1]; - char result[NAML$C_MAXRSS+1]; -#else - char filespec[256]; - char result[256]; -#endif + char filespec[ NAMX_MAXRSS+ 1]; + char result[ NAMX_MAXRSS+ 1]; struct dsc$descriptor_d filespec_dsc; struct dsc$descriptor_d result_dsc; }; @@ -66,6 +62,16 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) char *p, *r; size_t l; unsigned long flags = 0; + +/* Arrange 32-bit pointer to (copied) string storage, if needed. */ +#if __INITIAL_POINTER_SIZE == 64 +# pragma pointer_size save +# pragma pointer_size 32 + char *ctx_filespec_32p; +# pragma pointer_size restore + char ctx_filespec_32[ NAMX_MAXRSS+ 1]; +#endif /* __INITIAL_POINTER_SIZE == 64 */ + #ifdef NAML$C_MAXRSS flags |= LIB$M_FIL_LONG_NAMES; #endif @@ -93,13 +99,7 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) filespeclen += 4; /* "*.*;" */ - if (filespeclen > -#ifdef NAML$C_MAXRSS - NAML$C_MAXRSS -#else - 255 -#endif - ) + if (filespeclen > NAMX_MAXRSS) { errno = ENAMETOOLONG; return 0; @@ -115,14 +115,21 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) strcpy((*ctx)->filespec,directory); strcat((*ctx)->filespec,"*.*;"); + +/* Arrange 32-bit pointer to (copied) string storage, if needed. */ +#if __INITIAL_POINTER_SIZE == 64 +# define CTX_FILESPEC ctx_filespec_32p + /* Copy the file name to storage with a 32-bit pointer. */ + ctx_filespec_32p = ctx_filespec_32; + strcpy( ctx_filespec_32p, (*ctx)->filespec); +#else /* __INITIAL_POINTER_SIZE == 64 */ +# define CTX_FILESPEC (*ctx)->filespec +#endif /* __INITIAL_POINTER_SIZE == 64 [else] */ + (*ctx)->filespec_dsc.dsc$w_length = filespeclen; (*ctx)->filespec_dsc.dsc$b_dtype = DSC$K_DTYPE_T; (*ctx)->filespec_dsc.dsc$b_class = DSC$K_CLASS_S; - (*ctx)->filespec_dsc.dsc$a_pointer = (*ctx)->filespec; - (*ctx)->result_dsc.dsc$w_length = 0; - (*ctx)->result_dsc.dsc$b_dtype = DSC$K_DTYPE_T; - (*ctx)->result_dsc.dsc$b_class = DSC$K_CLASS_D; - (*ctx)->result_dsc.dsc$a_pointer = 0; + (*ctx)->filespec_dsc.dsc$a_pointer = CTX_FILESPEC; } (*ctx)->result_dsc.dsc$w_length = 0; diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index 12b0a53a81..54112e6ebe 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -551,7 +551,30 @@ int BIO_socket_ioctl(int fd, long type, void *arg) #ifdef __DJGPP__ i=ioctlsocket(fd,type,(char *)arg); #else - i=ioctlsocket(fd,type,arg); +# if defined(OPENSSL_SYS_VMS) + /* 2011-02-18 SMS. + * VMS ioctl() can't tolerate a 64-bit "void *arg", but we + * observe that all the consumers pass in an "unsigned long *", + * so we arrange a local copy with a short pointer, and use + * that, instead. + */ +# if __INITIAL_POINTER_SIZE == 64 +# define ARG arg_32p +# pragma pointer_size save +# pragma pointer_size 32 + unsigned long arg_32; + unsigned long *arg_32p; +# pragma pointer_size restore + arg_32p = &arg_32; + arg_32 = *((unsigned long *) arg); +# else /* __INITIAL_POINTER_SIZE == 64 */ +# define ARG arg +# endif /* __INITIAL_POINTER_SIZE == 64 [else] */ +# else /* defined(OPENSSL_SYS_VMS) */ +# define ARG arg +# endif /* defined(OPENSSL_SYS_VMS) [else] */ + + i=ioctlsocket(fd,type,ARG); #endif /* __DJGPP__ */ if (i < 0) SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error()); diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c index 7ead044b37..b7dce5c1a2 100644 --- a/crypto/bio/bss_log.c +++ b/crypto/bio/bss_log.c @@ -75,6 +75,15 @@ # include # include # include +/* Some compiler options may mask the declaration of "_malloc32". */ +# if __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE +# if __INITIAL_POINTER_SIZE == 64 +# pragma pointer_size save +# pragma pointer_size 32 + void * _malloc32 (__size_t); +# pragma pointer_size restore +# endif /* __INITIAL_POINTER_SIZE == 64 */ +# endif /* __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE */ #elif defined(__ultrix) # include #elif defined(OPENSSL_SYS_NETWARE) @@ -300,7 +309,24 @@ static void xopenlog(BIO* bp, char* name, int level) static void xsyslog(BIO *bp, int priority, const char *string) { struct dsc$descriptor_s opc_dsc; + +/* Arrange 32-bit pointer to opcdef buffer and malloc(), if needed. */ +#if __INITIAL_POINTER_SIZE == 64 +# pragma pointer_size save +# pragma pointer_size 32 +# define OPCDEF_TYPE __char_ptr32 +# define OPCDEF_MALLOC _malloc32 +#else /* __INITIAL_POINTER_SIZE == 64 */ +# define OPCDEF_TYPE char * +# define OPCDEF_MALLOC OPENSSL_malloc +#endif /* __INITIAL_POINTER_SIZE == 64 [else] */ + struct opcdef *opcdef_p; + +#if __INITIAL_POINTER_SIZE == 64 +# pragma pointer_size restore +#endif /* __INITIAL_POINTER_SIZE == 64 */ + char buf[10240]; unsigned int len; struct dsc$descriptor_s buf_dsc; @@ -326,8 +352,8 @@ static void xsyslog(BIO *bp, int priority, const char *string) lib$sys_fao(&fao_cmd, &len, &buf_dsc, priority_tag, string); - /* we know there's an 8 byte header. That's documented */ - opcdef_p = (struct opcdef *) OPENSSL_malloc(8 + len); + /* We know there's an 8-byte header. That's documented. */ + opcdef_p = OPCDEF_MALLOC( 8+ len); opcdef_p->opc$b_ms_type = OPC$_RQ_RQST; memcpy(opcdef_p->opc$z_ms_target_classes, &VMS_OPC_target, 3); opcdef_p->opc$l_ms_rqstid = 0; @@ -335,7 +361,7 @@ static void xsyslog(BIO *bp, int priority, const char *string) opc_dsc.dsc$b_dtype = DSC$K_DTYPE_T; opc_dsc.dsc$b_class = DSC$K_CLASS_S; - opc_dsc.dsc$a_pointer = (char *)opcdef_p; + opc_dsc.dsc$a_pointer = (OPCDEF_TYPE) opcdef_p; opc_dsc.dsc$w_length = len + 8; sys$sndopr(opc_dsc, 0); diff --git a/crypto/bn/bn.h b/crypto/bn/bn.h index e484b7fc11..a0bc47837d 100644 --- a/crypto/bn/bn.h +++ b/crypto/bn/bn.h @@ -253,6 +253,24 @@ extern "C" { #define BN_HEX_FMT2 "%08X" #endif +/* 2011-02-22 SMS. + * In various places, a size_t variable or a type cast to size_t was + * used to perform integer-only operations on pointers. This failed on + * VMS with 64-bit pointers (CC /POINTER_SIZE = 64) because size_t is + * still only 32 bits. What's needed in these cases is an integer type + * with the same size as a pointer, which size_t is not certain to be. + * The only fix here is VMS-specific. + */ +#if defined(OPENSSL_SYS_VMS) +# if __INITIAL_POINTER_SIZE == 64 +# define PTR_SIZE_INT long long +# else /* __INITIAL_POINTER_SIZE == 64 */ +# define PTR_SIZE_INT int +# endif /* __INITIAL_POINTER_SIZE == 64 [else] */ +#else /* defined(OPENSSL_SYS_VMS) */ +# define PTR_SIZE_INT size_t +#endif /* defined(OPENSSL_SYS_VMS) [else] */ + #define BN_DEFAULT_BITS 1280 #define BN_FLG_MALLOCED 0x01 diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c index 7224637ab3..1a866880f5 100644 --- a/crypto/bn/bn_mont.c +++ b/crypto/bn/bn_mont.c @@ -277,7 +277,7 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) m1|=m2; /* (al!=ri) */ m1|=(0-(size_t)v); /* (al!=ri || v) */ m1&=~m2; /* (al!=ri || v) && !al>ri */ - nrp=(BN_ULONG *)(((size_t)rp&~m1)|((size_t)ap&m1)); + nrp=(BN_ULONG *)(((PTR_SIZE_INT)rp&~m1)|((PTR_SIZE_INT)ap&m1)); } /* 'itop = BN_NIST_192_TOP; bn_correct_top(r); @@ -438,8 +439,8 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, buf[BN_NIST_224_TOP], c_d[BN_NIST_224_TOP], *res; - size_t mask; - union { bn_addsub_f f; size_t p; } u; + PTR_SIZE_INT mask; + union { bn_addsub_f f; PTR_SIZE_INT p; } u; static const BIGNUM _bignum_nist_p_224_sqr = { (BN_ULONG *)_nist_p_224_sqr, sizeof(_nist_p_224_sqr)/sizeof(_nist_p_224_sqr[0]), @@ -510,16 +511,18 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, * to be compared to the modulus and conditionally * adjusted by *subtracting* the latter. */ carry = (int)bn_add_words(r_d,r_d,_nist_p_224[-carry-1],BN_NIST_224_TOP); - mask = 0-(size_t)carry; - u.p = ((size_t)bn_sub_words&mask) | ((size_t)bn_add_words&~mask); + mask = 0-(PTR_SIZE_INT)carry; + u.p = ((PTR_SIZE_INT)bn_sub_words&mask) | + ((PTR_SIZE_INT)bn_add_words&~mask); } else carry = 1; /* otherwise it's effectively same as in BN_nist_mod_192... */ - mask = 0-(size_t)(*u.f)(c_d,r_d,_nist_p_224[0],BN_NIST_224_TOP); - mask &= 0-(size_t)carry; - res = (BN_ULONG *)(((size_t)c_d&~mask) | ((size_t)r_d&mask)); + mask = 0-(PTR_SIZE_INT)(*u.f)(c_d,r_d,_nist_p_224[0],BN_NIST_224_TOP); + mask &= 0-(PTR_SIZE_INT)carry; + res = (BN_ULONG *)(((PTR_SIZE_INT)c_d&~mask) | + ((PTR_SIZE_INT)r_d&mask)); nist_cp_bn(r_d, res, BN_NIST_224_TOP); r->top = BN_NIST_224_TOP; bn_correct_top(r); @@ -549,8 +552,8 @@ int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, buf[BN_NIST_256_TOP], c_d[BN_NIST_256_TOP], *res; - size_t mask; - union { bn_addsub_f f; size_t p; } u; + PTR_SIZE_INT mask; + union { bn_addsub_f f; PTR_SIZE_INT p; } u; static const BIGNUM _bignum_nist_p_256_sqr = { (BN_ULONG *)_nist_p_256_sqr, sizeof(_nist_p_256_sqr)/sizeof(_nist_p_256_sqr[0]), @@ -629,15 +632,17 @@ int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, else if (carry < 0) { carry = (int)bn_add_words(r_d,r_d,_nist_p_256[-carry-1],BN_NIST_256_TOP); - mask = 0-(size_t)carry; - u.p = ((size_t)bn_sub_words&mask) | ((size_t)bn_add_words&~mask); + mask = 0-(PTR_SIZE_INT)carry; + u.p = ((PTR_SIZE_INT)bn_sub_words&mask) | + ((PTR_SIZE_INT)bn_add_words&~mask); } else carry = 1; - mask = 0-(size_t)(*u.f)(c_d,r_d,_nist_p_256[0],BN_NIST_256_TOP); - mask &= 0-(size_t)carry; - res = (BN_ULONG *)(((size_t)c_d&~mask) | ((size_t)r_d&mask)); + mask = 0-(PTR_SIZE_INT)(*u.f)(c_d,r_d,_nist_p_256[0],BN_NIST_256_TOP); + mask &= 0-(PTR_SIZE_INT)carry; + res = (BN_ULONG *)(((PTR_SIZE_INT)c_d&~mask) | + ((PTR_SIZE_INT)r_d&mask)); nist_cp_bn(r_d, res, BN_NIST_256_TOP); r->top = BN_NIST_256_TOP; bn_correct_top(r); @@ -671,8 +676,8 @@ int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, buf[BN_NIST_384_TOP], c_d[BN_NIST_384_TOP], *res; - size_t mask; - union { bn_addsub_f f; size_t p; } u; + PTR_SIZE_INT mask; + union { bn_addsub_f f; PTR_SIZE_INT p; } u; static const BIGNUM _bignum_nist_p_384_sqr = { (BN_ULONG *)_nist_p_384_sqr, sizeof(_nist_p_384_sqr)/sizeof(_nist_p_384_sqr[0]), @@ -754,15 +759,17 @@ int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, else if (carry < 0) { carry = (int)bn_add_words(r_d,r_d,_nist_p_384[-carry-1],BN_NIST_384_TOP); - mask = 0-(size_t)carry; - u.p = ((size_t)bn_sub_words&mask) | ((size_t)bn_add_words&~mask); + mask = 0-(PTR_SIZE_INT)carry; + u.p = ((PTR_SIZE_INT)bn_sub_words&mask) | + ((PTR_SIZE_INT)bn_add_words&~mask); } else carry = 1; - mask = 0-(size_t)(*u.f)(c_d,r_d,_nist_p_384[0],BN_NIST_384_TOP); - mask &= 0-(size_t)carry; - res = (BN_ULONG *)(((size_t)c_d&~mask) | ((size_t)r_d&mask)); + mask = 0-(PTR_SIZE_INT)(*u.f)(c_d,r_d,_nist_p_384[0],BN_NIST_384_TOP); + mask &= 0-(PTR_SIZE_INT)carry; + res = (BN_ULONG *)(((PTR_SIZE_INT)c_d&~mask) | + ((PTR_SIZE_INT)r_d&mask)); nist_cp_bn(r_d, res, BN_NIST_384_TOP); r->top = BN_NIST_384_TOP; bn_correct_top(r); @@ -781,7 +788,7 @@ int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, BN_ULONG *r_d, *a_d = a->d, t_d[BN_NIST_521_TOP], val,tmp,*res; - size_t mask; + PTR_SIZE_INT mask; static const BIGNUM _bignum_nist_p_521_sqr = { (BN_ULONG *)_nist_p_521_sqr, sizeof(_nist_p_521_sqr)/sizeof(_nist_p_521_sqr[0]), @@ -826,8 +833,9 @@ int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, r_d[i] &= BN_NIST_521_TOP_MASK; bn_add_words(r_d,r_d,t_d,BN_NIST_521_TOP); - mask = 0-(size_t)bn_sub_words(t_d,r_d,_nist_p_521,BN_NIST_521_TOP); - res = (BN_ULONG *)(((size_t)t_d&~mask) | ((size_t)r_d&mask)); + mask = 0-(PTR_SIZE_INT)bn_sub_words(t_d,r_d,_nist_p_521,BN_NIST_521_TOP); + res = (BN_ULONG *)(((PTR_SIZE_INT)t_d&~mask) | + ((PTR_SIZE_INT)r_d&mask)); nist_cp_bn(r_d,res,BN_NIST_521_TOP); r->top = BN_NIST_521_TOP; bn_correct_top(r); diff --git a/crypto/crypto-lib.com b/crypto/crypto-lib.com index 6719c8aed4..939c53a108 100644 --- a/crypto/crypto-lib.com +++ b/crypto/crypto-lib.com @@ -47,18 +47,29 @@ $! P6, if defined, sets a choice of crypto methods to compile. $! WARNING: this should only be done to recompile some part of an already $! fully compiled library. $! -$! For 64 bit architectures (Alpha and IA64), specify the pointer size as P7. -$! For 32 bit architectures (VAX), P7 is ignored. -$! Currently supported values are: +$! P7, if defined, specifies the C pointer size. Ignored on VAX. +$! Supported values are: $! -$! 32 To ge a library compiled with /POINTER_SIZE=32 -$! 64 To ge a library compiled with /POINTER_SIZE=64 +$! "" Compile with default (/NOPOINTER_SIZE) +$! 32 Compile with /POINTER_SIZE=32 (SHORT) +$! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV]) $! +$! P8, if defined, specifies a directory where ZLIB files (zlib.h, +$! libz.olb) may be found. Optionally, a non-default object library +$! name may be included ("dev:[dir]libz_64.olb", for example). +$! +$! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") $! $! Define A TCP/IP Library That We Will Need To Link To. $! (That Is, If We Need To Link To One.) $! $ TCPIP_LIB = "" +$ ZLIB_LIB = "" $! $! Check Which Architecture We Are Using. $! @@ -82,6 +93,11 @@ $! End The Architecture Check. $! $ ENDIF $! +$ ARCHD = ARCH +$ LIB32 = "32" +$ OPT_FILE = "" +$ POINTER_SIZE = "" +$! $! Define The Different Encryption Types. $! NOTE: Some might think this list ugly. However, it's made this way to $! reflect the SDIRS variable in [-]Makefile.org as closely as possible, @@ -98,17 +114,29 @@ $ ENCRYPT_TYPES = "Basic,"+ - "EVP,EVP_2,EVP_3,ASN1,ASN1_2,PEM,X509,X509V3,"+ - "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ - "STORE,CMS,PQUEUE,TS,JPAKE" -$! Define The OBJ Directory. $! -$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.CRYPTO] +$! Check To Make Sure We Have Valid Command Line Parameters. $! -$! Define The EXE Directory. +$ GOSUB CHECK_OPTIONS $! -$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.CRYPTO] +$! Define The OBJ and EXE Directories. $! -$! Check To Make Sure We Have Valid Command Line Parameters. +$ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.CRYPTO] +$ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO] $! -$ GOSUB CHECK_OPTIONS +$! Specify the destination directory in any /MAP option. +$! +$ if (LINKMAP .eqs. "MAP") +$ then +$ LINKMAP = LINKMAP+ "=''EXE_DIR'" +$ endif +$! +$! Add the location prefix to the linker options file name. +$! +$ if (OPT_FILE .nes. "") +$ then +$ OPT_FILE = EXE_DIR+ OPT_FILE +$ endif $! $! Initialise logical names and such $! @@ -116,7 +144,7 @@ $ GOSUB INITIALISE $! $! Tell The User What Kind of Machine We Run On. $! -$ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine." +$ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'" $! $! $! Check To See If The Architecture Specific OBJ Directory Exists. @@ -147,11 +175,11 @@ $ ENDIF $! $! Define The Library Name. $! -$ LIB_NAME := 'EXE_DIR'LIBCRYPTO'LIB32'.OLB +$ LIB_NAME := 'EXE_DIR'SSL_LIBCRYPTO'LIB32'.OLB $! $! Define The CRYPTO-LIB We Are To Use. $! -$ CRYPTO_LIB := 'EXE_DIR'LIBCRYPTO'LIB32'.OLB +$ CRYPTO_LIB := 'EXE_DIR'SSL_LIBCRYPTO'LIB32'.OLB $! $! Check To See If We Already Have A "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" Library... $! @@ -308,15 +336,23 @@ $ LIB_JPAKE = "jpake,jpake_err" $! $! Setup exceptional compilations $! -$ ! Add definitions for no threads on OpenVMS 7.1 and higher +$ CC3_SHOWN = 0 +$ CC4_SHOWN = 0 +$ CC5_SHOWN = 0 +$ CC6_SHOWN = 0 +$! +$! The following lists must have leading and trailing commas, and no +$! embedded spaces. (They are scanned for ",name,".) +$! +$ ! Add definitions for no threads on OpenVMS 7.1 and higher. $ COMPILEWITH_CC3 = ",bss_rtcp," -$ ! Disable the DOLLARID warning -$ COMPILEWITH_CC4 = ",a_utctm,bss_log,o_time,o_dir" -$ ! Disable disjoint optimization +$ ! Disable the DOLLARID warning. Not needed with /STANDARD=RELAXED. +$ COMPILEWITH_CC4 = "" !!! ",a_utctm,bss_log,o_time,o_dir," +$ ! Disable disjoint optimization on VAX with DECC. $ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + - "seed,sha_dgst,sha1dgst,rmd_dgst,bf_enc," -$ ! Disable the MIXLINKAGE warning -$ COMPILEWITH_CC6 = ",enc_read,set_key," +$ ! Disable the MIXLINKAGE warning. +$ COMPILEWITH_CC6 = "" !!! ",enc_read,set_key," $! $! Figure Out What Other Modules We Are To Build. $! @@ -522,31 +558,60 @@ $ WRITE SYS$OUTPUT "Compiling The ",FILE_NAME," File. (",BUILDALL,",",STATE," $ ENDIF $ IF (MODULE_NAME.NES."") $ THEN -$ WRITE SYS$OUTPUT " ",FILE_NAME,"" +$ WRITE SYS$OUTPUT " ",FILE_NAME,"" $ ENDIF $! $! Compile The File. $! $ ON ERROR THEN GOTO NEXT_FILE -$ FILE_NAME0 = F$ELEMENT(0,".",FILE_NAME) +$ FILE_NAME0 = ","+ F$ELEMENT(0,".",FILE_NAME)+ "," $ IF FILE_NAME - ".mar" .NES. FILE_NAME $ THEN $ MACRO/OBJECT='OBJECT_FILE' 'SOURCE_FILE' $ ELSE $ IF COMPILEWITH_CC3 - FILE_NAME0 .NES. COMPILEWITH_CC3 $ THEN +$ write sys$output " \Using special rule (3)" +$ if (.not. CC3_SHOWN) +$ then +$ CC3_SHOWN = 1 +$ x = " "+ CC3 +$ write /symbol sys$output x +$ endif $ CC3/OBJECT='OBJECT_FILE' 'SOURCE_FILE' $ ELSE $ IF COMPILEWITH_CC4 - FILE_NAME0 .NES. COMPILEWITH_CC4 $ THEN +$ write /symbol sys$output " \Using special rule (4)" +$ if (.not. CC4_SHOWN) +$ then +$ CC4_SHOWN = 1 +$ x = " "+ CC4 +$ write /symbol sys$output x +$ endif $ CC4/OBJECT='OBJECT_FILE' 'SOURCE_FILE' $ ELSE -$ IF COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5 +$ IF CC5_DIFFERENT .AND. - + (COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5) $ THEN +$ write sys$output " \Using special rule (5)" +$ if (.not. CC5_SHOWN) +$ then +$ CC5_SHOWN = 1 +$ x = " "+ CC5 +$ write /symbol sys$output x +$ endif $ CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE' $ ELSE $ IF COMPILEWITH_CC6 - FILE_NAME0 .NES. COMPILEWITH_CC6 $ THEN +$ write sys$output " \Using special rule (6)" +$ if (.not. CC6_SHOWN) +$ then +$ CC6_SHOWN = 1 +$ x = " "+ CC6 +$ write /symbol sys$output x +$ endif $ CC6/OBJECT='OBJECT_FILE' 'SOURCE_FILE' $ ELSE $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE' @@ -593,38 +658,22 @@ $! SHOW SYMBOL APPLICATION* $! $! Tell the user what happens $! -$ WRITE SYS$OUTPUT " ",APPLICATION,".exe" +$ WRITE SYS$OUTPUT " ",APPLICATION,".exe" $! $! Link The Program. $! $ ON ERROR THEN GOTO NEXT_APPLICATION $! -$! Check To See If We Are To Link With A Specific TCP/IP Library. -$! -$ IF (TCPIP_LIB.NES."") -$ THEN +$! Link With A TCP/IP Library. $! -$! Link With A TCP/IP Library. +$ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' - + /EXE='EXE_DIR''APPLICATION'.EXE - + 'OBJ_DIR''APPLICATION_OBJECTS', - + 'CRYPTO_LIB'/LIBRARY - + 'TCPIP_LIB' - + 'ZLIB_LIB' - + ,'OPT_FILE' /OPTIONS $! -$ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE - - 'OBJ_DIR''APPLICATION_OBJECTS', - - 'CRYPTO_LIB'/LIBRARY, - - 'TCPIP_LIB','OPT_FILE'/OPTION -$! -$! Else... -$! -$ ELSE -$! -$! Don't Link With A TCP/IP Library. -$! -$ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE - - 'OBJ_DIR''APPLICATION_OBJECTS',- - 'CRYPTO_LIB'/LIBRARY, - - 'OPT_FILE'/OPTION -$! -$! End The TCP/IP Library Check. -$! -$ ENDIF $ GOTO NEXT_APPLICATION $ APPLICATION_DONE: $ ENDIF @@ -663,7 +712,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable VAX C Runtime Library. ! SYS$SHARE:VAXCRTL.EXE/SHARE @@ -692,7 +741,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable C Runtime Library. ! GNU_CC:[000000]GCCLIB/LIBRARY @@ -727,7 +776,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable DEC C Runtime Library. ! SYS$SHARE:DECC$SHR.EXE/SHARE @@ -742,7 +791,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File For non-VAX To Link Agianst +! Default System Options File For non-VAX To Link Against ! The Sharable C Runtime Library. ! SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE @@ -763,7 +812,7 @@ $ ENDIF $! $! Tell The User What Linker Option File We Are Using. $! -$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." +$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." $! $! Time To RETURN. $! @@ -810,8 +859,8 @@ $ WRITE SYS$OUTPUT " APPS : To Compile Just The [.xxx.EXE.CRYPTO]*.E $ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:" $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT " ALPHA : Alpha Architecture." -$ WRITE SYS$OUTPUT " IA64 : IA64 Architecture." +$ WRITE SYS$OUTPUT " ALPHA[64]: Alpha Architecture." +$ WRITE SYS$OUTPUT " IA64[64] : IA64 Architecture." $ WRITE SYS$OUTPUT " VAX : VAX Architecture." $ WRITE SYS$OUTPUT "" $! @@ -832,15 +881,16 @@ $! $ IF (P2.EQS."NODEBUG") $ THEN $! -$! P2 Is NODEBUG, So Compile Without The Debugger Information. +$! P2 Is NODEBUG, So Compile Without The Debugger Information. $! -$ DEBUGGER = "NODEBUG" -$ TRACEBACK = "NOTRACEBACK" -$ GCC_OPTIMIZE = "OPTIMIZE" -$ CC_OPTIMIZE = "OPTIMIZE" -$ MACRO_OPTIMIZE = "OPTIMIZE" -$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." -$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." +$ DEBUGGER = "NODEBUG" +$ LINKMAP = "NOMAP" +$ TRACEBACK = "NOTRACEBACK" +$ GCC_OPTIMIZE = "OPTIMIZE" +$ CC_OPTIMIZE = "OPTIMIZE" +$ MACRO_OPTIMIZE = "OPTIMIZE" +$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." +$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." $ ELSE $! $! Check To See If We Are To Compile With Debugger Information. @@ -851,6 +901,7 @@ $! $! Compile With Debugger Information. $! $ DEBUGGER = "DEBUG" +$ LINKMAP = "MAP" $ TRACEBACK = "TRACEBACK" $ GCC_OPTIMIZE = "NOOPTIMIZE" $ CC_OPTIMIZE = "NOOPTIMIZE" @@ -859,7 +910,7 @@ $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile." $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." $ ELSE $! -$! They Entered An Invalid Option.. +$! They Entered An Invalid Option. $! $ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" @@ -914,58 +965,50 @@ $! End The P5 Check. $! $ ENDIF $! -$! Check To See If P7 Is Blank. +$! Check P7 (POINTER_SIZE). $! -$ IF (P7.EQS."") +$ IF (P7 .NES. "") .AND. (ARCH .NES. "VAX") $ THEN -$ POINTER_SIZE = "" -$ ELSE -$! -$! Check is P7 Is Valid $! -$ IF (P7.EQS."32") +$ IF (P7 .EQS. "32") $ THEN $ POINTER_SIZE = "/POINTER_SIZE=32" -$ IF ARCH .EQS. "VAX" -$ THEN -$ LIB32 = "" -$ ELSE -$ LIB32 = "32" -$ ENDIF $ ELSE -$ IF (P7.EQS."64") +$ IF (P7 .EQS. "64") $ THEN +$ POINTER_SIZE = "/POINTER_SIZE=64" +$ ARCHD = ARCH+ "_64" $ LIB32 = "" -$ IF ARCH .EQS. "VAX" -$ THEN -$ POINTER_SIZE = "/POINTER_SIZE=32" -$ ELSE -$ POINTER_SIZE = "/POINTER_SIZE=64" -$ ENDIF $ ELSE $! -$! Tell The User Entered An Invalid Option.. +$! Tell The User Entered An Invalid Option. $! $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT "The Option ",P7," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "The Option ", P7, - + " Is Invalid. The Valid Options Are:" $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT " 32 : Compile with 32 bit pointer size" -$ WRITE SYS$OUTPUT " 64 : Compile with 64 bit pointer size" +$ WRITE SYS$OUTPUT " """" : Compile with default (short) pointers." +$ WRITE SYS$OUTPUT " 32 : Compile with 32-bit (short) pointers." +$ WRITE SYS$OUTPUT " 64 : Compile with 64-bit (long) pointers." $ WRITE SYS$OUTPUT "" -$! +$! $! Time To EXIT. $! -$ GOTO TIDY -$! -$! End The Valid Arguement Check. +$ EXIT $! $ ENDIF +$! $ ENDIF $! -$! End The P7 Check. +$! End The P7 (POINTER_SIZE) Check. $! $ ENDIF $! +$! Set basic C compiler /INCLUDE directories. +$! +$ CC_INCLUDES = "SYS$DISK:[.''ARCHD'],SYS$DISK:[],SYS$DISK:[-],"+ - + "SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1]" +$! $! Check To See If P3 Is Blank. $! $ IF (P3.EQS."") @@ -1066,11 +1109,64 @@ $ CCDEFS = "TCPIP_TYPE_''P4',DSO_VMS" $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS $ CCEXTRAFLAGS = "" $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS -$ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR" +$ CCDISABLEWARNINGS = "" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR" $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS $! -$! Check To See If The User Entered A Valid Paramter. +$! Check To See If We Have A ZLIB Option. +$! +$ ZLIB = P8 +$ IF (ZLIB .NES. "") +$ THEN +$! +$! Check for expected ZLIB files. +$! +$ err = 0 +$ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY") +$ if (f$search( file1) .eqs. "") +$ then +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." +$ WRITE SYS$OUTPUT " Can't find header: ''file1'" +$ err = 1 +$ endif +$ file1 = f$parse( "A.;", ZLIB)- "A.;" +$! +$ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY") +$ if (f$search( file2) .eqs. "") +$ then +$ if (err .eq. 0) +$ then +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." +$ endif +$ WRITE SYS$OUTPUT " Can't find library: ''file2'" +$ WRITE SYS$OUTPUT "" +$ err = err+ 2 +$ endif +$ if (err .eq. 1) +$ then +$ WRITE SYS$OUTPUT "" +$ endif +$! +$ if (err .ne. 0) +$ then +$ EXIT +$ endif +$! +$ CCDEFS = """ZLIB=1"", "+ CCDEFS +$ CC_INCLUDES = CC_INCLUDES+ ", "+ file1 +$ ZLIB_LIB = ", ''file2' /library" +$! +$! Print info +$! +$ WRITE SYS$OUTPUT "ZLIB library spec: ", file2 +$! +$! End The ZLIB Check. +$! +$ ENDIF +$! +$! Check To See If The User Entered A Valid Parameter. $! $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC") $ THEN @@ -1093,14 +1189,14 @@ $! $ CC = "CC" $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - THEN CC = "CC/DECC" -$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89''POINTER_SIZE'" + - - "/NOLIST/PREFIX=ALL" + - - "/INCLUDE=(SYS$DISK:[._''ARCH'],SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + - - CCEXTRAFLAGS +$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=RELAXED"+ - + "''POINTER_SIZE'/NOLIST/PREFIX=ALL" + - + "/INCLUDE=(''CC_INCLUDES')"+ - + CCEXTRAFLAGS $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT" +$ OPT_FILE = "VAX_DECC_OPTIONS.OPT" $! $! End DECC Check. $! @@ -1129,7 +1225,7 @@ $ EXIT $ ENDIF $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - - "/INCLUDE=(SYS$DISK:[._''ARCH'],SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + - + "/INCLUDE=(''CC_INCLUDES')"+ - CCEXTRAFLAGS $ CCDEFS = """VAXC""," + CCDEFS $! @@ -1139,7 +1235,7 @@ $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT" +$ OPT_FILE = "VAX_VAXC_OPTIONS.OPT" $! $! End VAXC Check $! @@ -1161,12 +1257,12 @@ $! $! Use GNU C... $! $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - - "/INCLUDE=(SYS$DISK:[._''ARCH'],SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + - + "/INCLUDE=(''CC_INCLUDES')"+ - CCEXTRAFLAGS $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT" +$ OPT_FILE = "VAX_GNUC_OPTIONS.OPT" $! $! End The GNU C Check. $! @@ -1201,8 +1297,10 @@ $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS $ IF ARCH .EQS. "VAX" .AND. COMPILER .EQS. "DECC" .AND. P2 .NES. "DEBUG" $ THEN $ CC5 = CC + "/OPTIMIZE=NODISJOINT" +$ CC5_DIFFERENT = 1 $ ELSE -$ CC5 = CC + "/NOOPTIMIZE" +$ CC5 = CC +$ CC5_DIFFERENT = 0 $ ENDIF $ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS $ CC6 = CC - CCDISABLEWARNINGS + CC6DISABLEWARNINGS @@ -1255,7 +1353,7 @@ $ THEN $! $! Set the library to use SOCKETSHR $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS" $! $! Done with SOCKETSHR $! @@ -1281,13 +1379,13 @@ $ THEN $! $! Set the library to use UCX. $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS" $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" $ THEN -$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS" $ ELSE $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - - TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT" + TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS" $ ENDIF $! $! Done with UCX @@ -1301,7 +1399,7 @@ $ THEN $! $! Set the library to use TCPIP (post UCX). $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS" $! $! Done with TCPIP $! @@ -1322,7 +1420,7 @@ $ ENDIF $! $! Print info $! -$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB +$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- "," $! $! Else The User Entered An Invalid Argument. $! diff --git a/crypto/dso/dso_vms.c b/crypto/dso/dso_vms.c index 321512772a..af599cf991 100644 --- a/crypto/dso/dso_vms.c +++ b/crypto/dso/dso_vms.c @@ -69,6 +69,18 @@ #include #include #endif +#include "vms_rms.h" + +/* Some compiler options may mask the declaration of "_malloc32". */ +#if __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE +# if __INITIAL_POINTER_SIZE == 64 +# pragma pointer_size save +# pragma pointer_size 32 + void * _malloc32 (__size_t); +# pragma pointer_size restore +# endif /* __INITIAL_POINTER_SIZE == 64 */ +#endif /* __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE */ + #ifndef OPENSSL_SYS_VMS DSO_METHOD *DSO_METHOD_vms(void) @@ -121,14 +133,13 @@ typedef struct dso_internal_st /* This should contain the name only, no directory, * no extension, nothing but a name. */ struct dsc$descriptor_s filename_dsc; - char filename[FILENAME_MAX+1]; + char filename[ NAMX_MAXRSS+ 1]; /* This contains whatever is not in filename, if needed. * Normally not defined. */ struct dsc$descriptor_s imagename_dsc; - char imagename[FILENAME_MAX+1]; + char imagename[ NAMX_MAXRSS+ 1]; } DSO_VMS_INTERNAL; - DSO_METHOD *DSO_METHOD_vms(void) { return(&dso_meth_vms); @@ -139,7 +150,22 @@ static int vms_load(DSO *dso) void *ptr = NULL; /* See applicable comments in dso_dl.c */ char *filename = DSO_convert_filename(dso, NULL); + +/* Ensure 32-bit pointer for "p", and appropriate malloc() function. */ +#if __INITIAL_POINTER_SIZE == 64 +# define DSO_MALLOC _malloc32 +# pragma pointer_size save +# pragma pointer_size 32 +#else /* __INITIAL_POINTER_SIZE == 64 */ +# define DSO_MALLOC OPENSSL_malloc +#endif /* __INITIAL_POINTER_SIZE == 64 [else] */ + DSO_VMS_INTERNAL *p; + +#if __INITIAL_POINTER_SIZE == 64 +# pragma pointer_size restore +#endif /* __INITIAL_POINTER_SIZE == 64 */ + const char *sp1, *sp2; /* Search result */ if(filename == NULL) @@ -192,7 +218,7 @@ static int vms_load(DSO *dso) goto err; } - p = (DSO_VMS_INTERNAL *)OPENSSL_malloc(sizeof(DSO_VMS_INTERNAL)); + p = DSO_MALLOC(sizeof(DSO_VMS_INTERNAL)); if(p == NULL) { DSOerr(DSO_F_VMS_LOAD,ERR_R_MALLOC_FAILURE); @@ -290,18 +316,38 @@ void vms_bind_sym(DSO *dso, const char *symname, void **sym) int flags = 0; #endif struct dsc$descriptor_s symname_dsc; - *sym = NULL; - symname_dsc.dsc$w_length = strlen(symname); - symname_dsc.dsc$b_dtype = DSC$K_DTYPE_T; - symname_dsc.dsc$b_class = DSC$K_CLASS_S; - symname_dsc.dsc$a_pointer = (char *)symname; /* The cast is needed */ +/* Arrange 32-bit pointer to (copied) string storage, if needed. */ +#if __INITIAL_POINTER_SIZE == 64 +# define SYMNAME symname_32p +# pragma pointer_size save +# pragma pointer_size 32 + char *symname_32p; +# pragma pointer_size restore + char symname_32[ NAMX_MAXRSS+ 1]; +#else /* __INITIAL_POINTER_SIZE == 64 */ +# define SYMNAME ((char *) symname) +#endif /* __INITIAL_POINTER_SIZE == 64 [else] */ + + *sym = NULL; if((dso == NULL) || (symname == NULL)) { DSOerr(DSO_F_VMS_BIND_SYM,ERR_R_PASSED_NULL_PARAMETER); return; } + +#if __INITIAL_POINTER_SIZE == 64 + /* Copy the symbol name to storage with a 32-bit pointer. */ + symname_32p = symname_32; + strcpy( symname_32p, symname); +#endif /* __INITIAL_POINTER_SIZE == 64 [else] */ + + symname_dsc.dsc$w_length = strlen(SYMNAME); + symname_dsc.dsc$b_dtype = DSC$K_DTYPE_T; + symname_dsc.dsc$b_class = DSC$K_CLASS_S; + symname_dsc.dsc$a_pointer = SYMNAME; + if(sk_void_num(dso->meth_data) < 1) { DSOerr(DSO_F_VMS_BIND_SYM,DSO_R_STACK_ERROR); @@ -372,64 +418,60 @@ static DSO_FUNC_TYPE vms_bind_func(DSO *dso, const char *symname) return sym; } + static char *vms_merger(DSO *dso, const char *filespec1, const char *filespec2) { int status; int filespec1len, filespec2len; struct FAB fab; -#ifdef NAML$C_MAXRSS - struct NAML nam; - char esa[NAML$C_MAXRSS]; -#else - struct NAM nam; - char esa[NAM$C_MAXRSS]; -#endif + struct NAMX_STRUCT nam; + char esa[ NAMX_MAXRSS+ 1]; char *merged; +/* Arrange 32-bit pointer to (copied) string storage, if needed. */ +#if __INITIAL_POINTER_SIZE == 64 +# define FILESPEC1 filespec1_32p; +# define FILESPEC2 filespec2_32p; +# pragma pointer_size save +# pragma pointer_size 32 + char *filespec1_32p; + char *filespec2_32p; +# pragma pointer_size restore + char filespec1_32[ NAMX_MAXRSS+ 1]; + char filespec2_32[ NAMX_MAXRSS+ 1]; +#else /* __INITIAL_POINTER_SIZE == 64 */ +# define FILESPEC1 ((char *) filespec1) +# define FILESPEC2 ((char *) filespec2) +#endif /* __INITIAL_POINTER_SIZE == 64 [else] */ + if (!filespec1) filespec1 = ""; if (!filespec2) filespec2 = ""; filespec1len = strlen(filespec1); filespec2len = strlen(filespec2); +#if __INITIAL_POINTER_SIZE == 64 + /* Copy the file names to storage with a 32-bit pointer. */ + filespec1_32p = filespec1_32; + filespec2_32p = filespec2_32; + strcpy( filespec1_32p, filespec1); + strcpy( filespec2_32p, filespec2); +#endif /* __INITIAL_POINTER_SIZE == 64 [else] */ + fab = cc$rms_fab; -#ifdef NAML$C_MAXRSS - nam = cc$rms_naml; -#else - nam = cc$rms_nam; -#endif + nam = CC_RMS_NAMX; - fab.fab$l_fna = (char *)filespec1; - fab.fab$b_fns = filespec1len; - fab.fab$l_dna = (char *)filespec2; - fab.fab$b_dns = filespec2len; -#ifdef NAML$C_MAXRSS - if (filespec1len > NAM$C_MAXRSS) - { - fab.fab$l_fna = 0; - fab.fab$b_fns = 0; - nam.naml$l_long_filename = (char *)filespec1; - nam.naml$l_long_filename_size = filespec1len; - } - if (filespec2len > NAM$C_MAXRSS) - { - fab.fab$l_dna = 0; - fab.fab$b_dns = 0; - nam.naml$l_long_defname = (char *)filespec2; - nam.naml$l_long_defname_size = filespec2len; - } - nam.naml$l_esa = esa; - nam.naml$b_ess = NAM$C_MAXRSS; - nam.naml$l_long_expand = esa; - nam.naml$l_long_expand_alloc = sizeof(esa); - nam.naml$b_nop = NAM$M_SYNCHK | NAM$M_PWD; - nam.naml$v_no_short_upcase = 1; - fab.fab$l_naml = &nam; -#else - nam.nam$l_esa = esa; - nam.nam$b_ess = NAM$C_MAXRSS; - nam.nam$b_nop = NAM$M_SYNCHK | NAM$M_PWD; - fab.fab$l_nam = &nam; -#endif + FAB_OR_NAML( fab, nam).FAB_OR_NAML_FNA = FILESPEC1; + FAB_OR_NAML( fab, nam).FAB_OR_NAML_FNS = filespec1len; + FAB_OR_NAML( fab, nam).FAB_OR_NAML_DNA = FILESPEC2; + FAB_OR_NAML( fab, nam).FAB_OR_NAML_DNS = filespec2len; + NAMX_DNA_FNA_SET( fab) + + nam.NAMX_ESA = esa; + nam.NAMX_ESS = NAMX_MAXRSS; + nam.NAMX_NOP = NAM$M_SYNCHK | NAM$M_PWD; + SET_NAMX_NO_SHORT_UPCASE( nam); + + fab.FAB_NAMX = &nam; status = sys$parse(&fab, 0, 0); @@ -460,33 +502,12 @@ static char *vms_merger(DSO *dso, const char *filespec1, const char *filespec2) } return(NULL); } -#ifdef NAML$C_MAXRSS - if (nam.naml$l_long_expand_size) - { - merged = OPENSSL_malloc(nam.naml$l_long_expand_size + 1); - if(!merged) - goto malloc_err; - strncpy(merged, nam.naml$l_long_expand, - nam.naml$l_long_expand_size); - merged[nam.naml$l_long_expand_size] = '\0'; - } - else - { - merged = OPENSSL_malloc(nam.naml$b_esl + 1); - if(!merged) - goto malloc_err; - strncpy(merged, nam.naml$l_esa, - nam.naml$b_esl); - merged[nam.naml$b_esl] = '\0'; - } -#else - merged = OPENSSL_malloc(nam.nam$b_esl + 1); + + merged = OPENSSL_malloc( nam.NAMX_ESL+ 1); if(!merged) goto malloc_err; - strncpy(merged, nam.nam$l_esa, - nam.nam$b_esl); - merged[nam.nam$b_esl] = '\0'; -#endif + strncpy( merged, nam.NAMX_ESA, nam.NAMX_ESL); + merged[ nam.NAMX_ESL] = '\0'; return(merged); malloc_err: DSOerr(DSO_F_VMS_MERGER, diff --git a/crypto/install-crypto.com b/crypto/install-crypto.com new file mode 100755 index 0000000000..85b3d583cf --- /dev/null +++ b/crypto/install-crypto.com @@ -0,0 +1,196 @@ +$! INSTALL.COM -- Installs the files in a given directory tree +$! +$! Author: Richard Levitte +$! Time of creation: 22-MAY-1998 10:13 +$! +$! Changes by Zoltan Arpadffy +$! +$! P1 root of the directory tree +$! P2 "64" for 64-bit pointers. +$! +$! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") +$! +$ on error then goto tidy +$ on control_c then goto tidy +$! +$ if (p1 .eqs. "") +$ then +$ write sys$output "First argument missing." +$ write sys$output - + "It should be the directory where you want things installed." +$ exit +$ endif +$! +$ if (f$getsyi( "cpu") .lt. 128) +$ then +$ arch = "VAX" +$ else +$ arch = f$edit( f$getsyi( "arch_name"), "upcase") +$ if (arch .eqs. "") then arch = "UNK" +$ endif +$! +$ archd = arch +$ lib32 = "32" +$ shr = "_SHR32" +$! +$ if (p2 .nes. "") +$ then +$ if (p2 .eqs. "64") +$ then +$ archd = arch+ "_64" +$ lib32 = "" +$ shr = "_SHR" +$ else +$ if (p2 .nes. "32") +$ then +$ write sys$output "Second argument invalid." +$ write sys$output "It should be "32", "64", or nothing." +$ exit +$ endif +$ endif +$ endif +$! +$ root = f$parse( p1, "[]A.;0", , , "syntax_only, no_conceal") - "A.;0" +$ root_dev = f$parse( root, , , "device", "syntax_only") +$ root_dir = f$parse( root, , , "directory", "syntax_only") - - + "[000000." - "][" - "[" - "]" +$ root = root_dev + "[" + root_dir +$! +$ define /nolog wrk_sslroot 'root'.] /trans=conc +$ define /nolog wrk_sslinclude wrk_sslroot:[include] +$ define /nolog wrk_sslxlib wrk_sslroot:['arch'_lib] +$! +$ if f$parse("wrk_sslroot:[000000]") .eqs. "" then - + create /directory /log wrk_sslroot:[000000] +$ if f$parse("wrk_sslinclude:") .eqs. "" then - + create /directory /log wrk_sslinclude: +$ if f$parse("wrk_sslxlib:") .eqs. "" then - + create /directory /log wrk_sslxlib: +$! +$ sdirs := , - + 'archd', - + objects, - + md2, md4, md5, sha, mdc2, hmac, ripemd, whrlpool, - + des, aes, rc2, rc4, rc5, idea, bf, cast, camellia, seed, - + bn, ec, rsa, dsa, ecdsa, dh, ecdh, dso, engine, - + buffer, bio, stack, lhash, rand, err, - + evp, asn1, pem, x509, x509v3, conf, txt_db, pkcs7, pkcs12, comp, ocsp, - + ui, krb5, - + store, cms, pqueue, ts, jpake +$! +$ exheader_ := crypto.h, opensslv.h, ebcdic.h, symhacks.h, ossl_typ.h +$ exheader_'archd' := opensslconf.h +$ exheader_objects := objects.h, obj_mac.h +$ exheader_md2 := md2.h +$ exheader_md4 := md4.h +$ exheader_md5 := md5.h +$ exheader_sha := sha.h +$ exheader_mdc2 := mdc2.h +$ exheader_hmac := hmac.h +$ exheader_ripemd := ripemd.h +$ exheader_whrlpool := whrlpool.h +$ exheader_des := des.h, des_old.h +$ exheader_aes := aes.h +$ exheader_rc2 := rc2.h +$ exheader_rc4 := rc4.h +$ exheader_rc5 := rc5.h +$ exheader_idea := idea.h +$ exheader_bf := blowfish.h +$ exheader_cast := cast.h +$ exheader_camellia := camellia.h +$ exheader_seed := seed.h +$ exheader_modes := modes.h +$ exheader_bn := bn.h +$ exheader_ec := ec.h +$ exheader_rsa := rsa.h +$ exheader_dsa := dsa.h +$ exheader_ecdsa := ecdsa.h +$ exheader_dh := dh.h +$ exheader_ecdh := ecdh.h +$ exheader_dso := dso.h +$ exheader_engine := engine.h +$ exheader_buffer := buffer.h +$ exheader_bio := bio.h +$ exheader_stack := stack.h, safestack.h +$ exheader_lhash := lhash.h +$ exheader_rand := rand.h +$ exheader_err := err.h +$ exheader_evp := evp.h +$ exheader_asn1 := asn1.h, asn1_mac.h, asn1t.h +$ exheader_pem := pem.h, pem2.h +$ exheader_x509 := x509.h, x509_vfy.h +$ exheader_x509v3 := x509v3.h +$ exheader_conf := conf.h, conf_api.h +$ exheader_txt_db := txt_db.h +$ exheader_pkcs7 := pkcs7.h +$ exheader_pkcs12 := pkcs12.h +$ exheader_comp := comp.h +$ exheader_ocsp := ocsp.h +$ exheader_ui := ui.h, ui_compat.h +$ exheader_krb5 := krb5_asn.h +$! exheader_store := store.h, str_compat.h +$ exheader_store := store.h +$ exheader_cms := cms.h +$ exheader_pqueue := pqueue.h +$ exheader_ts := ts.h +$ exheader_jpake := jpake.h +$ libs := ssl_libcrypto +$! +$ exe_dir := [-.'archd'.exe.crypto] +$! +$! Header files. +$! +$ i = 0 +$ loop_sdirs: +$ d = f$edit( f$element( i, ",", sdirs), "trim") +$ i = i + 1 +$ if d .eqs. "," then goto loop_sdirs_end +$ tmp = exheader_'d' +$ if (d .nes. "") then d = "."+ d +$ copy /protection = w:re ['d']'tmp' wrk_sslinclude: /log +$ goto loop_sdirs +$ loop_sdirs_end: +$! +$! Object libraries, shareable images. +$! +$ i = 0 +$ loop_lib: +$ e = f$edit( f$element( i, ",", libs), "trim") +$ i = i + 1 +$ if e .eqs. "," then goto loop_lib_end +$ set noon +$ file = exe_dir+ e+ lib32+ ".olb" +$ if f$search( file) .nes. "" +$ then +$ copy /protection = w:re 'file' wrk_sslxlib: /log +$ endif +$! +$ file = exe_dir+ e+ shr+ ".exe" +$ if f$search( file) .nes. "" +$ then +$ copy /protection = w:re 'file' wrk_sslxlib: /log +$ endif +$ set on +$ goto loop_lib +$ loop_lib_end: +$! +$ tidy: +$! +$ call deass wrk_sslroot +$ call deass wrk_sslinclude +$ call deass wrk_sslxlib +$! +$ exit +$! +$ deass: subroutine +$ if (f$trnlnm( p1, "LNM$PROCESS") .nes. "") +$ then +$ deassign /process 'p1' +$ endif +$ endsubroutine +$! diff --git a/crypto/install.com b/crypto/install.com deleted file mode 100644 index 8bc1e180e6..0000000000 --- a/crypto/install.com +++ /dev/null @@ -1,150 +0,0 @@ -$! INSTALL.COM -- Installs the files in a given directory tree -$! -$! Author: Richard Levitte -$! Time of creation: 22-MAY-1998 10:13 -$! -$! Changes by Zoltan Arpadffy -$! -$! P1 root of the directory tree -$! -$ IF P1 .EQS. "" -$ THEN -$ WRITE SYS$OUTPUT "First argument missing." -$ WRITE SYS$OUTPUT - - "It should be the directory where you want things installed." -$ EXIT -$ ENDIF -$ -$ IF (F$GETSYI("CPU").LT.128) -$ THEN -$ ARCH := VAX -$ ELSE -$ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE") -$ IF (ARCH .EQS. "") THEN ARCH = "UNK" -$ ENDIF -$ -$ ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0" -$ ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY") -$ ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") - - - "[000000." - "][" - "[" - "]" -$ ROOT = ROOT_DEV + "[" + ROOT_DIR -$ -$ DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC -$ DEFINE/NOLOG WRK_SSLLIB WRK_SSLROOT:['ARCH'_LIB] -$ DEFINE/NOLOG WRK_SSLINCLUDE WRK_SSLROOT:[INCLUDE] -$ -$ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLROOT:[000000] -$ IF F$PARSE("WRK_SSLLIB:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLLIB: -$ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLINCLUDE: -$ -$ SDIRS := ,- - _'ARCH',- - OBJECTS,- - MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,WHRLPOOL,- - DES,AES,RC2,RC4,RC5,IDEA,BF,CAST,CAMELLIA,SEED,- - BN,EC,RSA,DSA,ECDSA,DH,ECDH,DSO,ENGINE,- - BUFFER,BIO,STACK,LHASH,RAND,ERR,- - EVP,ASN1,PEM,X509,X509V3,CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,- - UI,KRB5,- - STORE,CMS,PQUEUE,TS,JPAKE -$ EXHEADER_ := crypto.h,opensslv.h,ebcdic.h,symhacks.h,ossl_typ.h -$ EXHEADER__'ARCH' := opensslconf.h -$ EXHEADER_OBJECTS := objects.h,obj_mac.h -$ EXHEADER_MD2 := md2.h -$ EXHEADER_MD4 := md4.h -$ EXHEADER_MD5 := md5.h -$ EXHEADER_SHA := sha.h -$ EXHEADER_MDC2 := mdc2.h -$ EXHEADER_HMAC := hmac.h -$ EXHEADER_RIPEMD := ripemd.h -$ EXHEADER_WHRLPOOL := whrlpool.h -$ EXHEADER_DES := des.h,des_old.h -$ EXHEADER_AES := aes.h -$ EXHEADER_RC2 := rc2.h -$ EXHEADER_RC4 := rc4.h -$ EXHEADER_RC5 := rc5.h -$ EXHEADER_IDEA := idea.h -$ EXHEADER_BF := blowfish.h -$ EXHEADER_CAST := cast.h -$ EXHEADER_CAMELLIA := camellia.h -$ EXHEADER_SEED := seed.h -$ EXHEADER_MODES := modes.h -$ EXHEADER_BN := bn.h -$ EXHEADER_EC := ec.h -$ EXHEADER_RSA := rsa.h -$ EXHEADER_DSA := dsa.h -$ EXHEADER_ECDSA := ecdsa.h -$ EXHEADER_DH := dh.h -$ EXHEADER_ECDH := ecdh.h -$ EXHEADER_DSO := dso.h -$ EXHEADER_ENGINE := engine.h -$ EXHEADER_BUFFER := buffer.h -$ EXHEADER_BIO := bio.h -$ EXHEADER_STACK := stack.h,safestack.h -$ EXHEADER_LHASH := lhash.h -$ EXHEADER_RAND := rand.h -$ EXHEADER_ERR := err.h -$ EXHEADER_EVP := evp.h -$ EXHEADER_ASN1 := asn1.h,asn1_mac.h,asn1t.h -$ EXHEADER_PEM := pem.h,pem2.h -$ EXHEADER_X509 := x509.h,x509_vfy.h -$ EXHEADER_X509V3 := x509v3.h -$ EXHEADER_CONF := conf.h,conf_api.h -$ EXHEADER_TXT_DB := txt_db.h -$ EXHEADER_PKCS7 := pkcs7.h -$ EXHEADER_PKCS12 := pkcs12.h -$ EXHEADER_COMP := comp.h -$ EXHEADER_OCSP := ocsp.h -$ EXHEADER_UI := ui.h,ui_compat.h -$ EXHEADER_KRB5 := krb5_asn.h -$! EXHEADER_STORE := store.h,str_compat.h -$ EXHEADER_STORE := store.h -$ EXHEADER_CMS := cms.h -$ EXHEADER_PQUEUE := pqueue.h -$ EXHEADER_TS := ts.h -$ EXHEADER_JPAKE := jpake.h -$ LIBS := LIBCRYPTO,LIBCRYPTO32 -$ -$ EXE_DIR := [-.'ARCH'.EXE.CRYPTO] -$ -$ I = 0 -$ LOOP_SDIRS: -$ D = F$EDIT(F$ELEMENT(I, ",", SDIRS),"TRIM") -$ I = I + 1 -$ IF D .EQS. "," THEN GOTO LOOP_SDIRS_END -$ tmp = EXHEADER_'D' -$ IF D .EQS. "" -$ THEN -$ COPY 'tmp' WRK_SSLINCLUDE: /LOG -$ ELSE -$ COPY [.'D']'tmp' WRK_SSLINCLUDE: /LOG -$ ENDIF -$ SET FILE/PROT=WORLD:RE WRK_SSLINCLUDE:'tmp' -$ GOTO LOOP_SDIRS -$ LOOP_SDIRS_END: -$ -$ I = 0 -$ LOOP_LIB: -$ E = F$EDIT(F$ELEMENT(I, ",", LIBS),"TRIM") -$ I = I + 1 -$ IF E .EQS. "," THEN GOTO LOOP_LIB_END -$ SET NOON -$ IF F$SEARCH(EXE_DIR+E+".OLB") .NES. "" -$ THEN -$ COPY 'EXE_DIR''E'.OLB WRK_SSLLIB:'E'.OLB/log -$ SET FILE/PROT=W:RE WRK_SSLLIB:'E'.OLB -$ ENDIF -$ ! Preparing for the time when we have shareable images -$ IF F$SEARCH(EXE_DIR+E+".EXE") .NES. "" -$ THEN -$ COPY 'EXE_DIR''E'.EXE WRK_SSLLIB:'E'.EXE/log -$ SET FILE/PROT=W:RE WRK_SSLLIB:'E'.EXE -$ ENDIF -$ SET ON -$ GOTO LOOP_LIB -$ LOOP_LIB_END: -$ -$ EXIT diff --git a/crypto/o_time.c b/crypto/o_time.c index eecbdd19f0..9030fdef7a 100644 --- a/crypto/o_time.c +++ b/crypto/o_time.c @@ -64,12 +64,18 @@ #include "o_time.h" #ifdef OPENSSL_SYS_VMS -# include -# include -# include -# include -# include -# include +# if __CRTL_VER >= 70000000 && \ + (defined _POSIX_C_SOURCE || !defined _ANSI_C_SOURCE) +# define VMS_GMTIME_OK +# endif +# ifndef VMS_GMTIME_OK +# include +# include +# include +# include +# include +# include +# endif /* ndef VMS_GMTIME_OK */ #endif struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) @@ -81,7 +87,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) so we don't even look at the return value */ gmtime_r(timer,result); ts = result; -#elif !defined(OPENSSL_SYS_VMS) +#elif !defined(OPENSSL_SYS_VMS) || defined(VMS_GMTIME_OK) ts = gmtime(timer); if (ts == NULL) return NULL; @@ -89,7 +95,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) memcpy(result, ts, sizeof(struct tm)); ts = result; #endif -#ifdef OPENSSL_SYS_VMS +#if defined( OPENSSL_SYS_VMS) && !defined( VMS_GMTIME_OK) if (ts == NULL) { static $DESCRIPTOR(tabnam,"LNM$DCL_LOGICAL"); diff --git a/crypto/rand/rand_vms.c b/crypto/rand/rand_vms.c index 1267a3acae..0bfd8ff7e4 100644 --- a/crypto/rand/rand_vms.c +++ b/crypto/rand/rand_vms.c @@ -69,6 +69,17 @@ # pragma message disable DOLLARID #endif +/* Use 32-bit pointers almost everywhere. Define the type to which to + * cast a pointer passed to an external function. + */ +#if __INITIAL_POINTER_SIZE == 64 +# define PTR_T __void_ptr64 +# pragma pointer_size save +# pragma pointer_size 32 +#else /* __INITIAL_POINTER_SIZE == 64 */ +# define PTR_T void * +#endif /* __INITIAL_POINTER_SIZE == 64 [else] */ + static struct items_data_st { short length, code; /* length is amount of bytes */ @@ -125,11 +136,12 @@ int RAND_poll(void) { if (status == SS$_NORMAL) { - RAND_add(data_buffer, total_length, total_length/2); + RAND_add( (PTR_T)data_buffer, total_length, + total_length/2); } } sys$gettim(iosb); - RAND_add((unsigned char *)iosb, sizeof(iosb), sizeof(iosb)/2); + RAND_add( (PTR_T)iosb, sizeof(iosb), sizeof(iosb)/2); return 1; } diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index f9b709e6d5..bc7d9c5804 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -144,7 +144,9 @@ int RAND_load_file(const char *file, long bytes) * I/O because we will waste system entropy. */ bytes = (bytes == -1) ? 2048 : bytes; /* ok, is 2048 enough? */ +#ifndef OPENSSL_NO_SETVBUF_IONBF setvbuf(in, NULL, _IONBF, 0); /* don't do buffered reads */ +#endif /* ndef OPENSSL_NO_SETVBUF_IONBF */ } #endif for (;;) diff --git a/crypto/vms_rms.h b/crypto/vms_rms.h new file mode 100755 index 0000000000..00a00d993f --- /dev/null +++ b/crypto/vms_rms.h @@ -0,0 +1,51 @@ + +#ifdef NAML$C_MAXRSS + +# define CC_RMS_NAMX cc$rms_naml +# define FAB_NAMX fab$l_naml +# define FAB_OR_NAML( fab, naml) naml +# define FAB_OR_NAML_DNA naml$l_long_defname +# define FAB_OR_NAML_DNS naml$l_long_defname_size +# define FAB_OR_NAML_FNA naml$l_long_filename +# define FAB_OR_NAML_FNS naml$l_long_filename_size +# define NAMX_ESA naml$l_long_expand +# define NAMX_ESL naml$l_long_expand_size +# define NAMX_ESS naml$l_long_expand_alloc +# define NAMX_NOP naml$b_nop +# define SET_NAMX_NO_SHORT_UPCASE( nam) nam.naml$v_no_short_upcase = 1 + +# if __INITIAL_POINTER_SIZE == 64 +# define NAMX_DNA_FNA_SET(fab) fab.fab$l_dna = (__char_ptr32) -1; \ + fab.fab$l_fna = (__char_ptr32) -1; +# else /* __INITIAL_POINTER_SIZE == 64 */ +# define NAMX_DNA_FNA_SET(fab) fab.fab$l_dna = (char *) -1; \ + fab.fab$l_fna = (char *) -1; +# endif /* __INITIAL_POINTER_SIZE == 64 [else] */ + +# define NAMX_MAXRSS NAML$C_MAXRSS +# define NAMX_STRUCT NAML + +#else /* def NAML$C_MAXRSS */ + +# define CC_RMS_NAMX cc$rms_nam +# define FAB_NAMX fab$l_nam +# define FAB_OR_NAML( fab, naml) fab +# define FAB_OR_NAML_DNA fab$l_dna +# define FAB_OR_NAML_DNS fab$b_dns +# define FAB_OR_NAML_FNA fab$l_fna +# define FAB_OR_NAML_FNS fab$b_fns +# define NAMX_ESA nam$l_esa +# define NAMX_ESL nam$b_esl +# define NAMX_ESS nam$b_ess +# define NAMX_NOP nam$b_nop +# define NAMX_DNA_FNA_SET(fab) +# define NAMX_MAXRSS NAM$C_MAXRSS +# define NAMX_STRUCT NAM +# ifdef NAM$M_NO_SHORT_UPCASE +# define SET_NAMX_NO_SHORT_UPCASE( nam) naml.naml$v_no_short_upcase = 1 +# else /* def NAM$M_NO_SHORT_UPCASE */ +# define SET_NAMX_NO_SHORT_UPCASE( nam) +# endif /* def NAM$M_NO_SHORT_UPCASE [else] */ + +#endif /* def NAML$C_MAXRSS [else] */ + diff --git a/engines/makeengines.com b/engines/makeengines.com index 0d31742579..39b50ab3c9 100644 --- a/engines/makeengines.com +++ b/engines/makeengines.com @@ -28,18 +28,31 @@ $! $! P6 if defined, denotes which engines to build. If not defined, $! all available engines are built. $! -$! For 64 bit architectures (Alpha and IA64), specify the pointer size as P7. -$! For 32 bit architectures (VAX), P7 is ignored. -$! Currently supported values are: +$! P7, if defined, specifies the C pointer size. Ignored on VAX. +$! Supported values are: $! -$! 32 To ge a library compiled with /POINTER_SIZE=32 -$! 64 To ge a library compiled with /POINTER_SIZE=64 +$! "" Compile with default (/NOPOINTER_SIZE) +$! 32 Compile with /POINTER_SIZE=32 (SHORT) +$! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV]) +$! +$! P8, if defined, specifies a directory where ZLIB files (zlib.h, +$! libz.olb) may be found. Optionally, a non-default object library +$! name may be included ("dev:[dir]libz_64.olb", for example). $! $!----------------------------------------------------------------------------- $! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") +$! +$ on control_c then goto exit +$! $! Set the default TCP/IP library to link against if needed $! $ TCPIP_LIB = "" +$ ZLIB_LIB = "" $! $! Check What Architecture We Are Using. $! @@ -63,6 +76,11 @@ $! End The Architecture Check. $! $ ENDIF $! +$ ARCHD = ARCH +$ LIB32 = "32" +$ OPT_FILE = "" +$ POINTER_SIZE = "" +$! $! Set the names of the engines we want to build $! NOTE: Some might think this list ugly. However, it's made this way to $! reflect the LIBNAMES variable in Makefile as closely as possible, @@ -79,19 +97,7 @@ $! $ IF (ARCH .NES. "VAX") THEN - ENGINES = ENGINES+ ",ccgost" $! -$! Set the goal directories, and create them if necessary -$! -$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.ENGINES] -$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.ENGINES] -$ IF F$PARSE(OBJ_DIR) .EQS. "" THEN CREATE/DIRECTORY 'OBJ_DIR' -$ IF F$PARSE(EXE_DIR) .EQS. "" THEN CREATE/DIRECTORY 'EXE_DIR' -$! -$! Set the goal files, and create them if necessary -$! -$ CRYPTO_LIB :=SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO'LIB32'.OLB -$ IF F$SEARCH(CRYPTO_LIB) .EQS. "" THEN LIBRARY/CREATE/OBJECT 'CRYPTO_LIB' -$! -$! OK, time to check options and initialise +$! Check options. $! $ OPT_PHASE = P1 $ ACCEPT_PHASE = "ALL,ENGINES" @@ -100,8 +106,38 @@ $ OPT_COMPILER = P3 $ OPT_TCPIP_LIB = P4 $ OPT_SPECIAL_THREADS = P5 $ OPT_POINTER_SIZE = P7 +$ ZLIB = P8 $ $ GOSUB CHECK_OPTIONS +$! +$! Set the goal directories, and create them if necessary +$! +$ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.ENGINES] +$ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.ENGINES] +$ IF F$PARSE(OBJ_DIR) .EQS. "" THEN CREATE/DIRECTORY 'OBJ_DIR' +$ IF F$PARSE(EXE_DIR) .EQS. "" THEN CREATE/DIRECTORY 'EXE_DIR' +$! +$! Set the goal files, and create them if necessary +$! +$ CRYPTO_LIB := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO'LIB32'.OLB +$ IF F$SEARCH(CRYPTO_LIB) .EQS. "" THEN LIBRARY/CREATE/OBJECT 'CRYPTO_LIB' +$! +$! Specify the destination directory in any /MAP option. +$! +$ if (LINKMAP .eqs. "MAP") +$ then +$ LINKMAP = LINKMAP+ "=''EXE_DIR'" +$ endif +$! +$! Add the location prefix to the linker options file name. +$! +$ if (OPT_FILE .nes. "") +$ then +$ OPT_FILE = EXE_DIR+ OPT_FILE +$ endif +$! +$! Initialise. +$! $ GOSUB INITIALISE $ GOSUB CHECK_OPT_FILE $! @@ -180,7 +216,7 @@ $! Create a .OPT file for the object files (for a real engine name). $! $ IF ENGINE_NAME .NES. "" $ THEN -$ OPEN/WRITE OBJECTS 'EXE_DIR''ENGINE_NAME'.OPT +$ OPEN /WRITE OBJECTS 'EXE_DIR''ENGINE_NAME'.OPT $ ENDIF $! $! Here's the start of per-engine module loop. @@ -265,18 +301,14 @@ $! For shareable libraries, we need to do things a little differently $! depending on if we link with a TCP/IP library or not. $! $ ENGINE_OPT := SYS$DISK:[]'ARCH'.OPT -$ IF TCPIP_LIB .NES. "" -$ THEN -$ LINK/'DEBUGGER'/'TRACEBACK' /SHARE='EXE_DIR''ENGINE_NAME'.EXE - - 'EXE_DIR''ENGINE_NAME'.OPT/OPTION'TV_OBJ', - - 'CRYPTO_LIB'/LIBRARY, - - 'ENGINE_OPT'/OPTION,'TCPIP_LIB','OPT_FILE'/OPTION -$ ELSE -$ LINK/'DEBUGGER'/'TRACEBACK' /SHARE='EXE_DIR''ENGINE_NAME'.EXE - - 'EXE_DIR''ENGINE_NAME'.OPT/OPTION'TV_OBJ', - - 'CRYPTO_LIB'/LIBRARY, - - 'ENGINE_OPT'/OPTION,'OPT_FILE'/OPTION -$ ENDIF +$ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' /SHARE='EXE_DIR''ENGINE_NAME'.EXE - + 'EXE_DIR''ENGINE_NAME'.OPT /OPTIONS - + 'TV_OBJ', - + 'CRYPTO_LIB' /LIBRARY, - + 'ENGINE_OPT' /OPTIONS - + 'TCPIP_LIB' - + 'ZLIB_LIB' - + ,'OPT_FILE' /OPTIONS $! $! Next engine $! @@ -310,7 +342,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable VAX C Runtime Library. ! SYS$SHARE:VAXCRTL.EXE/SHARE @@ -339,7 +371,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable C Runtime Library. ! GNU_CC:[000000]GCCLIB/LIBRARY @@ -374,7 +406,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable DEC C Runtime Library. ! SYS$SHARE:DECC$SHR.EXE/SHARE @@ -389,7 +421,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File For non-VAX To Link Agianst +! Default System Options File For non-VAX To Link Against ! The Sharable C Runtime Library. ! SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE @@ -461,8 +493,8 @@ $ IF ("," + ACCEPT_PHASE + ",") - ",ENGINES," - $ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT " where 'xxx' stands for:" $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT " ALPHA : Alpha architecture." -$ WRITE SYS$OUTPUT " IA64 : IA64 architecture." +$ WRITE SYS$OUTPUT " ALPHA[64]: Alpha architecture." +$ WRITE SYS$OUTPUT " IA64[64] : IA64 architecture." $ WRITE SYS$OUTPUT " VAX : VAX architecture." $ WRITE SYS$OUTPUT "" $! @@ -483,15 +515,16 @@ $! $ IF (OPT_DEBUG.EQS."NODEBUG") $ THEN $! -$! OPT_DEBUG Is NODEBUG, So Compile Without The Debugger Information. +$! OPT_DEBUG Is NODEBUG, So Compile Without The Debugger Information. $! -$ DEBUGGER = "NODEBUG" -$ TRACEBACK = "NOTRACEBACK" -$ GCC_OPTIMIZE = "OPTIMIZE" -$ CC_OPTIMIZE = "OPTIMIZE" -$ MACRO_OPTIMIZE = "OPTIMIZE" -$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." -$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." +$ DEBUGGER = "NODEBUG" +$ LINKMAP = "NOMAP" +$ TRACEBACK = "NOTRACEBACK" +$ GCC_OPTIMIZE = "OPTIMIZE" +$ CC_OPTIMIZE = "OPTIMIZE" +$ MACRO_OPTIMIZE = "OPTIMIZE" +$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." +$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." $ ELSE $! $! Check To See If We Are To Compile With Debugger Information. @@ -502,6 +535,7 @@ $! $! Compile With Debugger Information. $! $ DEBUGGER = "DEBUG" +$ LINKMAP = "MAP" $ TRACEBACK = "TRACEBACK" $ GCC_OPTIMIZE = "NOOPTIMIZE" $ CC_OPTIMIZE = "NOOPTIMIZE" @@ -510,7 +544,7 @@ $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile." $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." $ ELSE $! -$! They Entered An Invalid Option.. +$! They Entered An Invalid Option. $! $ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT "The Option ",OPT_DEBUG," Is Invalid. The Valid Options Are:" @@ -565,58 +599,49 @@ $! End The OPT_SPECIAL_THREADS Check. $! $ ENDIF $! -$! Check To See If OPT_POINTER_SIZE Is Blank. +$! Check OPT_POINTER_SIZE (P7). $! -$ IF (OPT_POINTER_SIZE.EQS."") +$ IF (OPT_POINTER_SIZE .NES. "") .AND. (ARCH .NES. "VAX") $ THEN -$ POINTER_SIZE = "" -$ ELSE -$! -$! Check is OPT_POINTER_SIZE Is Valid $! -$ IF (OPT_POINTER_SIZE.EQS."32") +$ IF (OPT_POINTER_SIZE .EQS. "32") $ THEN $ POINTER_SIZE = "/POINTER_SIZE=32" -$ IF ARCH .EQS. "VAX" -$ THEN -$ LIB32 = "" -$ ELSE -$ LIB32 = "32" -$ ENDIF $ ELSE -$ IF (OPT_POINTER_SIZE.EQS."64") +$ IF (OPT_POINTER_SIZE .EQS. "64") $ THEN +$ POINTER_SIZE = "/POINTER_SIZE=64" +$ ARCHD = ARCH+ "_64" $ LIB32 = "" -$ IF ARCH .EQS. "VAX" -$ THEN -$ POINTER_SIZE = "/POINTER_SIZE=32" -$ ELSE -$ POINTER_SIZE = "/POINTER_SIZE=64" -$ ENDIF $ ELSE $! -$! Tell The User Entered An Invalid Option.. +$! Tell The User Entered An Invalid Option. $! $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT "The Option ",OPT_POINTER_SIZE," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "The Option ", OPT_POINTER_SIZE, - + " Is Invalid. The Valid Options Are:" $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT " 32 : Compile with 32 bit pointer size" -$ WRITE SYS$OUTPUT " 64 : Compile with 64 bit pointer size" +$ WRITE SYS$OUTPUT " """" : Compile with default (short) pointers." +$ WRITE SYS$OUTPUT " 32 : Compile with 32-bit (short) pointers." +$ WRITE SYS$OUTPUT " 64 : Compile with 64-bit (long) pointers." $ WRITE SYS$OUTPUT "" -$! +$! $! Time To EXIT. $! -$ GOTO TIDY -$! -$! End The Valid Arguement Check. +$ EXIT $! $ ENDIF +$! $ ENDIF $! $! End The OPT_POINTER_SIZE Check. $! $ ENDIF $! +$! Set basic C compiler /INCLUDE directories. +$! +$ CC_INCLUDES = "SYS$DISK:[],SYS$DISK:[.VENDOR_DEFNS]" +$! $! Check To See If OPT_COMPILER Is Blank. $! $ IF (OPT_COMPILER.EQS."") @@ -721,7 +746,59 @@ $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX" $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS $! -$! Check To See If The User Entered A Valid Paramter. +$! Check To See If We Have A ZLIB Option. +$! +$ IF (ZLIB .NES. "") +$ THEN +$! +$! Check for expected ZLIB files. +$! +$ err = 0 +$ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY") +$ if (f$search( file1) .eqs. "") +$ then +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." +$ WRITE SYS$OUTPUT " Can't find header: ''file1'" +$ err = 1 +$ endif +$ file1 = f$parse( "A.;", ZLIB)- "A.;" +$! +$ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY") +$ if (f$search( file2) .eqs. "") +$ then +$ if (err .eq. 0) +$ then +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." +$ endif +$ WRITE SYS$OUTPUT " Can't find library: ''file2'" +$ WRITE SYS$OUTPUT "" +$ err = err+ 2 +$ endif +$ if (err .eq. 1) +$ then +$ WRITE SYS$OUTPUT "" +$ endif +$! +$ if (err .ne. 0) +$ then +$ EXIT +$ endif +$! +$ CCDEFS = """ZLIB=1"", "+ CCDEFS +$ CC_INCLUDES = CC_INCLUDES+ ", "+ file1 +$ ZLIB_LIB = ", ''file2' /library" +$! +$! Print info +$! +$ WRITE SYS$OUTPUT "ZLIB library spec: ", file2 +$! +$! End The ZLIB Check. +$! +$ ENDIF +$! +$! Check To See If The User Entered A Valid Parameter. $! $ IF (OPT_COMPILER.EQS."VAXC").OR.(OPT_COMPILER.EQS."DECC").OR.(OPT_COMPILER.EQS."GNUC") $ THEN @@ -744,14 +821,14 @@ $! $ CC = "CC" $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - THEN CC = "CC/DECC" -$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89''POINTER_SIZE'" + - - "/NOLIST/PREFIX=ALL" + - - "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.VENDOR_DEFNS])" + - - CCEXTRAFLAGS +$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=RELAXED"+ - + "''POINTER_SIZE'/NOLIST/PREFIX=ALL" + - + "/INCLUDE=(''CC_INCLUDES')" + - + CCEXTRAFLAGS $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT" +$ OPT_FILE = "VAX_DECC_OPTIONS.OPT" $! $! End DECC Check. $! @@ -780,7 +857,7 @@ $ EXIT $ ENDIF $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - - "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.VENDOR_DEFNS])" + - + "/INCLUDE=(''CC_INCLUDES')" + - CCEXTRAFLAGS $ CCDEFS = """VAXC""," + CCDEFS $! @@ -790,7 +867,7 @@ $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT" +$ OPT_FILE = "VAX_VAXC_OPTIONS.OPT" $! $! End VAXC Check $! @@ -812,12 +889,12 @@ $! $! Use GNU C... $! $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - - "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.VENDOR_DEFNS])" + - + "/INCLUDE=(''CC_INCLUDES')" + - CCEXTRAFLAGS $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT" +$ OPT_FILE = "VAX_GNUC_OPTIONS.OPT" $! $! End The GNU C Check. $! @@ -868,8 +945,12 @@ $ ENDIF $! $! Build a MACRO command for the architecture at hand $! -$ IF ARCH .EQS. "VAX" THEN MACRO = "MACRO/''DEBUGGER'" -$ IF ARCH .NES. "VAX" THEN MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'" +$ IF ARCH .EQS. "VAX" +$ THEN +$ MACRO = "MACRO/''DEBUGGER'" +$ ELSE +$ MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'" +$ ENDIF $! $! Show user the result $! @@ -889,7 +970,7 @@ $ THEN $! $! Set the library to use SOCKETSHR $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS" $! $! Done with SOCKETSHR $! @@ -915,13 +996,13 @@ $ THEN $! $! Set the library to use UCX. $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT" +$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS" $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" $ THEN -$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS" $ ELSE $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - - TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT" + TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS" $ ENDIF $! $! Done with UCX @@ -935,7 +1016,7 @@ $ THEN $! $! Set the library to use TCPIP (post UCX). $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS" $! $! Done with TCPIP $! @@ -956,7 +1037,7 @@ $ ENDIF $! $! Print info $! -$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB +$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- "," $! $! Else The User Entered An Invalid Argument. $! @@ -999,7 +1080,7 @@ $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]" $! $! Set up the logical name OPENSSL to point at the include directory $! -$ DEFINE OPENSSL/NOLOG '__INCLUDE' +$ DEFINE OPENSSL /NOLOG '__INCLUDE' $! $! Done $! @@ -1007,15 +1088,24 @@ $ RETURN $! $ CLEANUP: $! -$! Restore the logical name OPENSSL if it had a value +$! Restore the saved logical name OPENSSL, if it had a value. $! -$ IF __SAVE_OPENSSL .EQS. "" -$ THEN -$ DEASSIGN OPENSSL -$ ELSE -$ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL' -$ ENDIF +$ if (f$type( __SAVE_OPENSSL) .nes. "") +$ then +$ IF __SAVE_OPENSSL .EQS. "" +$ THEN +$ DEASSIGN OPENSSL +$ ELSE +$ DEFINE /NOLOG OPENSSL '__SAVE_OPENSSL' +$ ENDIF +$ endif +$! +$! Close any open files. +$! +$ if (f$trnlnm( "objects", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then - + close objects $! $! Done $! $ RETURN +$! diff --git a/install.com b/install.com index d15c23a832..6a0ea2d4de 100644 --- a/install.com +++ b/install.com @@ -3,99 +3,134 @@ $! $! Author: Richard Levitte $! Time of creation: 22-MAY-1998 10:13 $! -$! P1 root of the directory tree -$! -$ DEF_ORIG = F$ENVIRONMENT( "DEFAULT") -$ ON ERROR THEN GOTO TIDY -$ ON CONTROL_C THEN GOTO TIDY -$ -$ IF P1 .EQS. "" -$ THEN -$ WRITE SYS$OUTPUT "First argument missing." -$ WRITE SYS$OUTPUT - - "It Should be the directory where you want things installed." -$ EXIT -$ ENDIF -$ -$ IF (F$GETSYI("CPU").LT.128) -$ THEN -$ ARCH := VAX -$ ELSE -$ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE") -$ IF (ARCH .EQS. "") THEN ARCH = "UNK" -$ ENDIF -$ -$ ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0" -$ ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY") -$ ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") - +$! P1 root of the directory tree +$! P2 "64" for 64-bit pointers. +$! +$! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") +$! +$ def_orig = f$environment( "default") +$ on error then goto tidy +$ on control_c then goto tidy +$! +$ if (p1 .eqs. "") +$ then +$ write sys$output "First argument missing." +$ write sys$output - + "It should be the directory where you want things installed." +$ exit +$ endif +$! +$ if (f$getsyi("cpu") .lt. 128) +$ then +$ arch = "VAX" +$ else +$ arch = f$edit( f$getsyi( "arch_name"), "upcase") +$ if (arch .eqs. "") then arch = "UNK" +$ endif +$! +$ archd = arch +$! +$ if (p2 .nes. "") +$ then +$ if (p2 .eqs. "64") +$ then +$ archd = arch+ "_64" +$ else +$ if (p2 .nes. "32") +$ then +$ write sys$output "Second argument invalid." +$ write sys$output "It should be "32", "64", or nothing." +$ exit +$ endif +$ endif +$ endif +$! +$ root = f$parse( p1, "[]A.;0", , , "syntax_only, no_conceal") - "A.;0" +$ root_dev = f$parse( root, , , "device", "syntax_only") +$ root_dir = f$parse( root, , , "directory", "syntax_only") - - ".][000000" - "[000000." - "][" - "[" - "]" -$ ROOT = ROOT_DEV + "[" + ROOT_DIR -$ -$ DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC -$ DEFINE/NOLOG WRK_SSLXLIB WRK_SSLROOT:['ARCH'_LIB] -$ DEFINE/NOLOG WRK_SSLLIB WRK_SSLROOT:[LIB] -$ DEFINE/NOLOG WRK_SSLINCLUDE WRK_SSLROOT:[INCLUDE] -$ DEFINE/NOLOG WRK_SSLXEXE WRK_SSLROOT:['ARCH'_EXE] -$ DEFINE/NOLOG WRK_SSLCERTS WRK_SSLROOT:[CERTS] -$ DEFINE/NOLOG WRK_SSLPRIVATE WRK_SSLROOT:[PRIVATE] -$ +$ root = root_dev + "[" + root_dir +$! +$ define /nolog wrk_sslroot 'root'.] /trans=conc +$ define /nolog wrk_sslcerts wrk_sslroot:[certs] +$ define /nolog wrk_sslinclude wrk_sslroot:[include] +$ define /nolog wrk_ssllib wrk_sslroot:[lib] +$ define /nolog wrk_sslprivate wrk_sslroot:[private] +$ define /nolog wrk_sslxexe wrk_sslroot:['archd'_exe] +$ define /nolog wrk_sslxlib wrk_sslroot:['arch'_lib] $! $! Exhibit the destination directory. $! -$ WRITE SYS$OUTPUT " Installing to (WRK_SSLROOT) =" -$ WRITE SYS$OUTPUT " ''f$trnlnm( "WRK_SSLROOT")'" -$ WRITE SYS$OUTPUT "" -$ -$ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLROOT:[000000] -$ IF F$PARSE("WRK_SSLXEXE:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLXEXE: -$ IF F$PARSE("WRK_SSLXLIB:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLXLIB: -$ IF F$PARSE("WRK_SSLLIB:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLLIB: -$ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLINCLUDE: -$ IF F$PARSE("WRK_SSLCERTS:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLCERTS: -$ IF F$PARSE("WRK_SSLPRIVATE:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLPRIVATE: -$ IF F$PARSE("WRK_SSLROOT:[VMS]") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLROOT:[VMS] -$ -$ SDIRS := CRYPTO,SSL,APPS,VMS!,RSAREF,TEST,TOOLS -$ EXHEADER := e_os2.h -$ -$ COPY 'EXHEADER' WRK_SSLINCLUDE: /LOG -$ SET FILE/PROT=WORLD:RE WRK_SSLINCLUDE:'EXHEADER' -$ -$ I = 0 -$ LOOP_SDIRS: -$ D = F$ELEMENT(I, ",", SDIRS) -$ I = I + 1 -$ IF D .EQS. "," THEN GOTO LOOP_SDIRS_END -$ WRITE SYS$OUTPUT "Installing ",D," files." -$ SET DEFAULT [.'D'] -$ @INSTALL 'ROOT'] -$ SET DEFAULT [-] -$ GOTO LOOP_SDIRS -$ LOOP_SDIRS_END: -$ -$ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT " Installation done!" -$ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT " You might want to purge ",ROOT,"...]" -$ WRITE SYS$OUTPUT "" -$ -$ TIDY: -$ SET DEFAULT 'DEF_ORIG' -$ -$ DEASSIGN WRK_SSLROOT -$ DEASSIGN WRK_SSLXLIB -$ DEASSIGN WRK_SSLLIB -$ DEASSIGN WRK_SSLINCLUDE -$ DEASSIGN WRK_SSLXEXE -$ DEASSIGN WRK_SSLCERTS -$ DEASSIGN WRK_SSLPRIVATE -$ -$ EXIT +$ write sys$output " Installing to (WRK_SSLROOT) =" +$ write sys$output " ''f$trnlnm( "wrk_sslroot")'" +$ write sys$output "" +$! +$ if f$parse("wrk_sslroot:[000000]") .eqs. "" then - + create /directory /log wrk_sslroot:[000000] +$ if f$parse("wrk_sslxexe:") .eqs. "" then - + create /directory /log wrk_sslxexe: +$ if f$parse("wrk_sslxlib:") .eqs. "" then - + create /directory /log wrk_sslxlib: +$ if f$parse("wrk_ssllib:") .eqs. "" then - + create /directory /log wrk_ssllib: +$ if f$parse("wrk_sslinclude:") .eqs. "" then - + create /directory /log wrk_sslinclude: +$ if f$parse("wrk_sslcerts:") .eqs. "" then - + create /directory /log wrk_sslcerts: +$ if f$parse("wrk_sslprivate:") .eqs. "" then - + create /directory /log wrk_sslprivate: +$ if f$parse("wrk_sslroot:[VMS]") .EQS. "" THEN - + create /directory /log wrk_sslroot:[VMS] +$! +$ sdirs := CRYPTO, SSL, APPS, VMS !!!, RSAREF, TEST, TOOLS +$ exheader := e_os2.h +$! +$ copy /protection = w:re 'exheader' wrk_sslinclude: /log +$! +$ i = 0 +$ loop_sdirs: +$ d = f$edit( f$element(i, ",", sdirs), "trim") +$ i = i + 1 +$ if d .eqs. "," then goto loop_sdirs_end +$ write sys$output "Installing ", d, " files." +$ set default [.'d'] +$ @ install-'d'.com 'root'] 'p2' +$ set default 'def_orig' +$ goto loop_sdirs +$ loop_sdirs_end: +$! +$ write sys$output "" +$ write sys$output " Installation done!" +$ write sys$output "" +$ if (f$search( root+ "...]*.*;-1") .nes. "") +$ then +$ write sys$output " You might want to purge ", root, "...]" +$ write sys$output "" +$ endif +$! +$ tidy: +$! +$ set default 'def_orig' +$! +$ call deass wrk_sslroot +$ call deass wrk_sslcerts +$ call deass wrk_sslinclude +$ call deass wrk_ssllib +$ call deass wrk_sslprivate +$ call deass wrk_sslxexe +$ call deass wrk_sslxlib +$! +$ exit +$! +$ deass: subroutine +$ if (f$trnlnm( p1, "LNM$PROCESS") .nes. "") +$ then +$ deassign /process 'p1' +$ endif +$ endsubroutine +$! diff --git a/makevms.com b/makevms.com index 8c59c67ca1..2438715e64 100755 --- a/makevms.com +++ b/makevms.com @@ -15,7 +15,7 @@ $! The "xxx" denotes the machine architecture of ALPHA, IA64 or VAX. $! $! This procedures accepts two command line options listed below. $! -$! Specify one of the following build options for P1. +$! P1 specifies one of the following build options: $! $! ALL Just build "everything". $! CONFIG Just build the "[.CRYPTO._xxx]OPENSSLCONF.H" file. @@ -31,19 +31,17 @@ $! TEST Just build the "[.xxx.EXE.TEST]" test programs for OpenSSL. $! APPS Just build the "[.xxx.EXE.APPS]" application programs for OpenSSL. $! ENGINES Just build the "[.xxx.EXE.ENGINES]" application programs for OpenSSL. $! +$! P2, if defined, specifies the C pointer size. Ignored on VAX. +$! Supported values are: $! -$! For 64 bit architectures (Alpha and IA64), specify the pointer size as P2. -$! For 32 bit architectures (VAX), P2 is ignored. -$! Currently supported values are: +$! "" Compile with default (/NOPOINTER_SIZE) +$! 32 Compile with /POINTER_SIZE=32 (SHORT) +$! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV]) $! -$! 32 To ge a library compiled with /POINTER_SIZE=32 -$! 64 To ge a library compiled with /POINTER_SIZE=64 +$! P3 specifies DEBUG or NODEBUG, to compile with or without debugging +$! information. $! -$! -$! Specify DEBUG or NODEBUG as P3 to compile with or without debugging -$! information. -$! -$! Specify which compiler as P4 to try to compile under. +$! P4 specifies which compiler to try to compile under. $! $! VAXC For VAX C. $! DECC For DEC C. @@ -65,8 +63,18 @@ $! NONE to avoid specifying which TCP/IP implementation to $! use at build time (this works with DEC C). This is $! the default. $! -$! P6, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) +$! P6, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up). +$! +$! P7, if defined, specifies a directory where ZLIB files (zlib.h, +$! libz.olb) may be found. Optionally, a non-default object library +$! name may be included ("dev:[dir]libz_64.olb", for example). +$! $! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") $! $ DEF_ORIG = F$ENVIRONMENT( "DEFAULT") $ ON ERROR THEN GOTO TIDY @@ -104,6 +112,10 @@ $! End The Architecture Check. $! $ ENDIF $! +$ ARCHD = ARCH +$ LIB32 = "32" +$ POINTER_SIZE = "" +$! $! Get VMS version. $! $ VMS_VERSION = f$edit( f$getsyi( "VERSION"), "TRIM") @@ -178,12 +190,12 @@ $ CONFIG: $! $! Tell The User We Are Creating The [.CRYPTO._xxx]OPENSSLCONF.H File. $! -$ WRITE SYS$OUTPUT "Creating [.CRYPTO._''ARCH']OPENSSLCONF.H Include File." +$ WRITE SYS$OUTPUT "Creating [.CRYPTO.''ARCHD']OPENSSLCONF.H Include File." $! $! First, make sure the directory exists. $! -$ IF F$PARSE("SYS$DISK:[.CRYPTO._''ARCH']") .EQS. "" THEN - - CREATE/DIRECTORY SYS$DISK:[.CRYPTO._'ARCH'] +$ IF F$PARSE("SYS$DISK:[.CRYPTO.''ARCHD']") .EQS. "" THEN - + CREATE/DIRECTORY SYS$DISK:[.CRYPTO.'ARCHD'] $! $! Different tar/UnZip versions/option may have named the file differently $ IF F$SEARCH("[.crypto]opensslconf.h_in") .NES. "" @@ -209,7 +221,7 @@ $! $! Create The [.CRYPTO._xxx]OPENSSLCONF.H File. $! Make sure it has the right format. $! -$ OSCH_NAME = "SYS$DISK:[.CRYPTO._''ARCH']OPENSSLCONF.H" +$ OSCH_NAME = "SYS$DISK:[.CRYPTO.''ARCHD']OPENSSLCONF.H" $ CREATE /FDL=SYS$INPUT: 'OSCH_NAME' RECORD FORMAT stream_lf @@ -228,7 +240,7 @@ $ WRITE H_FILE "# define OPENSSL_SYS_VMS" $ WRITE H_FILE "#endif" $ $! One of the best way to figure out what the list should be is to do -$! the followin on a Unix system: +$! the following on a Unix system: $! grep OPENSSL_NO_ crypto/*/*.h ssl/*.h engines/*.h engines/*/*.h|grep ':# *if'|sed -e 's/^.*def //'|sort|uniq $! For that reason, the list will also always end up in alphabetical order $ CONFIG_LOGICALS := AES,- @@ -326,7 +338,7 @@ $ $! Architecture specific rule addtions $ IF ARCH .EQS. "VAX" $ THEN -$ ! Disable algorithms that require 64 bit integers in C +$ ! Disable algorithms that require 64-bit integers in C $ CONFIG_DISABLE_RULES = CONFIG_DISABLE_RULES + - ";/GOST" + - ";/WHIRLPOOL" @@ -355,7 +367,8 @@ $ $! Apply cascading disable rules $ CONFIG_DISABLE_I = 0 $ CONFIG_DISABLE_LOOP0: -$ CONFIG_DISABLE_E = F$EDIT(F$ELEMENT(CONFIG_DISABLE_I,";",CONFIG_DISABLE_RULES),"TRIM") +$ CONFIG_DISABLE_E = F$EDIT(F$ELEMENT(CONFIG_DISABLE_I,";", - + CONFIG_DISABLE_RULES),"TRIM") $ CONFIG_DISABLE_I = CONFIG_DISABLE_I + 1 $ IF CONFIG_DISABLE_E .EQS. "" THEN GOTO CONFIG_DISABLE_LOOP0 $ IF CONFIG_DISABLE_E .EQS. ";" THEN GOTO CONFIG_DISABLE_LOOP0_END @@ -365,7 +378,8 @@ $ CONFIG_DISABLE_DEPENDENTS = F$EDIT(F$ELEMENT(1,"/",CONFIG_DISABLE_E),"TRIM") $ TO_DISABLE := YES $ CONFIG_ALGO_I = 0 $ CONFIG_DISABLE_LOOP1: -$ CONFIG_ALGO_E = F$EDIT(F$ELEMENT(CONFIG_ALGO_I,",",CONFIG_DISABLE_ALGOS),"TRIM") +$ CONFIG_ALGO_E = F$EDIT(F$ELEMENT(CONFIG_ALGO_I,",", - + CONFIG_DISABLE_ALGOS),"TRIM") $ CONFIG_ALGO_I = CONFIG_ALGO_I + 1 $ IF CONFIG_ALGO_E .EQS. "" THEN GOTO CONFIG_DISABLE_LOOP1 $ IF CONFIG_ALGO_E .EQS. "," THEN GOTO CONFIG_DISABLE_LOOP1_END @@ -382,7 +396,8 @@ $ IF TO_DISABLE $ THEN $ CONFIG_DEPENDENT_I = 0 $ CONFIG_DISABLE_LOOP2: -$ CONFIG_DEPENDENT_E = F$EDIT(F$ELEMENT(CONFIG_DEPENDENT_I,",",CONFIG_DISABLE_DEPENDENTS),"TRIM") +$ CONFIG_DEPENDENT_E = F$EDIT(F$ELEMENT(CONFIG_DEPENDENT_I,",", - + CONFIG_DISABLE_DEPENDENTS),"TRIM") $ CONFIG_DEPENDENT_I = CONFIG_DEPENDENT_I + 1 $ IF CONFIG_DEPENDENT_E .EQS. "" THEN GOTO CONFIG_DISABLE_LOOP2 $ IF CONFIG_DEPENDENT_E .EQS. "," THEN GOTO CONFIG_DISABLE_LOOP2_END @@ -390,7 +405,8 @@ $ CONFIG_DISABLED_'CONFIG_DEPENDENT_E' := YES $ CONFIG_ENABLED_'CONFIG_DEPENDENT_E' := NO $ ! Better not to assume defaults at this point... $ CONFIG_CHANGED_'CONFIG_DEPENDENT_E' := YES -$ WRITE SYS$ERROR "''CONFIG_DEPENDENT_E' disabled by rule ''CONFIG_DISABLE_E'" +$ WRITE SYS$ERROR - + "''CONFIG_DEPENDENT_E' disabled by rule ''CONFIG_DISABLE_E'" $ GOTO CONFIG_DISABLE_LOOP2 $ CONFIG_DISABLE_LOOP2_END: $ ENDIF @@ -400,7 +416,8 @@ $ $! Apply cascading enable rules $ CONFIG_ENABLE_I = 0 $ CONFIG_ENABLE_LOOP0: -$ CONFIG_ENABLE_E = F$EDIT(F$ELEMENT(CONFIG_ENABLE_I,";",CONFIG_ENABLE_RULES),"TRIM") +$ CONFIG_ENABLE_E = F$EDIT(F$ELEMENT(CONFIG_ENABLE_I,";", - + CONFIG_ENABLE_RULES),"TRIM") $ CONFIG_ENABLE_I = CONFIG_ENABLE_I + 1 $ IF CONFIG_ENABLE_E .EQS. "" THEN GOTO CONFIG_ENABLE_LOOP0 $ IF CONFIG_ENABLE_E .EQS. ";" THEN GOTO CONFIG_ENABLE_LOOP0_END @@ -410,7 +427,8 @@ $ CONFIG_ENABLE_DEPENDENTS = F$EDIT(F$ELEMENT(1,"/",CONFIG_ENABLE_E),"TRIM") $ TO_ENABLE := YES $ CONFIG_ALGO_I = 0 $ CONFIG_ENABLE_LOOP1: -$ CONFIG_ALGO_E = F$EDIT(F$ELEMENT(CONFIG_ALGO_I,",",CONFIG_ENABLE_ALGOS),"TRIM") +$ CONFIG_ALGO_E = F$EDIT(F$ELEMENT(CONFIG_ALGO_I,",", - + CONFIG_ENABLE_ALGOS),"TRIM") $ CONFIG_ALGO_I = CONFIG_ALGO_I + 1 $ IF CONFIG_ALGO_E .EQS. "" THEN GOTO CONFIG_ENABLE_LOOP1 $ IF CONFIG_ALGO_E .EQS. "," THEN GOTO CONFIG_ENABLE_LOOP1_END @@ -427,7 +445,8 @@ $ IF TO_ENABLE $ THEN $ CONFIG_DEPENDENT_I = 0 $ CONFIG_ENABLE_LOOP2: -$ CONFIG_DEPENDENT_E = F$EDIT(F$ELEMENT(CONFIG_DEPENDENT_I,",",CONFIG_ENABLE_DEPENDENTS),"TRIM") +$ CONFIG_DEPENDENT_E = F$EDIT(F$ELEMENT(CONFIG_DEPENDENT_I,",", - + CONFIG_ENABLE_DEPENDENTS),"TRIM") $ CONFIG_DEPENDENT_I = CONFIG_DEPENDENT_I + 1 $ IF CONFIG_DEPENDENT_E .EQS. "" THEN GOTO CONFIG_ENABLE_LOOP2 $ IF CONFIG_DEPENDENT_E .EQS. "," THEN GOTO CONFIG_ENABLE_LOOP2_END @@ -435,7 +454,8 @@ $ CONFIG_DISABLED_'CONFIG_DEPENDENT_E' := NO $ CONFIG_ENABLED_'CONFIG_DEPENDENT_E' := YES $ ! Better not to assume defaults at this point... $ CONFIG_CHANGED_'CONFIG_DEPENDENT_E' := YES -$ WRITE SYS$ERROR "''CONFIG_DEPENDENT_E' enabled by rule ''CONFIG_ENABLE_E'" +$ WRITE SYS$ERROR - + "''CONFIG_DEPENDENT_E' enabled by rule ''CONFIG_ENABLE_E'" $ GOTO CONFIG_ENABLE_LOOP2 $ CONFIG_ENABLE_LOOP2_END: $ ENDIF @@ -465,6 +485,17 @@ $ ENDIF $ GOTO CONFIG_LOG_LOOP2 $ CONFIG_LOG_LOOP2_END: $! +$ WRITE H_FILE "" +$ WRITE H_FILE "/* 2011-02-23 SMS." +$ WRITE H_FILE " * On VMS (V8.3), setvbuf() doesn't support a 64-bit" +$ WRITE H_FILE " * ""in"" pointer, and the help says:" +$ WRITE H_FILE " * Please note that the previously documented" +$ WRITE H_FILE " * value _IONBF is not supported." +$ WRITE H_FILE " * So, skip it on VMS." +$ WRITE H_FILE " */" +$ WRITE H_FILE "#define OPENSSL_NO_SETVBUF_IONBF" +$ WRITE H_FILE "" +$! $! Add in the common "crypto/opensslconf.h.in". $! $ TYPE 'OPENSSLCONF_H_IN' /OUTPUT=H_FILE: @@ -557,7 +588,7 @@ $ CLOSE H_FILE $! $! Purge The [.CRYPTO._xxx]OPENSSLCONF.H file $! -$ PURGE SYS$DISK:[.CRYPTO._'ARCH']OPENSSLCONF.H +$ PURGE SYS$DISK:[.CRYPTO.'ARCHD']OPENSSLCONF.H $! $! That's All, Time To RETURN. $! @@ -569,11 +600,11 @@ $ BUILDINF: $! $! Tell The User We Are Creating The [.CRYPTO._xxx]BUILDINF.H File. $! -$ WRITE SYS$OUTPUT "Creating [.CRYPTO._''ARCH']BUILDINF.H Include File." +$ WRITE SYS$OUTPUT "Creating [.CRYPTO.''ARCHD']BUILDINF.H Include File." $! $! Create The [.CRYPTO._xxx]BUILDINF.H File. $! -$ BIH_NAME = "SYS$DISK:[.CRYPTO._''ARCH']BUILDINF.H" +$ BIH_NAME = "SYS$DISK:[.CRYPTO.''ARCHD']BUILDINF.H" $ CREATE /FDL=SYS$INPUT: 'BIH_NAME' RECORD FORMAT stream_lf @@ -586,8 +617,19 @@ $ TIME = F$TIME() $! $! Write The [.CRYPTO._xxx]BUILDINF.H File. $! -$ WRITE H_FILE "#define CFLAGS ""/POINTER_SIZE=''POINTER_SIZE'""" -$ WRITE H_FILE "#define PLATFORM ""VMS ''ARCH' ''VMS_VERSION'""" +$ CFLAGS = "" +$ if (POINTER_SIZE .nes. "") +$ then +$ CFLAGS = CFLAGS+ "/POINTER_SIZE=''POINTER_SIZE'" +$ endif +$ if (ZLIB .nes. "") +$ then +$ if (CFLAGS .nes. "") then CFLAGS = CFLAGS+ " " +$ CFLAGS = CFLAGS+ "/DEFINE=ZLIB" +$ endif +$! +$ WRITE H_FILE "#define CFLAGS ""''CFLAGS'""" +$ WRITE H_FILE "#define PLATFORM ""VMS ''ARCHD' ''VMS_VERSION'""" $ WRITE H_FILE "#define DATE ""''TIME'"" " $! $! Close The [.CRYPTO._xxx]BUILDINF.H File. @@ -596,7 +638,7 @@ $ CLOSE H_FILE $! $! Purge The [.CRYPTO._xxx]BUILDINF.H File. $! -$ PURGE SYS$DISK:[.CRYPTO._'ARCH']BUILDINF.H +$ PURGE SYS$DISK:[.CRYPTO.'ARCHD']BUILDINF.H $! $! Delete [.CRYPTO]BUILDINF.H File, as there might be some residue from Unix. $! @@ -611,44 +653,58 @@ $! Copy a lot of files around. $! $ SOFTLINKS: $! -$! Tell The User We Are Partly Rebuilding The [.APPS] Directory. -$! -$ WRITE SYS$OUTPUT "Rebuilding The '[.APPS]MD4.C' File." -$! -$ DELETE SYS$DISK:[.APPS]MD4.C;* -$! -$! Copy MD4.C from [.CRYPTO.MD4] into [.APPS] -$! -$ COPY SYS$DISK:[.CRYPTO.MD4]MD4.C SYS$DISK:[.APPS] -$! -$! Tell The User We Are Rebuilding The [.INCLUDE.OPENSSL] Directory. -$! -$ WRITE SYS$OUTPUT "Rebuilding The '[.INCLUDE.OPENSSL]' Directory." -$! -$! First, make sure the directory exists -$! -$ IF F$PARSE("SYS$DISK:[.INCLUDE.OPENSSL]") .EQS. "" THEN - - CREATE/DIRECTORY SYS$DISK:[.INCLUDE.OPENSSL] +$!!!! Tell The User We Are Partly Rebuilding The [.APPS] Directory. +$!!!! +$!!! WRITE SYS$OUTPUT "Rebuilding The '[.APPS]MD4.C' File." +$!!!! +$!!! DELETE SYS$DISK:[.APPS]MD4.C;* +$!!!! +$!!!! Copy MD4.C from [.CRYPTO.MD4] into [.APPS] +$!!!! +$!!! COPY SYS$DISK:[.CRYPTO.MD4]MD4.C SYS$DISK:[.APPS] +$! +$! Ensure that the [.include.openssl] directory contains a full set of +$! real header files. The distribution kit may have left real or fake +$! symlinks there. Rather than think about what's there, simply delete +$! the destination files (fake or real symlinks) before copying the real +$! header files in. (Copying a real header file onto a real symlink +$! merely duplicates the real header file at its source.) +$! +$! Tell The User We Are Rebuilding The [.include.openssl] Directory. +$! +$ WRITE SYS$OUTPUT "Rebuilding The '[.include.openssl]' Directory." +$! +$! First, make sure the directory exists. If it did exist, delete all +$! the existing header files (or fake or real symlinks). +$! +$ if f$parse( "sys$disk:[.include.openssl]") .eqs. "" +$ then +$ create /directory sys$disk:[.include.openssl] +$ else +$ delete sys$disk:[.include.openssl]*.h;* +$ endif $! $! Copy All The ".H" Files From The Main Directory. $! $ EXHEADER := e_os2.h -$ COPY 'EXHEADER' SYS$DISK:[.INCLUDE.OPENSSL] +$ copy 'exheader' sys$disk:[.include.openssl] $! $! Copy All The ".H" Files From The [.CRYPTO] Directory Tree. $! -$ SDIRS := ,- - _'ARCH',- - OBJECTS,- - MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,WHRLPOOL,- - DES,AES,RC2,RC4,RC5,IDEA,BF,CAST,CAMELLIA,SEED,MODES,- - BN,EC,RSA,DSA,ECDSA,DH,ECDH,DSO,ENGINE,- - BUFFER,BIO,STACK,LHASH,RAND,ERR,- - EVP,ASN1,PEM,X509,X509V3,CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,- - STORE,CMS,PQUEUE,TS,JPAKE -$ EXHEADER_ := crypto.h,opensslv.h,ebcdic.h,symhacks.h,ossl_typ.h -$ EXHEADER__'ARCH' := opensslconf.h -$ EXHEADER_OBJECTS := objects.h,obj_mac.h +$ SDIRS := , - + 'ARCHD', - + OBJECTS, - + MD2, MD4, MD5, SHA, MDC2, HMAC, RIPEMD, WHRLPOOL, - + DES, AES, RC2, RC4, RC5, IDEA, BF, CAST, CAMELLIA, SEED, MODES, - + BN, EC, RSA, DSA, ECDSA, DH, ECDH, DSO, ENGINE, - + BUFFER, BIO, STACK, LHASH, RAND, ERR, - + EVP, ASN1, PEM, X509, X509V3, CONF, TXT_DB, PKCS7, PKCS12, - + COMP, OCSP, UI, KRB5, - + STORE, CMS, PQUEUE, TS, JPAKE +$! +$ EXHEADER_ := crypto.h, opensslv.h, ebcdic.h, symhacks.h, ossl_typ.h +$ EXHEADER_'ARCHD' := opensslconf.h +$ EXHEADER_OBJECTS := objects.h, obj_mac.h $ EXHEADER_MD2 := md2.h $ EXHEADER_MD4 := md4.h $ EXHEADER_MD5 := md5.h @@ -657,7 +713,7 @@ $ EXHEADER_MDC2 := mdc2.h $ EXHEADER_HMAC := hmac.h $ EXHEADER_RIPEMD := ripemd.h $ EXHEADER_WHRLPOOL := whrlpool.h -$ EXHEADER_DES := des.h,des_old.h +$ EXHEADER_DES := des.h, des_old.h $ EXHEADER_AES := aes.h $ EXHEADER_RC2 := rc2.h $ EXHEADER_RC4 := rc4.h @@ -679,66 +735,63 @@ $ EXHEADER_DSO := dso.h $ EXHEADER_ENGINE := engine.h $ EXHEADER_BUFFER := buffer.h $ EXHEADER_BIO := bio.h -$ EXHEADER_STACK := stack.h,safestack.h +$ EXHEADER_STACK := stack.h, safestack.h $ EXHEADER_LHASH := lhash.h $ EXHEADER_RAND := rand.h $ EXHEADER_ERR := err.h $ EXHEADER_EVP := evp.h -$ EXHEADER_ASN1 := asn1.h,asn1_mac.h,asn1t.h -$ EXHEADER_PEM := pem.h,pem2.h -$ EXHEADER_X509 := x509.h,x509_vfy.h +$ EXHEADER_ASN1 := asn1.h, asn1t.h, asn1_mac.h +$ EXHEADER_PEM := pem.h, pem2.h +$ EXHEADER_X509 := x509.h, x509_vfy.h $ EXHEADER_X509V3 := x509v3.h -$ EXHEADER_CONF := conf.h,conf_api.h +$ EXHEADER_CONF := conf.h, conf_api.h $ EXHEADER_TXT_DB := txt_db.h $ EXHEADER_PKCS7 := pkcs7.h $ EXHEADER_PKCS12 := pkcs12.h $ EXHEADER_COMP := comp.h $ EXHEADER_OCSP := ocsp.h -$ EXHEADER_UI := ui.h,ui_compat.h +$ EXHEADER_UI := ui.h, ui_compat.h $ EXHEADER_KRB5 := krb5_asn.h -$!EXHEADER_STORE := store.h,str_compat.h +$!!! EXHEADER_STORE := store.h, str_compat.h $ EXHEADER_STORE := store.h $ EXHEADER_CMS := cms.h $ EXHEADER_PQUEUE := pqueue.h $ EXHEADER_TS := ts.h $ EXHEADER_JPAKE := jpake.h -$ -$ I = 0 -$ LOOP_SDIRS: -$ D = F$EDIT(F$ELEMENT(I, ",", SDIRS),"TRIM") -$ I = I + 1 -$ IF D .EQS. "," THEN GOTO LOOP_SDIRS_END -$ tmp = EXHEADER_'D' -$ IF D .EQS. "" -$ THEN -$ COPY [.CRYPTO]'tmp' SYS$DISK:[.INCLUDE.OPENSSL] !/LOG -$ ELSE -$ COPY [.CRYPTO.'D']'tmp' SYS$DISK:[.INCLUDE.OPENSSL] !/LOG -$ ENDIF -$ GOTO LOOP_SDIRS -$ LOOP_SDIRS_END: +$! +$ i = 0 +$ loop_sdirs: +$ sdir = f$edit( f$element( i, ",", sdirs), "trim") +$ i = i + 1 +$ if (sdir .eqs. ",") then goto loop_sdirs_end +$ hdr_list = exheader_'sdir' +$ if (sdir .nes. "") then sdir = "."+ sdir +$ copy [.crypto'sdir']'hdr_list' sys$disk:[.include.openssl] +$ goto loop_sdirs +$ loop_sdirs_end: $! $! Copy All The ".H" Files From The [.SSL] Directory. $! -$ EXHEADER := ssl.h,ssl2.h,ssl3.h,ssl23.h,tls1.h,dtls1.h,kssl.h -$ COPY SYS$DISK:[.SSL]'EXHEADER' SYS$DISK:[.INCLUDE.OPENSSL] +$ EXHEADER := dtls1.h, kssl.h, ssl.h, ssl2.h, ssl23.h, ssl3.h, tls1.h +$ copy sys$disk:[.ssl]'exheader' sys$disk:[.include.openssl] $! -$! Purge all doubles +$! Purge the [.include.openssl] header files. $! -$ PURGE SYS$DISK:[.INCLUDE.OPENSSL]*.H +$ purge sys$disk:[.include.openssl]*.h $! $! That's All, Time To RETURN. $! $ RETURN $! -$! Build The "[.xxx.EXE.CRYPTO]LIBCRYPTO''LIB32'.OLB" Library. +$! Build The "[.xxx.EXE.CRYPTO]SSL_LIBCRYPTO''LIB32'.OLB" Library. $! $ CRYPTO: $! $! Tell The User What We Are Doing. $! $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT "Building The [.",ARCH,".EXE.CRYPTO]LIBCRYPTO''LIB32'.OLB Library." +$ WRITE SYS$OUTPUT - + "Building The [.",ARCHD,".EXE.CRYPTO]SSL_LIBCRYPTO''LIB32'.OLB Library." $! $! Go To The [.CRYPTO] Directory. $! @@ -746,11 +799,13 @@ $ SET DEFAULT SYS$DISK:[.CRYPTO] $! $! Build The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library. $! -$ @CRYPTO-LIB LIBRARY 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" "''ISSEVEN'" "''BUILDPART'" "''POINTER_SIZE'" +$ @CRYPTO-LIB LIBRARY 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" - + "''ISSEVEN'" "''BUILDPART'" "''POINTER_SIZE'" "''ZLIB'" $! $! Build The [.xxx.EXE.CRYPTO]*.EXE Test Applications. $! -$ @CRYPTO-LIB APPS 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" "''ISSEVEN'" "''BUILDPART'" "''POINTER_SIZE'" +$ @CRYPTO-LIB APPS 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" - + "''ISSEVEN'" "''BUILDPART'" "''POINTER_SIZE'" "''ZLIB'" $! $! Go Back To The Main Directory. $! @@ -760,14 +815,15 @@ $! Time To RETURN. $! $ RETURN $! -$! Build The "[.xxx.EXE.SSL]LIBSSL''LIB32'.OLB" Library. +$! Build The "[.xxx.EXE.SSL]SSL_LIBSSL''LIB32'.OLB" Library. $! $ SSL: $! $! Tell The User What We Are Doing. $! $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT "Building The [.",ARCH,".EXE.SSL]LIBSSL''LIB32'.OLB Library." +$ WRITE SYS$OUTPUT - + "Building The [.",ARCHD,".EXE.SSL]SSL_LIBSSL''LIB32'.OLB Library." $! $! Go To The [.SSL] Directory. $! @@ -775,7 +831,8 @@ $ SET DEFAULT SYS$DISK:[.SSL] $! $! Build The [.xxx.EXE.SSL]LIBSSL.OLB Library. $! -$ @SSL-LIB LIBRARY 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" "''ISSEVEN'" "''POINTER_SIZE'" +$ @SSL-LIB LIBRARY 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" - + "''ISSEVEN'" "''POINTER_SIZE'" "''ZLIB'" $! $! Go Back To The Main Directory. $! @@ -792,7 +849,8 @@ $! $! Tell The User What We Are Doing. $! $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT "Building DECNet Based SSL Engine, [.",ARCH,".EXE.SSL]SSL_TASK.EXE" +$ WRITE SYS$OUTPUT - + "Building DECNet Based SSL Engine, [.",ARCHD,".EXE.SSL]SSL_TASK.EXE" $! $! Go To The [.SSL] Directory. $! @@ -800,7 +858,8 @@ $ SET DEFAULT SYS$DISK:[.SSL] $! $! Build The [.xxx.EXE.SSL]SSL_TASK.EXE $! -$ @SSL-LIB SSL_TASK 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" "''ISSEVEN'" "''POINTER_SIZE'" +$ @SSL-LIB SSL_TASK 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" - + "''ISSEVEN'" "''POINTER_SIZE'" "''ZLIB'" $! $! Go Back To The Main Directory. $! @@ -817,7 +876,7 @@ $! $! Tell The User What We Are Doing. $! $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT "Building The OpenSSL [.",ARCH,".EXE.TEST] Test Utilities." +$ WRITE SYS$OUTPUT "Building The OpenSSL [.",ARCHD,".EXE.TEST] Test Utilities." $! $! Go To The [.TEST] Directory. $! @@ -825,7 +884,8 @@ $ SET DEFAULT SYS$DISK:[.TEST] $! $! Build The Test Programs. $! -$ @MAKETESTS 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" "''ISSEVEN'" "''POINTER_SIZE'" +$ @MAKETESTS 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" "''ISSEVEN'" - + "''POINTER_SIZE'" "''ZLIB'" $! $! Go Back To The Main Directory. $! @@ -842,7 +902,7 @@ $! $! Tell The User What We Are Doing. $! $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT "Building OpenSSL [.",ARCH,".EXE.APPS] Applications." +$ WRITE SYS$OUTPUT "Building OpenSSL [.",ARCHD,".EXE.APPS] Applications." $! $! Go To The [.APPS] Directory. $! @@ -850,7 +910,8 @@ $ SET DEFAULT SYS$DISK:[.APPS] $! $! Build The Application Programs. $! -$ @MAKEAPPS 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" "''ISSEVEN'" "" "''POINTER_SIZE'" +$ @MAKEAPPS 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" "''ISSEVEN'" - + "" "''POINTER_SIZE'" "''ZLIB'" $! $! Go Back To The Main Directory. $! @@ -867,7 +928,7 @@ $! $! Tell The User What We Are Doing. $! $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT "Building OpenSSL [.",ARCH,".EXE.ENGINES] Engines." +$ WRITE SYS$OUTPUT "Building OpenSSL [.",ARCHD,".EXE.ENGINES] Engines." $! $! Go To The [.ENGINES] Directory. $! @@ -875,7 +936,8 @@ $ SET DEFAULT SYS$DISK:[.ENGINES] $! $! Build The Application Programs. $! -$ @MAKEENGINES ENGINES 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" "''ISSEVEN'" "''BUILDPART'" "''POINTER_SIZE'" +$ @MAKEENGINES ENGINES 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" - + "''ISSEVEN'" "''BUILDPART'" "''POINTER_SIZE'" "''ZLIB'" $! $! Go Back To The Main Directory. $! @@ -954,8 +1016,8 @@ $ WRITE SYS$OUTPUT " ENGINES : To Build Just The ENGINES" $ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:" $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT " ALPHA : Alpha Architecture." -$ WRITE SYS$OUTPUT " IA64 : IA64 Architecture." +$ WRITE SYS$OUTPUT " ALPHA[64]: Alpha Architecture." +$ WRITE SYS$OUTPUT " IA64[64] : IA64 Architecture." $ WRITE SYS$OUTPUT " VAX : VAX Architecture." $ WRITE SYS$OUTPUT "" $! @@ -971,55 +1033,42 @@ $! End The P1 Check. $! $ ENDIF $! -$! Check To See If P2 Is Blank. +$! Check P2 (POINTER_SIZE). $! -$ IF (P2.EQS."") +$ IF (P2 .NES. "") .AND. (ARCH .NES. "VAX") $ THEN -$ POINTER_SIZE = "" -$ ELSE -$! -$! Check is P2 Is Valid $! -$ IF (P2.EQS."32") +$ IF (P2 .EQS. "32") $ THEN $ POINTER_SIZE = "32" -$ IF ARCH .EQS. "VAX" -$ THEN -$ LIB32 = "" -$ ELSE -$ LIB32 = "32" -$ ENDIF $ ELSE -$ IF (P2.EQS."64") +$ IF (P2 .EQS. "64") $ THEN +$ POINTER_SIZE = "64" +$ ARCHD = ARCH+ "_64" $ LIB32 = "" -$ IF ARCH .EQS. "VAX" -$ THEN -$ POINTER_SIZE = "32" -$ ELSE -$ POINTER_SIZE = "64" -$ ENDIF $ ELSE $! -$! Tell The User Entered An Invalid Option.. +$! Tell The User Entered An Invalid Option. $! $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "The Option ", P2, - + " Is Invalid. The Valid Options Are:" $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT " 32 : Compile with 32 bit pointer size" -$ WRITE SYS$OUTPUT " 64 : Compile with 64 bit pointer size" +$ WRITE SYS$OUTPUT " """" : Compile with default (short) pointers." +$ WRITE SYS$OUTPUT " 32 : Compile with 32-bit (short) pointers." +$ WRITE SYS$OUTPUT " 64 : Compile with 64-bit (long) pointers." $ WRITE SYS$OUTPUT "" -$! +$! $! Time To EXIT. $! $ GOTO TIDY $! -$! End The Valid Arguement Check. -$! $ ENDIF +$! $ ENDIF $! -$! End The P2 Check. +$! End The P2 (POINTER_SIZE) Check. $! $ ENDIF $! @@ -1049,7 +1098,7 @@ $! Else... $! $ ELSE $! -$! Tell The User Entered An Invalid Option.. +$! Tell The User Entered An Invalid Option. $! $ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" @@ -1128,7 +1177,7 @@ $! Else... $! $ ELSE $! -$! Check To See If The User Entered A Valid Paramter. +$! Check To See If The User Entered A Valid Parameter. $! $ IF (P4.EQS."VAXC").OR.(P4.EQS."DECC").OR.(P4.EQS."GNUC")!.OR.(P4.EQS."LINK") $ THEN @@ -1227,7 +1276,8 @@ $! End The P4 Check. $! $ ENDIF $! -$! Time to check the contents of P5, and to make sure we get the correct library. +$! Time to check the contents of P5, and to make sure we get the correct +$! library. $! $ IF P5.EQS."SOCKETSHR" .OR. P5.EQS."MULTINET" .OR. P5.EQS."UCX" - .OR. P5.EQS."TCPIP" .OR. P5.EQS."NONE" @@ -1240,7 +1290,7 @@ $ THEN $! $! Set the library to use SOCKETSHR $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT" +$ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS" $! $! Tell the user $! @@ -1274,7 +1324,7 @@ $ THEN $! $! Set the library to use UCX. $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT" +$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS" $! $! Tell the user $! @@ -1291,7 +1341,7 @@ $ THEN $! $! Set the library to use TCPIP (post UCX). $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT" +$ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS" $! $! Tell the user $! @@ -1401,11 +1451,69 @@ $! End The P6 Check. $! $ ENDIF $! +$! +$! Check To See If We Have A ZLIB Option. +$! +$ ZLIB = P7 +$ IF (ZLIB .NES. "") +$ THEN +$! +$! Check for expected ZLIB files. +$! +$ err = 0 +$ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY") +$ if (f$search( file1) .eqs. "") +$ then +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." +$ WRITE SYS$OUTPUT " Can't find header: ''file1'" +$ err = 1 +$ endif +$! +$ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY") +$ if (f$search( file2) .eqs. "") +$ then +$ if (err .eq. 0) +$ then +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." +$ endif +$ WRITE SYS$OUTPUT " Can't find library: ''file2'" +$ WRITE SYS$OUTPUT "" +$ err = err+ 2 +$ endif +$ if (err .eq. 1) +$ then +$ WRITE SYS$OUTPUT "" +$ endif +$! +$ if (err .ne. 0) +$ then +$ GOTO TIDY +$ endif +$! +$! Print info +$! +$ WRITE SYS$OUTPUT "ZLIB library spec: ", file2 +$! +$! End The ZLIB Check. +$! +$ ENDIF +$! $! Time To RETURN... $! $ RETURN $! $ TIDY: +$! +$! Close any open files. +$! +$ if (f$trnlnm( "h_file", "LNM$PROCESS", 0, "SUPERVISOR") .nes. "") then - + close h_file +$! +$! Restore the original default device:[directory]. +$! $ SET DEFAULT 'DEF_ORIG' +$! $ EXIT $! diff --git a/ssl/install-ssl.com b/ssl/install-ssl.com new file mode 100755 index 0000000000..1bd6ccaa7a --- /dev/null +++ b/ssl/install-ssl.com @@ -0,0 +1,136 @@ +$! INSTALL-SSL.COM -- Installs the files in a given directory tree +$! +$! Author: Richard Levitte +$! Time of creation: 22-MAY-1998 10:13 +$! +$! P1 root of the directory tree +$! P2 "64" for 64-bit pointers. +$! +$! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") +$! +$ on error then goto tidy +$ on control_c then goto tidy +$! +$ if p1 .eqs. "" +$ then +$ write sys$output "First argument missing." +$ write sys$output - + "It should be the directory where you want things installed." +$ exit +$ endif +$! +$ if (f$getsyi( "cpu") .lt. 128) +$ then +$ arch = "VAX" +$ else +$ arch = f$edit( f$getsyi( "arch_name"), "upcase") +$ if (arch .eqs. "") then arch = "UNK" +$ endif +$! +$ archd = arch +$ lib32 = "32" +$ shr = "_SHR32" +$! +$ if (p2 .nes. "") +$ then +$ if (p2 .eqs. "64") +$ then +$ archd = arch+ "_64" +$ lib32 = "" +$ shr = "_SHR" +$ else +$ if (p2 .nes. "32") +$ then +$ write sys$output "Second argument invalid." +$ write sys$output "It should be "32", "64", or nothing." +$ exit +$ endif +$ endif +$ endif +$! +$ root = f$parse( p1, "[]A.;0", , , "syntax_only, no_conceal") - "A.;0" +$ root_dev = f$parse(root,,,"device","syntax_only") +$ root_dir = f$parse(root,,,"directory","syntax_only") - - + "[000000." - "][" - "[" - "]" +$ root = root_dev + "[" + root_dir +$! +$ define /nolog wrk_sslroot 'root'.] /trans=conc +$ define /nolog wrk_sslinclude wrk_sslroot:[include] +$ define /nolog wrk_sslxexe wrk_sslroot:['archd'_exe] +$ define /nolog wrk_sslxlib wrk_sslroot:['arch'_lib] +$! +$ if f$parse("wrk_sslroot:[000000]") .eqs. "" then - + create /directory /log wrk_sslroot:[000000] +$ if f$parse("wrk_sslinclude:") .eqs. "" then - + create /directory /log wrk_sslinclude: +$ if f$parse("wrk_sslxexe:") .eqs. "" then - + create /directory /log wrk_sslxexe: +$ if f$parse("wrk_sslxlib:") .eqs. "" then - + create /directory /log wrk_sslxlib: +$! +$ exheader := ssl.h, ssl2.h, ssl3.h, ssl23.h, tls1.h, dtls1.h, kssl.h +$ e_exe := ssl_task +$ libs := ssl_libssl +$! +$ xexe_dir := [-.'archd'.exe.ssl] +$! +$ copy /protection = w:re 'exheader' wrk_sslinclude: /log +$! +$ i = 0 +$ loop_exe: +$ e = f$edit( f$element( i, ",", e_exe), "trim") +$ i = i + 1 +$ if e .eqs. "," then goto loop_exe_end +$ set noon +$ file = xexe_dir+ e+ ".exe" +$ if f$search( file) .nes. "" +$ then +$ copy /protection = w:re 'file' wrk_sslxexe: /log +$ endif +$ set on +$ goto loop_exe +$ loop_exe_end: +$! +$ i = 0 +$ loop_lib: +$ e = f$edit(f$element(i, ",", libs),"trim") +$ i = i + 1 +$ if e .eqs. "," then goto loop_lib_end +$ set noon +$! Object library. +$ file = xexe_dir+ e+ lib32+ ".olb" +$ if f$search( file) .nes. "" +$ then +$ copy /protection = w:re 'file' wrk_sslxlib: /log +$ endif +$! Shareable image. +$ file = xexe_dir+ e+ shr+ ".exe" +$ if f$search( file) .nes. "" +$ then +$ copy /protection = w:re 'file' wrk_sslxlib: /log +$ endif +$ set on +$ goto loop_lib +$ loop_lib_end: +$! +$ tidy: +$! +$ call deass wrk_sslroot +$ call deass wrk_sslinclude +$ call deass wrk_sslxexe +$ call deass wrk_sslxlib +$! +$ exit +$! +$ deass: subroutine +$ if (f$trnlnm( p1, "LNM$PROCESS") .nes. "") +$ then +$ deassign /process 'p1' +$ endif +$ endsubroutine +$! diff --git a/ssl/install.com b/ssl/install.com deleted file mode 100644 index fe1d7268e2..0000000000 --- a/ssl/install.com +++ /dev/null @@ -1,90 +0,0 @@ -$! INSTALL.COM -- Installs the files in a given directory tree -$! -$! Author: Richard Levitte -$! Time of creation: 22-MAY-1998 10:13 -$! -$! P1 root of the directory tree -$! -$ IF P1 .EQS. "" -$ THEN -$ WRITE SYS$OUTPUT "First argument missing." -$ WRITE SYS$OUTPUT - - "It should be the directory where you want things installed." -$ EXIT -$ ENDIF -$ -$ IF (F$GETSYI("CPU").LT.128) -$ THEN -$ ARCH := VAX -$ ELSE -$ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE") -$ IF (ARCH .EQS. "") THEN ARCH = "UNK" -$ ENDIF -$ -$ ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0" -$ ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY") -$ ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") - - - "[000000." - "][" - "[" - "]" -$ ROOT = ROOT_DEV + "[" + ROOT_DIR -$ -$ DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC -$ DEFINE/NOLOG WRK_SSLXLIB WRK_SSLROOT:['ARCH'_LIB] -$ DEFINE/NOLOG WRK_SSLINCLUDE WRK_SSLROOT:[INCLUDE] -$ DEFINE/NOLOG WRK_SSLXEXE WRK_SSLROOT:['ARCH'_EXE] -$ -$ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLROOT:[000000] -$ IF F$PARSE("WRK_SSLXLIB:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLXLIB: -$ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLINCLUDE: -$ IF F$PARSE("WRK_SSLXEXE:") .EQS. "" THEN - - CREATE/DIR/LOG WRK_SSLXEXE: -$ -$ EXHEADER := ssl.h,ssl2.h,ssl3.h,ssl23.h,tls1.h,dtls1.h,kssl.h -$ E_EXE := ssl_task -$ LIBS := LIBSSL,LIBSSL32 -$ -$ XEXE_DIR := [-.'ARCH'.EXE.SSL] -$ -$ COPY 'EXHEADER' WRK_SSLINCLUDE:/LOG -$ SET FILE/PROT=WORLD:RE WRK_SSLINCLUDE:'EXHEADER' -$ -$ I = 0 -$ LOOP_EXE: -$ E = F$EDIT(F$ELEMENT(I, ",", E_EXE),"TRIM") -$ I = I + 1 -$ IF E .EQS. "," THEN GOTO LOOP_EXE_END -$ SET NOON -$ IF F$SEARCH(XEXE_DIR+E+".EXE") .NES. "" -$ THEN -$ COPY 'XEXE_DIR''E'.EXE WRK_SSLXEXE:'E'.EXE/log -$ SET FILE/PROT=W:RE WRK_SSLXEXE:'E'.EXE -$ ENDIF -$ SET ON -$ GOTO LOOP_EXE -$ LOOP_EXE_END: -$ -$ I = 0 -$ LOOP_LIB: -$ E = F$EDIT(F$ELEMENT(I, ",", LIBS),"TRIM") -$ I = I + 1 -$ IF E .EQS. "," THEN GOTO LOOP_LIB_END -$ SET NOON -$! Object library. -$ IF F$SEARCH(XEXE_DIR+E+".OLB") .NES. "" -$ THEN -$ COPY 'XEXE_DIR''E'.OLB WRK_SSLXLIB:'E'.OLB/log -$ SET FILE/PROT=W:RE WRK_SSLXLIB:'E'.OLB -$ ENDIF -$! Shareable image. -$ IF F$SEARCH(XEXE_DIR+E+".EXE") .NES. "" -$ THEN -$ COPY 'XEXE_DIR''E'.EXE WRK_SSLXLIB:'E'.EXE/log -$ SET FILE/PROT=W:RE WRK_SSLXLIB:'E'.EXE -$ ENDIF -$ SET ON -$ GOTO LOOP_LIB -$ LOOP_LIB_END: -$ -$ EXIT diff --git a/ssl/ssl-lib.com b/ssl/ssl-lib.com index 35bdd34de8..4282bfb53a 100644 --- a/ssl/ssl-lib.com +++ b/ssl/ssl-lib.com @@ -42,18 +42,29 @@ $! SOCKETSHR for SOCKETSHR+NETLIB $! $! P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) $! -$! For 64 bit architectures (Alpha and IA64), specify the pointer size as P6. -$! For 32 bit architectures (VAX), P6 is ignored. -$! Currently supported values are: +$! P6, if defined, specifies the C pointer size. Ignored on VAX. +$! Supported values are: $! -$! 32 To ge a library compiled with /POINTER_SIZE=32 -$! 64 To ge a library compiled with /POINTER_SIZE=64 +$! "" Compile with default (/NOPOINTER_SIZE) +$! 32 Compile with /POINTER_SIZE=32 (SHORT) +$! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV]) $! +$! P7, if defined, specifies a directory where ZLIB files (zlib.h, +$! libz.olb) may be found. Optionally, a non-default object library +$! name may be included ("dev:[dir]libz_64.olb", for example). +$! +$! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") $! $! Define A TCP/IP Library That We Will Need To Link To. $! (That Is, If We Need To Link To One.) $! $ TCPIP_LIB = "" +$ ZLIB_LIB = "" $! $! Check What Architecture We Are Using. $! @@ -77,17 +88,33 @@ $! End The Architecture Check. $! $ ENDIF $! -$! Define The OBJ Directory. +$ ARCHD = ARCH +$ LIB32 = "32" +$ OPT_FILE = "" +$ POINTER_SIZE = "" $! -$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.SSL] +$! Check To Make Sure We Have Valid Command Line Parameters. $! -$! Define The EXE Directory. +$ GOSUB CHECK_OPTIONS $! -$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.SSL] +$! Define The OBJ and EXE Directories. $! -$! Check To Make Sure We Have Valid Command Line Parameters. +$ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.SSL] +$ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.SSL] $! -$ GOSUB CHECK_OPTIONS +$! Specify the destination directory in any /MAP option. +$! +$ if (LINKMAP .eqs. "MAP") +$ then +$ LINKMAP = LINKMAP+ "=''EXE_DIR'" +$ endif +$! +$! Add the location prefix to the linker options file name. +$! +$ if (OPT_FILE .nes. "") +$ then +$ OPT_FILE = EXE_DIR+ OPT_FILE +$ endif $! $! Initialise logical names and such $! @@ -95,7 +122,7 @@ $ GOSUB INITIALISE $! $! Tell The User What Kind of Machine We Run On. $! -$ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine." +$ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'" $! $! Check To See If The Architecture Specific OBJ Directory Exists. $! @@ -125,11 +152,11 @@ $ ENDIF $! $! Define The Library Name. $! -$ SSL_LIB := 'EXE_DIR'LIBSSL'LIB32'.OLB +$ SSL_LIB := 'EXE_DIR'SSL_LIBSSL'LIB32'.OLB $! $! Define The CRYPTO-LIB We Are To Use. $! -$ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO'LIB32'.OLB +$ CRYPTO_LIB := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO'LIB32'.OLB $! $! Check To See What We Are To Do. $! @@ -163,7 +190,7 @@ $! Compile The Library. $! $ LIBRARY: $! -$! Check To See If We Already Have A "[.xxx.EXE.SSL]LIBSSL''LIB32'.OLB" Library... +$! Check To See If We Already Have A "[.xxx.EXE.SSL]SSL_LIBSSL''LIB32'.OLB" Library... $! $ IF (F$SEARCH(SSL_LIB).EQS."") $ THEN @@ -306,38 +333,30 @@ $! Tell The User We Are Creating The SSL_TASK. $! $ WRITE SYS$OUTPUT "Creating SSL_TASK OSU HTTP SSL Engine." $! -$! Compile The File. -$! -$ ON ERROR THEN GOTO SSL_TASK_END -$ CC5/OBJECT='OBJ_DIR'SSL_TASK.OBJ SYS$DISK:[]SSL_TASK.C -$! -$! Link The Program. -$! Check To See If We Are To Link With A Specific TCP/IP Library. -$! -$ IF (TCPIP_LIB.NES."") -$ THEN -$! -$! Link With TCP/IP Library. +$! Tell The User What File We Are Compiling. $! -$ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR'SSL_TASK.EXE - - 'OBJ_DIR'SSL_TASK.OBJ, - - 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, - - 'TCPIP_LIB','OPT_FILE'/OPTION +$ FILE_NAME = "ssl_task" +$ WRITE SYS$OUTPUT " ",FILE_NAME,".c" $! -$! Else... +$! Compile The File. $! -$ ELSE +$ ON ERROR THEN GOTO SSL_TASK_END $! -$! Don't Link With TCP/IP Library. +$ write sys$output " \Using special rule (5)" +$ x = " "+ CC5 +$ write /symbol sys$output x $! -$ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR'SSL_TASK.EXE - - 'OBJ_DIR'SSL_TASK.OBJ,- - 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, - - 'OPT_FILE'/OPTION +$ CC5/OBJECT='OBJ_DIR''FILE_NAME'.OBJ SYS$DISK:[]'FILE_NAME'.C $! -$! End The TCP/IP Library Check. +$! Link The Program. $! -$ ENDIF +$ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' /EXE='EXE_DIR'SSL_TASK.EXE - + 'OBJ_DIR'SSL_TASK.OBJ, - + 'SSL_LIB'/LIBRARY, - + 'CRYPTO_LIB'/LIBRARY - + 'TCPIP_LIB' - + 'ZLIB_LIB' - + ,'OPT_FILE' /OPTIONS $! $! Time To Return. $! @@ -363,7 +382,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable VAX C Runtime Library. ! SYS$SHARE:VAXCRTL.EXE/SHARE @@ -392,7 +411,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable C Runtime Library. ! GNU_CC:[000000]GCCLIB/LIBRARY @@ -427,7 +446,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable DEC C Runtime Library. ! SYS$SHARE:DECC$SHR.EXE/SHARE @@ -442,7 +461,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File For non-VAX To Link Agianst +! Default System Options File For non-VAX To Link Against ! The Sharable C Runtime Library. ! SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE @@ -555,8 +574,8 @@ $ WRITE SYS$OUTPUT " SSL_TASK : To Compile Just The [.xxx.EXE.SSL]SSL_TA $ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:" $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT " ALPHA : Alpha Architecture." -$ WRITE SYS$OUTPUT " IA64 : IA64 Architecture." +$ WRITE SYS$OUTPUT " ALPHA[64]: Alpha Architecture." +$ WRITE SYS$OUTPUT " IA64[64] : IA64 Architecture." $ WRITE SYS$OUTPUT " VAX : VAX Architecture." $ WRITE SYS$OUTPUT "" $! @@ -577,14 +596,15 @@ $! $ IF (P2.EQS."NODEBUG") $ THEN $! -$! P2 Is NODEBUG, So Compile Without Debugger Information. +$! P2 Is NODEBUG, So Compile Without Debugger Information. $! -$ DEBUGGER = "NODEBUG" -$ TRACEBACK = "NOTRACEBACK" -$ GCC_OPTIMIZE = "OPTIMIZE" -$ CC_OPTIMIZE = "OPTIMIZE" -$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." -$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." +$ DEBUGGER = "NODEBUG" +$ LINKMAP = "NOMAP" +$ TRACEBACK = "NOTRACEBACK" +$ GCC_OPTIMIZE = "OPTIMIZE" +$ CC_OPTIMIZE = "OPTIMIZE" +$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." +$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." $! $! Else... $! @@ -598,6 +618,7 @@ $! $! Compile With Debugger Information. $! $ DEBUGGER = "DEBUG" +$ LINKMAP = "MAP" $ TRACEBACK = "TRACEBACK" $ GCC_OPTIMIZE = "NOOPTIMIZE" $ CC_OPTIMIZE = "NOOPTIMIZE" @@ -605,7 +626,7 @@ $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile." $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." $ ELSE $! -$! Tell The User Entered An Invalid Option.. +$! Tell The User Entered An Invalid Option. $! $ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" @@ -660,58 +681,49 @@ $! End The P5 Check. $! $ ENDIF $! -$! Check To See If P6 Is Blank. +$! Check P6 (POINTER_SIZE). $! -$ IF (P6.EQS."") +$ IF (P6 .NES. "") .AND. (ARCH .NES. "VAX") $ THEN -$ POINTER_SIZE = "" -$ ELSE -$! -$! Check is P6 Is Valid $! -$ IF (P6.EQS."32") +$ IF (P6 .EQS. "32") $ THEN $ POINTER_SIZE = "/POINTER_SIZE=32" -$ IF ARCH .EQS. "VAX" -$ THEN -$ LIB32 = "" -$ ELSE -$ LIB32 = "32" -$ ENDIF $ ELSE -$ IF (P6.EQS."64") +$ IF (P6 .EQS. "64") $ THEN +$ POINTER_SIZE = "/POINTER_SIZE=64" +$ ARCHD = ARCH+ "_64" $ LIB32 = "" -$ IF ARCH .EQS. "VAX" -$ THEN -$ POINTER_SIZE = "/POINTER_SIZE=32" -$ ELSE -$ POINTER_SIZE = "/POINTER_SIZE=64" -$ ENDIF $ ELSE $! -$! Tell The User Entered An Invalid Option.. +$! Tell The User Entered An Invalid Option. $! $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT "The Option ",P6," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "The Option ", P6, - + " Is Invalid. The Valid Options Are:" $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT " 32 : Compile with 32 bit pointer size" -$ WRITE SYS$OUTPUT " 64 : Compile with 64 bit pointer size" +$ WRITE SYS$OUTPUT " """" : Compile with default (short) pointers." +$ WRITE SYS$OUTPUT " 32 : Compile with 32-bit (short) pointers." +$ WRITE SYS$OUTPUT " 64 : Compile with 64-bit (long) pointers." $ WRITE SYS$OUTPUT "" -$! +$! $! Time To EXIT. $! -$ GOTO TIDY -$! -$! End The Valid Arguement Check. +$ EXIT $! $ ENDIF +$! $ ENDIF $! -$! End The P6 Check. +$! End The P6 (POINTER_SIZE) Check. $! $ ENDIF $! +$! Set basic C compiler /INCLUDE directories. +$! +$ CC_INCLUDES = "SYS$DISK:[-.CRYPTO],SYS$DISK:[-]" +$! $! Check To See If P3 Is Blank. $! $ IF (P3.EQS."") @@ -816,7 +828,60 @@ $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR" $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS $! -$! Check To See If The User Entered A Valid Paramter. +$! Check To See If We Have A ZLIB Option. +$! +$ ZLIB = P7 +$ IF (ZLIB .NES. "") +$ THEN +$! +$! Check for expected ZLIB files. +$! +$ err = 0 +$ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY") +$ if (f$search( file1) .eqs. "") +$ then +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." +$ WRITE SYS$OUTPUT " Can't find header: ''file1'" +$ err = 1 +$ endif +$ file1 = f$parse( "A.;", ZLIB)- "A.;" +$! +$ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY") +$ if (f$search( file2) .eqs. "") +$ then +$ if (err .eq. 0) +$ then +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." +$ endif +$ WRITE SYS$OUTPUT " Can't find library: ''file2'" +$ WRITE SYS$OUTPUT "" +$ err = err+ 2 +$ endif +$ if (err .eq. 1) +$ then +$ WRITE SYS$OUTPUT "" +$ endif +$! +$ if (err .ne. 0) +$ then +$ EXIT +$ endif +$! +$ CCDEFS = """ZLIB=1"", "+ CCDEFS +$ CC_INCLUDES = CC_INCLUDES+ ", "+ file1 +$ ZLIB_LIB = ", ''file2' /library" +$! +$! Print info +$! +$ WRITE SYS$OUTPUT "ZLIB library spec: ", file2 +$! +$! End The ZLIB Check. +$! +$ ENDIF +$! +$! Check To See If The User Entered A Valid Parameter. $! $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC") $ THEN @@ -839,13 +904,13 @@ $! $ CC = "CC" $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - THEN CC = "CC/DECC" -$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89''POINTER_SIZE'" + - - "/NOLIST/PREFIX=ALL" + - - "/INCLUDE=(SYS$DISK:[-.CRYPTO],SYS$DISK:[-])" + CCEXTRAFLAGS +$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=RELAXED"+ - + "''POINTER_SIZE'/NOLIST/PREFIX=ALL" + - + "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT" +$ OPT_FILE = "VAX_DECC_OPTIONS.OPT" $! $! End DECC Check. $! @@ -874,7 +939,7 @@ $ EXIT $ ENDIF $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - - "/INCLUDE=(SYS$DISK:[-.CRYPTO],SYS$DISK:[-])" + CCEXTRAFLAGS + "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS $ CCDEFS = CCDEFS + ",""VAXC""" $! $! Define As SYS$COMMON:[SYSLIB] @@ -883,7 +948,7 @@ $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT" +$ OPT_FILE = "VAX_VAXC_OPTIONS.OPT" $! $! End VAXC Check $! @@ -906,11 +971,11 @@ $! Use GNU C... $! $ IF F$TYPE(GCC) .EQS. "" THEN GCC := GCC $ CC = GCC+"/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - - "/INCLUDE=(SYS$DISK:[-.CRYPTO],SYS$DISK:[-])" + CCEXTRAFLAGS + "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT" +$ OPT_FILE = "VAX_GNUC_OPTIONS.OPT" $! $! End The GNU C Check. $! @@ -984,7 +1049,7 @@ $ THEN $! $! Set the library to use SOCKETSHR $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS" $! $! Done with SOCKETSHR $! @@ -1010,13 +1075,13 @@ $ THEN $! $! Set the library to use UCX. $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS" $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" $ THEN -$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS" $ ELSE $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - - TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT" + TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS" $ ENDIF $! $! Done with UCX @@ -1030,7 +1095,7 @@ $ THEN $! $! Set the library to use TCPIP (post UCX). $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS" $! $! Done with TCPIP $! @@ -1051,7 +1116,7 @@ $ ENDIF $! $! Print info $! -$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB +$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- "," $! $! Else The User Entered An Invalid Argument. $! diff --git a/test/bntest.com b/test/bntest.com index cb6d3abd7a..6545d2e5a5 100644 --- a/test/bntest.com +++ b/test/bntest.com @@ -4,6 +4,8 @@ $! $! Exit status = 1 (success) if all tests passed, $! 0 (warning) if any test failed. $! +$! 2011-02-20 SMS. Added code to skip "#" comments in the input file. +$! $! 2010-04-05 SMS. New. Based (loosely) on perl code in bntest-vms.sh. $! $! Expect data like: @@ -35,6 +37,11 @@ $! $ read_loop: $ read /end = read_loop_end /error = tidy result_file line $ t1 = f$element( 0, " ", line) +$! +$! Skip "#" comment lines. +$ if (f$extract( 0, 1, f$edit( line, "TRIM")) .eqs. "#") then - + goto read_loop +$! $ if (t1 .eqs. "test") $ then $ passed = passed+ 1 diff --git a/test/cms-test.pl b/test/cms-test.pl index 31b84707ad..c938bcf00d 100644 --- a/test/cms-test.pl +++ b/test/cms-test.pl @@ -56,8 +56,8 @@ my $ossl_path; my $redir = " 2> cms.err > cms.out"; # Make VMS work -if ( $^O eq "VMS" && -f "$ENV{EXE_DIR}openssl.exe" ) { - $ossl_path = "pipe mcr $ENV{EXE_DIR}openssl.exe"; +if ( $^O eq "VMS" && -f "OSSLX:openssl.exe" ) { + $ossl_path = "pipe mcr OSSLX:openssl"; } # Make MSYS work elsif ( $^O eq "MSWin32" && -f "../apps/openssl.exe" ) { diff --git a/test/maketests.com b/test/maketests.com index 5dd797e35d..1afeb4dd24 100644 --- a/test/maketests.com +++ b/test/maketests.com @@ -36,54 +36,84 @@ $! SOCKETSHR for SOCKETSHR+NETLIB $! $! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) $! -$! For 64 bit architectures (Alpha and IA64), specify the pointer size as P5. -$! For 32 bit architectures (VAX), P5 is ignored. -$! Currently supported values are: $! -$! 32 To ge a library compiled with /POINTER_SIZE=32 -$! 64 To ge a library compiled with /POINTER_SIZE=64 +$! P5, if defined, specifies the C pointer size. Ignored on VAX. +$! Supported values are: $! +$! "" Compile with default (/NOPOINTER_SIZE) +$! 32 Compile with /POINTER_SIZE=32 (SHORT) +$! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV]) +$! +$! P6, if defined, specifies a directory where ZLIB files (zlib.h, +$! libz.olb) may be found. Optionally, a non-default object library +$! name may be included ("dev:[dir]libz_64.olb", for example). +$! +$! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") $! $! Define A TCP/IP Library That We Will Need To Link To. -$! (That is, If Wee Need To Link To One.) +$! (That is, If We Need To Link To One.) $! $ TCPIP_LIB = "" +$ ZLIB_LIB = "" $! $! Check Which Architecture We Are Using. $! -$ if (f$getsyi( "HW_MODEL") .lt. 1024) +$ if (f$getsyi( "cpu") .lt. 128) $ then -$ arch = "VAX" +$ ARCH = "VAX" $ else -$ arch = "" -$ arch = arch+ f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") -$ if (arch .eqs. "") then arch = "UNK" +$ ARCH = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") +$ if (ARCH .eqs. "") then ARCH = "UNK" $ endif $! -$! Define The OBJ and EXE Directories (EXE before CHECK_OPTIONS). -$! -$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.TEST] -$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.TEST] +$ ARCHD = ARCH +$ LIB32 = "32" +$ OPT_FILE = "" +$ POINTER_SIZE = "" $! $! Check To Make Sure We Have Valid Command Line Parameters. $! $ GOSUB CHECK_OPTIONS $! +$! Define The OBJ and EXE Directories. +$! +$ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.TEST] +$ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.TEST] +$! +$! Specify the destination directory in any /MAP option. +$! +$ if (LINKMAP .eqs. "MAP") +$ then +$ LINKMAP = LINKMAP+ "=''EXE_DIR'" +$ endif +$! +$! Add the location prefix to the linker options file name. +$! +$ if (OPT_FILE .nes. "") +$ then +$ OPT_FILE = EXE_DIR+ OPT_FILE +$ endif +$! $! Initialise logical names and such $! $ GOSUB INITIALISE $! $! Tell The User What Kind of Machine We Run On. $! -$ WRITE SYS$OUTPUT "Compiling On ''ARCH'." +$ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'" $! $! Define The CRYPTO-LIB We Are To Use. $! -$ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO'LIB32'.OLB +$ CRYPTO_LIB := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO'LIB32'.OLB $! $! Define The SSL We Are To Use. $! -$ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL'LIB32'.OLB +$ SSL_LIB := SYS$DISK:[-.'ARCHD'.EXE.SSL]SSL_LIBSSL'LIB32'.OLB $! $! Create the OBJ and EXE Directories, if needed. $! @@ -231,33 +261,15 @@ $! $! Link The Program, Check To See If We Need To Link With RSAREF Or Not. $! Check To See If We Are To Link With A Specific TCP/IP Library. $! -$ IF (TCPIP_LIB.NES."") -$ THEN -$! $! Don't Link With The RSAREF Routines And TCP/IP Library. $! -$ LINK /'DEBUGGER' /'TRACEBACK' /EXECTABLE = 'EXE_FILE' - - 'OBJECT_FILE', - - 'SSL_LIB' /LIBRARY, - - 'CRYPTO_LIB' /LIBRARY, - - 'TCPIP_LIB', - - 'OPT_FILE' /OPTIONS -$! -$! Else... -$! -$ ELSE -$! -$! Don't Link With The RSAREF Routines And Link With A TCP/IP Library. -$! -$ LINK /'DEBUGGER' /'TRACEBACK' /EXECUTABLE = 'EXE_FILE' - - 'OBJECT_FILE', - - 'SSL_LIB' /LIBRARY, - - 'CRYPTO_LIB' /LIBRARY, - - 'OPT_FILE' /OPTIONS -$! -$! End The TCP/IP Library Check. -$! -$ ENDIF +$ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' /EXECTABLE = 'EXE_FILE' - + 'OBJECT_FILE', - + 'SSL_LIB' /LIBRARY, - + 'CRYPTO_LIB' /LIBRARY - + 'TCPIP_LIB' - + 'ZLIB_LIB' - + ,'OPT_FILE' /OPTIONS $! $! Go Back And Do It Again. $! @@ -321,7 +333,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable C Runtime Library. ! GNU_CC:[000000]GCCLIB.OLB /LIBRARY @@ -356,7 +368,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File To Link Agianst +! Default System Options File To Link Against ! The Sharable DEC C Runtime Library. ! SYS$SHARE:DECC$SHR.EXE /SHAREABLE @@ -371,7 +383,7 @@ $! $ CREATE 'OPT_FILE' $DECK ! -! Default System Options File For non-VAX To Link Agianst +! Default System Options File For non-VAX To Link Against ! The Sharable C Runtime Library. ! SYS$SHARE:CMA$OPEN_LIB_SHR.EXE /SHAREABLE @@ -450,19 +462,24 @@ $! Check The User's Options. $! $ CHECK_OPTIONS: $! +$! Set basic C compiler /INCLUDE directories. +$! +$ CC_INCLUDES = "SYS$DISK:[-],SYS$DISK:[-.CRYPTO]" +$! $! Check To See If P1 Is Blank. $! $ IF (P1.EQS."NODEBUG") $ THEN $! -$! P1 Is NODEBUG, So Compile Without Debugger Information. +$! P1 Is NODEBUG, So Compile Without Debugger Information. $! -$ DEBUGGER = "NODEBUG" -$ TRACEBACK = "NOTRACEBACK" -$ GCC_OPTIMIZE = "OPTIMIZE" -$ CC_OPTIMIZE = "OPTIMIZE" -$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." -$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." +$ DEBUGGER = "NODEBUG" +$ LINKMAP = "NOMAP" +$ TRACEBACK = "NOTRACEBACK" +$ GCC_OPTIMIZE = "OPTIMIZE" +$ CC_OPTIMIZE = "OPTIMIZE" +$ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." +$ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." $! $! Else... $! @@ -476,6 +493,7 @@ $! $! Compile With Debugger Information. $! $ DEBUGGER = "DEBUG" +$ LINKMAP = "MAP" $ TRACEBACK = "TRACEBACK" $ GCC_OPTIMIZE = "NOOPTIMIZE" $ CC_OPTIMIZE = "NOOPTIMIZE" @@ -486,7 +504,7 @@ $! Else... $! $ ELSE $! -$! Tell The User Entered An Invalid Option.. +$! Tell The User Entered An Invalid Option. $! $ WRITE SYS$OUTPUT "" $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:" @@ -499,7 +517,7 @@ $! Time To EXIT. $! $ EXIT $! -$! End The Valid Arguement Check. +$! End The Valid Argument Check. $! $ ENDIF $! @@ -507,55 +525,42 @@ $! End The P1 Check. $! $ ENDIF $! -$! Check To See If P5 Is Blank. +$! Check P5 (POINTER_SIZE). $! -$ IF (P5.EQS."") +$ IF (P5 .NES. "") .AND. (ARCH .NES. "VAX") $ THEN -$ POINTER_SIZE = "" -$ ELSE -$! -$! Check is P5 Is Valid $! -$ IF (P5.EQS."32") +$ IF (P5 .EQS. "32") $ THEN $ POINTER_SIZE = "/POINTER_SIZE=32" -$ IF ARCH .EQS. "VAX" -$ THEN -$ LIB32 = "" -$ ELSE -$ LIB32 = "32" -$ ENDIF $ ELSE -$ IF (P5.EQS."64") +$ IF (P5 .EQS. "64") $ THEN +$ POINTER_SIZE = "/POINTER_SIZE=64=ARGV" +$ ARCHD = ARCH+ "_64" $ LIB32 = "" -$ IF ARCH .EQS. "VAX" -$ THEN -$ POINTER_SIZE = "/POINTER_SIZE=32" -$ ELSE -$ POINTER_SIZE = "/POINTER_SIZE=64" -$ ENDIF $ ELSE $! -$! Tell The User Entered An Invalid Option.. +$! Tell The User Entered An Invalid Option. $! $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT "The Option ",P5," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "The Option ", P5, - + " Is Invalid. The Valid Options Are:" $ WRITE SYS$OUTPUT "" -$ WRITE SYS$OUTPUT " 32 : Compile with 32 bit pointer size" -$ WRITE SYS$OUTPUT " 64 : Compile with 64 bit pointer size" +$ WRITE SYS$OUTPUT " """" : Compile with default (short) pointers." +$ WRITE SYS$OUTPUT " 32 : Compile with 32-bit (short) pointers." +$ WRITE SYS$OUTPUT " 64 : Compile with 64-bit (long) pointers." $ WRITE SYS$OUTPUT "" -$! +$! $! Time To EXIT. $! -$ GOTO TIDY -$! -$! End The Valid Arguement Check. +$ EXIT $! $ ENDIF +$! $ ENDIF $! -$! End The P5 Check. +$! End The P5 (POINTER_SIZE) Check. $! $ ENDIF $! @@ -663,7 +668,60 @@ $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR" $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS $! -$! Check To See If The User Entered A Valid Paramter. +$! Check To See If We Have A ZLIB Option. +$! +$ ZLIB = P6 +$ IF (ZLIB .NES. "") +$ THEN +$! +$! Check for expected ZLIB files. +$! +$ err = 0 +$ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY") +$ if (f$search( file1) .eqs. "") +$ then +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." +$ WRITE SYS$OUTPUT " Can't find header: ''file1'" +$ err = 1 +$ endif +$ file1 = f$parse( "A.;", ZLIB)- "A.;" +$! +$ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY") +$ if (f$search( file2) .eqs. "") +$ then +$ if (err .eq. 0) +$ then +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." +$ endif +$ WRITE SYS$OUTPUT " Can't find library: ''file2'" +$ WRITE SYS$OUTPUT "" +$ err = err+ 2 +$ endif +$ if (err .eq. 1) +$ then +$ WRITE SYS$OUTPUT "" +$ endif +$! +$ if (err .ne. 0) +$ then +$ GOTO EXIT +$ endif +$! +$ CCDEFS = """ZLIB=1"", "+ CCDEFS +$ CC_INCLUDES = CC_INCLUDES+ ", "+ file1 +$ ZLIB_LIB = ", ''file2' /library" +$! +$! Print info +$! +$ WRITE SYS$OUTPUT "ZLIB library spec: ", file2 +$! +$! End The P8 Check. +$! +$ ENDIF +$! +$! Check To See If The User Entered A Valid Parameter. $! $ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC") $ THEN @@ -686,13 +744,13 @@ $! $ CC = "CC" $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - THEN CC = "CC /DECC" -$ CC = CC + "/''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=ANSI89 ''POINTER_SIZE'" + - - "/NOLIST /PREFIX=ALL" + - - "/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS +$ CC = CC + "/''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ - + "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + - + "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT" +$ OPT_FILE = "VAX_DECC_OPTIONS.OPT" $! $! End DECC Check. $! @@ -721,7 +779,7 @@ $ EXIT $ ENDIF $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC /VAXC" $ CC = CC + "/''CC_OPTIMIZE' /''DEBUGGER' /NOLIST" + - - "/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS + "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS $ CCDEFS = CCDEFS + ",""VAXC""" $! $! Define As SYS$COMMON:[SYSLIB] @@ -730,7 +788,7 @@ $ DEFINE /NOLOG SYS SYS$COMMON:[SYSLIB] $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT" +$ OPT_FILE = "VAX_VAXC_OPTIONS.OPT" $! $! End VAXC Check $! @@ -752,11 +810,11 @@ $! $! Use GNU C... $! $ CC = "GCC /NOCASE_HACK /''GCC_OPTIMIZE' /''DEBUGGER' /NOLIST" + - - "/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS + "/INCLUDE=(''CC_INCLUDES')" + CCEXTRAFLAGS $! $! Define The Linker Options File Name. $! -$ OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT" +$ OPT_FILE = "VAX_GNUC_OPTIONS.OPT" $! $! End The GNU C Check. $! @@ -788,7 +846,7 @@ $! Show user the result $! $ WRITE /SYMBOL SYS$OUTPUT "Main Compiling Command: ", CC $! -$! Else The User Entered An Invalid Arguement. +$! Else The User Entered An Invalid Argument. $! $ ELSE $! @@ -820,7 +878,7 @@ $ THEN $! $! Set the library to use SOCKETSHR $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS" $! $! Done with SOCKETSHR $! @@ -846,13 +904,13 @@ $ THEN $! $! Set the library to use UCX. $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS" $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" $ THEN -$ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS" $ ELSE $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - - TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS" + TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS" $ ENDIF $! $! Done with UCX @@ -866,7 +924,7 @@ $ THEN $! $! Set the library to use TCPIP (post UCX). $! -$ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS" +$ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS" $! $! Done with TCPIP $! @@ -887,9 +945,9 @@ $ ENDIF $! $! Print info $! -$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB +$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- "," $! -$! Else The User Entered An Invalid Arguement. +$! Else The User Entered An Invalid Argument. $! $ ELSE $! diff --git a/test/tcrl.com b/test/tcrl.com index 1f606eb850..dd96a2b6dd 100644 --- a/test/tcrl.com +++ b/test/tcrl.com @@ -1,14 +1,17 @@ $! TCRL.COM -- Tests crl keys $ -$ __arch := VAX +$ __arch = "VAX" $ 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] +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p2 .eqs. "64") then __arch = __arch+ "_64" +$! +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" $ -$ cmd := mcr 'exe_dir'openssl crl +$ cmd = "mcr ''exe_dir'openssl crl" $ -$ t := testcrl.pem +$ t = "testcrl.pem" $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing CRL conversions" diff --git a/test/testca.com b/test/testca.com index ec7e56dad6..78cda9ec5a 100644 --- a/test/testca.com +++ b/test/testca.com @@ -1,11 +1,13 @@ $! TESTCA.COM $ -$ __arch := VAX +$ __arch = "VAX" $ if f$getsyi("cpu") .ge. 128 then - __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") -$ if __arch .eqs. "" then __arch := UNK +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p1 .eqs. "64") then __arch = __arch+ "_64" $ -$ openssl := mcr 'exe_dir'openssl +$ openssl = "mcr ''exe_dir'openssl" $ $ SSLEAY_CONFIG="-config ""CAss.cnf""" $ diff --git a/test/testenc.com b/test/testenc.com index 621d9a2126..75acd6f07f 100644 --- a/test/testenc.com +++ b/test/testenc.com @@ -1,13 +1,16 @@ $! TESTENC.COM -- Test encoding and decoding $ -$ __arch := VAX +$ __arch = "VAX" $ if f$getsyi("cpu") .ge. 128 then - __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") -$ if __arch .eqs. "" then __arch := UNK +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p1 .eqs. 64) then __arch = __arch+ "_64" $ -$ testsrc := makefile. -$ test := p.txt -$ cmd := mcr 'exe_dir'openssl +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" +$ testsrc = "makefile." +$ test = "p.txt" +$ cmd = "mcr ''exe_dir'openssl" $ $ if f$search(test) .nes. "" then delete 'test';* $ convert/fdl=sys$input: 'testsrc' 'test' diff --git a/test/testgen.com b/test/testgen.com index a4bc574bec..e076da2f30 100644 --- a/test/testgen.com +++ b/test/testgen.com @@ -1,14 +1,15 @@ -$! TETSGEN.COM +$! TESTGEN.COM $ -$ __arch := VAX +$ __arch = "VAX" $ 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] +$ if __arch .eqs. "" then __arch = "UNK" +$ if (p1 .eqs. 64) then __arch = __arch+ "_64" +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" $ -$ T := testcert +$ T = "testcert" $ KEY = 512 -$ CA := [-.certs]testca.pem +$ CA = "[-.certs]testca.pem" $ $ set noon $ if f$search(T+".1;*") .nes. "" then delete 'T'.1;* @@ -20,7 +21,8 @@ $ write sys$output "generating certificate request" $ $ append/new nl: .rnd $ open/append random_file .rnd -$ write random_file "string to make the random number generator think it has entropy" +$ write random_file - + "string to make the random number generator think it has entropy" $ close random_file $ $ set noon @@ -33,8 +35,10 @@ $ then $ req_new="-newkey dsa:[-.apps]dsa512.pem" $ else $ req_new="-new" -$ write sys$output "There should be a 2 sequences of .'s and some +'s." -$ write sys$output "There should not be more that at most 80 per line" +$ write sys$output - + "There should be a 2 sequences of .'s and some +'s." +$ write sys$output - + "There should not be more that at most 80 per line" $ endif $ $ write sys$output "This could take some time." diff --git a/test/tests.com b/test/tests.com index f3193d0264..373dd16eac 100644 --- a/test/tests.com +++ b/test/tests.com @@ -1,16 +1,32 @@ $! TESTS.COM -- Performs the necessary tests $! $! P1 tests to be performed. Empty means all. -$ +$! P2 Pointer size: "", "32", or "64". +$! +$! Announce/identify. +$! +$ proc = f$environment( "procedure") +$ write sys$output "@@@ "+ - + f$parse( proc, , , "name")+ f$parse( proc, , , "type") +$! $ __proc = f$element(0,";",f$environment("procedure")) $ __here = f$parse(f$parse("A.;",__proc) - "A.;","[]A.;") - "A.;" $ __save_default = f$environment("default") -$ __arch := VAX +$ __arch = "VAX" $ 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] +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ __archd = __arch +$ pointer_size = "" +$ if (p2 .eq. "64") +$ then +$ pointer_size = "64" +$ __archd = __arch+ "_64" +$ endif +$! +$ texe_dir := sys$disk:[-.'__archd'.exe.test] +$ exe_dir := sys$disk:[-.'__archd'.exe.apps] $ $ set default '__here' $ @@ -76,7 +92,7 @@ $ EVPTEST := evp_test $ IGETEST := igetest $ JPAKETEST := jpaketest $ ASN1TEST := asn1test -$ +$! $ tests_i = 0 $ loop_tests: $ tests_e = f$element(tests_i,",",tests) @@ -139,58 +155,69 @@ $ test_rand: $ mcr 'texe_dir''randtest' $ return $ test_enc: -$ @testenc.com +$ @testenc.com 'pointer_size' $ return $ test_x509: -$ define sys$error nla0: +$ set noon +$ define sys$error test_x509.err $ write sys$output "test normal x509v1 certificate" -$ @tx509.com +$ @tx509.com "" 'pointer_size' $ write sys$output "test first x509v3 certificate" -$ @tx509.com v3-cert1.pem +$ @tx509.com v3-cert1.pem 'pointer_size' $ write sys$output "test second x509v3 certificate" -$ @tx509.com v3-cert2.pem +$ @tx509.com v3-cert2.pem 'pointer_size' $ deassign sys$error +$ set on $ return $ test_rsa: -$ define sys$error nla0: -$ @trsa.com +$ set noon +$ define sys$error test_rsa.err +$ @trsa.com "" 'pointer_size' $ deassign sys$error $ mcr 'texe_dir''rsatest' +$ set on $ return $ test_crl: -$ define sys$error nla0: -$ @tcrl.com +$ set noon +$ define sys$error test_crl.err +$ @tcrl.com "" 'pointer_size' $ deassign sys$error +$ set on $ return $ test_sid: -$ define sys$error nla0: -$ @tsid.com +$ set noon +$ define sys$error test_sid.err +$ @tsid.com "" 'pointer_size' $ deassign sys$error +$ set on $ return $ test_req: -$ define sys$error nla0: -$ @treq.com -$ @treq.com testreq2.pem +$ set noon +$ define sys$error test_req.err +$ @treq.com "" 'pointer_size' +$ @treq.com testreq2.pem 'pointer_size' $ deassign sys$error +$ set on $ return $ test_pkcs7: -$ define sys$error nla0: -$ @tpkcs7.com -$ @tpkcs7d.com +$ set noon +$ define sys$error test_pkcs7.err +$ @tpkcs7.com "" 'pointer_size' +$ @tpkcs7d.com "" 'pointer_size' $ deassign sys$error +$ set on $ return $ test_bn: $ write sys$output - "starting big number library test, could take a while..." $ set noon -$ define sys$error nl: -$ define sys$output nl: +$ define sys$error test_bn.err +$ define sys$output test_bn.out $ @ bctest.com $ status = $status $ deassign sys$error $ deassign sys$output -$ on control_y then goto exit -$ on error then goto exit +$ set on $ if (status) $ then $ create /fdl = sys$input bntest-vms.tmp @@ -219,7 +246,7 @@ RECORD $ open /append bntest_file bntest-vms.sh $ type /output = bntest_file sys$input: << __FOO__ sh -c "`sh ./bctest`" | perl -e '$i=0; while () {if (/^test (.*)/) {print STDERR "\nverify $1";} elsif (!/^0$/) {die "\nFailed! bc: $_";} else {print STDERR "."; $i++;}} print STDERR "\n$i tests passed\n"' -$ define/user sys$output bntest-vms.tmp +$ define /user_mode sys$output bntest-vms.tmp $ mcr 'texe_dir''bntest' $ copy bntest-vms.tmp bntest_file $ delete bntest-vms.tmp;* @@ -249,7 +276,7 @@ $ return $ test_verify: $ write sys$output "The following command should have some OK's and some failures" $ write sys$output "There are definitly a few expired certificates" -$ @tverify.com +$ @tverify.com 'pointer_size' $ return $ test_dh: $ write sys$output "Generate a set of DH parameters" @@ -261,7 +288,7 @@ $ mcr 'texe_dir''dsatest' $ return $ test_gen: $ write sys$output "Generate and verify a certificate request" -$ @testgen.com +$ @testgen.com 'pointer_size' $ return $ maybe_test_ss: $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT")) @@ -274,7 +301,7 @@ $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then - $ return $ test_ss: $ write sys$output "Generate and certify a test certificate" -$ @testss.com +$ @testss.com 'pointer_size' $ return $ test_engine: $ write sys$output "Manipulate the ENGINE structures" @@ -283,11 +310,11 @@ $ return $ test_ssl: $ write sys$output "test SSL protocol" $ gosub maybe_test_ss -$ @testssl.com keyU.ss certU.ss certCA.ss +$ @testssl.com keyU.ss certU.ss certCA.ss 'pointer_size' $ return $ test_ca: $ set noon -$ define/user sys$output nla0: +$ define /user_mode sys$output test_ca.out $ mcr 'exe_dir'openssl no-rsa $ save_severity=$SEVERITY $ set on @@ -296,7 +323,7 @@ $ then $ write sys$output "skipping CA.com test -- requires RSA" $ else $ write sys$output "Generate and certify a test certificate via the 'ca' program" -$ @testca.com +$ @testca.com 'pointer_size' $ endif $ return $ test_aes: @@ -305,7 +332,7 @@ $! !mcr 'texe_dir''aestest' $ return $ test_tsa: $ set noon -$ define/user sys$output nla0: +$ define /user_mode sys$output nla0: $ mcr 'exe_dir'openssl no-rsa $ save_severity=$SEVERITY $ set on @@ -313,7 +340,7 @@ $ if save_severity $ then $ write sys$output "skipping testtsa.com test -- requires RSA" $ else -$ @testtsa.com +$ @testtsa.com "" "" "" 'pointer_size' $ endif $ return $ test_ige: @@ -326,8 +353,8 @@ $ mcr 'texe_dir''jpaketest' $ return $ test_cms: $ write sys$output "CMS consistency test" -$ ! The following makes perl include the DCL symbol table in the env. -$ define/user perl_env_tables clisym_local,lnm$file_dev,ctrl_env +$ ! Define the logical name used to find openssl.exe in the perl script. +$ define /user_mode osslx 'exe_dir' $ perl CMS-TEST.PL $ return $ diff --git a/test/testss.com b/test/testss.com index 6598106b09..32a74d0fc2 100644 --- a/test/testss.com +++ b/test/testss.com @@ -1,16 +1,19 @@ $! TESTSS.COM $ -$ __arch := VAX +$ __arch = "VAX" $ 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] +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p1 .eqs. "64") then __arch = __arch+ "_64" +$! +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" $ $ digest="-md5" -$ reqcmd := mcr 'exe_dir'openssl req -$ x509cmd := mcr 'exe_dir'openssl x509 'digest' -$ verifycmd := mcr 'exe_dir'openssl verify -$ dummycnf := sys$disk:[-.apps]openssl-vms.cnf +$ reqcmd = "mcr ''exe_dir'openssl req" +$ x509cmd = "mcr ''exe_dir'openssl x509 ''digest'" +$ verifycmd = "mcr ''exe_dir'openssl verify" +$ dummycnf = "sys$disk:[-.apps]openssl-vms.cnf" $ $ CAkey="""keyCA.ss""" $ CAcert="""certCA.ss""" diff --git a/test/testssl.com b/test/testssl.com index 88580291f1..f19edc4719 100644 --- a/test/testssl.com +++ b/test/testssl.com @@ -1,11 +1,14 @@ $! TESTSSL.COM $ -$ __arch := VAX +$ __arch = "VAX" $ 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] +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p4 .eqs. "64") then __arch = __arch+ "_64" +$! +$ texe_dir = "sys$disk:[-.''__arch'.exe.test]" +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" $ $ if p1 .eqs. "" $ then @@ -19,8 +22,9 @@ $ cert="[-.apps]server.pem" $ else $ cert=p2 $ endif -$ ssltest := mcr 'texe_dir'ssltest -key 'key' -cert 'cert' -c_key 'key' -c_cert 'cert' -$ +$ ssltest = "mcr ''texe_dir'ssltest -key ''key'"+ - + " -cert ''cert' -c_key ''key' -c_cert ''cert'" +$! $ set noon $ define/user sys$output testssl-x509-output. $ define/user sys$error nla0: @@ -29,9 +33,9 @@ $ define/user sys$error nla0: $ search/output=nla0: testssl-x509-output. "DSA Public Key"/exact $ if $severity .eq. 1 $ then -$ dsa_cert := YES +$ dsa_cert = "YES" $ else -$ dsa_cert := NO +$ dsa_cert = "NO" $ endif $ delete testssl-x509-output.;* $ diff --git a/test/testtsa.com b/test/testtsa.com index 2ca1adac59..29fb1d0e63 100644 --- a/test/testtsa.com +++ b/test/testtsa.com @@ -2,14 +2,17 @@ $! $! A few very basic tests for the 'ts' time stamping authority command. $! $ -$ __arch := VAX +$ __arch = "VAX" $ 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] +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p4 .eqs. "64") then __arch = __arch+ "_64" +$! +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" $ -$ openssl := mcr 'f$parse(exe_dir+"openssl.exe")' -$ OPENSSL_CONF := [-]CAtsa.cnf +$ openssl = "mcr ''f$parse(exe_dir+"openssl.exe")'" +$ OPENSSL_CONF = "[-]CAtsa.cnf" $ ! Because that's what ../apps/CA.sh really looks at $ SSLEAY_CONFIG = "-config " + OPENSSL_CONF $ @@ -114,8 +117,8 @@ $ $ time_stamp_response_token_test: $ subroutine $ -$ RESPONSE2:='p2'.copy_tsr -$ TOKEN_DER:='p2'.token_der +$ RESPONSE2 = p2+ "-copy_tsr" +$ TOKEN_DER = p2+ "-token_der" $ openssl ts -reply -in 'p2' -out 'TOKEN_DER' -token_out $ if $severity .ne. 1 then call error $ openssl ts -reply -in 'TOKEN_DER' -token_in -out 'RESPONSE2' @@ -145,13 +148,13 @@ $ verify_time_stamp_token: $ subroutine $ $ ! create the token from the response first -$ openssl ts -reply -in 'p2' -out 'p2'.token -token_out +$ openssl ts -reply -in "''p2'" -out "''p2'-token" -token_out $ if $severity .ne. 1 then call error -$ openssl ts -verify -queryfile 'p1' -in 'p2'.token -token_in - - "-CAfile" tsaca.pem -untrusted tsa_cert1.pem +$ openssl ts -verify -queryfile "''p1'" -in "''p2'-token" - + -token_in "-CAfile" tsaca.pem -untrusted tsa_cert1.pem $ if $severity .ne. 1 then call error -$ openssl ts -verify -data 'p3' -in 'p2'.token -token_in - - "-CAfile" tsaca.pem -untrusted tsa_cert1.pem +$ openssl ts -verify -data "''p3'" -in "''p2'-token" - + -token_in "-CAfile" tsaca.pem -untrusted tsa_cert1.pem $ if $severity .ne. 1 then call error $ endsubroutine $ @@ -185,64 +188,64 @@ $ write sys$output "Creating req1.req time stamp request for file testtsa..." $ call create_time_stamp_request1 $ $ write sys$output "Printing req1.req..." -$ call print_request req1.tsq +$ call print_request "req1.tsq" $ $ write sys$output "Generating valid response for req1.req..." -$ call create_time_stamp_response req1.tsq resp1.tsr tsa_config1 +$ call create_time_stamp_response "req1.tsq" "resp1.tsr" "tsa_config1" $ $ write sys$output "Printing response..." -$ call print_response resp1.tsr +$ call print_response "resp1.tsr" $ $ write sys$output "Verifying valid response..." -$ call verify_time_stamp_response req1.tsq resp1.tsr [-]testtsa.com +$ call verify_time_stamp_response "req1.tsq" "resp1.tsr" "[-]testtsa.com" $ $ write sys$output "Verifying valid token..." -$ call verify_time_stamp_token req1.tsq resp1.tsr [-]testtsa.com +$ call verify_time_stamp_token "req1.tsq" "resp1.tsr" "[-]testtsa.com" $ $ ! The tests below are commented out, because invalid signer certificates $ ! can no longer be specified in the config file. $ $ ! write sys$output "Generating _invalid_ response for req1.req..." -$ ! call create_time_stamp_response req1.tsq resp1_bad.tsr tsa_config2 +$ ! call create_time_stamp_response "req1.tsq" "resp1_bad.tsr" "tsa_config2" $ $ ! write sys$output "Printing response..." -$ ! call print_response resp1_bad.tsr +$ ! call print_response "resp1_bad.tsr" $ $ ! write sys$output "Verifying invalid response, it should fail..." -$ ! call verify_time_stamp_response_fail req1.tsq resp1_bad.tsr +$ ! call verify_time_stamp_response_fail "req1.tsq" "resp1_bad.tsr" $ $ write sys$output "Creating req2.req time stamp request for file testtsa..." $ call create_time_stamp_request2 $ $ write sys$output "Printing req2.req..." -$ call print_request req2.tsq +$ call print_request "req2.tsq" $ $ write sys$output "Generating valid response for req2.req..." -$ call create_time_stamp_response req2.tsq resp2.tsr tsa_config1 +$ call create_time_stamp_response "req2.tsq" "resp2.tsr" "tsa_config1" $ $ write sys$output "Checking '-token_in' and '-token_out' options with '-reply'..." -$ call time_stamp_response_token_test req2.tsq resp2.tsr +$ call time_stamp_response_token_test "req2.tsq" "resp2.tsr" $ $ write sys$output "Printing response..." -$ call print_response resp2.tsr +$ call print_response "resp2.tsr" $ $ write sys$output "Verifying valid response..." -$ call verify_time_stamp_response req2.tsq resp2.tsr [-]testtsa.com +$ call verify_time_stamp_response "req2.tsq" "resp2.tsr" "[-]testtsa.com" $ $ write sys$output "Verifying response against wrong request, it should fail..." -$ call verify_time_stamp_response_fail req1.tsq resp2.tsr +$ call verify_time_stamp_response_fail "req1.tsq" "resp2.tsr" $ $ write sys$output "Verifying response against wrong request, it should fail..." -$ call verify_time_stamp_response_fail req2.tsq resp1.tsr +$ call verify_time_stamp_response_fail "req2.tsq" "resp1.tsr" $ $ write sys$output "Creating req3.req time stamp request for file CAtsa.cnf..." $ call create_time_stamp_request3 $ $ write sys$output "Printing req3.req..." -$ call print_request req3.tsq +$ call print_request "req3.tsq" $ $ write sys$output "Verifying response against wrong request, it should fail..." -$ call verify_time_stamp_response_fail req3.tsq resp1.tsr +$ call verify_time_stamp_response_fail "req3.tsq" "resp1.tsr" $ $ write sys$output "Cleaning up..." $ call clean_up_dir diff --git a/test/tpkcs7.com b/test/tpkcs7.com index e107cc141a..3fc4982bb0 100644 --- a/test/tpkcs7.com +++ b/test/tpkcs7.com @@ -1,14 +1,17 @@ $! TPKCS7.COM -- Tests pkcs7 keys $ -$ __arch := VAX +$ __arch = "VAX" $ 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] +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p2 .eqs. "64") then __arch = __arch+ "_64" +$! +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" $ -$ cmd := mcr 'exe_dir'openssl pkcs7 +$ cmd = "mcr ''exe_dir'openssl pkcs7" $ -$ t := testp7.pem +$ t = "testp7.pem" $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing PKCS7 conversions" diff --git a/test/tpkcs7d.com b/test/tpkcs7d.com index 5ff653ccee..eea8c888ee 100644 --- a/test/tpkcs7d.com +++ b/test/tpkcs7d.com @@ -1,14 +1,17 @@ $! TPKCS7.COM -- Tests pkcs7 keys $ -$ __arch := VAX +$ __arch = "VAX" $ 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] +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p2 .eqs. "64") then __arch = __arch+ "_64" +$! +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" $ -$ cmd := mcr 'exe_dir'openssl pkcs7 +$ cmd = "mcr ''exe_dir'openssl pkcs7" $ -$ t := pkcs7-1.pem +$ t = "pkcs7-1.pem" $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing PKCS7 conversions (2)" diff --git a/test/treq.com b/test/treq.com index d2594be6a7..acf08b79ef 100644 --- a/test/treq.com +++ b/test/treq.com @@ -1,14 +1,17 @@ $! TREQ.COM -- Tests req keys $ -$ __arch := VAX +$ __arch = "VAX" $ 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] +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p2 .eqs. "64") then __arch = __arch+ "_64" +$! +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" $ -$ cmd := mcr 'exe_dir'openssl req -config [-.apps]openssl-vms.cnf +$ cmd = "mcr ''exe_dir'openssl req -config [-.apps]openssl-vms.cnf" $ -$ t := testreq.pem +$ t = "testreq.pem" $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing req conversions" diff --git a/test/trsa.com b/test/trsa.com index d3a8a605b7..54180843ee 100644 --- a/test/trsa.com +++ b/test/trsa.com @@ -1,10 +1,13 @@ $! TRSA.COM -- Tests rsa keys $ -$ __arch := VAX +$ __arch = "VAX" $ 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] +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p2 .eqs. "64") then __arch = __arch+ "_64" +$! +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" $ $ set noon $ define/user sys$output nla0: @@ -17,9 +20,9 @@ $ write sys$output "skipping RSA conversion test" $ exit $ endif $ -$ cmd := mcr 'exe_dir'openssl rsa +$ cmd = "mcr ''exe_dir'openssl rsa" $ -$ t := testrsa.pem +$ t = "testrsa.pem" $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing RSA conversions" diff --git a/test/tsid.com b/test/tsid.com index 267ace1135..b6c4e49473 100644 --- a/test/tsid.com +++ b/test/tsid.com @@ -1,14 +1,17 @@ $! TSID.COM -- Tests sid keys $ -$ __arch := VAX +$ __arch = "VAX" $ 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] +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p2 .eqs. "64") then __arch = __arch+ "_64" +$! +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" $ -$ cmd := mcr 'exe_dir'openssl sess_id +$ cmd = "mcr ''exe_dir'openssl sess_id" $ -$ t := testsid.pem +$ t = "testsid.pem" $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing session-id conversions" diff --git a/test/tverify.com b/test/tverify.com index 01431f4aac..d888344637 100644 --- a/test/tverify.com +++ b/test/tverify.com @@ -1,13 +1,15 @@ $! TVERIFY.COM $ -$ __arch := VAX +$ __arch = "VAX" $ if f$getsyi("cpu") .ge. 128 then - __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") -$ if __arch .eqs. "" then __arch := UNK +$ 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] +$ 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" @@ -19,7 +21,7 @@ $! $! Loop through all the certificate files. $! $ args = "" -$ old_f := +$ old_f = "" $ loop_file: $ f = f$search( pems) $ if ((f .nes. "") .and. (f .nes. old_f)) diff --git a/test/tx509.com b/test/tx509.com index 399eb01490..93ce988b41 100644 --- a/test/tx509.com +++ b/test/tx509.com @@ -1,14 +1,17 @@ $! TX509.COM -- Tests x509 certificates $ -$ __arch := VAX +$ __arch = "VAX" $ 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] +$ if __arch .eqs. "" then __arch = "UNK" +$! +$ if (p2 .eqs. "64") then __arch = __arch+ "_64" +$! +$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]" $ -$ cmd := mcr 'exe_dir'openssl x509 +$ cmd = "mcr ''exe_dir'openssl x509" $ -$ t := testx509.pem +$ t = "testx509.pem" $ if p1 .nes. "" then t = p1 $ $ write sys$output "testing X509 conversions" diff --git a/util/libeay.num b/util/libeay.num index 08808fec5d..d29cfeae79 100755 --- a/util/libeay.num +++ b/util/libeay.num @@ -4189,3 +4189,4 @@ CRYPTO_cts128_encrypt_block 4560 EXIST::FUNCTION: CRYPTO_cbc128_decrypt 4561 EXIST::FUNCTION: CRYPTO_cfb128_encrypt 4562 EXIST::FUNCTION: CRYPTO_cfb128_8_encrypt 4563 EXIST::FUNCTION: +OPENSSL_strcasecmp 4594 EXIST::FUNCTION: -- 2.25.1