After some adjustments, apply the changes OpenSSL 1.0.0d on OpenVMS

submitted by Steven M. Schweda <sms@antinode.info>
This commit is contained in:
Richard Levitte 2011-03-19 10:58:14 +00:00
parent 5904882eaa
commit 537c982306
53 changed files with 3198 additions and 1688 deletions

View file

@ -71,7 +71,7 @@ the top to understand how to use them. However, if you want to
compile all you can get, the simplest is to use MAKEVMS.COM in the top
directory. The syntax is the following:
@MAKEVMS <option> <rsaref-p> <debug-p> [<compiler>]
@MAKEVMS <option> <bits> <debug-p> [<compiler>]
<option> must be one of the following:
@ -87,24 +87,11 @@ directory. The syntax is the following:
TEST Just build the "[.xxx.EXE.TEST]" test programs for OpenSSL.
APPS Just build the "[.xxx.EXE.APPS]" application programs for OpenSSL.
<rsaref-p> must be one of the following:
<bits> must be one of the following:
RSAREF compile using the RSAREF Library
NORSAREF compile without using RSAREF
Note 0: The RSAREF library IS NO LONGER NEEDED. The RSA patent
expires September 20, 2000, and RSA Security chose to make
the algorithm public domain two weeks before that.
Note 1: If you still want to use RSAREF, the library is NOT INCLUDED
and you have to download it. RSA Security doesn't carry it
any more, but there are a number of places where you can find
it. You have to get the ".tar-Z" file as the ".zip" file
doesn't have the directory structure stored. You have to
extract the file into the [.RSAREF] directory as that is where
the scripts will look for the files.
Note 2: I have never done this, so I've no idea if it works or not.
"" compile using default pointer size
32 compile using 32 bit pointer size
64 compile using 64 bit pointer size
<debug-p> must be one of the following:
@ -117,12 +104,13 @@ Note 2: I have never done this, so I've no idea if it works or not.
GNUC For GNU C.
You will find the crypto library in [.xxx.EXE.CRYPTO], called LIBCRYPTO.OLB,
where xxx is VAX or AXP. You will find the SSL library in [.xxx.EXE.SSL],
named LIBSSL.OLB, and you will find a bunch of useful programs in
[.xxx.EXE.APPS]. However, these shouldn't be used right off unless it's
just to test them. For production use, make sure you install first, see
Installation below.
You will find the crypto library in [.xxx.EXE.CRYPTO] (where xxx is VAX,
ALPHA or IA64), called SSL_LIBCRYPTO32.OLB or SSL_LIBCRYPTO.OLB depending
on how it was built. You will find the SSL library in [.xxx.EXE.SSL],
named SSL_LIBSSL32.OLB or SSL_LIBSSL.OLB, and you will find a bunch of
useful programs in [.xxx.EXE.APPS]. However, these shouldn't be used
right off unless it's just to test them. For production use, make sure
you install first, see Installation below.
Note 1: Some programs in this package require a TCP/IP library.
@ -170,12 +158,14 @@ Installation:
Installation is easy, just do the following:
@INSTALL <root>
@INSTALL <root> <bits>
<root> is the directory in which everything will be installed,
subdirectories, libraries, header files, programs and startup command
procedures.
<bits> works the same way as for MAKEVMS.COM
N.B.: INSTALL.COM builds a new directory structure, different from
the directory tree where you have now build OpenSSL.
@ -196,6 +186,10 @@ following command procedures:
sets up the symbols to the applications. Should be called
from for example SYS$MANAGER:SYLOGIN.COM
OPENSSL_UNDO.COM
deassigns the logical names created with OPENSSL_STARTUP.COM.
The logical names that are set up are the following:
SSLROOT a dotted concealed logical name pointing at the
@ -203,7 +197,6 @@ The logical names that are set up are the following:
SSLCERTS Initially an empty directory, this is the default
location for certificate files.
SSLMISC Various scripts.
SSLPRIVATE Initially an empty directory, this is the default
location for private key files.
@ -211,8 +204,9 @@ The logical names that are set up are the following:
programs.
SSLINCLUDE Contains the header files needed if you want to
compile programs with libcrypto or libssl.
SSLLIB Contains the OpenSSL library files (LIBCRYPTO.OLB
and LIBSSL.OLB) themselves.
SSLLIB Contains the OpenSSL library files themselves:
- SSL_LIBCRYPTO32.OLB and SSL_LIBSSL32.OLB or
- SSL_LIBCRYPTO.OLB and SSL_LIBSSL.OLB
OPENSSL Same as SSLINCLUDE. This is because the standard
way to include OpenSSL header files from version
@ -296,4 +290,4 @@ have any ideas.
--
Richard Levitte <richard@levitte.org>
2000-02-27
2000-02-27, 2011-03-18

67
VMS/install-vms.com Executable file
View file

@ -0,0 +1,67 @@
$! install-vms.com -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <richard@levitte.org>
$! 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
$!

View file

@ -1,79 +0,0 @@
$! INSTALL.COM -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <richard@levitte.org>
$! 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 <openssl/{foo}.h>"
$ 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

View file

@ -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
$ else
$ arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if (arch .eqs. "") then arch = "UNK"
$ endif
$
$ if arch .nes. "VAX"
$ 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
$ 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"
$ libref = ""
$ if f$search(libdir+libolb) .nes. "" then gosub create_nonvax_shr
$ 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
$ else
$ arch_vax = 1
$ arch = "VAX"
$ else
$ arch_vax = 0
$ arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$ if (arch .eqs. "") then arch = "UNK"
$ endif
$!
$ archd = arch
$ lib32 = "32"
$ shr = "SHR32"
$!
$ if (p1 .nes. "")
$ then
$ 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]"
$ 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]"
$ 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 = ""
$ libvec = "LIBCRYPTO"
$ if f$search(libdir+libolb) .nes. "" then gosub create_vax_shr
$ if f$search( libolb) .nes. "" then gosub create_vax_shr
$ libtit = "SSL_TRANSFER_VECTOR"
$ 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"
$ 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(libdir+libolb) .nes. "" then gosub create_vax_shr
$ if f$search( libolb) .nes. "" then gosub create_vax_shr
$ else
$ libid = "Crypto"
$ libnum = "[.UTIL]LIBEAY.NUM"
$ 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 = ""
$ if f$search( libolb) .nes. "" then gosub create_nonvax_shr
$ libid = "SSL"
$ libnum = "[.UTIL]SSLEAY.NUM"
$ 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 -

108
VMS/openssl_startup.com Executable file
View file

@ -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 <openssl/{foo}.h>":
$ 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'
$!

20
VMS/openssl_undo.com Executable file
View file

@ -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
$!

View file

@ -114,8 +114,8 @@ $!
$ IF F$SEARCH(CATOP+".private"+CAKEY) .EQS. ""
$ THEN
$ READ '__INPUT' FILE -
/PROMT="CA certificate filename (or enter to create)"
$ IF F$SEARCH(FILE) .NES. ""
/PROMPT="CA certificate filename (or enter to create): "
$ IF (FILE .NES. "") .AND. (F$SEARCH(FILE) .NES. "")
$ THEN
$ COPY 'FILE' 'CATOP'.private'CAKEY'
$ RET=$STATUS

View file

@ -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);
}

View file

@ -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());

107
apps/install-apps.com Executable file
View file

@ -0,0 +1,107 @@
$! INSTALL.COM -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <richard@levitte.org>
$! 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
$!

View file

@ -1,65 +0,0 @@
$! INSTALL.COM -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <richard@levitte.org>
$! 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

View file

@ -25,7 +25,7 @@ $! VAXC For VAX C.
$! DECC For DEC C.
$! GNUC For GNU C.
$!
$! If you don't speficy a compiler, it will try to determine which
$! If you don't specify a compiler, it will try to determine which
$! "C" compiler to use.
$!
$! P3, if defined, sets a TCP/IP library to use, through one of the following
@ -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.
$!
@ -59,7 +72,7 @@ $ THEN
$!
$! The Architecture Is VAX.
$!
$ ARCH := VAX
$ ARCH = "VAX"
$!
$! Else...
$!
@ -74,37 +87,53 @@ $! End The Architecture Check.
$!
$ ENDIF
$!
$ ARCHD = ARCH
$ LIB32 = "32"
$ OPT_FILE = ""
$ POINTER_SIZE = ""
$!
$! Define what programs should be compiled
$!
$ PROGRAMS := OPENSSL
$!
$! Define The CRYPTO Library.
$!
$ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO'LIB32'.OLB
$!
$! Define The SSL Library.
$!
$ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL'LIB32'.OLB
$!
$! Define The OBJ Directory.
$!
$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.APPS]
$!
$! Define The EXE Directory.
$!
$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.APPS]
$!
$! Check To Make Sure We Have Valid Command Line Parameters.
$!
$ GOSUB CHECK_OPTIONS
$!
$! Define The CRYPTO Library.
$!
$ CRYPTO_LIB := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]SSL_LIBCRYPTO'LIB32'.OLB
$!
$! Define The SSL Library.
$!
$ SSL_LIB := SYS$DISK:[-.'ARCHD'.EXE.SSL]SSL_LIBSSL'LIB32'.OLB
$!
$! Define The OBJ and EXE Directories.
$!
$ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.APPS]
$ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.APPS]
$!
$! 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 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:"
@ -562,7 +580,7 @@ $! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$! End The Valid Argument Check.
$!
$ ENDIF
$!
@ -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 <sys> 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.
$!
@ -829,7 +891,7 @@ $! Set up default defines
$!
$ CCDEFS = """FLAT_INC=1""," + CCDEFS
$!
$! Else The User Entered An Invalid Arguement.
$! Else The User Entered An Invalid Argument.
$!
$ ELSE
$!
@ -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,9 +994,9 @@ $ 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 Arguement.
$! Else The User Entered An Invalid Argument.
$!
$ ELSE
$!
@ -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
$!

View file

@ -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)
{

188
apps/vms_decc_init.c Executable file
View file

@ -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 <stdio.h>
#include <stdlib.h>
#include <unixlib.h>
/* 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 */

View file

@ -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;

View file

@ -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());

View file

@ -75,6 +75,15 @@
# include <descrip.h>
# include <lib$routines.h>
# include <starlet.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 */
#elif defined(__ultrix)
# include <sys/syslog.h>
#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);

View file

@ -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

View file

@ -279,7 +279,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));
}
/* 'i<ri' is chosen to eliminate dependency on input data, even

View file

@ -354,7 +354,7 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
buf[BN_NIST_192_TOP],
c_d[BN_NIST_192_TOP],
*res;
size_t mask;
PTR_SIZE_INT mask;
static const BIGNUM _bignum_nist_p_192_sqr = {
(BN_ULONG *)_nist_p_192_sqr,
sizeof(_nist_p_192_sqr)/sizeof(_nist_p_192_sqr[0]),
@ -405,9 +405,10 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
* 'tmp=result-modulus; if (!carry || !borrow) result=tmp;'
* this is what happens below, but without explicit if:-) a.
*/
mask = 0-(size_t)bn_sub_words(c_d,r_d,_nist_p_192[0],BN_NIST_192_TOP);
mask &= 0-(size_t)carry;
res = (BN_ULONG *)(((size_t)c_d&~mask) | ((size_t)r_d&mask));
mask = 0-(PTR_SIZE_INT)bn_sub_words(c_d,r_d,_nist_p_192[0],BN_NIST_192_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_192_TOP);
r->top = 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);

View file

@ -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.
$!
@ -67,7 +78,7 @@ $ THEN
$!
$! The Architecture Is VAX
$!
$ ARCH := VAX
$ ARCH = "VAX"
$!
$! Else...
$!
@ -82,39 +93,58 @@ $! 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,
$! thereby making it fairly easy to verify that the lists are the same.
$!
$ ET_WHIRLPOOL = "WHRLPOOL"
$ IF ARCH .EQS. "VAX" THEN ET_WHIRLPOOL = ""
$ ENCRYPT_TYPES = "Basic,"+ -
"OBJECTS,"+ -
"MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,WHRLPOOL,"+ -
"MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,"+ET_WHIRLPOOL+","+ -
"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,EVP_2,EVP_3,ASN1,ASN1_2,PEM,X509,X509V3,"+ -
"CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ -
"CMS,PQUEUE,TS,JPAKE,STORE,CMAC"
$! Define The OBJ Directory.
$!
$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.CRYPTO]
$!
$! Define The EXE Directory.
$!
$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]
"CMS,PQUEUE,TS,JPAKE,SRP,STORE,CMAC"
$!
$! 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.CRYPTO]
$ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO]
$!
$! 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 A ",ARCH," Machine."
$ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'"
$!
$!
$! Check To See If The Architecture Specific OBJ Directory Exists.
@ -145,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...
$!
@ -206,7 +236,7 @@ $ LIB_BN = "bn_add,bn_div,bn_exp,bn_lib,bn_ctx,bn_mul,bn_mod,"+ -
"bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ -
"bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ -
"bn_recp,bn_mont,bn_mpi,bn_exp2,bn_gf2m,bn_nist,"+ -
"bn_depr,bn_const,bn_x931"
"bn_depr,bn_const,bn_x931p"
$ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_nist,ec_cvt,ec_mult,"+ -
"ec_err,ec_curve,ec_check,ec_print,ec_asn1,ec_key,"+ -
"ec2_smpl,ec2_mult,ec_ameth,ec_pmeth,eck_prn"
@ -304,20 +334,29 @@ $ LIB_TS = "ts_err,ts_req_utils,ts_req_print,ts_rsp_utils,ts_rsp_print,"+ -
"ts_rsp_sign,ts_rsp_verify,ts_verify_ctx,ts_lib,ts_conf,"+ -
"ts_asn1"
$ LIB_JPAKE = "jpake,jpake_err"
$ LIB_SRP = "srp_lib,srp_vfy"
$ LIB_STORE = "str_err,str_lib,str_meth,str_mem"
$ LIB_CMAC = "cmac,cm_ameth,cm_pmeth"
$!
$! 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.
$!
@ -377,7 +416,7 @@ $!
$ IF F$TYPE('LIB_MODULE') .EQS. ""
$ THEN
$ WRITE SYS$ERROR ""
$ WRITE SYS$ERROR "The module ",MODULE_NAME," does not exist. Continuing..."
$ WRITE SYS$ERROR "The module ",MODULE_NAME1," does not exist. Continuing..."
$ WRITE SYS$ERROR ""
$ GOTO MODULE_NEXT
$ ENDIF
@ -523,31 +562,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'
@ -594,38 +662,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.
$! Link With A TCP/IP Library.
$!
$ IF (TCPIP_LIB.NES."")
$ THEN
$ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' -
/EXE='EXE_DIR''APPLICATION'.EXE -
'OBJ_DIR''APPLICATION_OBJECTS', -
'CRYPTO_LIB'/LIBRARY -
'TCPIP_LIB' -
'ZLIB_LIB' -
,'OPT_FILE' /OPTIONS
$!
$! Link With A TCP/IP Library.
$!
$ 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
@ -664,7 +716,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
@ -693,7 +745,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
@ -728,7 +780,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
@ -743,7 +795,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
@ -764,7 +816,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.
$!
@ -787,12 +839,12 @@ $! Else...
$!
$ ELSE
$!
$! Else, Check To See If P1 Has A Valid Arguement.
$! Else, Check To See If P1 Has A Valid Argument.
$!
$ IF (P1.EQS."LIBRARY").OR.(P1.EQS."APPS")
$ THEN
$!
$! A Valid Arguement.
$! A Valid Argument.
$!
$ BUILDALL = P1
$!
@ -811,8 +863,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 ""
$!
@ -820,7 +872,7 @@ $! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$! End The Valid Argument Check.
$!
$ ENDIF
$!
@ -833,15 +885,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.
@ -852,6 +905,7 @@ $!
$! Compile With Debugger Information.
$!
$ DEBUGGER = "DEBUG"
$ LINKMAP = "MAP"
$ TRACEBACK = "TRACEBACK"
$ GCC_OPTIMIZE = "NOOPTIMIZE"
$ CC_OPTIMIZE = "NOOPTIMIZE"
@ -860,7 +914,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:"
@ -873,7 +927,7 @@ $! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$! End The Valid Argument Check.
$!
$ ENDIF
$!
@ -915,58 +969,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."")
@ -1067,11 +1113,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
@ -1094,14 +1193,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.
$!
@ -1130,7 +1229,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
$!
@ -1140,7 +1239,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
$!
@ -1162,12 +1261,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.
$!
@ -1202,8 +1301,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
@ -1212,7 +1313,7 @@ $! Show user the result
$!
$ WRITE/SYMBOL SYS$OUTPUT "Main C Compiling Command: ",CC
$!
$! Else The User Entered An Invalid Arguement.
$! Else The User Entered An Invalid Argument.
$!
$ ELSE
$!
@ -1230,7 +1331,7 @@ $! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$! End The Valid Argument Check.
$!
$ ENDIF
$!
@ -1256,7 +1357,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
$!
@ -1282,13 +1383,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
@ -1302,7 +1403,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
$!
@ -1323,9 +1424,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
$!

View file

@ -659,13 +659,13 @@ $! Else...
$!
$ ELSE
$!
$! Else, Check To See If P1 Has A Valid Arguement.
$! Else, Check To See If P1 Has A Valid Argument.
$!
$ IF (P1.EQS."LIBRARY").OR.(P1.EQS."DESTEST").OR.(P1.EQS."SPEED") -
.OR.(P1.EQS."RPW").OR.(P1.EQS."DES").OR.(P1.EQS."DES_OPTS")
$ THEN
$!
$! A Valid Arguement.
$! A Valid Argument.
$!
$ BUILDALL = P1
$!
@ -678,7 +678,7 @@ $!
$ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:"
$ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT " ALL : Just Build Everything.
$ WRITE SYS$OUTPUT " ALL : Just Build Everything."
$ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.CRYPTO.DES]LIBDES.OLB Library."
$ WRITE SYS$OUTPUT " DESTEST : To Compile Just The [.xxx.EXE.CRYPTO.DES]DESTEST.EXE Program."
$ WRITE SYS$OUTPUT " SPEED : To Compile Just The [.xxx.EXE.CRYPTO.DES]SPEED.EXE Program."
@ -697,7 +697,7 @@ $! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$! End The Valid Argument Check.
$!
$ ENDIF
$!
@ -754,7 +754,7 @@ $! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$! End The Valid Argument Check.
$!
$ ENDIF
$!
@ -978,7 +978,7 @@ $! Show user the result
$!
$ WRITE SYS$OUTPUT "Main Compiling Command: ",CC
$!
$! Else The User Entered An Invalid Arguement.
$! Else The User Entered An Invalid Argument.
$!
$ ELSE
$!

View file

@ -69,6 +69,18 @@
#include <descrip.h>
#include <starlet.h>
#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);
fab = cc$rms_fab;
#ifdef NAML$C_MAXRSS
nam = cc$rms_naml;
#else
nam = cc$rms_nam;
#endif
#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.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 = cc$rms_fab;
nam = CC_RMS_NAMX;
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,

196
crypto/install-crypto.com Executable file
View file

@ -0,0 +1,196 @@
$! INSTALL.COM -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <richard@levitte.org>
$! Time of creation: 22-MAY-1998 10:13
$!
$! Changes by Zoltan Arpadffy <zoli@polarhome.com>
$!
$! 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
$!

View file

@ -1,150 +0,0 @@
$! INSTALL.COM -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <richard@levitte.org>
$! Time of creation: 22-MAY-1998 10:13
$!
$! Changes by Zoltan Arpadffy <zoli@polarhome.com>
$!
$! 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

View file

@ -64,12 +64,18 @@
#include "o_time.h"
#ifdef OPENSSL_SYS_VMS
# include <libdtdef.h>
# include <lib$routines.h>
# include <lnmdef.h>
# include <starlet.h>
# include <descrip.h>
# include <stdlib.h>
# if __CRTL_VER >= 70000000 && \
(defined _POSIX_C_SOURCE || !defined _ANSI_C_SOURCE)
# define VMS_GMTIME_OK
# endif
# ifndef VMS_GMTIME_OK
# include <libdtdef.h>
# include <lib$routines.h>
# include <lnmdef.h>
# include <starlet.h>
# include <descrip.h>
# include <stdlib.h>
# 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");

View file

@ -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;
}

View file

@ -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 (;;)

51
crypto/vms_rms.h Executable file
View file

@ -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] */

View file

@ -28,29 +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).
$!
$!-----------------------------------------------------------------------------
$!
$! 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,
$! thereby making it fairly easy to verify that the lists are the same.
$! NOTE: gmp isn't built, as it's mostly a test engine and brings in another
$! library that isn't necessarely ported to VMS.
$! Announce/identify.
$!
$ ENGINES = "," + P6
$ IF ENGINES .EQS. "," THEN -
ENGINES = ",4758cca,aep,atalla,cswift,chil,nuron,sureware,ubsec,padlock,ccgost"
$ 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.
$!
@ -59,7 +61,7 @@ $ THEN
$!
$! The Architecture Is VAX.
$!
$ ARCH := VAX
$ ARCH = "VAX"
$!
$! Else...
$!
@ -74,19 +76,28 @@ $! End The Architecture Check.
$!
$ ENDIF
$!
$! Set the goal directories, and creat them if necessary
$ ARCHD = ARCH
$ LIB32 = "32"
$ OPT_FILE = ""
$ POINTER_SIZE = ""
$!
$ 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 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,
$! thereby making it fairly easy to verify that the lists are the same.
$! NOTE: gmp isn't built, as it's mostly a test engine and brings in another
$! library that isn't necessarely ported to VMS.
$!
$! Set the goal files, and create them if necessary
$ ENGINES = "," + P6
$ IF ENGINES .EQS. "," THEN -
ENGINES = ",4758cca,aep,atalla,cswift,chil,nuron,sureware,ubsec,padlock,"
$!
$ CRYPTO_LIB :=SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO'LIB32'.OLB
$ IF F$SEARCH(CRYPTO_LIB) .EQS. "" THEN LIBRARY/CREATE/OBJECT 'CRYPTO_LIB'
$! GOST requires a 64-bit integer type, unavailable on VAX.
$!
$! OK, time to check options and initialise
$ IF (ARCH .NES. "VAX") THEN -
ENGINES = ENGINES+ ",ccgost"
$!
$! Check options.
$!
$ OPT_PHASE = P1
$ ACCEPT_PHASE = "ALL,ENGINES"
@ -95,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
$!
@ -118,7 +159,7 @@ $ ENGINE_chil = "e_chil"
$ ENGINE_nuron = "e_nuron"
$ ENGINE_sureware = "e_sureware"
$ ENGINE_ubsec = "e_ubsec"
$ ENGINE_ubsec = "e_padlock"
$ ENGINE_padlock = "e_padlock"
$
$ ENGINE_ccgost_SUBDIR = "ccgost"
$ ENGINE_ccgost = "e_gost_err,gost2001_keyx,gost2001,gost89,gost94_keyx,"+ -
@ -171,9 +212,12 @@ $ ELSE
$ WRITE SYS$OUTPUT "Compiling Support Files. (",BUILDALL,")"
$ ENDIF
$!
$! Create a .OPT file for the object files
$! Create a .OPT file for the object files (for a real engine name).
$!
$ OPEN/WRITE OBJECTS 'EXE_DIR''ENGINE_NAME'.OPT
$ IF ENGINE_NAME .NES. ""
$ THEN
$ OPEN /WRITE OBJECTS 'EXE_DIR''ENGINE_NAME'.OPT
$ ENDIF
$!
$! Here's the start of per-engine module loop.
$!
@ -225,23 +269,28 @@ $ MACRO/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
$ ELSE
$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE'
$ ENDIF
$ WRITE OBJECTS OBJECT_FILE
$!
$! Write the entry to the .OPT file (for a real engine name).
$!
$ IF ENGINE_NAME .NES. ""
$ THEN
$ WRITE OBJECTS OBJECT_FILE
$ ENDIF
$!
$! Next file
$!
$ GOTO FILE_NEXT
$!
$ FILE_DONE:
$!
$! Do not link the support files.
$!
$ IF ENGINE_NAME .EQS. "" THEN GOTO ENGINE_NEXT
$!
$! Close the linker options file (for a real engine name).
$!
$ CLOSE OBJECTS
$!
$! Do not link the support files.
$!
$ IF ENGINE_NAME .EQS. "" THEN GOTO ENGINE_NEXT
$!
$! Do not link the support files.
$!
$ IF ENGINE_NAME .EQS. "" THEN GOTO ENGINE_NEXT
$!
$! Now, there are two ways to handle this. We can either build
$! shareable images or stick the engine object file into libcrypto.
$! For now, the latter is NOT supported.
@ -252,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
$!
@ -297,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
@ -326,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
@ -361,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
@ -376,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
@ -420,13 +465,13 @@ $! Else...
$!
$ ELSE
$!
$! Else, Check To See If OPT_PHASE Has A Valid Arguement.
$! Else, Check To See If OPT_PHASE Has A Valid Argument.
$!
$ IF ("," + ACCEPT_PHASE + ",") - ("," + OPT_PHASE + ",") -
.NES. ("," + ACCEPT_PHASE + ",")
$ THEN
$!
$! A Valid Arguement.
$! A Valid Argument.
$!
$ BUILDALL = OPT_PHASE
$!
@ -448,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 ""
$!
@ -457,7 +502,7 @@ $! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$! End The Valid Argument Check.
$!
$ ENDIF
$!
@ -470,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.
@ -489,6 +535,7 @@ $!
$! Compile With Debugger Information.
$!
$ DEBUGGER = "DEBUG"
$ LINKMAP = "MAP"
$ TRACEBACK = "TRACEBACK"
$ GCC_OPTIMIZE = "NOOPTIMIZE"
$ CC_OPTIMIZE = "NOOPTIMIZE"
@ -497,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:"
@ -510,7 +557,7 @@ $! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$! End The Valid Argument Check.
$!
$ ENDIF
$!
@ -552,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."")
@ -708,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
@ -731,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.
$!
@ -767,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
$!
@ -777,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
$!
@ -799,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.
$!
@ -831,7 +921,7 @@ $! Show user the result
$!
$ WRITE/SYMBOL SYS$OUTPUT "Main C Compiling Command: ",CC
$!
$! Else The User Entered An Invalid Arguement.
$! Else The User Entered An Invalid Argument.
$!
$ ELSE
$!
@ -849,14 +939,18 @@ $! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$! End The Valid Argument Check.
$!
$ 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
$!
@ -876,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
$!
@ -902,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
@ -922,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
$!
@ -943,9 +1037,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
$!
@ -986,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
$!
@ -994,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
$!

View file

@ -3,99 +3,134 @@ $!
$! Author: Richard Levitte <richard@levitte.org>
$! Time of creation: 22-MAY-1998 10:13
$!
$! P1 root of the directory tree
$! P1 root of the directory tree
$! P2 "64" for 64-bit pointers.
$!
$ 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") -
$!
$! 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
$!

File diff suppressed because it is too large Load diff

136
ssl/install-ssl.com Executable file
View file

@ -0,0 +1,136 @@
$! INSTALL-SSL.COM -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <richard@levitte.org>
$! 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
$!

View file

@ -1,90 +0,0 @@
$! INSTALL.COM -- Installs the files in a given directory tree
$!
$! Author: Richard Levitte <richard@levitte.org>
$! 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

View file

@ -30,7 +30,7 @@ $! VAXC For VAX C.
$! DECC For DEC C.
$! GNUC For GNU C.
$!
$! If you don't speficy a compiler, it will try to determine which
$! If you don't specify a compiler, it will try to determine which
$! "C" compiler to use.
$!
$! P4, if defined, sets a TCP/IP library to use, through one of the following
@ -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.
$!
@ -62,7 +73,7 @@ $ THEN
$!
$! The Architecture Is VAX.
$!
$ ARCH := VAX
$ ARCH = "VAX"
$!
$! Else...
$!
@ -77,25 +88,41 @@ $! End The Architecture Check.
$!
$ ENDIF
$!
$! Define The OBJ Directory.
$!
$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.SSL]
$!
$! Define The EXE Directory.
$!
$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.SSL]
$ 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.SSL]
$ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.SSL]
$!
$! 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 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
@ -187,7 +214,7 @@ $ LIB_SSL = "s2_meth,s2_srvr,s2_clnt,s2_lib,s2_enc,s2_pkt,"+ -
"ssl_lib,ssl_err2,ssl_cert,ssl_sess,"+ -
"ssl_ciph,ssl_stat,ssl_rsa,"+ -
"ssl_asn1,ssl_txt,ssl_algs,"+ -
"bio_ssl,ssl_err,kssl,t1_reneg"
"bio_ssl,ssl_err,kssl,tls_srp,t1_reneg"
$!
$! Tell The User That We Are Compiling The Library.
$!
@ -306,38 +333,30 @@ $! Tell The User We Are Creating The SSL_TASK.
$!
$ WRITE SYS$OUTPUT "Creating SSL_TASK OSU HTTP SSL Engine."
$!
$! Tell The User What File We Are Compiling.
$!
$ FILE_NAME = "ssl_task"
$ WRITE SYS$OUTPUT " ",FILE_NAME,".c"
$!
$! Compile The File.
$!
$ ON ERROR THEN GOTO SSL_TASK_END
$ CC5/OBJECT='OBJ_DIR'SSL_TASK.OBJ SYS$DISK:[]SSL_TASK.C
$!
$ write sys$output " \Using special rule (5)"
$ x = " "+ CC5
$ write /symbol sys$output x
$!
$ CC5/OBJECT='OBJ_DIR''FILE_NAME'.OBJ SYS$DISK:[]'FILE_NAME'.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.
$!
$ 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
$!
$! Else...
$!
$ ELSE
$!
$! Don't Link With TCP/IP Library.
$!
$ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR'SSL_TASK.EXE -
'OBJ_DIR'SSL_TASK.OBJ,-
'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, -
'OPT_FILE'/OPTION
$!
$! End The TCP/IP Library Check.
$!
$ 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
@ -531,12 +550,12 @@ $! Else...
$!
$ ELSE
$!
$! Else, Check To See If P1 Has A Valid Arguement.
$! Else, Check To See If P1 Has A Valid Argument.
$!
$ IF (P1.EQS."LIBRARY").OR.(P1.EQS."SSL_TASK")
$ THEN
$!
$! A Valid Arguement.
$! A Valid Argument.
$!
$ BUILDALL = P1
$!
@ -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 ""
$!
@ -564,7 +583,7 @@ $! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$! End The Valid Argument Check.
$!
$ ENDIF
$!
@ -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:"
@ -618,7 +639,7 @@ $! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$! End The Valid Argument Check.
$!
$ ENDIF
$!
@ -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 <sys> 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.
$!
@ -952,7 +1017,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
$!
@ -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,9 +1116,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
$!

View file

@ -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

View file

@ -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" ) {

View file

@ -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.
$!
@ -112,7 +142,7 @@ $ TEST_FILES = "BNTEST,ECTEST,ECDSATEST,ECDHTEST,IDEATEST,"+ -
"MDC2TEST,RMDTEST,"+ -
"RANDTEST,DHTEST,ENGINETEST,"+ -
"BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_TEST,"+ -
"EVP_TEST,IGETEST,JPAKETEST"
"EVP_TEST,IGETEST,JPAKETEST,SRPTEST"
$! Should we add MTTEST,PQ_TEST,LH_TEST,DIVTEST,TABTEST as well?
$!
$! Additional directory information.
@ -148,6 +178,7 @@ $ T_D_RSA_TEST := [-.crypto.rsa]
$ T_D_EVP_TEST := [-.crypto.evp]
$ T_D_IGETEST := [-.test]
$ T_D_JPAKETEST := [-.crypto.jpake]
$ T_D_SRPTEST := [-.crypto.srp]
$!
$ TCPIP_PROGRAMS = ",,"
$ IF COMPILER .EQS. "VAXC" THEN -
@ -230,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.
$!
@ -320,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
@ -355,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
@ -370,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
@ -449,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...
$!
@ -475,6 +493,7 @@ $!
$! Compile With Debugger Information.
$!
$ DEBUGGER = "DEBUG"
$ LINKMAP = "MAP"
$ TRACEBACK = "TRACEBACK"
$ GCC_OPTIMIZE = "NOOPTIMIZE"
$ CC_OPTIMIZE = "NOOPTIMIZE"
@ -485,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:"
@ -498,7 +517,7 @@ $! Time To EXIT.
$!
$ EXIT
$!
$! End The Valid Arguement Check.
$! End The Valid Argument Check.
$!
$ ENDIF
$!
@ -506,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
$!
@ -662,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
@ -685,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.
$!
@ -720,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 <sys> As SYS$COMMON:[SYSLIB]
@ -729,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
$!
@ -751,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.
$!
@ -787,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
$!
@ -819,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
$!
@ -845,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
@ -865,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
$!
@ -886,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
$!

View file

@ -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"

View file

@ -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"""
$

View file

@ -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'

View file

@ -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."

View file

@ -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'
$
@ -40,7 +56,7 @@ $ tests := -
test_enc,test_x509,test_rsa,test_crl,test_sid,-
test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,-
test_ss,test_ca,test_engine,test_evp,test_ssl,test_tsa,test_ige,-
test_jpake,test_cms
test_jpake,test_srp,test_cms
$ endif
$ tests = f$edit(tests,"COLLAPSE")
$
@ -75,7 +91,8 @@ $ ENGINETEST := enginetest
$ EVPTEST := evp_test
$ IGETEST := igetest
$ JPAKETEST := jpaketest
$
$ SRPTEST := srptest
$!
$ tests_i = 0
$ loop_tests:
$ tests_e = f$element(tests_i,",",tests)
@ -138,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
@ -218,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 (<STDIN>) {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;*
@ -248,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"
@ -260,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"))
@ -273,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"
@ -282,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
@ -295,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:
@ -304,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
@ -312,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:
@ -325,10 +353,14 @@ $ 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
$ test_srp:
$ write sys$output "Test SRP"
$ mcr 'texe_dir''srptest'
$ return
$
$
$ exit:

View file

@ -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"""

View file

@ -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.;*
$

View file

@ -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

View file

@ -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"

View file

@ -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)"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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))

View file

@ -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"