diff options
107 files changed, 16968 insertions, 452 deletions
@@ -5,6 +5,9 @@ Changes between 0.9.2b and 0.9.3 + *) VMS support. + [Richard Levitte <richard@levitte.org>] + *) New option -out to asn1parse to allow the parsed structure to be output to a file. This is most useful when combined with the -strparse option to examine the output of things like OCTET STRINGS. @@ -2,7 +2,8 @@ INSTALLATION ON THE UNIX PLATFORM --------------------------------- - [For instructions for compiling OpenSSL on Windows systems, see INSTALL.W32]. + [See INSTALL.W32 for instructions for compiling OpenSSL on Windows systems, + and INSTALL.VMS for installing on OpenVMS systems.] To install OpenSSL, you will need: diff --git a/INSTALL.VMS b/INSTALL.VMS new file mode 100644 index 0000000000..cf3c81a6ef --- /dev/null +++ b/INSTALL.VMS @@ -0,0 +1,204 @@ + VMS Installation instructions + written by Richard Levitte + <richard@levitte.org> + + +Intro: +====== + +This file is divided in the following parts: + + Compilation - Mandatory reading. + Test - Mandatory reading. + Installation - Mandatory reading. + Backward portability - Read if it's an issue. + Possible bugs or quirks - A few warnings on things that + may go wrong or may surprise you. + Report - How to get in touch with me. + +Compilation: +============ + +I've used the very good command procedures written by Robert Byer +<byer@mail.all-net.net>, and just slightly modified them, making +them slightly more general and easier to maintain. + +You can actually compile in almost any directory separately. Look +for a command procedure name xxx-LIB.COM (in the library directories) +or MAKExxx.COM (in the program directories) and read the comments at +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 trhe following: + + @MAKEVMS <option> <rsaref-p> <debug-p> [<compiler>] + +<option> must be one of the following: + + ALL Just build "everything". + DATE Just build the "[.INCLUDE]DATE.H" file. + SOFTLINKS Just copies some files, to simulate Unix soft links. + RSAREF Just build the "[.xxx.EXE.RSAREF]LIBRSAGLUE.OLB" library. + CRYPTO Just build the "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" library. + SSL Just build the "[.xxx.EXE.SSL]LIBSSL.OLB" library. + SSL_TASK Just build the "[.xxx.EXE.SSL]SSL_TASK.EXE" program. + TEST Just build the "test" programs for OpenSSL. + APPS Just build the "application" programs for OpenSSL. + +<rsaref-p> must be one of the following: + + RSAREF compile using the RSAREF Library + NORSAREF compile without using RSAREF + +Note: The RSAREF libraries are NOT INCLUDED and you have to + download it from "ftp://ftp.rsa.com/rsaref". You have to + get the ".tar-Z" file as the ".zip" file dosen'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. + +<debug-p> must be one of the following: + + DEBUG compile with debugging info (will not optimize) + NODEBUG compile without debugging info (will optimize) + +<compiler> must be one of the following: + + VAXC For VAX C. + DECC For DEC C. + 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. + +Note: Some programs in this package require a TCP/IP library. + +Note 2: if you want to compile the crypto library only, please make sure + you have at least done a @MAKEVMS DATE and a @MAKEVMS SOFTLINKS. + A lot of things will break if you don't. + +Test: +===== + +Testing is very simple, just do the following: + + @[.TEST]TESTS + +If a test fails, try with defining the logical name OPENSSL_NO_ASM (yes, +it's an ugly hack!) and rebuild. Please send a bug report to +<openssl-bugs@openssl.org>, including the output of "openssl version -a" +and of the failed test. + +Installation: +============= + +Installation is easy, just do the following: + + @INSTALL <root> + +<root> is the directory in which everything will be installed, +subdirectories, libraries, header files, programs and startup command +procedures. + +In the [.VMS] subdirectory of the installation, you will find the +following command procedures: + + OPENSSL_STARTUP.COM + + defines all needed logical names. Takes one argument that + tells it in what logical name table to insert the logical + names. If you insert if it SYS$MANAGER:SYSTARTUP_VMS.COM, the + call should look like this: + + @openssldev:[openssldir.VMS]OPENSSL_STARTUP "/SYSTEM" + + OPENSSL_UTILS.COM + + sets up the symbols to the applications. Should be called + from for example SYS$MANAGER:SYLOGIN.COM + +The logical names that are set up are the following: + + SSLROOT a dotted concealed logical name pointing at the + root directory. + SSLLIB points at the directory where CRYPTORTL.OLB and + SSLRTL.OLB are installed. + SSLINCLUDE points at the directory where the header files are + installed. + SSLEXE points at the directory where the applications are + installed. + SSLCERTS the place where the certificates are stored. + SSLPRIVATE I'm actually not sure what this is used for. + + +Backward portability: +===================== + +One great problem when you build a library is making sure it will work +on as many versions of VMS as possible. Especially, code compiled on +OpenVMS version 7.x and above tend to be unusable in version 6.x or +lower, because some C library routines have changed names internally +(the C programmer won't usually see it, because the old name is +maintained through C macros). One obvious solution is to make sure +you have a development machine with an old enough version of OpenVMS. +However, if you are stuck with a bunch of Alphas running OpenVMS version +7.1, you seem to be out of luck. Fortunately, the DEC C header files +are cluttered with conditionals that make some declarations and definitions +dependent on the OpenVMS version or the C library version, *and* you +can use those macros to simulate older OpenVMS or C library versions, +by defining the macros _VMS_V6_SOURCE, __VMS_VER and __CTRL_VER with +correct values. In the compilation scripts, I've provided the possibility +for the user to influense the creation of such macros, through a bunch of +symbols, all having names starting with USER_. Here's the list of them: + + USER_CCFLAGS - Used to give additional qualifiers to the + compiler. It can't be used to define macros + since the scripts will do such things as well. + To do such things, use USER_CCDEFS. + USER_CCDEFS - Used to define macros on the command line. The + value of this symbol will be inserted inside a + /DEFINE=(...). + USER_CCDISABLEWARNINGS - Used to disable some warnings. The value is + inserted inside a /DISABLE=WARNING=(...). + +So, to maintain backward compatibility with older VMS versions, do the +following before you start compiling: + + $ USER_CCDEFS := _VMS_V6_SOURCE=1,__VMS_VER=60000000,__CRTL_VER=60000000 + $ USER_CCDISABLEWARNINGS := PREOPTW + +The USER_CCDISABLEWARNINGS is there because otherwise, DEC C will complain +that those macros have been changed. + +Note: Currently, this is only usefull for library compilation. The + programs will still be linked with the current version of the + C library shareable image, and will thus complain if they are + faced with an older version of the same C library shareable image. + This will probably be fixed in a future revision of OpenSSL. + + +Possible bugs or quirks: +======================== + +I'm not perfectly sure all the programs will use the SSLCERTS: +directory by default, it may very well be that you have to give them +extra arguments. Please experiment. + + +Report: +======= + +I maintain a few mailinglists for bug reports and such on software that +I develop/port/enhance/destroy. Please look at http://www.free.lp.se/ +for further info. + + +-- +Richard Levitte <richard@levitte.org> +1999-03-09 diff --git a/Makefile.org b/Makefile.org index d8dacc650f..ef956d87f1 100644 --- a/Makefile.org +++ b/Makefile.org @@ -162,7 +162,7 @@ SHELL=/bin/sh TOP= . ONEDIRS=out tmp -EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep +EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS WDIRS= windows LIBS= libcrypto.a libssl.a @@ -308,7 +308,7 @@ dist: @$(MAKE) tar dist_pem_h: - (cd crypto/pem; $(MAKE) SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean) + (cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean) install: all @-mkdir -p $(INSTALL_PREFIX)$(INSTALLTOP)/bin 2>/dev/null @@ -141,7 +141,8 @@ ------------ To install this package under a Unix derivative, read the INSTALL file. For - a Win32 platform, read the INSTALL.W32 file. + a Win32 platform, read the INSTALL.W32 file. For OpenVMS systems, read + INSTALL.VMS. For people in the USA, it is possible to compile OpenSSL to use RSA Inc.'s public key library, RSAREF, by configuring OpenSSL with the option "rsaref". diff --git a/apps/CA.com b/apps/CA.com new file mode 100644 index 0000000000..f324788eca --- /dev/null +++ b/apps/CA.com @@ -0,0 +1,200 @@ +$! CA - wrapper around ca to make it easier to use ... basically ca requires +$! some setup stuff to be done before you can use it and this makes +$! things easier between now and when Eric is convinced to fix it :-) +$! +$! CA -newca ... will setup the right stuff +$! CA -newreq ... will generate a certificate request +$! CA -sign ... will sign the generated request and output +$! +$! At the end of that grab newreq.pem and newcert.pem (one has the key +$! and the other the certificate) and cat them together and that is what +$! you want/need ... I'll make even this a little cleaner later. +$! +$! +$! 12-Jan-96 tjh Added more things ... including CA -signcert which +$! converts a certificate to a request and then signs it. +$! 10-Jan-96 eay Fixed a few more bugs and added the SSLEAY_CONFIG +$! environment variable so this can be driven from +$! a script. +$! 25-Jul-96 eay Cleaned up filenames some more. +$! 11-Jun-96 eay Fixed a few filename missmatches. +$! 03-May-96 eay Modified to use 'openssl cmd' instead of 'cmd'. +$! 18-Apr-96 tjh Original hacking +$! +$! Tim Hudson +$! tjh@cryptsoft.com +$! +$! +$! default ssleay.cnf file has setup as per the following +$! demoCA ... where everything is stored +$ +$ IF F$TYPE(SSLEAY_CONFIG) .EQS. "" THEN SSLEAY_CONFIG := SSLLIB:SSLEAY.CNF +$ +$ DAYS = "-days 365" +$ REQ = openssl + " req " + SSLEAY_CONFIG +$ CA = openssl + " ca " + SSLEAY_CONFIG +$ VERIFY = openssl + " verify" +$ X509 = openssl + " x509" +$ echo = "write sys$Output" +$! +$ s = F$PARSE(F$ENVIRONMENT("DEFAULT"),"[]") - "].;" +$ CATOP := 's'.demoCA +$ CAKEY := ]cakey.pem +$ CACERT := ]cacert.pem +$ +$ __INPUT := SYS$COMMAND +$ RET = 1 +$! +$ i = 1 +$opt_loop: +$ if i .gt. 8 then goto opt_loop_end +$ +$ prog_opt = F$EDIT(P'i',"lowercase") +$ +$ IF (prog_opt .EQS. "?" .OR. prog_opt .EQS. "-h" .OR. prog_opt .EQS. "-help") +$ THEN +$ echo "usage: CA -newcert|-newreq|-newca|-sign|-verify" +$ exit +$ ENDIF +$! +$ IF (prog_opt .EQS. "-input") +$ THEN +$ ! Get input from somewhere other than SYS$COMMAND +$ i = i + 1 +$ __INPUT = P'i' +$ GOTO opt_loop_continue +$ ENDIF +$! +$ IF (prog_opt .EQS. "-newcert") +$ THEN +$ ! Create a certificate. +$ DEFINE/USER SYS$INPUT '__INPUT' +$ REQ -new -x509 -keyout newreq.pem -out newreq.pem 'DAYS' +$ RET=$STATUS +$ echo "Certificate (and private key) is in newreq.pem" +$ GOTO opt_loop_continue +$ ENDIF +$! +$ IF (prog_opt .EQS. "-newreq") +$ THEN +$ ! Create a certificate request +$ DEFINE/USER SYS$INPUT '__INPUT' +$ REQ -new -keyout newreq.pem -out newreq.pem 'DAYS' +$ RET=$STATUS +$ echo "Request (and private key) is in newreq.pem" +$ GOTO opt_loop_continue +$ ENDIF +$! +$ IF (prog_opt .EQS. "-newca") +$ THEN +$ ! If explicitly asked for or it doesn't exist then setup the directory +$ ! structure that Eric likes to manage things. +$ IF F$SEARCH(CATOP+"]serial.") .EQS. "" +$ THEN +$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'] +$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'.certs] +$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'.crl] +$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'.newcerts] +$ CREATE /DIR /PROTECTION=OWNER:RWED 'CATOP'.private] +$ OPEN /WRITE ser_file 'CATOP']serial. +$ WRITE ser_file "01" +$ CLOSE ser_file +$ APPEND/NEW NL: 'CATOP']index.txt +$ ENDIF +$! +$ IF F$SEARCH(CATOP+".private"+CAKEY) .EQS. "" +$ THEN +$ READ '__INPUT' FILE - + /PROMT="CA certificate filename (or enter to create)" +$ IF F$SEARCH(FILE) .NES. "" +$ THEN +$ COPY 'FILE' 'CATOP'.private'CAKEY' +$ RET=$STATUS +$ ELSE +$ echo "Making CA certificate ..." +$ DEFINE/USER SYS$INPUT '__INPUT' +$ REQ -new -x509 -keyout 'CATOP'.private'CAKEY' - + -out 'CATOP''CACERT' 'DAYS' +$ RET=$STATUS +$ ENDIF +$ ENDIF +$ GOTO opt_loop_continue +$ ENDIF +$! +$ IF (prog_opt .EQS. "-xsign") +$ THEN +$! +$ DEFINE/USER SYS$INPUT '__INPUT' +$ CA -policy policy_anything -infiles newreq.pem +$ RET=$STATUS +$ GOTO opt_loop_continue +$ ENDIF +$! +$ IF ((prog_opt .EQS. "-sign") .OR. (prog_opt .EQS. "-signreq")) +$ THEN +$! +$ DEFINE/USER SYS$INPUT '__INPUT' +$ CA -policy policy_anything -out newcert.pem -infiles newreq.pem +$ RET=$STATUS +$ type newcert.pem +$ echo "Signed certificate is in newcert.pem" +$ GOTO opt_loop_continue +$ ENDIF +$! +$ IF (prog_opt .EQS. "-signcert") +$ THEN +$! +$ echo "Cert passphrase will be requested twice - bug?" +$ DEFINE/USER SYS$INPUT '__INPUT' +$ X509 -x509toreq -in newreq.pem -signkey newreq.pem -out tmp.pem +$ DEFINE/USER SYS$INPUT '__INPUT' +$ CA -policy policy_anything -out newcert.pem -infiles tmp.pem +y +y +$ type newcert.pem +$ echo "Signed certificate is in newcert.pem" +$ GOTO opt_loop_continue +$ ENDIF +$! +$ IF (prog_opt .EQS. "-verify") +$ THEN +$! +$ i = i + 1 +$ IF (p'i' .EQS. "") +$ THEN +$ DEFINE/USER SYS$INPUT '__INPUT' +$ VERIFY "-CAfile" 'CATOP''CACERT' newcert.pem +$ ELSE +$ j = i +$ verify_opt_loop: +$ IF j .GT. 8 THEN GOTO verify_opt_loop_end +$ IF p'j' .NES. "" +$ THEN +$ DEFINE/USER SYS$INPUT '__INPUT' +$ __tmp = p'j' +$ VERIFY "-CAfile" 'CATOP''CACERT' '__tmp' +$ tmp=$STATUS +$ IF tmp .NE. 0 THEN RET=tmp +$ ENDIF +$ j = j + 1 +$ GOTO verify_opt_loop +$ verify_opt_loop_end: +$ ENDIF +$ +$ GOTO opt_loop_end +$ ENDIF +$! +$ IF (prog_opt .NES. "") +$ THEN +$! +$ echo "Unknown argument ''prog_opt'" +$ +$ EXIT 3 +$ ENDIF +$ +$opt_loop_continue: +$ i = i + 1 +$ GOTO opt_loop +$ +$opt_loop_end: +$ EXIT 'RET' diff --git a/apps/Makefile.ssl b/apps/Makefile.ssl index 9e19793728..5d632390c8 100644 --- a/apps/Makefile.ssl +++ b/apps/Makefile.ssl @@ -20,7 +20,7 @@ EX_LIBS= CFLAGS= -DMONOLITH $(INCLUDES) $(CFLAG) -GENERAL=Makefile +GENERAL=Makefile makeapps.com install.com DLIBCRYPTO=../libcrypto.a DLIBSSL=../libssl.a diff --git a/apps/apps.c b/apps/apps.c index f9cc27052b..354043ef6e 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -201,6 +201,27 @@ void program_name(char *in, char *out, int size) out[n]='\0'; } #else +#ifdef VMS +void program_name(char *in, char *out, int size) + { + char *p=in, *q; + char *chars=":]>"; + + while(*chars != '\0') + { + q=strrchr(p,*chars); + if (q > p) + p = q + 1; + chars++; + } + + q=strrchr(p,'.'); + if (q == NULL) + q = in+size; + strncpy(out,p,q-p); + out[q-p]='\0'; + } +#else void program_name(char *in, char *out, int size) { char *p; @@ -214,6 +235,7 @@ void program_name(char *in, char *out, int size) out[size-1]='\0'; } #endif +#endif #ifdef WIN32 int WIN32_rename(char *from, char *to) @@ -76,7 +76,22 @@ #include <openssl/pem.h> #ifndef W_OK -#include <sys/file.h> +# ifdef VMS +# if defined(__DECC) +# include <unistd.h> +# else +# include <unixlib.h> +# endif +# else +# include <sys/file.h> +# endif +#endif + +#ifndef W_OK +# define F_OK 0 +# define X_OK 1 +# define W_OK 2 +# define R_OK 4 #endif #undef PROG @@ -395,9 +410,14 @@ bad: if (configfile == NULL) { /* We will just use 'buf[0]' as a temporary buffer. */ +#ifdef VMS + strncpy(buf[0],X509_get_default_cert_area(), + sizeof(buf[0])-1-sizeof(CONFIG_FILE)); +#else strncpy(buf[0],X509_get_default_cert_area(), sizeof(buf[0])-2-sizeof(CONFIG_FILE)); strcat(buf[0],"/"); +#endif strcat(buf[0],CONFIG_FILE); configfile=buf[0]; } @@ -537,7 +557,12 @@ bad: BIO_printf(bio_err,"there needs to be defined a directory for new certificate to be placed in\n"); goto err; } +#ifdef VMS + /* For technical reasons, VMS misbehaves with X_OK */ + if (access(outdir,R_OK|W_OK) != 0) +#else if (access(outdir,R_OK|W_OK|X_OK) != 0) +#endif { BIO_printf(bio_err,"I am unable to acces the %s directory\n",outdir); perror(outdir); @@ -855,12 +880,23 @@ bad: BIO_printf(bio_err,"Write out database with %d new entries\n",sk_num(cert_sk)); strncpy(buf[0],serialfile,BSIZE-4); + +#ifdef VMS + strcat(buf[0],"-new"); +#else strcat(buf[0],".new"); +#endif if (!save_serial(buf[0],serial)) goto err; strncpy(buf[1],dbfile,BSIZE-4); + +#ifdef VMS + strcat(buf[1],"-new"); +#else strcat(buf[1],".new"); +#endif + if (BIO_write_filename(out,buf[1]) <= 0) { perror(dbfile); @@ -884,7 +920,11 @@ bad: p=(char *)x->cert_info->serialNumber->data; strncpy(buf[2],outdir,BSIZE-(j*2)-6); + +#ifndef VMS strcat(buf[2],"/"); +#endif + n=(unsigned char *)&(buf[2][strlen(buf[2])]); if (j > 0) { @@ -917,7 +957,13 @@ bad: { /* Rename the database and the serial file */ strncpy(buf[2],serialfile,BSIZE-4); + +#ifdef VMS + strcat(buf[2],"-old"); +#else strcat(buf[2],".old"); +#endif + BIO_free(in); BIO_free(out); in=NULL; @@ -939,7 +985,13 @@ bad: } strncpy(buf[2],dbfile,BSIZE-4); + +#ifdef VMS + strcat(buf[2],"-old"); +#else strcat(buf[2],".old"); +#endif + if (rename(dbfile,buf[2]) < 0) { BIO_printf(bio_err,"unabel to rename %s to %s\n", diff --git a/apps/eay.c b/apps/eay.c index 80a141b938..a7d9e811b0 100644 --- a/apps/eay.c +++ b/apps/eay.c @@ -62,7 +62,7 @@ #define MONOLITH #define USE_SOCKETS -#include "../e_os.h" +#include <openssl/e_os.h> #include <openssl/bio.h> #include <openssl/stack.h> diff --git a/apps/install.com b/apps/install.com new file mode 100644 index 0000000000..f927dc29f5 --- /dev/null +++ b/apps/install.com @@ -0,0 +1,69 @@ +$! 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 +$ +$ 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_SSLVEXE WRK_SSLROOT:[VAX_EXE] +$ DEFINE/NOLOG WRK_SSLAEXE WRK_SSLROOT:[ALPHA_EXE] +$ DEFINE/NOLOG WRK_SSLLIB WRK_SSLROOT:[LIB] +$ +$ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLROOT:[000000] +$ IF F$PARSE("WRK_SSLVEXE:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLVEXE: +$ IF F$PARSE("WRK_SSLAEXE:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLAEXE: +$ IF F$PARSE("WRK_SSLLIB:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLLIB: +$ +$ EXE := openssl +$ +$ VEXE_DIR := [-.VAX.EXE.APPS] +$ AEXE_DIR := [-.AXP.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(VEXE_DIR+E+".EXE") .NES. "" +$ THEN +$ COPY 'VEXE_DIR''E'.EXE WRK_SSLVEXE:'E'.EXE/log +$ SET FILE/PROT=W:RE WRK_SSLVEXE:'E'.EXE +$ ENDIF +$ IF F$SEARCH(AEXE_DIR+E+".EXE") .NES. "" +$ THEN +$ COPY 'AEXE_DIR''E'.EXE WRK_SSLAEXE:'E'.EXE/log +$ SET FILE/PROT=W:RE WRK_SSLAEXE:'E'.EXE +$ ENDIF +$ SET ON +$ GOTO LOOP_EXE +$ LOOP_EXE_END: +$ +$ SET NOON +$ COPY CA.COM WRK_SSLAEXE:CA.COM/LOG +$ SET FILE/PROT=W:RE WRK_SSLAEXE:CA.COM +$ COPY CA.COM WRK_SSLVEXE:CA.COM/LOG +$ SET FILE/PROT=W:RE WRK_SSLVEXE:CA.COM +$ COPY OPENSSL-VMS.CNF WRK_SSLROOT:[000000]OPENSSL.CNF/LOG +$ SET FILE/PROT=W:R WRK_SSLROOT:[000000]OPENSSL.CNF +$ SET ON +$ +$ EXIT diff --git a/apps/makeapps.com b/apps/makeapps.com new file mode 100644 index 0000000000..ab8c8fac61 --- /dev/null +++ b/apps/makeapps.com @@ -0,0 +1,1137 @@ +$! +$! MAKEAPPS.COM +$! Written By: Robert Byer +$! Vice-President +$! A-Com Computing, Inc. +$! byer@mail.all-net.net +$! +$! Changes by Richard Levitte <richard@levitte.org> +$! +$! This command files compiles and creates all the various different +$! "application" programs for the different types of encryption for OpenSSL. +$! The EXE's are placed in the directory [.xxx.EXE.APPS] where "xxx" denotes +$! either AXP or VAX depending on your machine architecture. +$! +$! It was written so it would try to determine what "C" compiler to +$! use or you can specify which "C" compiler to use. +$! +$! Specify RSAREF as P1 to compile with the RSAREF library instead of +$! the regular one. If you specify NORSAREF it will compile with the +$! regular RSAREF routines. (Note: If you are in the United States +$! you MUST compile with RSAREF unless you have a license from RSA). +$! +$! Note: The RSAREF libraries are NOT INCLUDED and you have to +$! download it from "ftp://ftp.rsa.com/rsaref". You have to +$! get the ".tar-Z" file as the ".zip" file dosen't have the +$! directory structure stored. You have to extract the file +$! into the [.RSAREF] directory under the root directory as that +$! is where the scripts will look for the files. +$! +$! Specify DEBUG or NODEBUG as P2 to compile with or without debugger +$! information. +$! +$! Specify which compiler at P3 to try to compile under. +$! +$! 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 +$! "C" compiler to use. +$! +$! P4, if defined, sets a TCP/IP library to use, through one of the following +$! keywords: +$! +$! UCX for UCX +$! SOCKETSHR for SOCKETSHR+NETLIB +$! +$! P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) +$! +$! P6, if defined, sets a choice of programs to compile. +$! +$! +$! Define A TCP/IP Library That We Will Need To Link To. +$! (That Is, If We Need To Link To One.) +$! +$ TCPIP_LIB = "" +$! +$! Check What Architecture We Are Using. +$! +$ IF (F$GETSYI("CPU").GE.128) +$ THEN +$! +$! The Architecture Is AXP. +$! +$ ARCH := AXP +$! +$! Else... +$! +$ ELSE +$! +$! The Architecture Is VAX. +$! +$ ARCH := VAX +$! +$! End The Architecture Check. +$! +$ ENDIF +$! +$! Define what programs should be compiled +$! +$ PROGRAMS := OPENSSL +$!$ PROGRAMS := VERIFY,ASN1PARS,REQ,DGST,DH,ENC,GENDH,ERRSTR,CA,CRL,- +$! RSA,DSA,DSAPARAM,- +$! X509,GENRSA,GENDSA,S_SERVER,S_CLIENT,SPEED,- +$! S_TIME,VERSION,PKCS7,CRL2P7,SESS_ID,CIPHERS,NSEQ, +$! +$! Check To Make Sure We Have Valid Command Line Parameters. +$! +$ GOSUB CHECK_OPTIONS +$! +$! 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." +$! +$! Define The CRYPTO Library. +$! +$ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB +$! +$! Define The RSAREF Library. +$! +$ RSAREF_LIB := SYS$DISK:[-.'ARCH'.EXE.RSAREF]LIBRSAGLUE.OLB +$! +$! Define The SSL Library. +$! +$ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL.OLB +$! +$! Define The OBJ Directory. +$! +$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.APPS] +$! +$! Check To See If The OBJ Directory Exists. +$! +$ IF (F$PARSE(OBJ_DIR).EQS."") +$ THEN +$! +$! It Dosen't Exist, So Create It. +$! +$ CREATE/DIRECTORY 'OBJ_DIR' +$! +$! End The OBJ Directory Check. +$! +$ ENDIF +$! +$! Define The EXE Directory. +$! +$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.APPS] +$! +$! Check To See If The EXE Directory Exists. +$! +$ IF (F$PARSE(EXE_DIR).EQS."") +$ THEN +$! +$! It Dosen't Exist, So Create It. +$! +$ CREATE/DIRECTORY 'EXE_DIR' +$! +$! End The EXE Directory Check. +$! +$ ENDIF +$! +$! Check To See If We Have The Proper Libraries. +$! +$ GOSUB LIB_CHECK +$! +$! Check To See If We Have A Linker Option File. +$! +$ GOSUB CHECK_OPT_FILE +$! +$! Define The Application Files. +$! +$ LIB_FILES = "VERIFY;ASN1PARS;REQ;DGST;DH;ENC;GENDH;"+- + "ERRSTR;CA;"+- + "PKCS7;CRL2P7;CRL;"+- + "RSA;DSA;DSAPARAM;"+- + "X509;GENRSA;GENDSA;S_SERVER;S_CLIENT;SPEED;"+- + "S_TIME;APPS;S_CB;S_SOCKET;VERSION;SESS_ID;"+- + "CIPHERS;NSEQ;PKCS12" +$ APP_FILES := OPENSSL,'OBJ_DIR'VERIFY.OBJ,ASN1PARS.OBJ,REQ.OBJ,DGST.OBJ,DH.OBJ,ENC.OBJ,GENDH.OBJ,- + ERRSTR.OBJ,CA.OBJ,- + PKCS7.OBJ,CRL2P7.OBJ,CRL.OBJ,- + RSA.OBJ,DSA.OBJ,DSAPARAM.OBJ,- + X509.OBJ,GENRSA.OBJ,GENDSA.OBJ,S_SERVER.OBJ,S_CLIENT.OBJ,SPEED.OBJ,- + S_TIME.OBJ,APPS.OBJ,S_CB.OBJ,S_SOCKET.OBJ,VERSION.OBJ,SESS_ID.OBJ,- + CIPHERS.OBJ,NSEQ.OBJ,PKCS12.OBJ +$ TCPIP_PROGRAMS = ",," +$ IF COMPILER .EQS. "VAXC" THEN - + TCPIP_PROGRAMS = ",OPENSSL," +$!$ APP_FILES := VERIFY;ASN1PARS;REQ;DGST;DH;ENC;GENDH;ERRSTR;CA;- +$! PKCS7;CRL2P7;CRL;- +$! RSA;DSA;DSAPARAM;- +$! X509;GENRSA;GENDSA;- +$! S_SERVER,'OBJ_DIR'S_SOCKET.OBJ,'OBJ_DIR'S_CB.OBJ;- +$! S_CLIENT,'OBJ_DIR'S_SOCKET.OBJ,'OBJ_DIR'S_CB.OBJ;- +$! SPEED;- +$! S_TIME,'OBJ_DIR'S_CB.OBJ;VERSION;SESS_ID;CIPHERS;NSEQ +$!$ TCPIP_PROGRAMS = ",," +$!$ IF COMPILER .EQS. "VAXC" THEN - +$! TCPIP_PROGRAMS = ",S_SERVER,S_CLIENT,SESS_ID,CIPHERS,S_TIME," +$! +$! Setup exceptional compilations +$! +$ COMPILEWITH_CC2 = ",S_SOCKET,S_SERVER,S_CLIENT," +$! +$ PHASE := LIB +$! +$ RESTART: +$! +$! Define A File Counter And Set It To "0". +$! +$ FILE_COUNTER = 0 +$! +$! Top Of The File Loop. +$! +$ NEXT_FILE: +$! +$! O.K, Extract The File Name From The File List. +$! +$ FILE_NAME0 = F$EDIT(F$ELEMENT(FILE_COUNTER,";",'PHASE'_FILES),"TRIM") +$ FILE_NAME = F$EDIT(F$ELEMENT(0,",",FILE_NAME0),"TRIM") +$ EXTRA_OBJ = FILE_NAME0 - FILE_NAME +$! +$! Check To See If We Are At The End Of The File List. +$! +$ IF (FILE_NAME0.EQS.";") +$ THEN +$ IF (PHASE.EQS."LIB") +$ THEN +$ PHASE := APP +$ GOTO RESTART +$ ELSE +$ GOTO FILE_DONE +$ ENDIF +$ ENDIF +$! +$! Increment The Counter. +$! +$ FILE_COUNTER = FILE_COUNTER + 1 +$! +$! Check to see if this program should actually be compiled +$! +$ IF PHASE .EQS. "APP" .AND. - + ","+PROGRAMS+"," - (","+F$EDIT(FILE_NAME,"UPCASE")+",") .EQS. ","+PROGRAMS+"," +$ THEN +$ GOTO NEXT_FILE +$ ENDIF +$! +$! Create The Source File Name. +$! +$ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C" +$! +$! Create The Object File Name. +$! +$ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ" +$! +$! Create The Executable File Name. +$! +$ EXE_FILE = EXE_DIR + FILE_NAME + ".EXE" +$ ON WARNING THEN GOTO NEXT_FILE +$! +$! Check To See If The File We Want To Compile Actually Exists. +$! +$ IF (F$SEARCH(SOURCE_FILE).EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ GOTO EXIT +$! +$! End The File Exist Check. +$! +$ ENDIF +$! +$! Tell The User What We Are Building. +$! +$ IF (PHASE.EQS."LIB") +$ THEN +$ WRITE SYS$OUTPUT "Compiling The ",FILE_NAME,".C File." +$ ELSE +$ WRITE SYS$OUTPUT "Building The ",FILE_NAME," Application Program." +$ ENDIF +$! +$! Compile The File. +$! +$ ON ERROR THEN GOTO NEXT_FILE +$ IF COMPILEWITH_CC2 - FILE_NAME .NES. COMPILEWITH_CC2 +$ THEN +$ CC2/OBJECT='OBJECT_FILE' 'SOURCE_FILE' +$ ELSE +$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE' +$ ENDIF +$! +$ ON WARNING THEN GOTO NEXT_FILE +$! +$ IF (PHASE.EQS."LIB") +$ THEN +$ GOTO NEXT_FILE +$ ENDIF +$! +$! Check if this program works well without a TCPIP library +$! +$ IF TCPIP_LIB .EQS. "" .AND. TCPIP_PROGRAMS - FILE_NAME .NES. TCPIP_PROGRAMS +$ THEN +$ WRITE SYS$OUTPUT FILE_NAME," needs a TCP/IP library. Can't link. Skipping..." +$ GOTO NEXT_FILE +$ ENDIF +$! +$! Link The Program, Check To See If We Need To Link With RSAREF Or Not. +$! +$ IF (RSAREF.EQS."TRUE") +$ THEN +$! +$! Check To See If We Are To Link With A Specific TCP/IP Library. +$! +$ IF (TCPIP_LIB.NES."") +$ THEN +$! +$! Link With The RSAREF Library And A Specific TCP/IP Library. +$! +$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' - + 'OBJECT_FILE''EXTRA_OBJ', - + 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY,'RSAREF_LIB'/LIBRARY, - + 'TCPIP_LIB','OPT_FILE'/OPTION +$! +$! Else... +$! +$ ELSE +$! +$! Link With The RSAREF Library And NO TCP/IP Library. +$! +$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' - + 'OBJECT_FILE''EXTRA_OBJ', - + 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY,'RSAREF_LIB'/LIBRARY, - + 'OPT_FILE'/OPTION +$! +$! End The TCP/IP Library Check. +$! +$ ENDIF +$! +$! Else... +$! +$ ELSE +$! +$! Don't Link With The RSAREF Routines. +$! +$! +$! 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' /EXE='EXE_FILE' - + 'OBJECT_FILE''EXTRA_OBJ', - + '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' - + 'OBJECT_FILE''EXTRA_OBJ', - + 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, - + 'OPT_FILE'/OPTION +$! +$! End The TCP/IP Library Check. +$! +$ ENDIF +$! +$! End The RSAREF Link Check. +$! +$ ENDIF +$! +$! Go Back And Do It Again. +$! +$ GOTO NEXT_FILE +$! +$! All Done With This File. +$! +$ FILE_DONE: +$ EXIT: +$! +$! All Done, Time To Clean Up And Exit. +$! +$ GOSUB CLEANUP +$ EXIT +$! +$! Check For The Link Option FIle. +$! +$ CHECK_OPT_FILE: +$! +$! Check To See If We Need To Make A VAX C Option File. +$! +$ IF (COMPILER.EQS."VAXC") +$ THEN +$! +$! Check To See If We Already Have A VAX C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! We Need A VAX C Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable VAX C Runtime Library. +! +SYS$SHARE:VAXCRTL.EXE/SHARE +$EOD +$! +$! End The Option File Check. +$! +$ ENDIF +$! +$! End The VAXC Check. +$! +$ ENDIF +$! +$! Check To See If We Need A GNU C Option File. +$! +$ IF (COMPILER.EQS."GNUC") +$ THEN +$! +$! Check To See If We Already Have A GNU C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! We Need A GNU C Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable C Runtime Library. +! +GNU_CC:[000000]GCCLIB/LIBRARY +SYS$SHARE:VAXCRTL/SHARE +$EOD +$! +$! End The Option File Check. +$! +$ ENDIF +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Check To See If We Need A DEC C Option File. +$! +$ IF (COMPILER.EQS."DECC") +$ THEN +$! +$! Check To See If We Already Have A DEC C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! Figure Out If We Need An AXP Or A VAX Linker Option File. +$! +$ IF ARCH.EQS."VAX" +$ THEN +$! +$! We Need A DEC C Linker Option File For VAX. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable DEC C Runtime Library. +! +SYS$SHARE:DECC$SHR.EXE/SHARE +$EOD +$! +$! Else... +$! +$ ELSE +$! +$! Create The AXP Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File For AXP To Link Agianst +! The Sharable C Runtime Library. +! +SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE +SYS$SHARE:CMA$OPEN_RTL/SHARE +$EOD +$! +$! End The VAX/AXP DEC C Option File Check. +$! +$ ENDIF +$! +$! End The Option File Search. +$! +$ ENDIF +$! +$! End The DEC C Check. +$! +$ ENDIF +$! +$! Tell The User What Linker Option File We Are Using. +$! +$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." +$! +$! Time To RETURN. +$! +$ RETURN +$! +$! Check To See If We Have The Appropiate Libraries. +$! +$ LIB_CHECK: +$! +$! Look For The Library LIBCRYPTO.OLB. +$! +$ IF (F$SEARCH(CRYPTO_LIB).EQS."") +$ THEN +$! +$! Tell The User We Can't Find The LIBCRYPTO.OLB Library. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"." +$ WRITE SYS$OUTPUT "We Can't Link Without It." +$ WRITE SYS$OUTPUT "" +$! +$! Since We Can't Link Without It, Exit. +$! +$ EXIT +$! +$! End The Crypto Library Check. +$! +$ ENDIF +$! +$! See If We Need The RSAREF Library. +$! +$ IF (RSAREF.EQS."TRUE") +$ THEN +$! +$! Look For The Library LIBRSAGLUE.OLB. +$! +$ IF (F$SEARCH(RSAREF_LIB).EQS."") +$ THEN +$! +$! Tell The User We Can't Find The LIBRSAGLUE.OLB Library. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Can't Find The Library ",RSAREF_LIB,"." +$ WRITE SYS$OUTPUT "We Can't Link Without It." +$ WRITE SYS$OUTPUT "" +$! +$! Since We Can't Link Without It, Exit. +$! +$ EXIT +$ ENDIF +$! +$! End The RSAREF Library Check. +$! +$ ENDIF +$! +$! Look For The Library LIBSSL.OLB. +$! +$ IF (F$SEARCH(SSL_LIB).EQS."") +$ THEN +$! +$! Tell The User We Can't Find The LIBSSL.OLB Library. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"." +$ WRITE SYS$OUTPUT "Some Of The Test Programs Need To Link To It." +$ WRITE SYS$OUTPUT "" +$! +$! Since We Can't Link Without It, Exit. +$! +$ EXIT +$! +$! End The SSL Library Check. +$! +$ ENDIF +$! +$! Time To Return. +$! +$ RETURN +$! +$! Check The User's Options. +$! +$ CHECK_OPTIONS: +$! +$! Check To See If P1 Is Blank. +$! +$ IF (P1.EQS."NORSAREF") +$ THEN +$! +$! P1 Is NORSAREF, So Compile With The Regular RSA Libraries. +$! +$ RSAREF = "FALSE" +$! +$! Else... +$! +$ ELSE +$! +$! Check To See If We Are To Use The RSAREF Library. +$! +$ IF (P1.EQS."RSAREF") +$ THEN +$! +$! Check To Make Sure We Have The RSAREF Source Code Directory. +$! +$ IF (F$SEARCH("SYS$DISK:[-.RSAREF]SOURCE.DIR").EQS."") +$ THEN +$! +$! We Don't Have The RSAREF Souce Code Directory, So Tell The +$! User This. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "It appears that you don't have the RSAREF Souce Code." +$ WRITE SYS$OUTPUT "You need to go to 'ftp://ftp.rsa.com/rsaref'. You have to" +$ WRITE SYS$OUTPUT "get the '.tar-Z' file as the '.zip' file dosen't have the" +$ WRITE SYS$OUTPUT "directory structure stored. You have to extract the file" +$ WRITE SYS$OUTPUT "into the [.RSAREF] directory under the root directory" +$ WRITE SYS$OUTPUT "as that is where the scripts will look for the files." +$ WRITE SYS$OUTPUT "" +$! +$! Time To Exit. +$! +$ EXIT +$! +$! Else... +$! +$ ELSE +$! +$! Compile Using The RSAREF Library. +$! +$ RSAREF = "TRUE" +$! +$! End The RSAREF Soure Directory Check. +$! +$ ENDIF +$! +$! Else... +$! +$ ELSE +$! +$! They Entered An Invalid Option.. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " RSAREF : Compile With The RSAREF Library." +$ WRITE SYS$OUTPUT " NORSAREF : Compile With The Regular RSA Library." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End P1 Check. +$! +$ ENDIF +$! +$! Check To See If P2 Is Blank. +$! +$ IF (P2.EQS."NODEBUG") +$ THEN +$! +$! 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." +$! +$! Else... +$! +$ ELSE +$! +$! Check To See If We Are To Compile With Debugger Information. +$! +$ IF (P2.EQS."DEBUG") +$ THEN +$! +$! Compile With Debugger Information. +$! +$ DEBUGGER = "DEBUG" +$ TRACEBACK = "TRACEBACK" +$ GCC_OPTIMIZE = "NOOPTIMIZE" +$ CC_OPTIMIZE = "NOOPTIMIZE" +$ 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.. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information." +$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P2 Check. +$! +$ ENDIF +$! +$! Check To See If P3 Is Blank. +$! +$ IF (P3.EQS."") +$ THEN +$! +$! O.K., The User Didn't Specify A Compiler, Let's Try To +$! Find Out Which One To Use. +$! +$! Check To See If We Have GNU C. +$! +$ IF (F$TRNLNM("GNU_CC").NES."") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ P3 = "GNUC" +$! +$! Else... +$! +$ ELSE +$! +$! Check To See If We Have VAXC Or DECC. +$! +$ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ P3 = "DECC" +$! +$! Else... +$! +$ ELSE +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ P3 = "VAXC" +$! +$! End The VAXC Compiler Check. +$! +$ ENDIF +$! +$! End The DECC & VAXC Compiler Check. +$! +$ ENDIF +$! +$! End The Compiler Check. +$! +$ ENDIF +$! +$! Check To See If We Have A Option For P4. +$! +$ IF (P4.EQS."") +$ THEN +$! +$! Find out what socket library we have available +$! +$ IF F$PARSE("SOCKETSHR:") .NES. "" +$ THEN +$! +$! We have SOCKETSHR, and it is my opinion that it's the best to use. +$! +$ P4 = "SOCKETSHR" +$! +$! Tell the user +$! +$ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP" +$! +$! Else, let's look for something else +$! +$ ELSE +$! +$! Like UCX (the reason to do this before Multinet is that the UCX +$! emulation is easier to use...) +$! +$ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" - + .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" - + .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. "" +$ THEN +$! +$! Last resort: a UCX or UCX-compatible library +$! +$ P4 = "UCX" +$! +$! Tell the user +$! +$ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP" +$! +$! That was all... +$! +$ ENDIF +$ ENDIF +$ ENDIF +$! +$! Set Up Initial CC Definitions, Possibly With User Ones +$! +$ CCDEFS = "VMS=1,MONOLITH" +$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS +$ CCEXTRAFLAGS = "" +$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS +$ CCDISABLEWARNINGS = "" +$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - + CCDISABLEWARNINGS = USER_CCDISABLEWARNINGS +$! +$! Check To See If The User Entered A Valid Paramter. +$! +$ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC") +$ THEN +$! +$! Check To See If The User Wanted DECC. +$! +$ IF (P3.EQS."DECC") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ COMPILER = "DECC" +$! +$! Tell The User We Are Using DECC. +$! +$ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." +$! +$! Use DECC... +$! +$ 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" + - + "/NOLIST/PREFIX=ALL" + CCEXTRAFLAGS +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT" +$! +$! End DECC Check. +$! +$ ENDIF +$! +$! Check To See If We Are To Use VAXC. +$! +$ IF (P3.EQS."VAXC") +$ THEN +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ COMPILER = "VAXC" +$! +$! Tell The User We Are Using VAX C. +$ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler." +$! +$! Compile Using VAXC. +$! +$ CC = "CC" +$ IF ARCH.EQS."AXP" +$ THEN +$ WRITE SYS$OUTPUT "There is no VAX C on Alpha!" +$ EXIT +$ ENDIF +$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" +$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS +$ CCDEFS = CCDEFS + ",""VAXC""" +$! +$! Define <sys> As SYS$COMMON:[SYSLIB] +$! +$ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT" +$! +$! End VAXC Check +$! +$ ENDIF +$! +$! Check To See If We Are To Use GNU C. +$! +$ IF (P3.EQS."GNUC") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ COMPILER = "GNUC" +$! +$! Tell The User We Are Using GNUC. +$! +$ WRITE SYS$OUTPUT "Using GNU 'C' Compiler." +$! +$! Use GNU C... +$! +$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT" +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Set up default defines +$! +$ CCDEFS = """FLAT_INC=1""," + CCDEFS +$! +$! Check To See If We Are To Compile With RSAREF Routines. +$! +$ IF (RSAREF.EQS."TRUE") +$ THEN +$! +$! Compile With RSAREF. +$! +$ CCDEFS = CCDEFS + ",""RSAref=1""" +$! +$! Tell The User This. +$! +$ WRITE SYS$OUTPUT "Compiling With RSAREF Routines." +$! +$! Else, We Don't Care. Compile Without The RSAREF Library. +$! +$ ELSE +$! +$! Tell The User We Are Compile Without The RSAREF Routines. +$! +$ WRITE SYS$OUTPUT "Compiling Without The RSAREF Routines. +$! +$! End The RSAREF Check. +$! +$ ENDIF +$! +$! Else The User Entered An Invalid Arguement. +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C." +$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C." +$ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$ ENDIF +$! +$! Time to check the contents, and to make sure we get the correct library. +$! +$ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" +$ THEN +$! +$! Check to see if SOCKETSHR was chosen +$! +$ IF P4.EQS."SOCKETSHR" +$ THEN +$! +$! Set the library to use SOCKETSHR +$! +$ TCPIP_LIB = "[-.VMS]SOCKETSHR_SHR.OPT/OPT" +$! +$! Done with SOCKETSHR +$! +$ ENDIF +$! +$! Check to see if MULTINET was chosen +$! +$ IF P4.EQS."MULTINET" +$ THEN +$! +$! Set the library to use UCX emulation. +$! +$ P4 = "UCX" +$! +$! Done with MULTINET +$! +$ ENDIF +$! +$! Check to see if UCX was chosen +$! +$ IF P4.EQS."UCX" +$ THEN +$! +$! Set the library to use UCX. +$! +$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC.OPT/OPT" +$ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" +$ THEN +$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT" +$ ELSE +$ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - + TCPIP_LIB = "[-.VMS]UCX_SHR_VAXC.OPT/OPT" +$ ENDIF +$! +$! Done with UCX +$! +$ ENDIF +$! +$! Add TCP/IP type to CC definitions. +$! +$ CCDEFS = CCDEFS + ",TCPIP_TYPE_''P4'" +$! +$! Print info +$! +$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB +$! +$! Else The User Entered An Invalid Arguement. +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library." +$ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! Done with TCP/IP libraries +$! +$ ENDIF +$! +$! Finish up the definition of CC. +$! +$ IF COMPILER .EQS. "DECC" +$ THEN +$ IF CCDISABLEWARNINGS .NES. "" +$ THEN +$ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" +$ ENDIF +$ ELSE +$ CCDISABLEWARNINGS = "" +$ ENDIF +$ CC2 = CC + "/DEFINE=(" + CCDEFS + ",_POSIX_C_SOURCE)" + CCDISABLEWARNINGS +$ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS +$! +$! Show user the result +$! +$ WRITE SYS$OUTPUT "Main Compiling Command: ",CC +$! +$! Special Threads For OpenVMS v7.1 Or Later +$! +$! Written By: Richard Levitte +$! richard@levitte.org +$! +$! +$! Check To See If We Have A Option For P5. +$! +$ IF (P5.EQS."") +$ THEN +$! +$! Get The Version Of VMS We Are Using. +$! +$ ISSEVEN := +$ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION"))) +$ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP)) +$! +$! Check To See If The VMS Version Is v7.1 Or Later. +$! +$ IF (TMP.GE.71) +$ THEN +$! +$! We Have OpenVMS v7.1 Or Later, So Use The Special Threads. +$! +$ ISSEVEN := ,PTHREAD_USE_D4 +$! +$! End The VMS Version Check. +$! +$ ENDIF +$! +$! End The P5 Check. +$! +$ ENDIF +$! +$! Check if the user wanted to compile just a subset of all the programs. +$! +$ IF P6 .NES. "" +$ THEN +$ PROGRAMS = P6 +$ ENDIF +$! +$! Time To RETURN... +$! +$ RETURN +$! +$ INITIALISE: +$! +$! Save old value of the logical name OPENSSL +$! +$ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE") +$! +$! Save directory information +$! +$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;" +$ __TOP = __HERE - "APPS]" +$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]" +$! +$! Set up the logical name OPENSSL to point at the include directory +$! +$ DEFINE OPENSSL/NOLOG '__INCLUDE' +$! +$! Done +$! +$ RETURN +$! +$ CLEANUP: +$! +$! Restore the logical name OPENSSL if it had a value +$! +$ IF __SAVE_OPENSSL .EQS. "" +$ THEN +$ DEASSIGN OPENSSL +$ ELSE +$ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL' +$ ENDIF +$! +$! Done +$! +$ RETURN diff --git a/apps/openssl-vms.cnf b/apps/openssl-vms.cnf new file mode 100644 index 0000000000..f5c11a0cc8 --- /dev/null +++ b/apps/openssl-vms.cnf @@ -0,0 +1,190 @@ +# +# OpenSSL example configuration file. +# This is mostly being used for generation of certificate requests. +# + +RANDFILE = $ENV::HOME.rnd +oid_file = $ENV::HOME.oid +oid_section = new_oids + +[ new_oids ] + +# We can add new OIDs in here for use by 'ca' and 'req'. +# Add a simple OID like this: +# testoid1=1.2.3.4 +# Or use config file substitution like this: +# testoid2=${testoid1}.5.6 + +#################################################################### +[ ca ] +default_ca = CA_default # The default ca section + +#################################################################### +[ CA_default ] + +dir = sys\$disk:[.demoCA # Where everything is kept +certs = $dir.certs] # Where the issued certs are kept +crl_dir = $dir.crl] # Where the issued crl are kept +database = $dir]index.txt # database index file. +new_certs_dir = $dir.newcerts] # default place for new certs. + +certificate = $dir]cacert.pem # The CA certificate +serial = $dir]serial. # The current serial number +crl = $dir]crl.pem # The current CRL +private_key = $dir.private]cakey.pem# The private key +RANDFILE = $dir.private].rand # private random number file + +x509_extensions = usr_cert # The extentions to add to the cert +default_days = 365 # how long to certify for +default_crl_days= 30 # how long before next CRL +default_md = md5 # which md to use. +preserve = no # keep passed DN ordering + +# A few difference way of specifying how similar the request should look +# For type CA, the listed attributes must be the same, and the optional +# and supplied fields are just that :-) +policy = policy_match + +# For the CA policy +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +# For the 'anything' policy +# At this point in time, you must list all acceptable 'object' +# types. +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +#################################################################### +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca # The extentions to add to the self signed cert + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = AU +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = Some-State + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = Internet Widgits Pty Ltd + +# we can do this but it is not needed normally :-) +#1.organizationName = Second Organization Name (eg, company) +#1.organizationName_default = World Wide Web Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) +#organizationalUnitName_default = + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 40 + +# SET-ex3 = SET extension number 3 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 + +unstructuredName = An optional company name + +[ usr_cert ] + +# These extensions are added when 'ca' signs a request. + +# This goes against PKIX guidelines but some CAs do it and some software +# requires this to avoid interpreting an end user certificate as a CA. + +basicConstraints=CA:FALSE + +# Here are some examples of the usage of nsCertType. If it is omitted +# the certificate can be used for anything *except* object signing. + +# This is OK for an SSL server. +#nsCertType = server + +# For an object signing certificate this would be used. +#nsCertType = objsign + +# For normal client use this is typical +#nsCertType = client, email + +# This is typical also + +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +nsComment = "OpenSSL Generated Certificate" + +# PKIX recommendations +subjectKeyIdentifier=hash +authorityKeyIdentifier=keyid,issuer:always + +# Import the email address. + +subjectAltName=email:copy + +# Copy subject details + +issuerAltName=issuer:copy + +#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem +#nsBaseUrl +#nsRevocationUrl +#nsRenewalUrl +#nsCaPolicyUrl +#nsSslServerName + +[ v3_ca] + +# Extensions for a typical CA + +# It's a CA certificate +basicConstraints = CA:true + +# PKIX recommendation. + +subjectKeyIdentifier=hash + +authorityKeyIdentifier=keyid:always,issuer:always + +# This is what PKIX recommends but some broken software chokes on critical +# extensions. +#basicConstraints = critical,CA:true + +# Key usage: again this should really be critical. +keyUsage = cRLSign, keyCertSign + +# Some might want this also +#nsCertType = sslCA, emailCA + +# Include email address in subject alt name: another PKIX recommendation +subjectAltName=email:copy +# Copy issuer details +issuerAltName=issuer:copy + +# RAW DER hex encoding of an extension: beware experts only! +# 1.2.3.5=RAW:02:03 +# You can even override a supported extension: +# basicConstraints= critical, RAW:30:03:01:01:FF diff --git a/apps/openssl.c b/apps/openssl.c index 7bedff48cc..d7d6601b08 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -147,7 +147,9 @@ int main(int Argc, char *Argv[]) if (p == NULL) { strcpy(config_name,X509_get_default_cert_area()); +#ifndef VMS strcat(config_name,"/"); +#endif strcat(config_name,OPENSSL_CONF); p=config_name; } diff --git a/apps/req.c b/apps/req.c index 434ca7af22..052cae9804 100644 --- a/apps/req.c +++ b/apps/req.c @@ -361,7 +361,9 @@ bad: if (p == NULL) { strcpy(config_name,X509_get_default_cert_area()); +#ifndef VMS strcat(config_name,"/"); +#endif strcat(config_name,OPENSSL_CONF); p=config_name; } diff --git a/apps/s_apps.h b/apps/s_apps.h index 68d6a73b9b..1a0e9f9f92 100644 --- a/apps/s_apps.h +++ b/apps/s_apps.h @@ -56,6 +56,30 @@ * [including the GNU Public Licence.] */ +#include <sys/types.h> +#if (defined(VMS) || defined(__VMS)) && !defined(FD_SET) +/* VAX C does not defined fd_set and friends, but it's actually quite simple */ +/* These definitions are borrowed from SOCKETSHR. /Richard Levitte */ +#define MAX_NOFILE 32 +#define NBBY 8 /* number of bits in a byte */ + +#ifndef FD_SETSIZE +#define FD_SETSIZE MAX_NOFILE +#endif /* FD_SETSIZE */ + +/* How many things we'll allow select to use. 0 if unlimited */ +#define MAXSELFD MAX_NOFILE +typedef int fd_mask; /* int here! VMS prototypes int, not long */ +#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask (power of 2!)*/ +#define NFDSHIFT 5 /* Shift based on above */ + +typedef fd_mask fd_set; +#define FD_SET(n, p) (*(p) |= (1 << ((n) % NFDBITS))) +#define FD_CLR(n, p) (*(p) &= ~(1 << ((n) % NFDBITS))) +#define FD_ISSET(n, p) (*(p) & (1 << ((n) % NFDBITS))) +#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) +#endif + #define PORT 4433 #define PORT_STR "4433" #define PROTOCOL "tcp" diff --git a/apps/s_client.c b/apps/s_client.c index f0c2280d2e..594ee7ea16 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -56,6 +56,15 @@ * [including the GNU Public Licence.] */ +/* With IPv6, it looks like Digital has mixed up the proper order of + recursive header file inclusion, resulting in the compiler complaining + that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which + is needed to have fileno() declared correctly... So let's define u_int */ +#if defined(__DECC) && !defined(__U_INT) +#define __U_INT +typedef unsigned int u_int; +#endif + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -70,6 +79,11 @@ #include <openssl/pem.h> #include "s_apps.h" +#if (__VMS_VER < 70000000) /* FIONBIO used as a switch to enable ioctl, + and that isn't in VMS < 7.0 */ +#undef FIONBIO +#endif + #if defined(NO_RSA) && !defined(NO_SSL2) #define NO_SSL2 #endif @@ -454,7 +468,14 @@ re_start: /* printf("mode tty(%d %d%d) ssl(%d%d)\n", tty_on,read_tty,write_tty,read_ssl,write_ssl);*/ - i=select(width,&readfds,&writefds,NULL,NULL); + /* Note: under VMS with SOCKETSHR the third parameter + * is currently of type (int *) whereas under other + * systems it is (void *) if you don't have a cast it + * will choke the compiler: if you do have a cast then + * you can either go for (int *) or (void *). + */ + i=select(width,(void *)&readfds,(void *)&writefds, + NULL,NULL); if ( i < 0) { BIO_printf(bio_err,"bad select %d\n", diff --git a/apps/s_server.c b/apps/s_server.c index 7d1b569269..5004b6fc0e 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -56,6 +56,15 @@ * [including the GNU Public Licence.] */ +/* With IPv6, it looks like Digital has mixed up the proper order of + recursive header file inclusion, resulting in the compiler complaining + that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which + is needed to have fileno() declared correctly... So let's define u_int */ +#if defined(__DECC) && !defined(__U_INT) +#define __U_INT +typedef unsigned int u_int; +#endif + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -74,6 +83,11 @@ #include <openssl/ssl.h> #include "s_apps.h" +#if (__VMS_VER < 70000000) /* FIONBIO used as a switch to enable ioctl, + and that isn't in VMS < 7.0 */ +#undef FIONBIO +#endif + #if defined(NO_RSA) && !defined(NO_SSL2) #define NO_SSL2 #endif @@ -94,8 +108,12 @@ static DH *get_dh512(void); /* static void s_server_init(void);*/ #ifndef S_ISDIR +#if defined(VMS) && !defined(__DECC) +#define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR) +#else #define S_ISDIR(a) (((a) & _S_IFMT) == _S_IFDIR) #endif +#endif #ifndef NO_DH static unsigned char dh512_p[]={ @@ -610,7 +628,13 @@ static int sv_body(char *hostname, int s, unsigned char *context) FD_SET(fileno(stdin),&readfds); #endif FD_SET(s,&readfds); - i=select(width,&readfds,NULL,NULL,NULL); + /* Note: under VMS with SOCKETSHR the third parameter is + * currently of type (int *) whereas under other systems + * it is (void *) if you don't have a cast it will choke + * the compiler: if you do have a cast then you can either + * go for (int *) or (void *). + */ + i=select(width,(void *)&readfds,NULL,NULL,NULL); if (i <= 0) continue; if (FD_ISSET(fileno(stdin),&readfds)) { diff --git a/apps/s_socket.c b/apps/s_socket.c index 724d48a071..1d8587f1f5 100644 --- a/apps/s_socket.c +++ b/apps/s_socket.c @@ -56,6 +56,15 @@ * [including the GNU Public Licence.] */ +/* With IPv6, it looks like Digital has mixed up the proper order of + recursive header file inclusion, resulting in the compiler complaining + that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which + is needed to have fileno() declared correctly... So let's define u_int */ +#if defined(__DECC) && !defined(__U_INT) +#define __U_INT +typedef unsigned int u_int; +#endif + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -69,6 +78,14 @@ #include "s_apps.h" #include <openssl/ssl.h> +#if (__VMS_VER < 70000000) /* FIONBIO used as a switch to enable ioctl, + and that isn't in VMS < 7.0 */ +#undef FIONBIO +#endif +#ifdef VMS /* for vfork() */ +#include <processes.h> +#endif + static struct hostent *GetHostByName(char *name); int sock_init(void ); #ifdef WIN16 @@ -206,7 +223,12 @@ int nbio_sock_error(int sock) int size; size=sizeof(int); - i=getsockopt(sock,SOL_SOCKET,SO_ERROR,(char *)&j,&size); + /* Note: under VMS with SOCKETSHR the third parameter is currently + * of type (int *) whereas under other systems it is (void *) if + * you don't have a cast it will choke the compiler: if you do + * have a cast then you can either go for (int *) or (void *). + */ + i=getsockopt(sock,SOL_SOCKET,SO_ERROR,(char *)&j,(void *)&size); if (i < 0) return(1); else @@ -321,7 +343,7 @@ int init_server_long(int *sock, int port, char *ip) { int j = 1; setsockopt(s, SOL_SOCKET, SO_REUSEADDR, - (const void *) &j, sizeof j); + (void *) &j, sizeof j); } #endif if (bind(s,(struct sockaddr *)&server,sizeof(server)) == -1) @@ -365,7 +387,12 @@ redoit: memset((char *)&from,0,sizeof(from)); len=sizeof(from); - ret=accept(acc_sock,(struct sockaddr *)&from,&len); + /* Note: under VMS with SOCKETSHR the third parameter is currently + * of type (int *) whereas under other systems it is (void *) if + * you don't have a cast it will choke the compiler: if you do + * have a cast then you can either go for (int *) or (void *). + */ + ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len); if (ret == INVALID_SOCKET) { #ifdef WINDOWS @@ -589,7 +616,11 @@ int spawn(int argc, char **argv, int *in, int *out) if ((pipe(p1) < 0) || (pipe(p2) < 0)) return(-1); +#ifdef VMS + if ((pid=vfork()) == 0) +#else if ((pid=fork()) == 0) +#endif { /* child */ if (dup2(CHILD_WRITE,fileno(stdout)) < 0) perror("dup2"); diff --git a/apps/s_time.c b/apps/s_time.c index c5e3dcd5ae..9da140d05a 100644 --- a/apps/s_time.c +++ b/apps/s_time.c @@ -74,10 +74,10 @@ #ifdef NO_STDIO #define APPS_WIN16 #endif +#define USE_SOCKETS #include <openssl/x509.h> #include <openssl/ssl.h> #include <openssl/pem.h> -#define USE_SOCKETS #include "apps.h" #include "s_apps.h" #include <openssl/err.h> @@ -86,11 +86,10 @@ #include "wintext.h" #endif -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -98,15 +97,15 @@ #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif @@ -138,6 +137,7 @@ struct tms { #undef PROG #define PROG s_time_main +#undef ioctl #define ioctl ioctlsocket #define SSL_CONNECT_NAME "localhost:4433" @@ -668,7 +668,13 @@ static SSL *doConnection(SSL *scon) width=i+1; FD_ZERO(&readfds); FD_SET(i,&readfds); - select(width,&readfds,NULL,NULL,NULL); + /* Note: under VMS with SOCKETSHR the third parameter + * is currently of type (int *) whereas under other + * systems it is (void *) if you don't have a cast it + * will choke the compiler: if you do have a cast then + * you can either go for (int *) or (void *). + */ + select(width,(void *)&readfds,NULL,NULL,NULL); continue; } break; diff --git a/apps/speed.c b/apps/speed.c index 4c48fd5b92..f4bff5c1da 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -82,11 +82,10 @@ #include <openssl/rand.h> #include <openssl/err.h> -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -94,15 +93,15 @@ #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif diff --git a/crypto/Makefile.ssl b/crypto/Makefile.ssl index 15b1f11b4e..4806eeeb7c 100644 --- a/crypto/Makefile.ssl +++ b/crypto/Makefile.ssl @@ -31,7 +31,7 @@ SDIRS= md2 md5 sha mdc2 hmac ripemd \ buffer bio stack lhash rand err objects \ evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp -GENERAL=Makefile README +GENERAL=Makefile README crypto-lib.com install.com LIB= $(TOP)/libcrypto.a LIBSRC= cryptlib.c mem.c cversion.c ex_data.c tmdiff.c cpt_err.c diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c index 557c1efb8e..2c605ef33b 100644 --- a/crypto/asn1/a_utctm.c +++ b/crypto/asn1/a_utctm.c @@ -58,6 +58,11 @@ #include <stdio.h> #include <time.h> +#ifdef VMS +#include <descrip.h> +#include <lnmdef.h> +#include <starlet.h> +#endif #include "cryptlib.h" #include <openssl/asn1.h> @@ -182,6 +187,43 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t) #else ts=gmtime(&t); #endif +#ifdef VMS + if (ts == NULL) + { + static $DESCRIPTOR(tabnam,"LNM$DCL_LOGICAL"); + static $DESCRIPTOR(lognam,"SYS$TIMEZONE_DIFFERENTIAL"); + char result[256]; + unsigned int reslen = 0; + struct { + short buflen; + short code; + void *bufaddr; + unsigned int *reslen; + } itemlist[] = { + { 0, LNM$_STRING, 0, 0 }, + { 0, 0, 0, 0 }, + }; + int status; + + /* Get the value for SYS$TIMEZONE_DIFFERENTIAL */ + itemlist[0].buflen = sizeof(result); + itemlist[0].bufaddr = result; + itemlist[0].reslen = &reslen; + status = sys$trnlnm(0, &tabnam, &lognam, 0, itemlist); + if (!(status & 1)) + return NULL; + result[reslen] = '\0'; + + /* Get the numerical value of the equivalence string */ + status = atoi(result); + + /* and use it to move time to GMT */ + t -= status; + + /* then convert the result to the time structure */ + ts=(struct tm *)localtime(&t); + } +#endif p=(char *)s->data; if ((p == NULL) || (s->length < 14)) { diff --git a/crypto/bf/bf_opts.c b/crypto/bf/bf_opts.c index 7253d765e9..6ac0611918 100644 --- a/crypto/bf/bf_opts.c +++ b/crypto/bf/bf_opts.c @@ -59,7 +59,7 @@ /* define PART1, PART2, PART3 or PART4 to build only with a few of the options. * This is for machines with 64k code segment size restrictions. */ -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif @@ -71,7 +71,6 @@ extern void exit(); #endif #include <signal.h> -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -79,15 +78,15 @@ extern void exit(); #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif diff --git a/crypto/bf/bfspeed.c b/crypto/bf/bfspeed.c index bca36e5a3b..52758e24b1 100644 --- a/crypto/bf/bfspeed.c +++ b/crypto/bf/bfspeed.c @@ -59,7 +59,7 @@ /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif @@ -71,7 +71,6 @@ extern int exit(); #endif #include <signal.h> -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -79,15 +78,15 @@ extern int exit(); #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index cc9c125478..07c9edd33c 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -195,7 +195,7 @@ int BIO_sock_error(int sock) * a cast it will choke the compiler: if you do have a cast then * you can either go for (char *) or (void *). */ - i=getsockopt(sock,SOL_SOCKET,SO_ERROR,(void *)&j,&size); + i=getsockopt(sock,SOL_SOCKET,SO_ERROR,(void *)&j,(void *)&size); if (i < 0) return(1); else @@ -408,6 +408,8 @@ void BIO_sock_cleanup(void) #endif } +#if !defined(VMS) || __VMS_VER >= 70000000 + int BIO_socket_ioctl(int fd, long type, unsigned long *arg) { int i; @@ -417,6 +419,7 @@ int BIO_socket_ioctl(int fd, long type, unsigned long *arg) SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error()); return(i); } +#endif /* __VMS_VER */ /* The reason I have implemented this instead of using sscanf is because * Visual C 1.52c gives an unresolved external when linking a DLL :-( */ @@ -593,7 +596,12 @@ int BIO_accept(int sock, char **addr) memset((char *)&from,0,sizeof(from)); len=sizeof(from); - ret=accept(sock,(struct sockaddr *)&from,&len); + /* Note: under VMS with SOCKETSHR the third parameter is currently + * of type (int *) whereas under other systems it is (void *) if + * you don't have a cast it will choke the compiler: if you do + * have a cast then you can either go for (int *) or (void *). + */ + ret=accept(sock,(struct sockaddr *)&from,(void *)&len); if (ret == INVALID_SOCKET) { SYSerr(SYS_F_ACCEPT,get_last_socket_error()); diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index 74e6bd6a05..e6961f2305 100644 --- a/crypto/bio/bss_acpt.c +++ b/crypto/bio/bss_acpt.c @@ -70,6 +70,11 @@ #define SOCKET_PROTOCOL IPPROTO_TCP #endif +#if (__VMS_VER < 70000000) /* FIONBIO used as a switch to enable ioctl, + and that isn't in VMS < 7.0 */ +#undef FIONBIO +#endif + typedef struct bio_accept_st { int state; diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c index 6e4fe9f5d4..21c379ed1a 100644 --- a/crypto/bio/bss_conn.c +++ b/crypto/bio/bss_conn.c @@ -70,6 +70,12 @@ #define SOCKET_PROTOCOL IPPROTO_TCP #endif +#if (__VMS_VER < 70000000) /* FIONBIO used as a switch to enable ioctl, + and that isn't in VMS < 7.0 */ +#undef FIONBIO +#endif + + typedef struct bio_connect_st { int state; diff --git a/crypto/bio/bss_rtcp.c b/crypto/bio/bss_rtcp.c index 925e9c811a..2ef040057e 100644 --- a/crypto/bio/bss_rtcp.c +++ b/crypto/bio/bss_rtcp.c @@ -58,6 +58,7 @@ /* Written by David L. Jones <jonesd@kcgl1.eng.ohio-state.edu> * Date: 22-JUL-1996 + * Revised: 25-SEP-1997 Update for 0.8.1, BIO_CTRL_SET -> BIO_C_SET_FD */ /* VMS */ #include <stdio.h> @@ -68,7 +69,8 @@ #include <openssl/bio.h> #include <iodef.h> /* VMS IO$_ definitions */ -extern int SYS$QIOW(); +#include <starlet.h> + typedef unsigned short io_channel; /*************************************************************************/ struct io_status { short status, count; long flags; }; @@ -114,11 +116,17 @@ BIO_METHOD *BIO_s_rtcp(void) /*****************************************************************************/ /* Decnet I/O routines. */ + +#ifdef __DECC +#pragma message save +#pragma message disable DOLLARID +#endif + static int get ( io_channel chan, char *buffer, int maxlen, int *length ) { int status; struct io_status iosb; - status = SYS$QIOW ( 0, chan, IO$_READVBLK, &iosb, 0, 0, + status = sys$qiow ( 0, chan, IO$_READVBLK, &iosb, 0, 0, buffer, maxlen, 0, 0, 0, 0 ); if ( (status&1) == 1 ) status = iosb.status; if ( (status&1) == 1 ) *length = iosb.count; @@ -129,11 +137,16 @@ static int put ( io_channel chan, char *buffer, int length ) { int status; struct io_status iosb; - status = SYS$QIOW ( 0, chan, IO$_WRITEVBLK, &iosb, 0, 0, + status = sys$qiow ( 0, chan, IO$_WRITEVBLK, &iosb, 0, 0, buffer, length, 0, 0, 0, 0 ); if ( (status&1) == 1 ) status = iosb.status; return status; } + +#ifdef __DECC +#pragma message restore +#endif + /***************************************************************************/ static int rtcp_new(BIO *bi) @@ -243,7 +256,7 @@ static long rtcp_ctrl(BIO *b, int cmd, long num, char *ptr) case BIO_CTRL_EOF: ret = 1; break; - case BIO_CTRL_SET: + case BIO_C_SET_FD: b->num = num; ret = 1; break; diff --git a/crypto/bn/asm/vms.mar b/crypto/bn/asm/vms.mar new file mode 100644 index 0000000000..ac9d57d7b0 --- /dev/null +++ b/crypto/bn/asm/vms.mar @@ -0,0 +1,6695 @@ + .title vax_bn_mul_add_word unsigned multiply & add, 32*32+32+32=>64 +; +; w.j.m. 15-jan-1999 +; +; it's magic ... +; +; ULONG bn_mul_add_words(ULONG r[],ULONG a[],int n,ULONG w) { +; ULONG c = 0; +; int i; +; for(i = 0; i < n; i++) <c,r[i]> := r[i] + c + a[i] * w ; +; return c; +; } + +r=4 ;(AP) +a=8 ;(AP) +n=12 ;(AP) n by value (input) +w=16 ;(AP) w by value (input) + + + .psect code,nowrt + +.entry bn_mul_add_words,^m<r2,r3,r4,r5,r6> + + moval @r(ap),r2 + moval @a(ap),r3 + movl n(ap),r4 ; assumed >0 by C code + movl w(ap),r5 + clrl r6 ; c + +0$: + emul r5,(r3),(r2),r0 ; w, a[], r[] considered signed + + ; fixup for "negative" r[] + tstl (r2) + bgeq 10$ + incl r1 +10$: + + ; add in c + addl2 r6,r0 + adwc #0,r1 + + ; combined fixup for "negative" w, a[] + tstl r5 + bgeq 20$ + addl2 (r3),r1 +20$: + tstl (r3) + bgeq 30$ + addl2 r5,r1 +30$: + + movl r0,(r2)+ ; store lo result in r[] & advance + addl #4,r3 ; advance a[] + movl r1,r6 ; store hi result => c + + sobgtr r4,0$ + + movl r6,r0 ; return c + ret + + .title vax_bn_mul_word unsigned multiply & add, 32*32+32=>64 +; +; w.j.m. 15-jan-1999 +; +; it's magic ... +; +; ULONG bn_mul_words(ULONG r[],ULONG a[],int n,ULONG w) { +; ULONG c = 0; +; int i; +; for(i = 0; i < num; i++) <c,r[i]> := a[i] * w + c ; +; return(c); +; } + +r=4 ;(AP) +a=8 ;(AP) +n=12 ;(AP) n by value (input) +w=16 ;(AP) w by value (input) + + + .psect code,nowrt + +.entry bn_mul_words,^m<r2,r3,r4,r5,r6> + + moval @r(ap),r2 ; r2 -> r[] + moval @a(ap),r3 ; r3 -> a[] + movl n(ap),r4 ; r4 = loop count (assumed >0 by C code) + movl w(ap),r5 ; r5 = w + clrl r6 ; r6 = c + +0$: + ; <r1,r0> := w * a[] + c + emul r5,(r3),r6,r0 ; w, a[], c considered signed + + ; fixup for "negative" c + tstl r6 ; c + bgeq 10$ + incl r1 +10$: + + ; combined fixup for "negative" w, a[] + tstl r5 ; w + bgeq 20$ + addl2 (r3),r1 ; a[] +20$: + tstl (r3) ; a[] + bgeq 30$ + addl2 r5,r1 ; w +30$: + + movl r0,(r2)+ ; store lo result in r[] & advance + addl #4,r3 ; advance a[] + movl r1,r6 ; store hi result => c + + sobgtr r4,0$ + + movl r6,r0 ; return c + ret + + .title vax_bn_sqr_words unsigned square, 32*32=>64 +; +; w.j.m. 15-jan-1999 +; +; it's magic ... +; +; void bn_sqr_words(ULONG r[],ULONG a[],int n) { +; int i; +; for(i = 0; i < n; i++) <r[2*i+1],r[2*i]> := a[i] * a[i] ; +; } + +r=4 ;(AP) +a=8 ;(AP) +n=12 ;(AP) n by value (input) + + + .psect code,nowrt + +.entry bn_sqr_words,^m<r2,r3,r4,r5> + + moval @r(ap),r2 ; r2 -> r[] + moval @a(ap),r3 ; r3 -> a[] + movl n(ap),r4 ; r4 = n (assumed >0 by C code) + +0$: + movl (r3)+,r5 ; r5 = a[] & advance + + ; <r1,r0> := a[] * a[] + emul r5,r5,#0,r0 ; a[] considered signed + + ; fixup for "negative" a[] + tstl r5 ; a[] + bgeq 30$ + addl2 r5,r1 ; a[] + addl2 r5,r1 ; a[] +30$: + + movl r0,(r2)+ ; store lo result in r[] & advance + movl r1,(r2)+ ; store hi result in r[] & advance + + sobgtr r4,0$ + + movl #1,r0 ; return SS$_NORMAL + ret + + .title (generated) + + .psect code,nowrt + +.entry BN_DIV_WORDS,^m<r2,r3,r4,r5,r6,r7,r8,r9,r10> + subl2 #4,sp + + clrl r9 + movl #2,r8 + + tstl 12(ap) + bneq noname.2 + mnegl #1,r10 + brw noname.3 + tstl r0 + nop +noname.2: + + pushl 12(ap) + calls #1,BN_NUM_BITS_WORD + movl r0,r7 + + cmpl r7,#32 + beql noname.4 + ashl r7,#1,r2 + cmpl 4(ap),r2 + blequ noname.4 + + pushl r7 + calls #1,BN_DIV_WORDS_ABORT +noname.4: + + subl3 r7,#32,r7 + + movl 12(ap),r2 + cmpl 4(ap),r2 + blssu noname.5 + subl2 r2,4(ap) +noname.5: + + tstl r7 + beql noname.6 + + ashl r7,r2,12(ap) + + ashl r7,4(ap),r4 + subl3 r7,#32,r3 + subl3 r3,#32,r2 + extzv r3,r2,8(ap),r2 + bisl3 r4,r2,4(ap) + + ashl r7,8(ap),8(ap) +noname.6: + + bicl3 #65535,12(ap),r2 + extzv #16,#16,r2,r5 + + bicl3 #-65536,12(ap),r6 + +noname.7: + + moval 4(ap),r2 + movzwl 2(r2),r0 + cmpl r0,r5 + bneq noname.8 + + movzwl #65535,r4 + brb noname.9 +noname.8: + + clrl r1 + movl (r2),r0 + movl r5,r2 + bgeq vcg.1 + cmpl r2,r0 + bgtru vcg.2 + incl r1 + brb vcg.2 + nop +vcg.1: + ediv r2,r0,r1,r0 +vcg.2: + movl r1,r4 +noname.9: + +noname.10: + + mull3 r5,r4,r0 + subl3 r0,4(ap),r3 + + bicl3 #65535,r3,r0 + bneq noname.13 + mull3 r6,r4,r2 + ashl #16,r3,r1 + bicl3 #65535,8(ap),r0 + extzv #16,#16,r0,r0 + addl2 r0,r1 + cmpl r2,r1 + bgtru noname.12 +noname.11: + + brb noname.13 + nop +noname.12: + + decl r4 + brb noname.10 +noname.13: + + mull3 r5,r4,r1 + + mull3 r6,r4,r0 + + extzv #16,#16,r0,r3 + + ashl #16,r0,r2 + bicl3 #65535,r2,r0 + + addl2 r3,r1 + + moval 8(ap),r3 + cmpl (r3),r0 + bgequ noname.15 + incl r1 +noname.15: + + subl2 r0,(r3) + + cmpl 4(ap),r1 + bgequ noname.16 + + addl2 12(ap),4(ap) + + decl r4 +noname.16: + + subl2 r1,4(ap) + + decl r8 + beql noname.18 +noname.17: + + ashl #16,r4,r9 + + ashl #16,4(ap),r2 + movzwl 2(r3),r0 + bisl2 r0,r2 + bicl3 #0,r2,4(ap) + + bicl3 #-65536,(r3),r0 + ashl #16,r0,(r3) + brw noname.7 + nop +noname.18: + + bisl2 r4,r9 + + movl r9,r10 + +noname.3: + movl r10,r0 + ret + tstl r0 + + + .psect code,nowrt + +.entry BN_ADD_WORDS,^m<r2,r3,r4,r5,r6,r7> + + tstl 16(ap) + bgtr noname.21 + clrl r7 + brw noname.22 +noname.21: + + clrl r4 + + tstl r0 +noname.23: + + movl 8(ap),r6 + addl3 r4,(r6),r2 + + bicl2 #0,r2 + + clrl r0 + cmpl r2,r4 + bgequ vcg.3 + incl r0 +vcg.3: + movl r0,r4 + + movl 12(ap),r5 + addl3 (r5),r2,r1 + bicl2 #0,r1 + + clrl r0 + cmpl r1,r2 + bgequ vcg.4 + incl r0 +vcg.4: + addl2 r0,r4 + + movl 4(ap),r3 + movl r1,(r3) + + decl 16(ap) + bgtr gen.1 + brw noname.25 +gen.1: +noname.24: + + addl3 r4,4(r6),r2 + + bicl2 #0,r2 + + clrl r0 + cmpl r2,r4 + bgequ vcg.5 + incl r0 +vcg.5: + movl r0,r4 + + addl3 4(r5),r2,r1 + bicl2 #0,r1 + + clrl r0 + cmpl r1,r2 + bgequ vcg.6 + incl r0 +vcg.6: + addl2 r0,r4 + + movl r1,4(r3) + + decl 16(ap) + bleq noname.25 +noname.26: + + addl3 r4,8(r6),r2 + + bicl2 #0,r2 + + clrl r0 + cmpl r2,r4 + bgequ vcg.7 + incl r0 +vcg.7: + movl r0,r4 + + addl3 8(r5),r2,r1 + bicl2 #0,r1 + + clrl r0 + cmpl r1,r2 + bgequ vcg.8 + incl r0 +vcg.8: + addl2 r0,r4 + + movl r1,8(r3) + + decl 16(ap) + bleq noname.25 +noname.27: + + addl3 r4,12(r6),r2 + + bicl2 #0,r2 + + clrl r0 + cmpl r2,r4 + bgequ vcg.9 + incl r0 +vcg.9: + movl r0,r4 + + addl3 12(r5),r2,r1 + bicl2 #0,r1 + + clrl r0 + cmpl r1,r2 + bgequ vcg.10 + incl r0 +vcg.10: + addl2 r0,r4 + + movl r1,12(r3) + + decl 16(ap) + bleq noname.25 +noname.28: + + addl3 #16,r6,8(ap) + + addl3 #16,r5,12(ap) + + addl3 #16,r3,4(ap) + brw noname.23 + tstl r0 +noname.25: + + movl r4,r7 + +noname.22: + movl r7,r0 + ret + nop + + + +;r=4 ;(AP) +;a=8 ;(AP) +;b=12 ;(AP) +;n=16 ;(AP) n by value (input) + + .psect code,nowrt + +.entry BN_SUB_WORDS,^m<r2,r3,r4,r5,r6,r7> + + clrl r6 + + tstl 16(ap) + bgtr noname.31 + clrl r7 + brw noname.32 + tstl r0 +noname.31: + +noname.33: + + movl 8(ap),r5 + movl (r5),r1 + movl 12(ap),r4 + movl (r4),r2 + + movl 4(ap),r3 + subl3 r2,r1,r0 + subl2 r6,r0 + bicl3 #0,r0,(r3) + + cmpl r1,r2 + beql noname.34 + clrl r0 + cmpl r1,r2 + bgequ vcg.11 + incl r0 +vcg.11: + movl r0,r6 +noname.34: + + decl 16(ap) + bgtr gen.2 + brw noname.36 +gen.2: +noname.35: + + movl 4(r5),r2 + movl 4(r4),r1 + + subl3 r1,r2,r0 + subl2 r6,r0 + bicl3 #0,r0,4(r3) + + cmpl r2,r1 + beql noname.37 + clrl r0 + cmpl r2,r1 + bgequ vcg.12 + incl r0 +vcg.12: + movl r0,r6 +noname.37: + + decl 16(ap) + bleq noname.36 +noname.38: + + movl 8(r5),r1 + movl 8(r4),r2 + + subl3 r2,r1,r0 + subl2 r6,r0 + bicl3 #0,r0,8(r3) + + cmpl r1,r2 + beql noname.39 + clrl r0 + cmpl r1,r2 + bgequ vcg.13 + incl r0 +vcg.13: + movl r0,r6 +noname.39: + + decl 16(ap) + bleq noname.36 +noname.40: + + movl 12(r5),r1 + movl 12(r4),r2 + + subl3 r2,r1,r0 + subl2 r6,r0 + bicl3 #0,r0,12(r3) + + cmpl r1,r2 + beql noname.41 + clrl r0 + cmpl r1,r2 + bgequ vcg.14 + incl r0 +vcg.14: + movl r0,r6 +noname.41: + + decl 16(ap) + bleq noname.36 +noname.42: + + addl3 #16,r5,8(ap) + + addl3 #16,r4,12(ap) + + addl3 #16,r3,4(ap) + brw noname.33 + tstl r0 +noname.36: + + movl r6,r7 + +noname.32: + movl r7,r0 + ret + nop + + + +;r=4 ;(AP) +;a=8 ;(AP) +;b=12 ;(AP) +;n=16 ;(AP) n by value (input) + + .psect code,nowrt + +.entry BN_MUL_COMBA8,^m<r2,r3,r4,r5,r6,r7,r8,r9,r10,r11> + movab -924(sp),sp + clrq r8 + + clrl r10 + + movl 8(ap),r6 + movzwl 2(r6),r3 + movl 12(ap),r7 + bicl3 #-65536,(r7),r2 + movzwl 2(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,(r6),-12(fp) + bicl3 #-65536,r3,-16(fp) + mull3 r0,-12(fp),-4(fp) + mull2 r2,-12(fp) + mull3 r2,-16(fp),-8(fp) + mull2 r0,-16(fp) + addl3 -4(fp),-8(fp),r0 + bicl3 #0,r0,-4(fp) + cmpl -4(fp),-8(fp) + bgequ noname.45 + addl2 #65536,-16(fp) +noname.45: + movzwl -2(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-16(fp) + bicl3 #-65536,-4(fp),r0 + ashl #16,r0,-8(fp) + addl3 -8(fp),-12(fp),r0 + bicl3 #0,r0,-12(fp) + cmpl -12(fp),-8(fp) + bgequ noname.46 + incl -16(fp) +noname.46: + movl -12(fp),r1 + movl -16(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.47 + incl r2 +noname.47: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.48 + incl r10 +noname.48: + + movl 4(ap),r11 + movl r9,(r11) + + clrl r9 + + movzwl 2(r6),r2 + bicl3 #-65536,4(r7),r3 + movzwl 6(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,(r6),-28(fp) + bicl3 #-65536,r2,-32(fp) + mull3 r0,-28(fp),-20(fp) + mull2 r3,-28(fp) + mull3 r3,-32(fp),-24(fp) + mull2 r0,-32(fp) + addl3 -20(fp),-24(fp),r0 + bicl3 #0,r0,-20(fp) + cmpl -20(fp),-24(fp) + bgequ noname.49 + addl2 #65536,-32(fp) +noname.49: + movzwl -18(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-32(fp) + bicl3 #-65536,-20(fp),r0 + ashl #16,r0,-24(fp) + addl3 -24(fp),-28(fp),r0 + bicl3 #0,r0,-28(fp) + cmpl -28(fp),-24(fp) + bgequ noname.50 + incl -32(fp) +noname.50: + movl -28(fp),r1 + movl -32(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.51 + incl r2 +noname.51: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.52 + incl r9 +noname.52: + + movzwl 6(r6),r2 + bicl3 #-65536,(r7),r3 + movzwl 2(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,4(r6),-44(fp) + bicl3 #-65536,r2,-48(fp) + mull3 r0,-44(fp),-36(fp) + mull2 r3,-44(fp) + mull3 r3,-48(fp),-40(fp) + mull2 r0,-48(fp) + addl3 -36(fp),-40(fp),r0 + bicl3 #0,r0,-36(fp) + cmpl -36(fp),-40(fp) + bgequ noname.53 + addl2 #65536,-48(fp) +noname.53: + movzwl -34(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-48(fp) + bicl3 #-65536,-36(fp),r0 + ashl #16,r0,-40(fp) + addl3 -40(fp),-44(fp),r0 + bicl3 #0,r0,-44(fp) + cmpl -44(fp),-40(fp) + bgequ noname.54 + incl -48(fp) +noname.54: + movl -44(fp),r1 + movl -48(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.55 + incl r2 +noname.55: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.56 + incl r9 +noname.56: + + movl r8,4(r11) + + clrl r8 + + movzwl 10(r6),r2 + bicl3 #-65536,(r7),r3 + movzwl 2(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,8(r6),-60(fp) + bicl3 #-65536,r2,-64(fp) + mull3 r0,-60(fp),-52(fp) + mull2 r3,-60(fp) + mull3 r3,-64(fp),-56(fp) + mull2 r0,-64(fp) + addl3 -52(fp),-56(fp),r0 + bicl3 #0,r0,-52(fp) + cmpl -52(fp),-56(fp) + bgequ noname.57 + addl2 #65536,-64(fp) +noname.57: + movzwl -50(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-64(fp) + bicl3 #-65536,-52(fp),r0 + ashl #16,r0,-56(fp) + addl3 -56(fp),-60(fp),r0 + bicl3 #0,r0,-60(fp) + cmpl -60(fp),-56(fp) + bgequ noname.58 + incl -64(fp) +noname.58: + movl -60(fp),r1 + movl -64(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.59 + incl r2 +noname.59: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.60 + incl r8 +noname.60: + + movzwl 6(r6),r2 + bicl3 #-65536,4(r7),r3 + movzwl 6(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,4(r6),-76(fp) + bicl3 #-65536,r2,-80(fp) + mull3 r0,-76(fp),-68(fp) + mull2 r3,-76(fp) + mull3 r3,-80(fp),-72(fp) + mull2 r0,-80(fp) + addl3 -68(fp),-72(fp),r0 + bicl3 #0,r0,-68(fp) + cmpl -68(fp),-72(fp) + bgequ noname.61 + addl2 #65536,-80(fp) +noname.61: + movzwl -66(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-80(fp) + bicl3 #-65536,-68(fp),r0 + ashl #16,r0,-72(fp) + addl3 -72(fp),-76(fp),r0 + bicl3 #0,r0,-76(fp) + cmpl -76(fp),-72(fp) + bgequ noname.62 + incl -80(fp) +noname.62: + movl -76(fp),r1 + movl -80(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.63 + incl r2 +noname.63: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.64 + incl r8 +noname.64: + + movzwl 2(r6),r2 + bicl3 #-65536,8(r7),r3 + movzwl 10(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,(r6),-92(fp) + bicl3 #-65536,r2,-96(fp) + mull3 r0,-92(fp),-84(fp) + mull2 r3,-92(fp) + mull3 r3,-96(fp),-88(fp) + mull2 r0,-96(fp) + addl3 -84(fp),-88(fp),r0 + bicl3 #0,r0,-84(fp) + cmpl -84(fp),-88(fp) + bgequ noname.65 + addl2 #65536,-96(fp) +noname.65: + movzwl -82(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-96(fp) + bicl3 #-65536,-84(fp),r0 + ashl #16,r0,-88(fp) + addl3 -88(fp),-92(fp),r0 + bicl3 #0,r0,-92(fp) + cmpl -92(fp),-88(fp) + bgequ noname.66 + incl -96(fp) +noname.66: + movl -92(fp),r1 + movl -96(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.67 + incl r2 +noname.67: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.68 + incl r8 +noname.68: + + movl r10,8(r11) + + clrl r10 + + movzwl 2(r6),r2 + bicl3 #-65536,12(r7),r3 + movzwl 14(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,(r6),-108(fp) + bicl3 #-65536,r2,-112(fp) + mull3 r0,-108(fp),-100(fp) + mull2 r3,-108(fp) + mull3 r3,-112(fp),-104(fp) + mull2 r0,-112(fp) + addl3 -100(fp),-104(fp),r0 + bicl3 #0,r0,-100(fp) + cmpl -100(fp),-104(fp) + bgequ noname.69 + addl2 #65536,-112(fp) +noname.69: + movzwl -98(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-112(fp) + bicl3 #-65536,-100(fp),r0 + ashl #16,r0,-104(fp) + addl3 -104(fp),-108(fp),r0 + bicl3 #0,r0,-108(fp) + cmpl -108(fp),-104(fp) + bgequ noname.70 + incl -112(fp) +noname.70: + movl -108(fp),r1 + movl -112(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.71 + incl r2 +noname.71: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.72 + incl r10 +noname.72: + + movzwl 6(r6),r2 + bicl3 #-65536,8(r7),r3 + movzwl 10(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,4(r6),-124(fp) + bicl3 #-65536,r2,-128(fp) + mull3 r0,-124(fp),-116(fp) + mull2 r3,-124(fp) + mull3 r3,-128(fp),-120(fp) + mull2 r0,-128(fp) + addl3 -116(fp),-120(fp),r0 + bicl3 #0,r0,-116(fp) + cmpl -116(fp),-120(fp) + bgequ noname.73 + addl2 #65536,-128(fp) +noname.73: + movzwl -114(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-128(fp) + bicl3 #-65536,-116(fp),r0 + ashl #16,r0,-120(fp) + addl3 -120(fp),-124(fp),r0 + bicl3 #0,r0,-124(fp) + cmpl -124(fp),-120(fp) + bgequ noname.74 + incl -128(fp) +noname.74: + movl -124(fp),r1 + movl -128(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.75 + incl r2 +noname.75: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.76 + incl r10 +noname.76: + + movzwl 10(r6),r2 + bicl3 #-65536,4(r7),r3 + movzwl 6(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,8(r6),-140(fp) + bicl3 #-65536,r2,-144(fp) + mull3 r0,-140(fp),-132(fp) + mull2 r3,-140(fp) + mull3 r3,-144(fp),-136(fp) + mull2 r0,-144(fp) + addl3 -132(fp),-136(fp),r0 + bicl3 #0,r0,-132(fp) + cmpl -132(fp),-136(fp) + bgequ noname.77 + addl2 #65536,-144(fp) +noname.77: + movzwl -130(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-144(fp) + bicl3 #-65536,-132(fp),r0 + ashl #16,r0,-136(fp) + addl3 -136(fp),-140(fp),r0 + bicl3 #0,r0,-140(fp) + cmpl -140(fp),-136(fp) + bgequ noname.78 + incl -144(fp) +noname.78: + movl -140(fp),r1 + movl -144(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.79 + incl r2 +noname.79: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.80 + incl r10 +noname.80: + + movzwl 14(r6),r2 + bicl3 #-65536,(r7),r3 + movzwl 2(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,12(r6),-156(fp) + bicl3 #-65536,r2,-160(fp) + mull3 r0,-156(fp),-148(fp) + mull2 r3,-156(fp) + mull3 r3,-160(fp),-152(fp) + mull2 r0,-160(fp) + addl3 -148(fp),-152(fp),r0 + bicl3 #0,r0,-148(fp) + cmpl -148(fp),-152(fp) + bgequ noname.81 + addl2 #65536,-160(fp) +noname.81: + movzwl -146(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-160(fp) + bicl3 #-65536,-148(fp),r0 + ashl #16,r0,-152(fp) + addl3 -152(fp),-156(fp),r0 + bicl3 #0,r0,-156(fp) + cmpl -156(fp),-152(fp) + bgequ noname.82 + incl -160(fp) +noname.82: + movl -156(fp),r1 + movl -160(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.83 + incl r2 +noname.83: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.84 + incl r10 +noname.84: + + movl r9,12(r11) + + clrl r9 + + movzwl 18(r6),r2 + bicl3 #-65536,(r7),r3 + movzwl 2(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,16(r6),-172(fp) + bicl3 #-65536,r2,-176(fp) + mull3 r0,-172(fp),-164(fp) + mull2 r3,-172(fp) + mull3 r3,-176(fp),-168(fp) + mull2 r0,-176(fp) + addl3 -164(fp),-168(fp),r0 + bicl3 #0,r0,-164(fp) + cmpl -164(fp),-168(fp) + bgequ noname.85 + addl2 #65536,-176(fp) +noname.85: + movzwl -162(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-176(fp) + bicl3 #-65536,-164(fp),r0 + ashl #16,r0,-168(fp) + addl3 -168(fp),-172(fp),r0 + bicl3 #0,r0,-172(fp) + cmpl -172(fp),-168(fp) + bgequ noname.86 + incl -176(fp) +noname.86: + movl -172(fp),r1 + movl -176(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.87 + incl r2 +noname.87: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.88 + incl r9 +noname.88: + + movzwl 14(r6),r2 + bicl3 #-65536,4(r7),r3 + movzwl 6(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,12(r6),-188(fp) + bicl3 #-65536,r2,-192(fp) + mull3 r0,-188(fp),-180(fp) + mull2 r3,-188(fp) + mull3 r3,-192(fp),-184(fp) + mull2 r0,-192(fp) + addl3 -180(fp),-184(fp),r0 + bicl3 #0,r0,-180(fp) + cmpl -180(fp),-184(fp) + bgequ noname.89 + addl2 #65536,-192(fp) +noname.89: + movzwl -178(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-192(fp) + bicl3 #-65536,-180(fp),r0 + ashl #16,r0,-184(fp) + addl3 -184(fp),-188(fp),r0 + bicl3 #0,r0,-188(fp) + cmpl -188(fp),-184(fp) + bgequ noname.90 + incl -192(fp) +noname.90: + movl -188(fp),r1 + movl -192(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.91 + incl r2 +noname.91: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.92 + incl r9 +noname.92: + + movzwl 10(r6),r2 + bicl3 #-65536,8(r7),r3 + movzwl 10(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,8(r6),-204(fp) + bicl3 #-65536,r2,-208(fp) + mull3 r0,-204(fp),-196(fp) + mull2 r3,-204(fp) + mull3 r3,-208(fp),-200(fp) + mull2 r0,-208(fp) + addl3 -196(fp),-200(fp),r0 + bicl3 #0,r0,-196(fp) + cmpl -196(fp),-200(fp) + bgequ noname.93 + addl2 #65536,-208(fp) +noname.93: + movzwl -194(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-208(fp) + bicl3 #-65536,-196(fp),r0 + ashl #16,r0,-200(fp) + addl3 -200(fp),-204(fp),r0 + bicl3 #0,r0,-204(fp) + cmpl -204(fp),-200(fp) + bgequ noname.94 + incl -208(fp) +noname.94: + movl -204(fp),r1 + movl -208(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.95 + incl r2 +noname.95: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.96 + incl r9 +noname.96: + + movzwl 6(r6),r2 + bicl3 #-65536,12(r7),r3 + movzwl 14(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,4(r6),-220(fp) + bicl3 #-65536,r2,-224(fp) + mull3 r0,-220(fp),-212(fp) + mull2 r3,-220(fp) + mull3 r3,-224(fp),-216(fp) + mull2 r0,-224(fp) + addl3 -212(fp),-216(fp),r0 + bicl3 #0,r0,-212(fp) + cmpl -212(fp),-216(fp) + bgequ noname.97 + addl2 #65536,-224(fp) +noname.97: + movzwl -210(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-224(fp) + bicl3 #-65536,-212(fp),r0 + ashl #16,r0,-216(fp) + addl3 -216(fp),-220(fp),r0 + bicl3 #0,r0,-220(fp) + cmpl -220(fp),-216(fp) + bgequ noname.98 + incl -224(fp) +noname.98: + movl -220(fp),r1 + movl -224(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.99 + incl r2 +noname.99: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.100 + incl r9 +noname.100: + + movzwl 2(r6),r2 + bicl3 #-65536,16(r7),r3 + movzwl 18(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,(r6),-236(fp) + bicl3 #-65536,r2,-240(fp) + mull3 r0,-236(fp),-228(fp) + mull2 r3,-236(fp) + mull3 r3,-240(fp),-232(fp) + mull2 r0,-240(fp) + addl3 -228(fp),-232(fp),r0 + bicl3 #0,r0,-228(fp) + cmpl -228(fp),-232(fp) + bgequ noname.101 + addl2 #65536,-240(fp) +noname.101: + movzwl -226(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-240(fp) + bicl3 #-65536,-228(fp),r0 + ashl #16,r0,-232(fp) + addl3 -232(fp),-236(fp),r0 + bicl3 #0,r0,-236(fp) + cmpl -236(fp),-232(fp) + bgequ noname.102 + incl -240(fp) +noname.102: + movl -236(fp),r1 + movl -240(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.103 + incl r2 +noname.103: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.104 + incl r9 +noname.104: + + movl r8,16(r11) + + clrl r8 + + movzwl 2(r6),r2 + bicl3 #-65536,20(r7),r3 + movzwl 22(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,(r6),-252(fp) + bicl3 #-65536,r2,-256(fp) + mull3 r0,-252(fp),-244(fp) + mull2 r3,-252(fp) + mull3 r3,-256(fp),-248(fp) + mull2 r0,-256(fp) + addl3 -244(fp),-248(fp),r0 + bicl3 #0,r0,-244(fp) + cmpl -244(fp),-248(fp) + bgequ noname.105 + addl2 #65536,-256(fp) +noname.105: + movzwl -242(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-256(fp) + bicl3 #-65536,-244(fp),r0 + ashl #16,r0,-248(fp) + addl3 -248(fp),-252(fp),r0 + bicl3 #0,r0,-252(fp) + cmpl -252(fp),-248(fp) + bgequ noname.106 + incl -256(fp) +noname.106: + movl -252(fp),r1 + movl -256(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.107 + incl r2 +noname.107: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.108 + incl r8 +noname.108: + + movzwl 6(r6),r2 + bicl3 #-65536,16(r7),r3 + movzwl 18(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,4(r6),-268(fp) + bicl3 #-65536,r2,-272(fp) + mull3 r0,-268(fp),-260(fp) + mull2 r3,-268(fp) + mull3 r3,-272(fp),-264(fp) + mull2 r0,-272(fp) + addl3 -260(fp),-264(fp),r0 + bicl3 #0,r0,-260(fp) + cmpl -260(fp),-264(fp) + bgequ noname.109 + addl2 #65536,-272(fp) +noname.109: + movzwl -258(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-272(fp) + bicl3 #-65536,-260(fp),r0 + ashl #16,r0,-264(fp) + addl3 -264(fp),-268(fp),r0 + bicl3 #0,r0,-268(fp) + cmpl -268(fp),-264(fp) + bgequ noname.110 + incl -272(fp) +noname.110: + movl -268(fp),r1 + movl -272(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.111 + incl r2 +noname.111: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.112 + incl r8 +noname.112: + + movzwl 10(r6),r2 + bicl3 #-65536,12(r7),r3 + movzwl 14(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,8(r6),-284(fp) + bicl3 #-65536,r2,-288(fp) + mull3 r0,-284(fp),-276(fp) + mull2 r3,-284(fp) + mull3 r3,-288(fp),-280(fp) + mull2 r0,-288(fp) + addl3 -276(fp),-280(fp),r0 + bicl3 #0,r0,-276(fp) + cmpl -276(fp),-280(fp) + bgequ noname.113 + addl2 #65536,-288(fp) +noname.113: + movzwl -274(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-288(fp) + bicl3 #-65536,-276(fp),r0 + ashl #16,r0,-280(fp) + addl3 -280(fp),-284(fp),r0 + bicl3 #0,r0,-284(fp) + cmpl -284(fp),-280(fp) + bgequ noname.114 + incl -288(fp) +noname.114: + movl -284(fp),r1 + movl -288(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.115 + incl r2 +noname.115: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.116 + incl r8 +noname.116: + + movzwl 14(r6),r2 + bicl3 #-65536,8(r7),r3 + movzwl 10(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,12(r6),-300(fp) + bicl3 #-65536,r2,-304(fp) + mull3 r0,-300(fp),-292(fp) + mull2 r3,-300(fp) + mull3 r3,-304(fp),-296(fp) + mull2 r0,-304(fp) + addl3 -292(fp),-296(fp),r0 + bicl3 #0,r0,-292(fp) + cmpl -292(fp),-296(fp) + bgequ noname.117 + addl2 #65536,-304(fp) +noname.117: + movzwl -290(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-304(fp) + bicl3 #-65536,-292(fp),r0 + ashl #16,r0,-296(fp) + addl3 -296(fp),-300(fp),r0 + bicl3 #0,r0,-300(fp) + cmpl -300(fp),-296(fp) + bgequ noname.118 + incl -304(fp) +noname.118: + movl -300(fp),r1 + movl -304(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.119 + incl r2 +noname.119: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.120 + incl r8 +noname.120: + + movzwl 18(r6),r2 + bicl3 #-65536,4(r7),r3 + movzwl 6(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,16(r6),-316(fp) + bicl3 #-65536,r2,-320(fp) + mull3 r0,-316(fp),-308(fp) + mull2 r3,-316(fp) + mull3 r3,-320(fp),-312(fp) + mull2 r0,-320(fp) + addl3 -308(fp),-312(fp),r0 + bicl3 #0,r0,-308(fp) + cmpl -308(fp),-312(fp) + bgequ noname.121 + addl2 #65536,-320(fp) +noname.121: + movzwl -306(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-320(fp) + bicl3 #-65536,-308(fp),r0 + ashl #16,r0,-312(fp) + addl3 -312(fp),-316(fp),r0 + bicl3 #0,r0,-316(fp) + cmpl -316(fp),-312(fp) + bgequ noname.122 + incl -320(fp) +noname.122: + movl -316(fp),r1 + movl -320(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.123 + incl r2 + +noname.123: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.124 + incl r8 +noname.124: + + movzwl 22(r6),r2 + bicl3 #-65536,(r7),r3 + movzwl 2(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,20(r6),-332(fp) + bicl3 #-65536,r2,-336(fp) + mull3 r0,-332(fp),-324(fp) + mull2 r3,-332(fp) + mull3 r3,-336(fp),-328(fp) + mull2 r0,-336(fp) + addl3 -324(fp),-328(fp),r0 + bicl3 #0,r0,-324(fp) + cmpl -324(fp),-328(fp) + bgequ noname.125 + addl2 #65536,-336(fp) +noname.125: + movzwl -322(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-336(fp) + bicl3 #-65536,-324(fp),r0 + ashl #16,r0,-328(fp) + addl3 -328(fp),-332(fp),r0 + bicl3 #0,r0,-332(fp) + cmpl -332(fp),-328(fp) + bgequ noname.126 + incl -336(fp) +noname.126: + movl -332(fp),r1 + movl -336(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.127 + incl r2 +noname.127: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.128 + incl r8 +noname.128: + + movl r10,20(r11) + + clrl r10 + + movzwl 26(r6),r2 + bicl3 #-65536,(r7),r3 + movzwl 2(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,24(r6),-348(fp) + bicl3 #-65536,r2,-352(fp) + mull3 r0,-348(fp),-340(fp) + mull2 r3,-348(fp) + mull3 r3,-352(fp),-344(fp) + mull2 r0,-352(fp) + addl3 -340(fp),-344(fp),r0 + bicl3 #0,r0,-340(fp) + cmpl -340(fp),-344(fp) + bgequ noname.129 + addl2 #65536,-352(fp) +noname.129: + movzwl -338(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-352(fp) + bicl3 #-65536,-340(fp),r0 + ashl #16,r0,-344(fp) + addl3 -344(fp),-348(fp),r0 + bicl3 #0,r0,-348(fp) + cmpl -348(fp),-344(fp) + bgequ noname.130 + incl -352(fp) +noname.130: + movl -348(fp),r1 + movl -352(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.131 + incl r2 +noname.131: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.132 + incl r10 +noname.132: + + movzwl 22(r6),r2 + bicl3 #-65536,4(r7),r3 + movzwl 6(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,20(r6),-364(fp) + bicl3 #-65536,r2,-368(fp) + mull3 r0,-364(fp),-356(fp) + mull2 r3,-364(fp) + mull3 r3,-368(fp),-360(fp) + mull2 r0,-368(fp) + addl3 -356(fp),-360(fp),r0 + bicl3 #0,r0,-356(fp) + cmpl -356(fp),-360(fp) + bgequ noname.133 + addl2 #65536,-368(fp) +noname.133: + movzwl -354(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-368(fp) + bicl3 #-65536,-356(fp),r0 + ashl #16,r0,-360(fp) + addl3 -360(fp),-364(fp),r0 + bicl3 #0,r0,-364(fp) + cmpl -364(fp),-360(fp) + bgequ noname.134 + incl -368(fp) +noname.134: + movl -364(fp),r1 + movl -368(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.135 + incl r2 +noname.135: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.136 + incl r10 +noname.136: + + movzwl 18(r6),r2 + bicl3 #-65536,8(r7),r3 + movzwl 10(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,16(r6),-380(fp) + bicl3 #-65536,r2,-384(fp) + mull3 r0,-380(fp),-372(fp) + mull2 r3,-380(fp) + mull3 r3,-384(fp),-376(fp) + mull2 r0,-384(fp) + addl3 -372(fp),-376(fp),r0 + bicl3 #0,r0,-372(fp) + cmpl -372(fp),-376(fp) + bgequ noname.137 + addl2 #65536,-384(fp) +noname.137: + movzwl -370(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-384(fp) + bicl3 #-65536,-372(fp),r0 + ashl #16,r0,-376(fp) + addl3 -376(fp),-380(fp),r0 + bicl3 #0,r0,-380(fp) + cmpl -380(fp),-376(fp) + bgequ noname.138 + incl -384(fp) +noname.138: + movl -380(fp),r1 + movl -384(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.139 + incl r2 +noname.139: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.140 + incl r10 +noname.140: + + movzwl 14(r6),r2 + bicl3 #-65536,12(r7),r3 + movzwl 14(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,12(r6),-396(fp) + bicl3 #-65536,r2,-400(fp) + mull3 r0,-396(fp),-388(fp) + mull2 r3,-396(fp) + mull3 r3,-400(fp),-392(fp) + mull2 r0,-400(fp) + addl3 -388(fp),-392(fp),r0 + bicl3 #0,r0,-388(fp) + cmpl -388(fp),-392(fp) + bgequ noname.141 + addl2 #65536,-400(fp) +noname.141: + movzwl -386(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-400(fp) + bicl3 #-65536,-388(fp),r0 + ashl #16,r0,-392(fp) + addl3 -392(fp),-396(fp),r0 + bicl3 #0,r0,-396(fp) + cmpl -396(fp),-392(fp) + bgequ noname.142 + incl -400(fp) +noname.142: + movl -396(fp),r1 + movl -400(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.143 + incl r2 +noname.143: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.144 + incl r10 +noname.144: + + movzwl 10(r6),r2 + bicl3 #-65536,16(r7),r3 + movzwl 18(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,8(r6),-412(fp) + bicl3 #-65536,r2,-416(fp) + mull3 r0,-412(fp),-404(fp) + mull2 r3,-412(fp) + mull3 r3,-416(fp),-408(fp) + mull2 r0,-416(fp) + addl3 -404(fp),-408(fp),r0 + bicl3 #0,r0,-404(fp) + cmpl -404(fp),-408(fp) + bgequ noname.145 + addl2 #65536,-416(fp) +noname.145: + movzwl -402(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-416(fp) + bicl3 #-65536,-404(fp),r0 + ashl #16,r0,-408(fp) + addl3 -408(fp),-412(fp),r0 + bicl3 #0,r0,-412(fp) + cmpl -412(fp),-408(fp) + bgequ noname.146 + incl -416(fp) +noname.146: + movl -412(fp),r1 + movl -416(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.147 + incl r2 +noname.147: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.148 + incl r10 +noname.148: + + movzwl 6(r6),r2 + bicl3 #-65536,20(r7),r3 + movzwl 22(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,4(r6),-428(fp) + bicl3 #-65536,r2,-432(fp) + mull3 r0,-428(fp),-420(fp) + mull2 r3,-428(fp) + mull3 r3,-432(fp),-424(fp) + mull2 r0,-432(fp) + addl3 -420(fp),-424(fp),r0 + bicl3 #0,r0,-420(fp) + cmpl -420(fp),-424(fp) + bgequ noname.149 + addl2 #65536,-432(fp) +noname.149: + movzwl -418(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-432(fp) + bicl3 #-65536,-420(fp),r0 + ashl #16,r0,-424(fp) + addl3 -424(fp),-428(fp),r0 + bicl3 #0,r0,-428(fp) + cmpl -428(fp),-424(fp) + bgequ noname.150 + incl -432(fp) +noname.150: + movl -428(fp),r1 + movl -432(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.151 + incl r2 +noname.151: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.152 + incl r10 +noname.152: + + movzwl 2(r6),r2 + bicl3 #-65536,24(r7),r3 + movzwl 26(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,(r6),-444(fp) + bicl3 #-65536,r2,-448(fp) + mull3 r0,-444(fp),-436(fp) + mull2 r3,-444(fp) + mull3 r3,-448(fp),-440(fp) + mull2 r0,-448(fp) + addl3 -436(fp),-440(fp),r0 + bicl3 #0,r0,-436(fp) + cmpl -436(fp),-440(fp) + bgequ noname.153 + addl2 #65536,-448(fp) +noname.153: + movzwl -434(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-448(fp) + bicl3 #-65536,-436(fp),r0 + ashl #16,r0,-440(fp) + addl3 -440(fp),-444(fp),r0 + bicl3 #0,r0,-444(fp) + cmpl -444(fp),-440(fp) + bgequ noname.154 + incl -448(fp) +noname.154: + movl -444(fp),r1 + movl -448(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.155 + incl r2 +noname.155: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.156 + incl r10 +noname.156: + + movl r9,24(r11) + + clrl r9 + + movzwl 2(r6),r2 + bicl3 #-65536,28(r7),r3 + movzwl 30(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,(r6),-460(fp) + bicl3 #-65536,r2,-464(fp) + mull3 r0,-460(fp),-452(fp) + mull2 r3,-460(fp) + mull3 r3,-464(fp),-456(fp) + mull2 r0,-464(fp) + addl3 -452(fp),-456(fp),r0 + bicl3 #0,r0,-452(fp) + cmpl -452(fp),-456(fp) + bgequ noname.157 + addl2 #65536,-464(fp) +noname.157: + movzwl -450(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-464(fp) + bicl3 #-65536,-452(fp),r0 + ashl #16,r0,-456(fp) + addl3 -456(fp),-460(fp),r0 + bicl3 #0,r0,-460(fp) + cmpl -460(fp),-456(fp) + bgequ noname.158 + incl -464(fp) +noname.158: + movl -460(fp),r1 + movl -464(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.159 + incl r2 +noname.159: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.160 + incl r9 +noname.160: + + movzwl 6(r6),r2 + bicl3 #-65536,24(r7),r3 + movzwl 26(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,4(r6),-476(fp) + bicl3 #-65536,r2,-480(fp) + mull3 r0,-476(fp),-468(fp) + mull2 r3,-476(fp) + mull3 r3,-480(fp),-472(fp) + mull2 r0,-480(fp) + addl3 -468(fp),-472(fp),r0 + bicl3 #0,r0,-468(fp) + cmpl -468(fp),-472(fp) + bgequ noname.161 + addl2 #65536,-480(fp) +noname.161: + movzwl -466(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-480(fp) + bicl3 #-65536,-468(fp),r0 + ashl #16,r0,-472(fp) + addl3 -472(fp),-476(fp),r0 + bicl3 #0,r0,-476(fp) + cmpl -476(fp),-472(fp) + bgequ noname.162 + incl -480(fp) +noname.162: + movl -476(fp),r1 + movl -480(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.163 + incl r2 +noname.163: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.164 + incl r9 +noname.164: + + movzwl 10(r6),r2 + bicl3 #-65536,20(r7),r3 + movzwl 22(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,8(r6),-492(fp) + bicl3 #-65536,r2,-496(fp) + mull3 r0,-492(fp),-484(fp) + mull2 r3,-492(fp) + mull3 r3,-496(fp),-488(fp) + mull2 r0,-496(fp) + addl3 -484(fp),-488(fp),r0 + bicl3 #0,r0,-484(fp) + cmpl -484(fp),-488(fp) + bgequ noname.165 + addl2 #65536,-496(fp) +noname.165: + movzwl -482(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-496(fp) + bicl3 #-65536,-484(fp),r0 + ashl #16,r0,-488(fp) + addl3 -488(fp),-492(fp),r0 + bicl3 #0,r0,-492(fp) + cmpl -492(fp),-488(fp) + bgequ noname.166 + incl -496(fp) +noname.166: + movl -492(fp),r1 + movl -496(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.167 + incl r2 +noname.167: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.168 + incl r9 +noname.168: + + movzwl 14(r6),r2 + bicl3 #-65536,16(r7),r3 + movzwl 18(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,12(r6),-508(fp) + bicl3 #-65536,r2,-512(fp) + mull3 r0,-508(fp),-500(fp) + mull2 r3,-508(fp) + mull3 r3,-512(fp),-504(fp) + mull2 r0,-512(fp) + addl3 -500(fp),-504(fp),r0 + bicl3 #0,r0,-500(fp) + cmpl -500(fp),-504(fp) + bgequ noname.169 + addl2 #65536,-512(fp) +noname.169: + movzwl -498(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-512(fp) + bicl3 #-65536,-500(fp),r0 + ashl #16,r0,-504(fp) + addl3 -504(fp),-508(fp),r0 + bicl3 #0,r0,-508(fp) + cmpl -508(fp),-504(fp) + bgequ noname.170 + incl -512(fp) +noname.170: + movl -508(fp),r1 + movl -512(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.171 + incl r2 +noname.171: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.172 + incl r9 +noname.172: + + movzwl 18(r6),r2 + bicl3 #-65536,12(r7),r3 + movzwl 14(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,16(r6),-524(fp) + bicl3 #-65536,r2,-528(fp) + mull3 r0,-524(fp),-516(fp) + mull2 r3,-524(fp) + mull3 r3,-528(fp),-520(fp) + mull2 r0,-528(fp) + addl3 -516(fp),-520(fp),r0 + bicl3 #0,r0,-516(fp) + cmpl -516(fp),-520(fp) + bgequ noname.173 + addl2 #65536,-528(fp) +noname.173: + movzwl -514(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-528(fp) + bicl3 #-65536,-516(fp),r0 + ashl #16,r0,-520(fp) + addl3 -520(fp),-524(fp),r0 + bicl3 #0,r0,-524(fp) + cmpl -524(fp),-520(fp) + bgequ noname.174 + incl -528(fp) +noname.174: + movl -524(fp),r1 + movl -528(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.175 + incl r2 +noname.175: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.176 + incl r9 +noname.176: + + movzwl 22(r6),r2 + bicl3 #-65536,8(r7),r3 + movzwl 10(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,20(r6),-540(fp) + bicl3 #-65536,r2,-544(fp) + mull3 r0,-540(fp),-532(fp) + mull2 r3,-540(fp) + mull3 r3,-544(fp),-536(fp) + mull2 r0,-544(fp) + addl3 -532(fp),-536(fp),r0 + bicl3 #0,r0,-532(fp) + cmpl -532(fp),-536(fp) + bgequ noname.177 + addl2 #65536,-544(fp) +noname.177: + movzwl -530(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-544(fp) + bicl3 #-65536,-532(fp),r0 + ashl #16,r0,-536(fp) + addl3 -536(fp),-540(fp),r0 + bicl3 #0,r0,-540(fp) + cmpl -540(fp),-536(fp) + bgequ noname.178 + incl -544(fp) +noname.178: + movl -540(fp),r1 + movl -544(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.179 + incl r2 +noname.179: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.180 + incl r9 +noname.180: + + movzwl 26(r6),r2 + bicl3 #-65536,4(r7),r3 + movzwl 6(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,24(r6),-556(fp) + bicl3 #-65536,r2,-560(fp) + mull3 r0,-556(fp),-548(fp) + mull2 r3,-556(fp) + mull3 r3,-560(fp),-552(fp) + mull2 r0,-560(fp) + addl3 -548(fp),-552(fp),r0 + bicl3 #0,r0,-548(fp) + cmpl -548(fp),-552(fp) + bgequ noname.181 + addl2 #65536,-560(fp) +noname.181: + movzwl -546(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-560(fp) + bicl3 #-65536,-548(fp),r0 + ashl #16,r0,-552(fp) + addl3 -552(fp),-556(fp),r0 + bicl3 #0,r0,-556(fp) + cmpl -556(fp),-552(fp) + bgequ noname.182 + incl -560(fp) +noname.182: + movl -556(fp),r1 + movl -560(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.183 + incl r2 +noname.183: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.184 + incl r9 +noname.184: + + movzwl 30(r6),r2 + bicl3 #-65536,(r7),r3 + movzwl 2(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,28(r6),-572(fp) + bicl3 #-65536,r2,-576(fp) + mull3 r0,-572(fp),-564(fp) + mull2 r3,-572(fp) + mull3 r3,-576(fp),-568(fp) + mull2 r0,-576(fp) + addl3 -564(fp),-568(fp),r0 + bicl3 #0,r0,-564(fp) + cmpl -564(fp),-568(fp) + bgequ noname.185 + addl2 #65536,-576(fp) +noname.185: + movzwl -562(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-576(fp) + bicl3 #-65536,-564(fp),r0 + ashl #16,r0,-568(fp) + addl3 -568(fp),-572(fp),r0 + bicl3 #0,r0,-572(fp) + cmpl -572(fp),-568(fp) + bgequ noname.186 + incl -576(fp) +noname.186: + movl -572(fp),r1 + movl -576(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.187 + incl r2 +noname.187: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.188 + incl r9 +noname.188: + + movl r8,28(r11) + + clrl r8 + + movzwl 30(r6),r2 + bicl3 #-65536,4(r7),r3 + movzwl 6(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,28(r6),-588(fp) + bicl3 #-65536,r2,-592(fp) + mull3 r0,-588(fp),-580(fp) + mull2 r3,-588(fp) + mull3 r3,-592(fp),-584(fp) + mull2 r0,-592(fp) + addl3 -580(fp),-584(fp),r0 + bicl3 #0,r0,-580(fp) + cmpl -580(fp),-584(fp) + bgequ noname.189 + addl2 #65536,-592(fp) +noname.189: + movzwl -578(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-592(fp) + bicl3 #-65536,-580(fp),r0 + ashl #16,r0,-584(fp) + addl3 -584(fp),-588(fp),r0 + bicl3 #0,r0,-588(fp) + cmpl -588(fp),-584(fp) + bgequ noname.190 + incl -592(fp) +noname.190: + movl -588(fp),r1 + movl -592(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.191 + incl r2 +noname.191: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.192 + incl r8 +noname.192: + + movzwl 26(r6),r2 + bicl3 #-65536,8(r7),r3 + movzwl 10(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,24(r6),-604(fp) + bicl3 #-65536,r2,-608(fp) + mull3 r0,-604(fp),-596(fp) + mull2 r3,-604(fp) + mull3 r3,-608(fp),-600(fp) + mull2 r0,-608(fp) + addl3 -596(fp),-600(fp),r0 + bicl3 #0,r0,-596(fp) + cmpl -596(fp),-600(fp) + bgequ noname.193 + addl2 #65536,-608(fp) +noname.193: + movzwl -594(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-608(fp) + bicl3 #-65536,-596(fp),r0 + ashl #16,r0,-600(fp) + addl3 -600(fp),-604(fp),r0 + bicl3 #0,r0,-604(fp) + cmpl -604(fp),-600(fp) + bgequ noname.194 + incl -608(fp) +noname.194: + movl -604(fp),r1 + movl -608(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.195 + incl r2 +noname.195: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.196 + incl r8 +noname.196: + + movzwl 22(r6),r2 + bicl3 #-65536,12(r7),r3 + movzwl 14(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,20(r6),-620(fp) + bicl3 #-65536,r2,-624(fp) + mull3 r0,-620(fp),-612(fp) + mull2 r3,-620(fp) + mull3 r3,-624(fp),-616(fp) + mull2 r0,-624(fp) + addl3 -612(fp),-616(fp),r0 + bicl3 #0,r0,-612(fp) + cmpl -612(fp),-616(fp) + bgequ noname.197 + addl2 #65536,-624(fp) +noname.197: + movzwl -610(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-624(fp) + bicl3 #-65536,-612(fp),r0 + ashl #16,r0,-616(fp) + addl3 -616(fp),-620(fp),r0 + bicl3 #0,r0,-620(fp) + cmpl -620(fp),-616(fp) + bgequ noname.198 + incl -624(fp) +noname.198: + movl -620(fp),r1 + movl -624(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.199 + incl r2 +noname.199: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.200 + incl r8 +noname.200: + + movzwl 18(r6),r2 + bicl3 #-65536,16(r7),r3 + movzwl 18(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,16(r6),-636(fp) + bicl3 #-65536,r2,-640(fp) + mull3 r0,-636(fp),-628(fp) + mull2 r3,-636(fp) + mull3 r3,-640(fp),-632(fp) + mull2 r0,-640(fp) + addl3 -628(fp),-632(fp),r0 + bicl3 #0,r0,-628(fp) + cmpl -628(fp),-632(fp) + bgequ noname.201 + addl2 #65536,-640(fp) +noname.201: + movzwl -626(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-640(fp) + bicl3 #-65536,-628(fp),r0 + ashl #16,r0,-632(fp) + addl3 -632(fp),-636(fp),r0 + bicl3 #0,r0,-636(fp) + cmpl -636(fp),-632(fp) + bgequ noname.202 + incl -640(fp) +noname.202: + movl -636(fp),r1 + movl -640(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.203 + incl r2 +noname.203: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.204 + incl r8 +noname.204: + + movzwl 14(r6),r2 + bicl3 #-65536,20(r7),r3 + movzwl 22(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,12(r6),-652(fp) + bicl3 #-65536,r2,-656(fp) + mull3 r0,-652(fp),-644(fp) + mull2 r3,-652(fp) + mull3 r3,-656(fp),-648(fp) + mull2 r0,-656(fp) + addl3 -644(fp),-648(fp),r0 + bicl3 #0,r0,-644(fp) + cmpl -644(fp),-648(fp) + bgequ noname.205 + addl2 #65536,-656(fp) +noname.205: + movzwl -642(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-656(fp) + bicl3 #-65536,-644(fp),r0 + ashl #16,r0,-648(fp) + addl3 -648(fp),-652(fp),r0 + bicl3 #0,r0,-652(fp) + cmpl -652(fp),-648(fp) + bgequ noname.206 + incl -656(fp) +noname.206: + movl -652(fp),r1 + movl -656(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.207 + incl r2 +noname.207: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.208 + incl r8 +noname.208: + + movzwl 10(r6),r2 + bicl3 #-65536,24(r7),r3 + movzwl 26(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,8(r6),-668(fp) + bicl3 #-65536,r2,-672(fp) + mull3 r0,-668(fp),-660(fp) + mull2 r3,-668(fp) + mull3 r3,-672(fp),-664(fp) + mull2 r0,-672(fp) + addl3 -660(fp),-664(fp),r0 + bicl3 #0,r0,-660(fp) + cmpl -660(fp),-664(fp) + bgequ noname.209 + addl2 #65536,-672(fp) +noname.209: + movzwl -658(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-672(fp) + bicl3 #-65536,-660(fp),r0 + ashl #16,r0,-664(fp) + addl3 -664(fp),-668(fp),r0 + bicl3 #0,r0,-668(fp) + cmpl -668(fp),-664(fp) + bgequ noname.210 + incl -672(fp) +noname.210: + movl -668(fp),r1 + movl -672(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.211 + incl r2 +noname.211: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.212 + incl r8 +noname.212: + + movzwl 6(r6),r2 + bicl3 #-65536,28(r7),r3 + movzwl 30(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,4(r6),-684(fp) + bicl3 #-65536,r2,-688(fp) + mull3 r0,-684(fp),-676(fp) + mull2 r3,-684(fp) + mull3 r3,-688(fp),-680(fp) + mull2 r0,-688(fp) + addl3 -676(fp),-680(fp),r0 + bicl3 #0,r0,-676(fp) + cmpl -676(fp),-680(fp) + bgequ noname.213 + addl2 #65536,-688(fp) +noname.213: + movzwl -674(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-688(fp) + bicl3 #-65536,-676(fp),r0 + ashl #16,r0,-680(fp) + addl3 -680(fp),-684(fp),r0 + bicl3 #0,r0,-684(fp) + cmpl -684(fp),-680(fp) + bgequ noname.214 + incl -688(fp) +noname.214: + movl -684(fp),r1 + movl -688(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.215 + incl r2 +noname.215: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.216 + incl r8 +noname.216: + + movl r10,32(r11) + + clrl r10 + + movzwl 10(r6),r2 + bicl3 #-65536,28(r7),r3 + movzwl 30(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,8(r6),-700(fp) + bicl3 #-65536,r2,-704(fp) + mull3 r0,-700(fp),-692(fp) + mull2 r3,-700(fp) + mull3 r3,-704(fp),-696(fp) + mull2 r0,-704(fp) + addl3 -692(fp),-696(fp),r0 + bicl3 #0,r0,-692(fp) + cmpl -692(fp),-696(fp) + bgequ noname.217 + addl2 #65536,-704(fp) +noname.217: + movzwl -690(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-704(fp) + bicl3 #-65536,-692(fp),r0 + ashl #16,r0,-696(fp) + addl3 -696(fp),-700(fp),r0 + bicl3 #0,r0,-700(fp) + cmpl -700(fp),-696(fp) + bgequ noname.218 + incl -704(fp) +noname.218: + movl -700(fp),r1 + movl -704(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.219 + incl r2 +noname.219: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.220 + incl r10 +noname.220: + + movzwl 14(r6),r2 + bicl3 #-65536,24(r7),r3 + movzwl 26(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,12(r6),-716(fp) + bicl3 #-65536,r2,-720(fp) + mull3 r0,-716(fp),-708(fp) + mull2 r3,-716(fp) + mull3 r3,-720(fp),-712(fp) + mull2 r0,-720(fp) + addl3 -708(fp),-712(fp),r0 + bicl3 #0,r0,-708(fp) + cmpl -708(fp),-712(fp) + bgequ noname.221 + addl2 #65536,-720(fp) +noname.221: + movzwl -706(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-720(fp) + bicl3 #-65536,-708(fp),r0 + ashl #16,r0,-712(fp) + addl3 -712(fp),-716(fp),r0 + bicl3 #0,r0,-716(fp) + cmpl -716(fp),-712(fp) + bgequ noname.222 + incl -720(fp) +noname.222: + movl -716(fp),r1 + movl -720(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.223 + incl r2 +noname.223: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.224 + incl r10 +noname.224: + + movzwl 18(r6),r2 + bicl3 #-65536,20(r7),r3 + movzwl 22(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,16(r6),-732(fp) + bicl3 #-65536,r2,-736(fp) + mull3 r0,-732(fp),-724(fp) + mull2 r3,-732(fp) + mull3 r3,-736(fp),-728(fp) + mull2 r0,-736(fp) + addl3 -724(fp),-728(fp),r0 + bicl3 #0,r0,-724(fp) + cmpl -724(fp),-728(fp) + bgequ noname.225 + addl2 #65536,-736(fp) +noname.225: + movzwl -722(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-736(fp) + bicl3 #-65536,-724(fp),r0 + ashl #16,r0,-728(fp) + addl3 -728(fp),-732(fp),r0 + bicl3 #0,r0,-732(fp) + cmpl -732(fp),-728(fp) + bgequ noname.226 + incl -736(fp) +noname.226: + movl -732(fp),r1 + movl -736(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.227 + incl r2 +noname.227: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.228 + incl r10 +noname.228: + + movzwl 22(r6),r2 + bicl3 #-65536,16(r7),r3 + movzwl 18(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,20(r6),-748(fp) + bicl3 #-65536,r2,-752(fp) + mull3 r0,-748(fp),-740(fp) + mull2 r3,-748(fp) + mull3 r3,-752(fp),-744(fp) + mull2 r0,-752(fp) + addl3 -740(fp),-744(fp),r0 + bicl3 #0,r0,-740(fp) + cmpl -740(fp),-744(fp) + bgequ noname.229 + addl2 #65536,-752(fp) +noname.229: + movzwl -738(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-752(fp) + bicl3 #-65536,-740(fp),r0 + ashl #16,r0,-744(fp) + addl3 -744(fp),-748(fp),r0 + bicl3 #0,r0,-748(fp) + cmpl -748(fp),-744(fp) + bgequ noname.230 + incl -752(fp) +noname.230: + movl -748(fp),r1 + movl -752(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.231 + incl r2 +noname.231: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.232 + incl r10 +noname.232: + + movzwl 26(r6),r2 + bicl3 #-65536,12(r7),r3 + movzwl 14(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,24(r6),-764(fp) + bicl3 #-65536,r2,-768(fp) + mull3 r0,-764(fp),-756(fp) + mull2 r3,-764(fp) + mull3 r3,-768(fp),-760(fp) + mull2 r0,-768(fp) + addl3 -756(fp),-760(fp),r0 + bicl3 #0,r0,-756(fp) + cmpl -756(fp),-760(fp) + bgequ noname.233 + addl2 #65536,-768(fp) +noname.233: + movzwl -754(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-768(fp) + bicl3 #-65536,-756(fp),r0 + ashl #16,r0,-760(fp) + addl3 -760(fp),-764(fp),r0 + bicl3 #0,r0,-764(fp) + cmpl -764(fp),-760(fp) + bgequ noname.234 + incl -768(fp) +noname.234: + movl -764(fp),r1 + movl -768(fp),r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.235 + incl r2 +noname.235: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.236 + incl r10 +noname.236: + + bicl3 #-65536,28(r6),r3 + movzwl 30(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,8(r7),r2 + movzwl 10(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-772(fp) + mull2 r2,r5 + mull3 r2,r4,-776(fp) + mull2 r0,r4 + addl3 -772(fp),-776(fp),r0 + bicl3 #0,r0,-772(fp) + cmpl -772(fp),-776(fp) + bgequ noname.237 + addl2 #65536,r4 +noname.237: + movzwl -770(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-772(fp),r0 + ashl #16,r0,-776(fp) + addl2 -776(fp),r5 + bicl2 #0,r5 + cmpl r5,-776(fp) + bgequ noname.238 + incl r4 +noname.238: + movl r5,r1 + movl r4,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.239 + incl r2 +noname.239: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.240 + incl r10 +noname.240: + + movl r9,36(r11) + + clrl r9 + + bicl3 #-65536,28(r6),r3 + movzwl 30(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,12(r7),r2 + movzwl 14(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-780(fp) + mull2 r2,r5 + mull3 r2,r4,-784(fp) + mull2 r0,r4 + addl3 -780(fp),-784(fp),r0 + bicl3 #0,r0,-780(fp) + cmpl -780(fp),-784(fp) + bgequ noname.241 + addl2 #65536,r4 +noname.241: + movzwl -778(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-780(fp),r0 + ashl #16,r0,-784(fp) + addl2 -784(fp),r5 + bicl2 #0,r5 + cmpl r5,-784(fp) + bgequ noname.242 + incl r4 +noname.242: + movl r5,r1 + movl r4,r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.243 + incl r2 +noname.243: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.244 + incl r9 +noname.244: + + bicl3 #-65536,24(r6),r3 + movzwl 26(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,16(r7),r2 + movzwl 18(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-788(fp) + mull2 r2,r5 + mull3 r2,r4,-792(fp) + mull2 r0,r4 + addl3 -788(fp),-792(fp),r0 + bicl3 #0,r0,-788(fp) + cmpl -788(fp),-792(fp) + bgequ noname.245 + addl2 #65536,r4 +noname.245: + movzwl -786(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-788(fp),r0 + ashl #16,r0,-792(fp) + addl2 -792(fp),r5 + bicl2 #0,r5 + cmpl r5,-792(fp) + bgequ noname.246 + incl r4 +noname.246: + movl r5,r1 + movl r4,r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.247 + incl r2 +noname.247: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.248 + incl r9 +noname.248: + + bicl3 #-65536,20(r6),r3 + movzwl 22(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,20(r7),r2 + movzwl 22(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-796(fp) + mull2 r2,r5 + mull3 r2,r4,-800(fp) + mull2 r0,r4 + addl3 -796(fp),-800(fp),r0 + bicl3 #0,r0,-796(fp) + cmpl -796(fp),-800(fp) + bgequ noname.249 + addl2 #65536,r4 +noname.249: + movzwl -794(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-796(fp),r0 + ashl #16,r0,-800(fp) + addl2 -800(fp),r5 + bicl2 #0,r5 + cmpl r5,-800(fp) + bgequ noname.250 + incl r4 +noname.250: + movl r5,r1 + movl r4,r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.251 + incl r2 +noname.251: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.252 + incl r9 +noname.252: + + bicl3 #-65536,16(r6),r3 + movzwl 18(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,24(r7),r2 + movzwl 26(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-804(fp) + mull2 r2,r5 + mull3 r2,r4,-808(fp) + mull2 r0,r4 + addl3 -804(fp),-808(fp),r0 + bicl3 #0,r0,-804(fp) + cmpl -804(fp),-808(fp) + bgequ noname.253 + addl2 #65536,r4 +noname.253: + movzwl -802(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-804(fp),r0 + ashl #16,r0,-808(fp) + addl2 -808(fp),r5 + bicl2 #0,r5 + cmpl r5,-808(fp) + bgequ noname.254 + incl r4 +noname.254: + movl r5,r1 + movl r4,r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.255 + incl r2 +noname.255: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.256 + incl r9 +noname.256: + + bicl3 #-65536,12(r6),r3 + movzwl 14(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,28(r7),r2 + movzwl 30(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-812(fp) + mull2 r2,r5 + mull3 r2,r4,-816(fp) + mull2 r0,r4 + addl3 -812(fp),-816(fp),r0 + bicl3 #0,r0,-812(fp) + cmpl -812(fp),-816(fp) + bgequ noname.257 + addl2 #65536,r4 +noname.257: + movzwl -810(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-812(fp),r0 + ashl #16,r0,-816(fp) + addl2 -816(fp),r5 + bicl2 #0,r5 + cmpl r5,-816(fp) + bgequ noname.258 + incl r4 +noname.258: + movl r5,r1 + movl r4,r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.259 + incl r2 +noname.259: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.260 + incl r9 +noname.260: + + movl r8,40(r11) + + clrl r8 + + bicl3 #-65536,16(r6),r3 + movzwl 18(r6),r2 + bicl3 #-65536,28(r7),r1 + movzwl 30(r7),r0 + bicl2 #-65536,r0 + movl r3,r4 + bicl3 #-65536,r2,-828(fp) + mull3 r0,r4,-820(fp) + mull2 r1,r4 + mull3 r1,-828(fp),-824(fp) + mull2 r0,-828(fp) + addl3 -820(fp),-824(fp),r0 + bicl3 #0,r0,-820(fp) + cmpl -820(fp),-824(fp) + bgequ noname.261 + addl2 #65536,-828(fp) +noname.261: + movzwl -818(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-828(fp) + bicl3 #-65536,-820(fp),r0 + ashl #16,r0,-824(fp) + addl2 -824(fp),r4 + bicl2 #0,r4 + cmpl r4,-824(fp) + bgequ noname.262 + incl -828(fp) +noname.262: + movl r4,r1 + movl -828(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.263 + incl r2 +noname.263: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.264 + incl r8 +noname.264: + + movzwl 22(r6),r2 + bicl3 #-65536,24(r7),r3 + movzwl 26(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,20(r6),-840(fp) + bicl3 #-65536,r2,-844(fp) + mull3 r0,-840(fp),-832(fp) + mull2 r3,-840(fp) + mull3 r3,-844(fp),-836(fp) + mull2 r0,-844(fp) + addl3 -832(fp),-836(fp),r0 + bicl3 #0,r0,-832(fp) + cmpl -832(fp),-836(fp) + bgequ noname.265 + addl2 #65536,-844(fp) +noname.265: + movzwl -830(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-844(fp) + bicl3 #-65536,-832(fp),r0 + ashl #16,r0,-836(fp) + addl3 -836(fp),-840(fp),r0 + bicl3 #0,r0,-840(fp) + cmpl -840(fp),-836(fp) + bgequ noname.266 + incl -844(fp) +noname.266: + movl -840(fp),r1 + movl -844(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.267 + incl r2 +noname.267: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.268 + incl r8 +noname.268: + + bicl3 #-65536,24(r6),r3 + movzwl 26(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,20(r7),r2 + movzwl 22(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-848(fp) + mull2 r2,r5 + mull3 r2,r4,-852(fp) + mull2 r0,r4 + addl3 -848(fp),-852(fp),r0 + bicl3 #0,r0,-848(fp) + cmpl -848(fp),-852(fp) + bgequ noname.269 + addl2 #65536,r4 +noname.269: + movzwl -846(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-848(fp),r0 + ashl #16,r0,-852(fp) + addl2 -852(fp),r5 + bicl2 #0,r5 + cmpl r5,-852(fp) + bgequ noname.270 + incl r4 +noname.270: + movl r5,r1 + movl r4,r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.271 + incl r2 +noname.271: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.272 + incl r8 +noname.272: + + bicl3 #-65536,28(r6),r3 + movzwl 30(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,16(r7),r2 + movzwl 18(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-856(fp) + mull2 r2,r5 + mull3 r2,r4,-860(fp) + mull2 r0,r4 + addl3 -856(fp),-860(fp),r0 + bicl3 #0,r0,-856(fp) + cmpl -856(fp),-860(fp) + bgequ noname.273 + addl2 #65536,r4 +noname.273: + movzwl -854(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-856(fp),r0 + ashl #16,r0,-860(fp) + addl2 -860(fp),r5 + bicl2 #0,r5 + cmpl r5,-860(fp) + bgequ noname.274 + incl r4 +noname.274: + movl r5,r1 + movl r4,r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.275 + incl r2 +noname.275: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.276 + incl r8 +noname.276: + + movl r10,44(r11) + + clrl r10 + + bicl3 #-65536,28(r6),r3 + movzwl 30(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,20(r7),r2 + movzwl 22(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-864(fp) + mull2 r2,r5 + mull3 r2,r4,-868(fp) + mull2 r0,r4 + addl3 -864(fp),-868(fp),r0 + bicl3 #0,r0,-864(fp) + cmpl -864(fp),-868(fp) + bgequ noname.277 + addl2 #65536,r4 +noname.277: + movzwl -862(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-864(fp),r0 + ashl #16,r0,-868(fp) + addl2 -868(fp),r5 + bicl2 #0,r5 + cmpl r5,-868(fp) + bgequ noname.278 + incl r4 +noname.278: + movl r5,r1 + movl r4,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.279 + incl r2 +noname.279: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.280 + incl r10 +noname.280: + + bicl3 #-65536,24(r6),r3 + movzwl 26(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,24(r7),r2 + movzwl 26(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-872(fp) + mull2 r2,r5 + mull3 r2,r4,-876(fp) + mull2 r0,r4 + addl3 -872(fp),-876(fp),r0 + bicl3 #0,r0,-872(fp) + cmpl -872(fp),-876(fp) + bgequ noname.281 + addl2 #65536,r4 +noname.281: + movzwl -870(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-872(fp),r0 + ashl #16,r0,-876(fp) + addl2 -876(fp),r5 + bicl2 #0,r5 + cmpl r5,-876(fp) + bgequ noname.282 + incl r4 +noname.282: + movl r5,r1 + movl r4,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.283 + incl r2 +noname.283: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.284 + incl r10 +noname.284: + + bicl3 #-65536,20(r6),r3 + movzwl 22(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,28(r7),r2 + movzwl 30(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-880(fp) + mull2 r2,r5 + mull3 r2,r4,-884(fp) + mull2 r0,r4 + addl3 -880(fp),-884(fp),r0 + bicl3 #0,r0,-880(fp) + cmpl -880(fp),-884(fp) + bgequ noname.285 + addl2 #65536,r4 +noname.285: + movzwl -878(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-880(fp),r0 + ashl #16,r0,-884(fp) + addl2 -884(fp),r5 + bicl2 #0,r5 + cmpl r5,-884(fp) + bgequ noname.286 + incl r4 +noname.286: + movl r5,r1 + movl r4,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.287 + incl r2 +noname.287: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.288 + incl r10 +noname.288: + + movl r9,48(r11) + + clrl r9 + + bicl3 #-65536,24(r6),r3 + movzwl 26(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,28(r7),r2 + movzwl 30(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-888(fp) + mull2 r2,r5 + mull3 r2,r4,-892(fp) + mull2 r0,r4 + addl3 -888(fp),-892(fp),r0 + bicl3 #0,r0,-888(fp) + cmpl -888(fp),-892(fp) + bgequ noname.289 + addl2 #65536,r4 +noname.289: + movzwl -886(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-888(fp),r0 + ashl #16,r0,-892(fp) + addl2 -892(fp),r5 + bicl2 #0,r5 + cmpl r5,-892(fp) + bgequ noname.290 + incl r4 +noname.290: + movl r5,r1 + movl r4,r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.291 + incl r2 +noname.291: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.292 + incl r9 +noname.292: + + movzwl 30(r6),r2 + bicl3 #-65536,24(r7),r3 + movzwl 26(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,28(r6),-904(fp) + bicl3 #-65536,r2,-908(fp) + mull3 r0,-904(fp),-896(fp) + mull2 r3,-904(fp) + mull3 r3,-908(fp),-900(fp) + mull2 r0,-908(fp) + addl3 -896(fp),-900(fp),r0 + bicl3 #0,r0,-896(fp) + cmpl -896(fp),-900(fp) + bgequ noname.293 + addl2 #65536,-908(fp) +noname.293: + movzwl -894(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-908(fp) + bicl3 #-65536,-896(fp),r0 + ashl #16,r0,-900(fp) + addl3 -900(fp),-904(fp),r0 + bicl3 #0,r0,-904(fp) + cmpl -904(fp),-900(fp) + bgequ noname.294 + incl -908(fp) +noname.294: + movl -904(fp),r1 + movl -908(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.295 + incl r2 +noname.295: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.296 + incl r9 +noname.296: + + movl r8,52(r11) + + clrl r8 + + movzwl 30(r6),r2 + bicl3 #-65536,28(r7),r3 + movzwl 30(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,28(r6),-920(fp) + bicl3 #-65536,r2,-924(fp) + mull3 r0,-920(fp),-912(fp) + mull2 r3,-920(fp) + mull3 r3,-924(fp),-916(fp) + mull2 r0,-924(fp) + addl3 -912(fp),-916(fp),r0 + bicl3 #0,r0,-912(fp) + cmpl -912(fp),-916(fp) + bgequ noname.297 + addl2 #65536,-924(fp) +noname.297: + movzwl -910(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-924(fp) + bicl3 #-65536,-912(fp),r0 + ashl #16,r0,-916(fp) + addl3 -916(fp),-920(fp),r0 + bicl3 #0,r0,-920(fp) + cmpl -920(fp),-916(fp) + bgequ noname.298 + incl -924(fp) +noname.298: + movl -920(fp),r1 + movl -924(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.299 + incl r2 +noname.299: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.300 + incl r8 +noname.300: + + movl r10,56(r11) + + movl r9,60(r11) + + ret + + + +;r=4 ;(AP) +;a=8 ;(AP) +;b=12 ;(AP) +;n=16 ;(AP) n by value (input) + + .psect code,nowrt + +.entry BN_MUL_COMBA4,^m<r2,r3,r4,r5,r6,r7,r8,r9,r10,r11> + movab -156(sp),sp + + clrq r9 + + clrl r8 + + movl 8(ap),r6 + bicl3 #-65536,(r6),r3 + movzwl 2(r6),r2 + bicl2 #-65536,r2 + movl 12(ap),r7 + bicl3 #-65536,(r7),r1 + movzwl 2(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r2,r4 + mull3 r0,r5,-4(fp) + mull2 r1,r5 + mull3 r1,r4,-8(fp) + mull2 r0,r4 + addl3 -4(fp),-8(fp),r0 + bicl3 #0,r0,-4(fp) + cmpl -4(fp),-8(fp) + bgequ noname.303 + addl2 #65536,r4 +noname.303: + movzwl -2(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-4(fp),r0 + ashl #16,r0,-8(fp) + addl2 -8(fp),r5 + bicl2 #0,r5 + cmpl r5,-8(fp) + bgequ noname.304 + incl r4 +noname.304: + movl r5,r1 + movl r4,r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.305 + incl r2 +noname.305: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.306 + incl r8 +noname.306: + + movl 4(ap),r11 + movl r10,(r11) + + clrl r10 + + bicl3 #-65536,(r6),r3 + movzwl 2(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,4(r7),r2 + movzwl 6(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-12(fp) + mull2 r2,r5 + mull3 r2,r4,-16(fp) + mull2 r0,r4 + addl3 -12(fp),-16(fp),r0 + bicl3 #0,r0,-12(fp) + cmpl -12(fp),-16(fp) + bgequ noname.307 + addl2 #65536,r4 +noname.307: + movzwl -10(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-12(fp),r0 + ashl #16,r0,-16(fp) + addl2 -16(fp),r5 + bicl2 #0,r5 + cmpl r5,-16(fp) + bgequ noname.308 + incl r4 +noname.308: + movl r5,r1 + movl r4,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.309 + incl r2 +noname.309: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.310 + incl r10 +noname.310: + + bicl3 #-65536,4(r6),r3 + movzwl 6(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,(r7),r2 + movzwl 2(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-20(fp) + mull2 r2,r5 + mull3 r2,r4,-24(fp) + mull2 r0,r4 + addl3 -20(fp),-24(fp),r0 + bicl3 #0,r0,-20(fp) + cmpl -20(fp),-24(fp) + bgequ noname.311 + addl2 #65536,r4 +noname.311: + movzwl -18(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-20(fp),r0 + ashl #16,r0,-24(fp) + addl2 -24(fp),r5 + bicl2 #0,r5 + cmpl r5,-24(fp) + bgequ noname.312 + incl r4 +noname.312: + movl r5,r1 + movl r4,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.313 + incl r2 +noname.313: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.314 + incl r10 +noname.314: + + movl r9,4(r11) + + clrl r9 + + bicl3 #-65536,8(r6),r3 + movzwl 10(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,(r7),r2 + movzwl 2(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-28(fp) + mull2 r2,r5 + mull3 r2,r4,-32(fp) + mull2 r0,r4 + addl3 -28(fp),-32(fp),r0 + bicl3 #0,r0,-28(fp) + cmpl -28(fp),-32(fp) + bgequ noname.315 + addl2 #65536,r4 +noname.315: + movzwl -26(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-28(fp),r0 + ashl #16,r0,-32(fp) + addl2 -32(fp),r5 + bicl2 #0,r5 + cmpl r5,-32(fp) + bgequ noname.316 + incl r4 +noname.316: + movl r5,r1 + movl r4,r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.317 + incl r2 +noname.317: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.318 + incl r9 +noname.318: + + bicl3 #-65536,4(r6),r3 + movzwl 6(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,4(r7),r2 + movzwl 6(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-36(fp) + mull2 r2,r5 + mull3 r2,r4,-40(fp) + mull2 r0,r4 + addl3 -36(fp),-40(fp),r0 + bicl3 #0,r0,-36(fp) + cmpl -36(fp),-40(fp) + bgequ noname.319 + addl2 #65536,r4 +noname.319: + movzwl -34(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-36(fp),r0 + ashl #16,r0,-40(fp) + addl2 -40(fp),r5 + bicl2 #0,r5 + cmpl r5,-40(fp) + bgequ noname.320 + incl r4 +noname.320: + movl r5,r1 + movl r4,r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.321 + incl r2 +noname.321: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.322 + incl r9 +noname.322: + + bicl3 #-65536,(r6),r3 + movzwl 2(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,8(r7),r2 + movzwl 10(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-44(fp) + mull2 r2,r5 + mull3 r2,r4,-48(fp) + mull2 r0,r4 + addl3 -44(fp),-48(fp),r0 + bicl3 #0,r0,-44(fp) + cmpl -44(fp),-48(fp) + bgequ noname.323 + addl2 #65536,r4 +noname.323: + movzwl -42(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-44(fp),r0 + ashl #16,r0,-48(fp) + addl2 -48(fp),r5 + bicl2 #0,r5 + cmpl r5,-48(fp) + bgequ noname.324 + incl r4 +noname.324: + movl r5,r1 + movl r4,r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.325 + incl r2 +noname.325: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.326 + incl r9 +noname.326: + + movl r8,8(r11) + + clrl r8 + + bicl3 #-65536,(r6),r3 + movzwl 2(r6),r2 + bicl3 #-65536,12(r7),r1 + movzwl 14(r7),r0 + bicl2 #-65536,r0 + movl r3,r4 + bicl3 #-65536,r2,-60(fp) + mull3 r0,r4,-52(fp) + mull2 r1,r4 + mull3 r1,-60(fp),-56(fp) + mull2 r0,-60(fp) + addl3 -52(fp),-56(fp),r0 + bicl3 #0,r0,-52(fp) + cmpl -52(fp),-56(fp) + bgequ noname.327 + addl2 #65536,-60(fp) +noname.327: + movzwl -50(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-60(fp) + bicl3 #-65536,-52(fp),r0 + ashl #16,r0,-56(fp) + addl2 -56(fp),r4 + bicl2 #0,r4 + cmpl r4,-56(fp) + bgequ noname.328 + incl -60(fp) +noname.328: + movl r4,r1 + movl -60(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.329 + incl r2 +noname.329: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.330 + incl r8 +noname.330: + + movzwl 6(r6),r2 + bicl3 #-65536,8(r7),r3 + movzwl 10(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,4(r6),-72(fp) + bicl3 #-65536,r2,-76(fp) + mull3 r0,-72(fp),-64(fp) + mull2 r3,-72(fp) + mull3 r3,-76(fp),-68(fp) + mull2 r0,-76(fp) + addl3 -64(fp),-68(fp),r0 + bicl3 #0,r0,-64(fp) + cmpl -64(fp),-68(fp) + bgequ noname.331 + addl2 #65536,-76(fp) +noname.331: + movzwl -62(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-76(fp) + bicl3 #-65536,-64(fp),r0 + ashl #16,r0,-68(fp) + addl3 -68(fp),-72(fp),r0 + bicl3 #0,r0,-72(fp) + cmpl -72(fp),-68(fp) + bgequ noname.332 + incl -76(fp) +noname.332: + movl -72(fp),r1 + movl -76(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.333 + incl r2 +noname.333: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.334 + incl r8 +noname.334: + + bicl3 #-65536,8(r6),r3 + movzwl 10(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,4(r7),r2 + movzwl 6(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-80(fp) + mull2 r2,r5 + mull3 r2,r4,-84(fp) + mull2 r0,r4 + addl3 -80(fp),-84(fp),r0 + bicl3 #0,r0,-80(fp) + cmpl -80(fp),-84(fp) + bgequ noname.335 + addl2 #65536,r4 +noname.335: + movzwl -78(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-80(fp),r0 + ashl #16,r0,-84(fp) + addl2 -84(fp),r5 + bicl2 #0,r5 + cmpl r5,-84(fp) + bgequ noname.336 + incl r4 +noname.336: + movl r5,r1 + movl r4,r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.337 + incl r2 +noname.337: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.338 + incl r8 +noname.338: + + bicl3 #-65536,12(r6),r3 + movzwl 14(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,(r7),r2 + movzwl 2(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-88(fp) + mull2 r2,r5 + mull3 r2,r4,-92(fp) + mull2 r0,r4 + addl3 -88(fp),-92(fp),r0 + bicl3 #0,r0,-88(fp) + cmpl -88(fp),-92(fp) + bgequ noname.339 + addl2 #65536,r4 +noname.339: + movzwl -86(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-88(fp),r0 + ashl #16,r0,-92(fp) + addl2 -92(fp),r5 + bicl2 #0,r5 + cmpl r5,-92(fp) + bgequ noname.340 + incl r4 +noname.340: + movl r5,r1 + movl r4,r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.341 + incl r2 +noname.341: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.342 + incl r8 +noname.342: + + movl r10,12(r11) + + clrl r10 + + bicl3 #-65536,12(r6),r3 + movzwl 14(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,4(r7),r2 + movzwl 6(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-96(fp) + mull2 r2,r5 + mull3 r2,r4,-100(fp) + mull2 r0,r4 + addl3 -96(fp),-100(fp),r0 + bicl3 #0,r0,-96(fp) + cmpl -96(fp),-100(fp) + bgequ noname.343 + addl2 #65536,r4 +noname.343: + movzwl -94(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-96(fp),r0 + ashl #16,r0,-100(fp) + addl2 -100(fp),r5 + bicl2 #0,r5 + cmpl r5,-100(fp) + bgequ noname.344 + incl r4 +noname.344: + movl r5,r1 + movl r4,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.345 + incl r2 +noname.345: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.346 + incl r10 +noname.346: + + bicl3 #-65536,8(r6),r3 + movzwl 10(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,8(r7),r2 + movzwl 10(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-104(fp) + mull2 r2,r5 + mull3 r2,r4,-108(fp) + mull2 r0,r4 + addl3 -104(fp),-108(fp),r0 + bicl3 #0,r0,-104(fp) + cmpl -104(fp),-108(fp) + bgequ noname.347 + addl2 #65536,r4 +noname.347: + movzwl -102(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-104(fp),r0 + ashl #16,r0,-108(fp) + addl2 -108(fp),r5 + bicl2 #0,r5 + cmpl r5,-108(fp) + bgequ noname.348 + incl r4 +noname.348: + movl r5,r1 + movl r4,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.349 + incl r2 +noname.349: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.350 + incl r10 +noname.350: + + bicl3 #-65536,4(r6),r3 + movzwl 6(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,12(r7),r2 + movzwl 14(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-112(fp) + mull2 r2,r5 + mull3 r2,r4,-116(fp) + mull2 r0,r4 + addl3 -112(fp),-116(fp),r0 + bicl3 #0,r0,-112(fp) + cmpl -112(fp),-116(fp) + bgequ noname.351 + addl2 #65536,r4 +noname.351: + movzwl -110(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-112(fp),r0 + ashl #16,r0,-116(fp) + addl2 -116(fp),r5 + bicl2 #0,r5 + cmpl r5,-116(fp) + bgequ noname.352 + incl r4 +noname.352: + movl r5,r1 + movl r4,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.353 + incl r2 +noname.353: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.354 + incl r10 +noname.354: + + movl r9,16(r11) + + clrl r9 + + bicl3 #-65536,8(r6),r3 + movzwl 10(r6),r1 + bicl2 #-65536,r1 + bicl3 #-65536,12(r7),r2 + movzwl 14(r7),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-120(fp) + mull2 r2,r5 + mull3 r2,r4,-124(fp) + mull2 r0,r4 + addl3 -120(fp),-124(fp),r0 + bicl3 #0,r0,-120(fp) + cmpl -120(fp),-124(fp) + bgequ noname.355 + addl2 #65536,r4 +noname.355: + movzwl -118(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-120(fp),r0 + ashl #16,r0,-124(fp) + addl2 -124(fp),r5 + bicl2 #0,r5 + cmpl r5,-124(fp) + bgequ noname.356 + incl r4 +noname.356: + movl r5,r1 + movl r4,r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.357 + incl r2 +noname.357: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.358 + incl r9 +noname.358: + + movzwl 14(r6),r2 + bicl3 #-65536,8(r7),r3 + movzwl 10(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,12(r6),-136(fp) + bicl3 #-65536,r2,-140(fp) + mull3 r0,-136(fp),-128(fp) + mull2 r3,-136(fp) + mull3 r3,-140(fp),-132(fp) + mull2 r0,-140(fp) + addl3 -128(fp),-132(fp),r0 + bicl3 #0,r0,-128(fp) + cmpl -128(fp),-132(fp) + bgequ noname.359 + addl2 #65536,-140(fp) +noname.359: + movzwl -126(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-140(fp) + bicl3 #-65536,-128(fp),r0 + ashl #16,r0,-132(fp) + addl3 -132(fp),-136(fp),r0 + bicl3 #0,r0,-136(fp) + cmpl -136(fp),-132(fp) + bgequ noname.360 + incl -140(fp) +noname.360: + movl -136(fp),r1 + movl -140(fp),r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.361 + incl r2 +noname.361: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.362 + incl r9 +noname.362: + + movl r8,20(r11) + + clrl r8 + + movzwl 14(r6),r2 + bicl3 #-65536,12(r7),r3 + movzwl 14(r7),r0 + bicl2 #-65536,r0 + bicl3 #-65536,12(r6),-152(fp) + bicl3 #-65536,r2,-156(fp) + mull3 r0,-152(fp),-144(fp) + mull2 r3,-152(fp) + mull3 r3,-156(fp),-148(fp) + mull2 r0,-156(fp) + addl3 -144(fp),-148(fp),r0 + bicl3 #0,r0,-144(fp) + cmpl -144(fp),-148(fp) + bgequ noname.363 + addl2 #65536,-156(fp) +noname.363: + movzwl -142(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-156(fp) + bicl3 #-65536,-144(fp),r0 + ashl #16,r0,-148(fp) + addl3 -148(fp),-152(fp),r0 + bicl3 #0,r0,-152(fp) + cmpl -152(fp),-148(fp) + bgequ noname.364 + incl -156(fp) +noname.364: + movl -152(fp),r1 + movl -156(fp),r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.365 + incl r2 +noname.365: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.366 + incl r8 +noname.366: + + movl r10,24(r11) + + movl r9,28(r11) + + ret + + + +;r=4 ;(AP) +;a=8 ;(AP) +;b=12 ;(AP) +;n=16 ;(AP) n by value (input) + + .psect code,nowrt + +.entry BN_SQR_COMBA8,^m<r2,r3,r4,r5,r6,r7,r8,r9> + movab -444(sp),sp + + clrq r8 + + clrl r7 + + movl 8(ap),r4 + movl (r4),r3 + bicl3 #-65536,r3,-4(fp) + extzv #16,#16,r3,r0 + bicl3 #-65536,r0,r3 + movl -4(fp),r0 + mull3 r0,r3,-8(fp) + mull3 r0,r0,-4(fp) + mull2 r3,r3 + bicl3 #32767,-8(fp),r0 + extzv #15,#17,r0,r0 + addl2 r0,r3 + bicl3 #-65536,-8(fp),r0 + ashl #17,r0,-8(fp) + addl3 -4(fp),-8(fp),r0 + bicl3 #0,r0,-4(fp) + cmpl -4(fp),-8(fp) + bgequ noname.369 + incl r3 +noname.369: + movl -4(fp),r1 + movl r3,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.370 + incl r2 +noname.370: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.371 + incl r7 +noname.371: + + movl r9,@4(ap) + + clrl r9 + + movzwl 6(r4),r2 + bicl3 #-65536,(r4),r3 + movzwl 2(r4),r0 + bicl2 #-65536,r0 + bicl3 #-65536,4(r4),-20(fp) + bicl3 #-65536,r2,-24(fp) + mull3 r0,-20(fp),-12(fp) + mull2 r3,-20(fp) + mull3 r3,-24(fp),-16(fp) + mull2 r0,-24(fp) + addl3 -12(fp),-16(fp),r0 + bicl3 #0,r0,-12(fp) + cmpl -12(fp),-16(fp) + bgequ noname.372 + addl2 #65536,-24(fp) +noname.372: + movzwl -10(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-24(fp) + bicl3 #-65536,-12(fp),r0 + ashl #16,r0,-16(fp) + addl3 -16(fp),-20(fp),r0 + bicl3 #0,r0,-20(fp) + cmpl -20(fp),-16(fp) + bgequ noname.373 + incl -24(fp) +noname.373: + movl -20(fp),r3 + movl -24(fp),r2 + bbc #31,r2,noname.374 + incl r9 +noname.374: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.375 + incl r2 +noname.375: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.376 + incl r2 + bicl3 #0,r2,r0 + bneq noname.376 + incl r9 +noname.376: + addl2 r2,r7 + bicl2 #0,r7 + cmpl r7,r2 + bgequ noname.377 + incl r9 +noname.377: + + movl 4(ap),r0 + movl r8,4(r0) + + clrl r8 + + movl 8(ap),r4 + movl 4(r4),r3 + bicl3 #-65536,r3,-28(fp) + extzv #16,#16,r3,r0 + bicl3 #-65536,r0,r3 + movl -28(fp),r0 + mull3 r0,r3,-32(fp) + mull3 r0,r0,-28(fp) + mull2 r3,r3 + bicl3 #32767,-32(fp),r0 + extzv #15,#17,r0,r0 + addl2 r0,r3 + bicl3 #-65536,-32(fp),r0 + ashl #17,r0,-32(fp) + addl3 -28(fp),-32(fp),r0 + bicl3 #0,r0,-28(fp) + cmpl -28(fp),-32(fp) + bgequ noname.378 + incl r3 +noname.378: + movl -28(fp),r1 + movl r3,r2 + addl2 r1,r7 + bicl2 #0,r7 + cmpl r7,r1 + bgequ noname.379 + incl r2 +noname.379: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.380 + incl r8 +noname.380: + + movzwl 10(r4),r2 + bicl3 #-65536,(r4),r3 + movzwl 2(r4),r0 + bicl2 #-65536,r0 + bicl3 #-65536,8(r4),-44(fp) + bicl3 #-65536,r2,-48(fp) + mull3 r0,-44(fp),-36(fp) + mull2 r3,-44(fp) + mull3 r3,-48(fp),-40(fp) + mull2 r0,-48(fp) + addl3 -36(fp),-40(fp),r0 + bicl3 #0,r0,-36(fp) + cmpl -36(fp),-40(fp) + bgequ noname.381 + addl2 #65536,-48(fp) +noname.381: + movzwl -34(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-48(fp) + bicl3 #-65536,-36(fp),r0 + ashl #16,r0,-40(fp) + addl3 -40(fp),-44(fp),r0 + bicl3 #0,r0,-44(fp) + cmpl -44(fp),-40(fp) + bgequ noname.382 + incl -48(fp) +noname.382: + movl -44(fp),r3 + movl -48(fp),r2 + bbc #31,r2,noname.383 + incl r8 +noname.383: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.384 + incl r2 +noname.384: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r7 + bicl2 #0,r7 + cmpl r7,r3 + bgequ noname.385 + incl r2 + bicl3 #0,r2,r0 + bneq noname.385 + incl r8 +noname.385: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.386 + incl r8 +noname.386: + + movl 4(ap),r0 + movl r7,8(r0) + + clrl r7 + + movl 8(ap),r0 + movzwl 14(r0),r2 + bicl3 #-65536,(r0),r3 + movzwl 2(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,12(r0),-60(fp) + bicl3 #-65536,r2,-64(fp) + mull3 r1,-60(fp),-52(fp) + mull2 r3,-60(fp) + mull3 r3,-64(fp),-56(fp) + mull2 r1,-64(fp) + addl3 -52(fp),-56(fp),r0 + bicl3 #0,r0,-52(fp) + cmpl -52(fp),-56(fp) + bgequ noname.387 + addl2 #65536,-64(fp) +noname.387: + movzwl -50(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-64(fp) + bicl3 #-65536,-52(fp),r0 + ashl #16,r0,-56(fp) + addl3 -56(fp),-60(fp),r0 + bicl3 #0,r0,-60(fp) + cmpl -60(fp),-56(fp) + bgequ noname.388 + incl -64(fp) +noname.388: + movl -60(fp),r3 + movl -64(fp),r2 + bbc #31,r2,noname.389 + incl r7 +noname.389: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.390 + incl r2 +noname.390: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r9 + bicl2 #0,r9 + cmpl r9,r3 + bgequ noname.391 + incl r2 + bicl3 #0,r2,r0 + bneq noname.391 + incl r7 +noname.391: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.392 + incl r7 +noname.392: + + movl 8(ap),r0 + movzwl 10(r0),r2 + bicl3 #-65536,4(r0),r3 + movzwl 6(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,8(r0),-76(fp) + bicl3 #-65536,r2,-80(fp) + mull3 r1,-76(fp),-68(fp) + mull2 r3,-76(fp) + mull3 r3,-80(fp),-72(fp) + mull2 r1,-80(fp) + addl3 -68(fp),-72(fp),r0 + bicl3 #0,r0,-68(fp) + cmpl -68(fp),-72(fp) + bgequ noname.393 + addl2 #65536,-80(fp) +noname.393: + movzwl -66(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-80(fp) + bicl3 #-65536,-68(fp),r0 + ashl #16,r0,-72(fp) + addl3 -72(fp),-76(fp),r0 + bicl3 #0,r0,-76(fp) + cmpl -76(fp),-72(fp) + bgequ noname.394 + incl -80(fp) +noname.394: + movl -76(fp),r3 + movl -80(fp),r2 + bbc #31,r2,noname.395 + incl r7 +noname.395: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.396 + incl r2 +noname.396: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r9 + bicl2 #0,r9 + cmpl r9,r3 + bgequ noname.397 + incl r2 + bicl3 #0,r2,r0 + bneq noname.397 + incl r7 +noname.397: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.398 + incl r7 +noname.398: + + movl 4(ap),r0 + movl r9,12(r0) + + clrl r9 + + movl 8(ap),r2 + movl 8(r2),r4 + bicl3 #-65536,r4,-84(fp) + extzv #16,#16,r4,r0 + bicl3 #-65536,r0,r4 + movl -84(fp),r0 + mull3 r0,r4,-88(fp) + mull3 r0,r0,-84(fp) + mull2 r4,r4 + bicl3 #32767,-88(fp),r0 + extzv #15,#17,r0,r0 + addl2 r0,r4 + bicl3 #-65536,-88(fp),r0 + ashl #17,r0,-88(fp) + addl3 -84(fp),-88(fp),r0 + bicl3 #0,r0,-84(fp) + cmpl -84(fp),-88(fp) + bgequ noname.399 + incl r4 +noname.399: + movl -84(fp),r1 + movl r4,r3 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.400 + incl r3 +noname.400: + addl2 r3,r7 + bicl2 #0,r7 + cmpl r7,r3 + bgequ noname.401 + incl r9 +noname.401: + + movzwl 14(r2),r3 + bicl3 #-65536,4(r2),r1 + movzwl 6(r2),r0 + bicl2 #-65536,r0 + bicl3 #-65536,12(r2),-100(fp) + bicl3 #-65536,r3,-104(fp) + mull3 r0,-100(fp),-92(fp) + mull2 r1,-100(fp) + mull3 r1,-104(fp),-96(fp) + mull2 r0,-104(fp) + addl3 -92(fp),-96(fp),r0 + bicl3 #0,r0,-92(fp) + cmpl -92(fp),-96(fp) + bgequ noname.402 + addl2 #65536,-104(fp) +noname.402: + movzwl -90(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-104(fp) + bicl3 #-65536,-92(fp),r0 + ashl #16,r0,-96(fp) + addl3 -96(fp),-100(fp),r0 + bicl3 #0,r0,-100(fp) + cmpl -100(fp),-96(fp) + bgequ noname.403 + incl -104(fp) +noname.403: + movl -100(fp),r3 + movl -104(fp),r2 + bbc #31,r2,noname.404 + incl r9 +noname.404: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.405 + incl r2 +noname.405: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.406 + incl r2 + bicl3 #0,r2,r0 + bneq noname.406 + incl r9 +noname.406: + addl2 r2,r7 + bicl2 #0,r7 + cmpl r7,r2 + bgequ noname.407 + incl r9 +noname.407: + + movl 8(ap),r0 + movzwl 18(r0),r2 + bicl3 #-65536,(r0),r3 + movzwl 2(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,16(r0),-116(fp) + bicl3 #-65536,r2,-120(fp) + mull3 r1,-116(fp),-108(fp) + mull2 r3,-116(fp) + mull3 r3,-120(fp),-112(fp) + mull2 r1,-120(fp) + addl3 -108(fp),-112(fp),r0 + bicl3 #0,r0,-108(fp) + cmpl -108(fp),-112(fp) + bgequ noname.408 + addl2 #65536,-120(fp) +noname.408: + movzwl -106(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-120(fp) + bicl3 #-65536,-108(fp),r0 + ashl #16,r0,-112(fp) + addl3 -112(fp),-116(fp),r0 + bicl3 #0,r0,-116(fp) + cmpl -116(fp),-112(fp) + bgequ noname.409 + incl -120(fp) +noname.409: + movl -116(fp),r3 + movl -120(fp),r2 + bbc #31,r2,noname.410 + incl r9 +noname.410: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.411 + incl r2 +noname.411: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.412 + incl r2 + bicl3 #0,r2,r0 + bneq noname.412 + incl r9 +noname.412: + addl2 r2,r7 + bicl2 #0,r7 + cmpl r7,r2 + bgequ noname.413 + incl r9 +noname.413: + + movl 4(ap),r0 + movl r8,16(r0) + + clrl r8 + + movl 8(ap),r0 + movzwl 22(r0),r2 + bicl3 #-65536,(r0),r3 + movzwl 2(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,20(r0),-132(fp) + bicl3 #-65536,r2,-136(fp) + mull3 r1,-132(fp),-124(fp) + mull2 r3,-132(fp) + mull3 r3,-136(fp),-128(fp) + mull2 r1,-136(fp) + addl3 -124(fp),-128(fp),r0 + bicl3 #0,r0,-124(fp) + cmpl -124(fp),-128(fp) + bgequ noname.414 + addl2 #65536,-136(fp) +noname.414: + movzwl -122(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-136(fp) + bicl3 #-65536,-124(fp),r0 + ashl #16,r0,-128(fp) + addl3 -128(fp),-132(fp),r0 + bicl3 #0,r0,-132(fp) + cmpl -132(fp),-128(fp) + bgequ noname.415 + incl -136(fp) +noname.415: + movl -132(fp),r3 + movl -136(fp),r2 + bbc #31,r2,noname.416 + incl r8 +noname.416: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.417 + incl r2 +noname.417: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r7 + bicl2 #0,r7 + cmpl r7,r3 + bgequ noname.418 + incl r2 + bicl3 #0,r2,r0 + bneq noname.418 + incl r8 +noname.418: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.419 + incl r8 +noname.419: + + movl 8(ap),r0 + movzwl 18(r0),r2 + bicl3 #-65536,4(r0),r3 + movzwl 6(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,16(r0),-148(fp) + bicl3 #-65536,r2,-152(fp) + mull3 r1,-148(fp),-140(fp) + mull2 r3,-148(fp) + mull3 r3,-152(fp),-144(fp) + mull2 r1,-152(fp) + addl3 -140(fp),-144(fp),r0 + bicl3 #0,r0,-140(fp) + cmpl -140(fp),-144(fp) + bgequ noname.420 + addl2 #65536,-152(fp) +noname.420: + movzwl -138(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-152(fp) + bicl3 #-65536,-140(fp),r0 + ashl #16,r0,-144(fp) + addl3 -144(fp),-148(fp),r0 + bicl3 #0,r0,-148(fp) + cmpl -148(fp),-144(fp) + bgequ noname.421 + incl -152(fp) +noname.421: + movl -148(fp),r3 + movl -152(fp),r2 + bbc #31,r2,noname.422 + incl r8 +noname.422: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.423 + incl r2 +noname.423: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r7 + bicl2 #0,r7 + cmpl r7,r3 + bgequ noname.424 + incl r2 + bicl3 #0,r2,r0 + bneq noname.424 + incl r8 +noname.424: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.425 + incl r8 +noname.425: + + movl 8(ap),r0 + movzwl 14(r0),r2 + bicl3 #-65536,8(r0),r3 + movzwl 10(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,12(r0),-164(fp) + bicl3 #-65536,r2,-168(fp) + mull3 r1,-164(fp),-156(fp) + mull2 r3,-164(fp) + mull3 r3,-168(fp),-160(fp) + mull2 r1,-168(fp) + addl3 -156(fp),-160(fp),r0 + bicl3 #0,r0,-156(fp) + cmpl -156(fp),-160(fp) + bgequ noname.426 + addl2 #65536,-168(fp) +noname.426: + movzwl -154(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-168(fp) + bicl3 #-65536,-156(fp),r0 + ashl #16,r0,-160(fp) + addl3 -160(fp),-164(fp),r0 + bicl3 #0,r0,-164(fp) + cmpl -164(fp),-160(fp) + bgequ noname.427 + incl -168(fp) +noname.427: + movl -164(fp),r3 + movl -168(fp),r2 + bbc #31,r2,noname.428 + incl r8 +noname.428: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.429 + incl r2 +noname.429: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r7 + bicl2 #0,r7 + cmpl r7,r3 + bgequ noname.430 + incl r2 + bicl3 #0,r2,r0 + bneq noname.430 + incl r8 +noname.430: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.431 + incl r8 +noname.431: + + movl 4(ap),r0 + movl r7,20(r0) + + clrl r7 + + movl 8(ap),r2 + movl 12(r2),r4 + bicl3 #-65536,r4,-172(fp) + extzv #16,#16,r4,r0 + bicl3 #-65536,r0,r4 + movl -172(fp),r0 + mull3 r0,r4,-176(fp) + mull3 r0,r0,-172(fp) + mull2 r4,r4 + bicl3 #32767,-176(fp),r0 + extzv #15,#17,r0,r0 + addl2 r0,r4 + bicl3 #-65536,-176(fp),r0 + ashl #17,r0,-176(fp) + addl3 -172(fp),-176(fp),r0 + bicl3 #0,r0,-172(fp) + cmpl -172(fp),-176(fp) + bgequ noname.432 + incl r4 +noname.432: + movl -172(fp),r1 + movl r4,r3 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.433 + incl r3 +noname.433: + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.434 + incl r7 +noname.434: + + movzwl 18(r2),r3 + bicl3 #-65536,8(r2),r1 + movzwl 10(r2),r0 + bicl2 #-65536,r0 + bicl3 #-65536,16(r2),-188(fp) + bicl3 #-65536,r3,-192(fp) + mull3 r0,-188(fp),-180(fp) + mull2 r1,-188(fp) + mull3 r1,-192(fp),-184(fp) + mull2 r0,-192(fp) + addl3 -180(fp),-184(fp),r0 + bicl3 #0,r0,-180(fp) + cmpl -180(fp),-184(fp) + bgequ noname.435 + addl2 #65536,-192(fp) +noname.435: + movzwl -178(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-192(fp) + bicl3 #-65536,-180(fp),r0 + ashl #16,r0,-184(fp) + addl3 -184(fp),-188(fp),r0 + bicl3 #0,r0,-188(fp) + cmpl -188(fp),-184(fp) + bgequ noname.436 + incl -192(fp) +noname.436: + movl -188(fp),r3 + movl -192(fp),r2 + bbc #31,r2,noname.437 + incl r7 +noname.437: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.438 + incl r2 +noname.438: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r9 + bicl2 #0,r9 + cmpl r9,r3 + bgequ noname.439 + incl r2 + bicl3 #0,r2,r0 + bneq noname.439 + incl r7 +noname.439: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.440 + incl r7 +noname.440: + + movl 8(ap),r0 + movzwl 22(r0),r2 + bicl3 #-65536,4(r0),r3 + movzwl 6(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,20(r0),-204(fp) + bicl3 #-65536,r2,-208(fp) + mull3 r1,-204(fp),-196(fp) + mull2 r3,-204(fp) + mull3 r3,-208(fp),-200(fp) + mull2 r1,-208(fp) + addl3 -196(fp),-200(fp),r0 + bicl3 #0,r0,-196(fp) + cmpl -196(fp),-200(fp) + bgequ noname.441 + addl2 #65536,-208(fp) +noname.441: + movzwl -194(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-208(fp) + bicl3 #-65536,-196(fp),r0 + ashl #16,r0,-200(fp) + addl3 -200(fp),-204(fp),r0 + bicl3 #0,r0,-204(fp) + cmpl -204(fp),-200(fp) + bgequ noname.442 + incl -208(fp) +noname.442: + movl -204(fp),r3 + movl -208(fp),r2 + bbc #31,r2,noname.443 + incl r7 +noname.443: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.444 + incl r2 +noname.444: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r9 + bicl2 #0,r9 + cmpl r9,r3 + bgequ noname.445 + incl r2 + bicl3 #0,r2,r0 + bneq noname.445 + incl r7 +noname.445: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.446 + incl r7 +noname.446: + + movl 8(ap),r0 + movzwl 26(r0),r2 + bicl3 #-65536,(r0),r3 + movzwl 2(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,24(r0),-220(fp) + bicl3 #-65536,r2,-224(fp) + mull3 r1,-220(fp),-212(fp) + mull2 r3,-220(fp) + mull3 r3,-224(fp),-216(fp) + mull2 r1,-224(fp) + addl3 -212(fp),-216(fp),r0 + bicl3 #0,r0,-212(fp) + cmpl -212(fp),-216(fp) + bgequ noname.447 + addl2 #65536,-224(fp) +noname.447: + movzwl -210(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-224(fp) + bicl3 #-65536,-212(fp),r0 + ashl #16,r0,-216(fp) + addl3 -216(fp),-220(fp),r0 + bicl3 #0,r0,-220(fp) + cmpl -220(fp),-216(fp) + bgequ noname.448 + incl -224(fp) +noname.448: + movl -220(fp),r3 + movl -224(fp),r2 + bbc #31,r2,noname.449 + incl r7 +noname.449: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.450 + incl r2 +noname.450: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r9 + bicl2 #0,r9 + cmpl r9,r3 + bgequ noname.451 + incl r2 + bicl3 #0,r2,r0 + bneq noname.451 + incl r7 +noname.451: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.452 + incl r7 +noname.452: + + movl 4(ap),r0 + movl r9,24(r0) + + clrl r9 + + movl 8(ap),r0 + movzwl 30(r0),r2 + bicl3 #-65536,(r0),r3 + movzwl 2(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,28(r0),-236(fp) + bicl3 #-65536,r2,-240(fp) + mull3 r1,-236(fp),-228(fp) + mull2 r3,-236(fp) + mull3 r3,-240(fp),-232(fp) + mull2 r1,-240(fp) + addl3 -228(fp),-232(fp),r0 + bicl3 #0,r0,-228(fp) + cmpl -228(fp),-232(fp) + bgequ noname.453 + addl2 #65536,-240(fp) +noname.453: + movzwl -226(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-240(fp) + bicl3 #-65536,-228(fp),r0 + ashl #16,r0,-232(fp) + addl3 -232(fp),-236(fp),r0 + bicl3 #0,r0,-236(fp) + cmpl -236(fp),-232(fp) + bgequ noname.454 + incl -240(fp) +noname.454: + movl -236(fp),r3 + movl -240(fp),r2 + bbc #31,r2,noname.455 + incl r9 +noname.455: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.456 + incl r2 +noname.456: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.457 + incl r2 + bicl3 #0,r2,r0 + bneq noname.457 + incl r9 +noname.457: + addl2 r2,r7 + bicl2 #0,r7 + cmpl r7,r2 + bgequ noname.458 + incl r9 +noname.458: + + movl 8(ap),r0 + movzwl 26(r0),r2 + bicl3 #-65536,4(r0),r3 + movzwl 6(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,24(r0),-252(fp) + bicl3 #-65536,r2,-256(fp) + mull3 r1,-252(fp),-244(fp) + mull2 r3,-252(fp) + mull3 r3,-256(fp),-248(fp) + mull2 r1,-256(fp) + addl3 -244(fp),-248(fp),r0 + bicl3 #0,r0,-244(fp) + cmpl -244(fp),-248(fp) + bgequ noname.459 + addl2 #65536,-256(fp) +noname.459: + movzwl -242(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-256(fp) + bicl3 #-65536,-244(fp),r0 + ashl #16,r0,-248(fp) + addl3 -248(fp),-252(fp),r0 + bicl3 #0,r0,-252(fp) + cmpl -252(fp),-248(fp) + bgequ noname.460 + incl -256(fp) +noname.460: + movl -252(fp),r3 + movl -256(fp),r2 + bbc #31,r2,noname.461 + incl r9 +noname.461: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.462 + incl r2 +noname.462: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.463 + incl r2 + bicl3 #0,r2,r0 + bneq noname.463 + incl r9 +noname.463: + addl2 r2,r7 + bicl2 #0,r7 + cmpl r7,r2 + bgequ noname.464 + incl r9 +noname.464: + + movl 8(ap),r0 + movzwl 22(r0),r2 + bicl3 #-65536,8(r0),r3 + movzwl 10(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,20(r0),-268(fp) + bicl3 #-65536,r2,-272(fp) + mull3 r1,-268(fp),-260(fp) + mull2 r3,-268(fp) + mull3 r3,-272(fp),-264(fp) + mull2 r1,-272(fp) + addl3 -260(fp),-264(fp),r0 + bicl3 #0,r0,-260(fp) + cmpl -260(fp),-264(fp) + bgequ noname.465 + addl2 #65536,-272(fp) +noname.465: + movzwl -258(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-272(fp) + bicl3 #-65536,-260(fp),r0 + ashl #16,r0,-264(fp) + addl3 -264(fp),-268(fp),r0 + bicl3 #0,r0,-268(fp) + cmpl -268(fp),-264(fp) + bgequ noname.466 + incl -272(fp) +noname.466: + movl -268(fp),r3 + movl -272(fp),r2 + bbc #31,r2,noname.467 + incl r9 +noname.467: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.468 + incl r2 +noname.468: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.469 + incl r2 + bicl3 #0,r2,r0 + bneq noname.469 + incl r9 +noname.469: + addl2 r2,r7 + bicl2 #0,r7 + cmpl r7,r2 + bgequ noname.470 + incl r9 +noname.470: + + movl 8(ap),r0 + movzwl 18(r0),r2 + bicl3 #-65536,12(r0),r3 + movzwl 14(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,16(r0),-284(fp) + bicl3 #-65536,r2,-288(fp) + mull3 r1,-284(fp),-276(fp) + mull2 r3,-284(fp) + mull3 r3,-288(fp),-280(fp) + mull2 r1,-288(fp) + addl3 -276(fp),-280(fp),r0 + bicl3 #0,r0,-276(fp) + cmpl -276(fp),-280(fp) + bgequ noname.471 + addl2 #65536,-288(fp) +noname.471: + movzwl -274(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-288(fp) + bicl3 #-65536,-276(fp),r0 + ashl #16,r0,-280(fp) + addl3 -280(fp),-284(fp),r0 + bicl3 #0,r0,-284(fp) + cmpl -284(fp),-280(fp) + bgequ noname.472 + incl -288(fp) +noname.472: + movl -284(fp),r3 + movl -288(fp),r2 + bbc #31,r2,noname.473 + incl r9 +noname.473: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.474 + incl r2 +noname.474: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.475 + incl r2 + bicl3 #0,r2,r0 + bneq noname.475 + incl r9 +noname.475: + addl2 r2,r7 + bicl2 #0,r7 + cmpl r7,r2 + bgequ noname.476 + incl r9 +noname.476: + + movl 4(ap),r0 + movl r8,28(r0) + + clrl r8 + + movl 8(ap),r3 + movl 16(r3),r4 + bicl3 #-65536,r4,r5 + extzv #16,#16,r4,r0 + bicl3 #-65536,r0,r4 + mull3 r5,r4,-292(fp) + mull2 r5,r5 + mull2 r4,r4 + bicl3 #32767,-292(fp),r0 + extzv #15,#17,r0,r0 + addl2 r0,r4 + bicl3 #-65536,-292(fp),r0 + ashl #17,r0,-292(fp) + addl2 -292(fp),r5 + bicl2 #0,r5 + cmpl r5,-292(fp) + bgequ noname.477 + incl r4 +noname.477: + movl r5,r1 + movl r4,r2 + addl2 r1,r7 + bicl2 #0,r7 + cmpl r7,r1 + bgequ noname.478 + incl r2 +noname.478: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.479 + incl r8 +noname.479: + + bicl3 #-65536,20(r3),r4 + movzwl 22(r3),r1 + bicl2 #-65536,r1 + bicl3 #-65536,12(r3),r2 + movzwl 14(r3),r0 + bicl2 #-65536,r0 + movl r4,r6 + movl r1,r5 + mull3 r0,r6,-296(fp) + mull2 r2,r6 + mull3 r2,r5,-300(fp) + mull2 r0,r5 + addl3 -296(fp),-300(fp),r0 + bicl3 #0,r0,-296(fp) + cmpl -296(fp),-300(fp) + bgequ noname.480 + addl2 #65536,r5 +noname.480: + movzwl -294(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r5 + bicl3 #-65536,-296(fp),r0 + ashl #16,r0,-300(fp) + addl2 -300(fp),r6 + bicl2 #0,r6 + cmpl r6,-300(fp) + bgequ noname.481 + incl r5 +noname.481: + movl r6,r3 + movl r5,r2 + bbc #31,r2,noname.482 + incl r8 +noname.482: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.483 + incl r2 +noname.483: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r7 + bicl2 #0,r7 + cmpl r7,r3 + bgequ noname.484 + incl r2 + bicl3 #0,r2,r0 + bneq noname.484 + incl r8 +noname.484: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.485 + incl r8 +noname.485: + + movl 8(ap),r0 + bicl3 #-65536,24(r0),r3 + movzwl 26(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,8(r0),r2 + movzwl 10(r0),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-304(fp) + mull2 r2,r5 + mull3 r2,r4,-308(fp) + mull2 r0,r4 + addl3 -304(fp),-308(fp),r0 + bicl3 #0,r0,-304(fp) + cmpl -304(fp),-308(fp) + bgequ noname.486 + addl2 #65536,r4 +noname.486: + movzwl -302(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-304(fp),r0 + ashl #16,r0,-308(fp) + addl2 -308(fp),r5 + bicl2 #0,r5 + cmpl r5,-308(fp) + bgequ noname.487 + incl r4 +noname.487: + movl r5,r3 + movl r4,r2 + bbc #31,r2,noname.488 + incl r8 +noname.488: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.489 + incl r2 +noname.489: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r7 + bicl2 #0,r7 + cmpl r7,r3 + bgequ noname.490 + incl r2 + bicl3 #0,r2,r0 + bneq noname.490 + incl r8 +noname.490: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.491 + incl r8 +noname.491: + + movl 8(ap),r0 + bicl3 #-65536,28(r0),r3 + movzwl 30(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,4(r0),r2 + movzwl 6(r0),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-312(fp) + mull2 r2,r5 + mull3 r2,r4,-316(fp) + mull2 r0,r4 + addl3 -312(fp),-316(fp),r0 + bicl3 #0,r0,-312(fp) + cmpl -312(fp),-316(fp) + bgequ noname.492 + addl2 #65536,r4 +noname.492: + movzwl -310(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-312(fp),r0 + ashl #16,r0,-316(fp) + addl2 -316(fp),r5 + bicl2 #0,r5 + cmpl r5,-316(fp) + bgequ noname.493 + incl r4 +noname.493: + movl r5,r3 + movl r4,r2 + bbc #31,r2,noname.494 + incl r8 +noname.494: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.495 + incl r2 +noname.495: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r7 + bicl2 #0,r7 + cmpl r7,r3 + bgequ noname.496 + incl r2 + bicl3 #0,r2,r0 + bneq noname.496 + incl r8 +noname.496: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.497 + incl r8 +noname.497: + + movl 4(ap),r0 + movl r7,32(r0) + + clrl r7 + + movl 8(ap),r0 + bicl3 #-65536,28(r0),r3 + movzwl 30(r0),r2 + bicl3 #-65536,8(r0),r1 + movzwl 10(r0),r0 + bicl2 #-65536,r0 + movl r3,r4 + bicl3 #-65536,r2,-328(fp) + mull3 r0,r4,-320(fp) + mull2 r1,r4 + mull3 r1,-328(fp),-324(fp) + mull2 r0,-328(fp) + addl3 -320(fp),-324(fp),r0 + bicl3 #0,r0,-320(fp) + cmpl -320(fp),-324(fp) + bgequ noname.498 + addl2 #65536,-328(fp) +noname.498: + movzwl -318(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-328(fp) + bicl3 #-65536,-320(fp),r0 + ashl #16,r0,-324(fp) + addl2 -324(fp),r4 + bicl2 #0,r4 + cmpl r4,-324(fp) + bgequ noname.499 + incl -328(fp) +noname.499: + movl r4,r3 + movl -328(fp),r2 + bbc #31,r2,noname.500 + incl r7 +noname.500: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.501 + incl r2 +noname.501: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r9 + bicl2 #0,r9 + cmpl r9,r3 + bgequ noname.502 + incl r2 + bicl3 #0,r2,r0 + bneq noname.502 + incl r7 +noname.502: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.503 + incl r7 +noname.503: + + movl 8(ap),r0 + movzwl 26(r0),r2 + bicl3 #-65536,12(r0),r3 + movzwl 14(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,24(r0),-340(fp) + bicl3 #-65536,r2,-344(fp) + mull3 r1,-340(fp),-332(fp) + mull2 r3,-340(fp) + mull3 r3,-344(fp),-336(fp) + mull2 r1,-344(fp) + addl3 -332(fp),-336(fp),r0 + bicl3 #0,r0,-332(fp) + cmpl -332(fp),-336(fp) + bgequ noname.504 + addl2 #65536,-344(fp) +noname.504: + movzwl -330(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-344(fp) + bicl3 #-65536,-332(fp),r0 + ashl #16,r0,-336(fp) + addl3 -336(fp),-340(fp),r0 + bicl3 #0,r0,-340(fp) + cmpl -340(fp),-336(fp) + bgequ noname.505 + incl -344(fp) +noname.505: + movl -340(fp),r3 + movl -344(fp),r2 + bbc #31,r2,noname.506 + incl r7 +noname.506: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.507 + incl r2 +noname.507: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r9 + bicl2 #0,r9 + cmpl r9,r3 + bgequ noname.508 + incl r2 + bicl3 #0,r2,r0 + bneq noname.508 + incl r7 +noname.508: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.509 + incl r7 +noname.509: + + movl 8(ap),r0 + movzwl 22(r0),r2 + bicl3 #-65536,16(r0),r3 + movzwl 18(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,20(r0),-356(fp) + bicl3 #-65536,r2,-360(fp) + mull3 r1,-356(fp),-348(fp) + mull2 r3,-356(fp) + mull3 r3,-360(fp),-352(fp) + mull2 r1,-360(fp) + addl3 -348(fp),-352(fp),r0 + bicl3 #0,r0,-348(fp) + cmpl -348(fp),-352(fp) + bgequ noname.510 + addl2 #65536,-360(fp) +noname.510: + movzwl -346(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-360(fp) + bicl3 #-65536,-348(fp),r0 + ashl #16,r0,-352(fp) + addl3 -352(fp),-356(fp),r0 + bicl3 #0,r0,-356(fp) + cmpl -356(fp),-352(fp) + bgequ noname.511 + incl -360(fp) +noname.511: + movl -356(fp),r3 + movl -360(fp),r2 + bbc #31,r2,noname.512 + incl r7 +noname.512: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.513 + incl r2 +noname.513: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r9 + bicl2 #0,r9 + cmpl r9,r3 + bgequ noname.514 + incl r2 + bicl3 #0,r2,r0 + bneq noname.514 + incl r7 +noname.514: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.515 + incl r7 +noname.515: + + movl 4(ap),r0 + movl r9,36(r0) + + clrl r9 + + movl 8(ap),r3 + movl 20(r3),r4 + bicl3 #-65536,r4,-364(fp) + extzv #16,#16,r4,r0 + bicl3 #-65536,r0,r4 + movl -364(fp),r0 + mull3 r0,r4,-368(fp) + mull3 r0,r0,-364(fp) + mull2 r4,r4 + bicl3 #32767,-368(fp),r0 + extzv #15,#17,r0,r0 + addl2 r0,r4 + bicl3 #-65536,-368(fp),r0 + ashl #17,r0,-368(fp) + addl3 -364(fp),-368(fp),r0 + bicl3 #0,r0,-364(fp) + cmpl -364(fp),-368(fp) + bgequ noname.516 + incl r4 +noname.516: + movl -364(fp),r1 + movl r4,r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.517 + incl r2 +noname.517: + addl2 r2,r7 + bicl2 #0,r7 + cmpl r7,r2 + bgequ noname.518 + incl r9 +noname.518: + + bicl3 #-65536,24(r3),r4 + movzwl 26(r3),r1 + bicl2 #-65536,r1 + bicl3 #-65536,16(r3),r2 + movzwl 18(r3),r0 + bicl2 #-65536,r0 + movl r4,r6 + movl r1,r5 + mull3 r0,r6,-372(fp) + mull2 r2,r6 + mull3 r2,r5,-376(fp) + mull2 r0,r5 + addl3 -372(fp),-376(fp),r0 + bicl3 #0,r0,-372(fp) + cmpl -372(fp),-376(fp) + bgequ noname.519 + addl2 #65536,r5 +noname.519: + movzwl -370(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r5 + bicl3 #-65536,-372(fp),r0 + ashl #16,r0,-376(fp) + addl2 -376(fp),r6 + bicl2 #0,r6 + cmpl r6,-376(fp) + bgequ noname.520 + incl r5 +noname.520: + movl r6,r3 + movl r5,r2 + bbc #31,r2,noname.521 + incl r9 +noname.521: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.522 + incl r2 +noname.522: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.523 + incl r2 + bicl3 #0,r2,r0 + bneq noname.523 + incl r9 +noname.523: + addl2 r2,r7 + bicl2 #0,r7 + cmpl r7,r2 + bgequ noname.524 + incl r9 +noname.524: + + movl 8(ap),r0 + bicl3 #-65536,28(r0),r3 + movzwl 30(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,12(r0),r2 + movzwl 14(r0),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-380(fp) + mull2 r2,r5 + mull3 r2,r4,-384(fp) + mull2 r0,r4 + addl3 -380(fp),-384(fp),r0 + bicl3 #0,r0,-380(fp) + cmpl -380(fp),-384(fp) + bgequ noname.525 + addl2 #65536,r4 +noname.525: + movzwl -378(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-380(fp),r0 + ashl #16,r0,-384(fp) + addl2 -384(fp),r5 + bicl2 #0,r5 + cmpl r5,-384(fp) + bgequ noname.526 + incl r4 +noname.526: + movl r5,r3 + movl r4,r2 + bbc #31,r2,noname.527 + incl r9 +noname.527: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.528 + incl r2 +noname.528: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.529 + incl r2 + bicl3 #0,r2,r0 + bneq noname.529 + incl r9 +noname.529: + addl2 r2,r7 + bicl2 #0,r7 + cmpl r7,r2 + bgequ noname.530 + incl r9 +noname.530: + movl 4(ap),r0 + movl r8,40(r0) + + clrl r8 + + movl 8(ap),r0 + bicl3 #-65536,28(r0),r3 + movzwl 30(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,16(r0),r2 + movzwl 18(r0),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-388(fp) + mull2 r2,r5 + mull3 r2,r4,-392(fp) + mull2 r0,r4 + addl3 -388(fp),-392(fp),r0 + bicl3 #0,r0,-388(fp) + cmpl -388(fp),-392(fp) + bgequ noname.531 + addl2 #65536,r4 +noname.531: + movzwl -386(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-388(fp),r0 + ashl #16,r0,-392(fp) + addl2 -392(fp),r5 + bicl2 #0,r5 + cmpl r5,-392(fp) + bgequ noname.532 + incl r4 +noname.532: + movl r5,r3 + movl r4,r2 + bbc #31,r2,noname.533 + incl r8 +noname.533: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.534 + incl r2 +noname.534: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r7 + bicl2 #0,r7 + cmpl r7,r3 + bgequ noname.535 + incl r2 + bicl3 #0,r2,r0 + bneq noname.535 + incl r8 +noname.535: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.536 + incl r8 +noname.536: + + movl 8(ap),r0 + bicl3 #-65536,24(r0),r3 + movzwl 26(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,20(r0),r2 + movzwl 22(r0),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-396(fp) + mull2 r2,r5 + mull3 r2,r4,-400(fp) + mull2 r0,r4 + addl3 -396(fp),-400(fp),r0 + bicl3 #0,r0,-396(fp) + cmpl -396(fp),-400(fp) + bgequ noname.537 + addl2 #65536,r4 +noname.537: + movzwl -394(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-396(fp),r0 + ashl #16,r0,-400(fp) + addl2 -400(fp),r5 + bicl2 #0,r5 + cmpl r5,-400(fp) + bgequ noname.538 + incl r4 +noname.538: + movl r5,r3 + movl r4,r2 + bbc #31,r2,noname.539 + incl r8 +noname.539: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.540 + incl r2 +noname.540: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r7 + bicl2 #0,r7 + cmpl r7,r3 + bgequ noname.541 + incl r2 + bicl3 #0,r2,r0 + bneq noname.541 + incl r8 +noname.541: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.542 + incl r8 +noname.542: + + movl 4(ap),r0 + movl r7,44(r0) + + clrl r7 + + movl 8(ap),r3 + movl 24(r3),r4 + bicl3 #-65536,r4,r5 + extzv #16,#16,r4,r0 + bicl3 #-65536,r0,r4 + mull3 r5,r4,-404(fp) + mull2 r5,r5 + mull2 r4,r4 + bicl3 #32767,-404(fp),r0 + extzv #15,#17,r0,r0 + addl2 r0,r4 + bicl3 #-65536,-404(fp),r0 + ashl #17,r0,-404(fp) + addl2 -404(fp),r5 + bicl2 #0,r5 + cmpl r5,-404(fp) + bgequ noname.543 + incl r4 +noname.543: + movl r5,r1 + movl r4,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.544 + incl r2 +noname.544: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.545 + incl r7 +noname.545: + + movzwl 30(r3),r2 + bicl3 #-65536,20(r3),r1 + movzwl 22(r3),r0 + bicl2 #-65536,r0 + bicl3 #-65536,28(r3),-416(fp) + bicl3 #-65536,r2,-420(fp) + mull3 r0,-416(fp),-408(fp) + mull2 r1,-416(fp) + mull3 r1,-420(fp),-412(fp) + mull2 r0,-420(fp) + addl3 -408(fp),-412(fp),r0 + bicl3 #0,r0,-408(fp) + cmpl -408(fp),-412(fp) + bgequ noname.546 + addl2 #65536,-420(fp) +noname.546: + movzwl -406(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-420(fp) + bicl3 #-65536,-408(fp),r0 + ashl #16,r0,-412(fp) + addl3 -412(fp),-416(fp),r0 + bicl3 #0,r0,-416(fp) + cmpl -416(fp),-412(fp) + bgequ noname.547 + incl -420(fp) +noname.547: + movl -416(fp),r3 + movl -420(fp),r2 + bbc #31,r2,noname.548 + incl r7 +noname.548: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.549 + incl r2 +noname.549: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r9 + bicl2 #0,r9 + cmpl r9,r3 + bgequ noname.550 + incl r2 + bicl3 #0,r2,r0 + bneq noname.550 + incl r7 +noname.550: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.551 + incl r7 +noname.551: + + movl 4(ap),r0 + movl r9,48(r0) + + clrl r9 + + movl 8(ap),r0 + movzwl 30(r0),r2 + bicl3 #-65536,24(r0),r3 + movzwl 26(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,28(r0),-432(fp) + bicl3 #-65536,r2,-436(fp) + mull3 r1,-432(fp),-424(fp) + mull2 r3,-432(fp) + mull3 r3,-436(fp),-428(fp) + mull2 r1,-436(fp) + addl3 -424(fp),-428(fp),r0 + bicl3 #0,r0,-424(fp) + cmpl -424(fp),-428(fp) + bgequ noname.552 + addl2 #65536,-436(fp) +noname.552: + movzwl -422(fp),r0 + bicl2 #-65536,r0 + addl2 r0,-436(fp) + bicl3 #-65536,-424(fp),r0 + ashl #16,r0,-428(fp) + addl3 -428(fp),-432(fp),r0 + bicl3 #0,r0,-432(fp) + cmpl -432(fp),-428(fp) + bgequ noname.553 + incl -436(fp) +noname.553: + movl -432(fp),r3 + movl -436(fp),r2 + bbc #31,r2,noname.554 + incl r9 +noname.554: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.555 + incl r2 +noname.555: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.556 + incl r2 + bicl3 #0,r2,r0 + bneq noname.556 + incl r9 +noname.556: + addl2 r2,r7 + bicl2 #0,r7 + cmpl r7,r2 + bgequ noname.557 + incl r9 +noname.557: + + movl 4(ap),r4 + movl r8,52(r4) + + clrl r8 + + movl 8(ap),r0 + movl 28(r0),r3 + bicl3 #-65536,r3,-440(fp) + extzv #16,#16,r3,r0 + bicl3 #-65536,r0,r3 + movl -440(fp),r0 + mull3 r0,r3,-444(fp) + mull3 r0,r0,-440(fp) + mull2 r3,r3 + bicl3 #32767,-444(fp),r0 + extzv #15,#17,r0,r0 + addl2 r0,r3 + bicl3 #-65536,-444(fp),r0 + ashl #17,r0,-444(fp) + addl3 -440(fp),-444(fp),r0 + bicl3 #0,r0,-440(fp) + cmpl -440(fp),-444(fp) + bgequ noname.558 + incl r3 +noname.558: + movl -440(fp),r1 + movl r3,r2 + addl2 r1,r7 + bicl2 #0,r7 + cmpl r7,r1 + bgequ noname.559 + incl r2 +noname.559: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.560 + incl r8 +noname.560: + + movl r7,56(r4) + + movl r9,60(r4) + + ret + + + +;r=4 ;(AP) +;a=8 ;(AP) +;b=12 ;(AP) +;n=16 ;(AP) n by value (input) + + .psect code,nowrt + +.entry BN_SQR_COMBA4,^m<r2,r3,r4,r5,r6,r7,r8,r9,r10> + subl2 #44,sp + + clrq r8 + + clrl r10 + + movl 8(ap),r5 + movl (r5),r3 + bicl3 #-65536,r3,r4 + extzv #16,#16,r3,r0 + bicl3 #-65536,r0,r3 + mull3 r4,r3,-4(fp) + mull2 r4,r4 + mull2 r3,r3 + bicl3 #32767,-4(fp),r0 + extzv #15,#17,r0,r0 + addl2 r0,r3 + bicl3 #-65536,-4(fp),r0 + ashl #17,r0,-4(fp) + addl2 -4(fp),r4 + bicl2 #0,r4 + cmpl r4,-4(fp) + bgequ noname.563 + incl r3 +noname.563: + movl r4,r1 + movl r3,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.564 + incl r2 +noname.564: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.565 + incl r10 +noname.565: + + movl r9,@4(ap) + + clrl r9 + + bicl3 #-65536,4(r5),r3 + movzwl 6(r5),r1 + bicl2 #-65536,r1 + bicl3 #-65536,(r5),r2 + movzwl 2(r5),r0 + bicl2 #-65536,r0 + movl r3,r6 + movl r1,r4 + mull3 r0,r6,-8(fp) + mull2 r2,r6 + mull2 r4,r2 + mull2 r0,r4 + addl3 -8(fp),r2,r0 + bicl3 #0,r0,-8(fp) + cmpl -8(fp),r2 + bgequ noname.566 + addl2 #65536,r4 +noname.566: + movzwl -6(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-8(fp),r0 + ashl #16,r0,r1 + addl2 r1,r6 + bicl2 #0,r6 + cmpl r6,r1 + bgequ noname.567 + incl r4 +noname.567: + movl r6,r3 + movl r4,r2 + bbc #31,r2,noname.568 + incl r9 +noname.568: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.569 + incl r2 +noname.569: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.570 + incl r2 + bicl3 #0,r2,r0 + bneq noname.570 + incl r9 +noname.570: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.571 + incl r9 +noname.571: + + movl 4(ap),r0 + movl r8,4(r0) + + clrl r8 + + movl 8(ap),r4 + movl 4(r4),r3 + bicl3 #-65536,r3,r5 + extzv #16,#16,r3,r0 + bicl3 #-65536,r0,r3 + mull3 r5,r3,r1 + mull2 r5,r5 + mull2 r3,r3 + bicl3 #32767,r1,r0 + extzv #15,#17,r0,r0 + addl2 r0,r3 + bicl2 #-65536,r1 + ashl #17,r1,r1 + addl2 r1,r5 + bicl2 #0,r5 + cmpl r5,r1 + bgequ noname.572 + incl r3 +noname.572: + movl r5,r1 + movl r3,r2 + addl2 r1,r10 + bicl2 #0,r10 + cmpl r10,r1 + bgequ noname.573 + incl r2 +noname.573: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.574 + incl r8 +noname.574: + + bicl3 #-65536,8(r4),r3 + movzwl 10(r4),r1 + bicl2 #-65536,r1 + bicl3 #-65536,(r4),r2 + movzwl 2(r4),r0 + bicl2 #-65536,r0 + movl r3,r6 + movl r1,r5 + mull3 r0,r6,r7 + mull2 r2,r6 + mull2 r5,r2 + mull2 r0,r5 + addl2 r2,r7 + bicl2 #0,r7 + cmpl r7,r2 + bgequ noname.575 + addl2 #65536,r5 +noname.575: + extzv #16,#16,r7,r0 + bicl2 #-65536,r0 + addl2 r0,r5 + bicl3 #-65536,r7,r0 + ashl #16,r0,r1 + addl2 r1,r6 + bicl2 #0,r6 + cmpl r6,r1 + bgequ noname.576 + incl r5 +noname.576: + movl r6,r3 + movl r5,r2 + bbc #31,r2,noname.577 + incl r8 +noname.577: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.578 + incl r2 +noname.578: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r10 + bicl2 #0,r10 + cmpl r10,r3 + bgequ noname.579 + incl r2 + bicl3 #0,r2,r0 + bneq noname.579 + incl r8 +noname.579: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.580 + incl r8 +noname.580: + + movl 4(ap),r0 + movl r10,8(r0) + + clrl r10 + + movl 8(ap),r0 + bicl3 #-65536,12(r0),r3 + movzwl 14(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,(r0),r2 + movzwl 2(r0),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,r6 + mull2 r2,r5 + mull3 r2,r4,-12(fp) + mull2 r0,r4 + addl2 -12(fp),r6 + bicl2 #0,r6 + cmpl r6,-12(fp) + bgequ noname.581 + addl2 #65536,r4 +noname.581: + extzv #16,#16,r6,r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,r6,r0 + ashl #16,r0,-12(fp) + addl2 -12(fp),r5 + bicl2 #0,r5 + cmpl r5,-12(fp) + bgequ noname.582 + incl r4 +noname.582: + movl r5,r3 + movl r4,r2 + bbc #31,r2,noname.583 + incl r10 +noname.583: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.584 + incl r2 +noname.584: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r9 + bicl2 #0,r9 + cmpl r9,r3 + bgequ noname.585 + incl r2 + bicl3 #0,r2,r0 + bneq noname.585 + incl r10 +noname.585: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.586 + incl r10 +noname.586: + + movl 8(ap),r0 + bicl3 #-65536,8(r0),r3 + movzwl 10(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,4(r0),r2 + movzwl 6(r0),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-16(fp) + mull2 r2,r5 + mull3 r2,r4,-20(fp) + mull2 r0,r4 + addl3 -16(fp),-20(fp),r0 + bicl3 #0,r0,-16(fp) + cmpl -16(fp),-20(fp) + bgequ noname.587 + addl2 #65536,r4 +noname.587: + movzwl -14(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-16(fp),r0 + ashl #16,r0,-20(fp) + addl2 -20(fp),r5 + bicl2 #0,r5 + cmpl r5,-20(fp) + bgequ noname.588 + incl r4 +noname.588: + movl r5,r3 + movl r4,r2 + bbc #31,r2,noname.589 + incl r10 +noname.589: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.590 + incl r2 +noname.590: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r9 + bicl2 #0,r9 + cmpl r9,r3 + bgequ noname.591 + incl r2 + bicl3 #0,r2,r0 + bneq noname.591 + incl r10 +noname.591: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.592 + incl r10 +noname.592: + movl 4(ap),r0 + movl r9,12(r0) + + clrl r9 + + movl 8(ap),r3 + movl 8(r3),r4 + bicl3 #-65536,r4,r5 + extzv #16,#16,r4,r0 + bicl3 #-65536,r0,r4 + mull3 r5,r4,-24(fp) + mull2 r5,r5 + mull2 r4,r4 + bicl3 #32767,-24(fp),r0 + extzv #15,#17,r0,r0 + addl2 r0,r4 + bicl3 #-65536,-24(fp),r0 + ashl #17,r0,-24(fp) + addl2 -24(fp),r5 + bicl2 #0,r5 + cmpl r5,-24(fp) + bgequ noname.593 + incl r4 +noname.593: + movl r5,r1 + movl r4,r2 + addl2 r1,r8 + bicl2 #0,r8 + cmpl r8,r1 + bgequ noname.594 + incl r2 +noname.594: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.595 + incl r9 +noname.595: + + bicl3 #-65536,12(r3),r4 + movzwl 14(r3),r1 + bicl2 #-65536,r1 + bicl3 #-65536,4(r3),r2 + movzwl 6(r3),r0 + bicl2 #-65536,r0 + movl r4,r6 + movl r1,r5 + mull3 r0,r6,-28(fp) + mull2 r2,r6 + mull3 r2,r5,-32(fp) + mull2 r0,r5 + addl3 -28(fp),-32(fp),r0 + bicl3 #0,r0,-28(fp) + cmpl -28(fp),-32(fp) + bgequ noname.596 + addl2 #65536,r5 +noname.596: + movzwl -26(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r5 + bicl3 #-65536,-28(fp),r0 + ashl #16,r0,-32(fp) + addl2 -32(fp),r6 + bicl2 #0,r6 + cmpl r6,-32(fp) + bgequ noname.597 + incl r5 +noname.597: + movl r6,r3 + movl r5,r2 + bbc #31,r2,noname.598 + incl r9 +noname.598: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.599 + incl r2 +noname.599: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r8 + bicl2 #0,r8 + cmpl r8,r3 + bgequ noname.600 + incl r2 + bicl3 #0,r2,r0 + bneq noname.600 + incl r9 +noname.600: + addl2 r2,r10 + bicl2 #0,r10 + cmpl r10,r2 + bgequ noname.601 + incl r9 +noname.601: + + movl 4(ap),r0 + movl r8,16(r0) + + clrl r8 + + movl 8(ap),r0 + bicl3 #-65536,12(r0),r3 + movzwl 14(r0),r1 + bicl2 #-65536,r1 + bicl3 #-65536,8(r0),r2 + movzwl 10(r0),r0 + bicl2 #-65536,r0 + movl r3,r5 + movl r1,r4 + mull3 r0,r5,-36(fp) + mull2 r2,r5 + mull3 r2,r4,-40(fp) + mull2 r0,r4 + addl3 -36(fp),-40(fp),r0 + bicl3 #0,r0,-36(fp) + cmpl -36(fp),-40(fp) + bgequ noname.602 + addl2 #65536,r4 +noname.602: + movzwl -34(fp),r0 + bicl2 #-65536,r0 + addl2 r0,r4 + bicl3 #-65536,-36(fp),r0 + ashl #16,r0,-40(fp) + addl2 -40(fp),r5 + bicl2 #0,r5 + cmpl r5,-40(fp) + bgequ noname.603 + incl r4 +noname.603: + movl r5,r3 + movl r4,r2 + bbc #31,r2,noname.604 + incl r8 +noname.604: + addl2 r2,r2 + bicl2 #0,r2 + bbc #31,r3,noname.605 + incl r2 +noname.605: + addl2 r3,r3 + bicl2 #0,r3 + addl2 r3,r10 + bicl2 #0,r10 + cmpl r10,r3 + bgequ noname.606 + incl r2 + bicl3 #0,r2,r0 + bneq noname.606 + incl r8 +noname.606: + addl2 r2,r9 + bicl2 #0,r9 + cmpl r9,r2 + bgequ noname.607 + incl r8 +noname.607: + + movl 4(ap),r4 + movl r10,20(r4) + + clrl r10 + + movl 8(ap),r0 + movl 12(r0),r3 + bicl3 #-65536,r3,r5 + extzv #16,#16,r3,r0 + bicl3 #-65536,r0,r3 + mull3 r5,r3,-44(fp) + mull2 r5,r5 + mull2 r3,r3 + bicl3 #32767,-44(fp),r0 + extzv #15,#17,r0,r0 + addl2 r0,r3 + bicl3 #-65536,-44(fp),r0 + ashl #17,r0,-44(fp) + addl2 -44(fp),r5 + bicl2 #0,r5 + cmpl r5,-44(fp) + bgequ noname.608 + incl r3 +noname.608: + movl r5,r1 + movl r3,r2 + addl2 r1,r9 + bicl2 #0,r9 + cmpl r9,r1 + bgequ noname.609 + incl r2 +noname.609: + addl2 r2,r8 + bicl2 #0,r8 + cmpl r8,r2 + bgequ noname.610 + incl r10 +noname.610: + + movl r9,24(r4) + + movl r8,28(r4) + + ret + +; For now, the code below doesn't work, so I end this prematurely. +.end + + .title vax_bn_div64 division 64/32=>32 +; +; r.l. 16-jan-1998 +; +; unsigned int bn_div64(unsigned long h, unsigned long l, unsigned long d) +; return <h,l>/d; +; + + .psect code,nowrt + +h=4 ;(AP) by value (input) +l=8 ;(AP) by value (input) +d=12 ;(AP) by value (input) + +.entry bn_div64,^m<r2,r3,r4,r5,r6,r7,r8,r9> + + movl l(ap),r2 ; l + movl h(ap),r3 ; h + movl d(ap),r4 ; d + clrl r5 ; q + clrl r6 ; r + + ; Treat "negative" specially + tstl r3 + blss 30$ + + tstl r4 + beql 90$ + + ediv r4,r2,r5,r6 + bvs 666$ + + movl r5,r0 + ret + +30$: + ; The theory here is to do some harmless shifting and a little + ; bit of rounding (brackets are to designate when decimals are + ; cut off): + ; + ; result = 2 * [ ([<h,0>/2] + [d/2]) / d ] + [ l / d ] + + movl #0,r7 + movl r3,r8 ; copy h + ashq #-1,r7,r7 ; [<h,0>/2] => <r8,r7> + bicl2 #^X80000000,r8 ; Remove "sign" + + movl r4,r9 ; copy d + ashl #-1,r9,r9 ; [d/2] => r9 + bicl2 #^X80000000,r9 ; Remove "sign" + + addl2 r9,r7 + adwc #0,r8 ; [<h,0>/2] + [d/2] => <r8,r7> + + ediv r4,r7,r5,r6 ; [ ([<h,0>/2] + [d/2]) / d ] => <r5,r6> + bvs 666$ + + movl #0,r6 + ashq #1,r5,r5 ; 2 * [ ([<h,0>/2] + [d/2]) / d ] => r5 + + movl #0,r3 + ediv r4,r2,r8,r9 ; [ l / d ] => <r8,r9> + + addl2 r8,r5 ; + bcs 666$ + + movl r5,r0 + ret + +90$: + movl #-1,r0 + ret + +666$: + + +.end diff --git a/crypto/bn/bn.h b/crypto/bn/bn.h index c8b7c090a9..78009239c4 100644 --- a/crypto/bn/bn.h +++ b/crypto/bn/bn.h @@ -68,6 +68,10 @@ extern "C" { #endif +#ifdef VMS +#undef BN_LLONG /* experimental, so far... */ +#endif + #define BN_MUL_COMBA #define BN_SQR_COMBA #define BN_RECURSION diff --git a/crypto/bn/bn_lcl.h b/crypto/bn/bn_lcl.h index 9ce0bc910b..3d684e70cd 100644 --- a/crypto/bn/bn_lcl.h +++ b/crypto/bn/bn_lcl.h @@ -231,16 +231,16 @@ extern "C" { #endif -extern int bn_limit_bits; -extern int bn_limit_num; /* (1<<bn_limit_bits) */ +EXTERN int bn_limit_bits; +EXTERN int bn_limit_num; /* (1<<bn_limit_bits) */ /* Recursive 'low' limit */ -extern int bn_limit_bits_low; -extern int bn_limit_num_low; /* (1<<bn_limit_bits_low) */ +EXTERN int bn_limit_bits_low; +EXTERN int bn_limit_num_low; /* (1<<bn_limit_bits_low) */ /* Do modified 'high' part calculation' */ -extern int bn_limit_bits_high; -extern int bn_limit_num_high; /* (1<<bn_limit_bits_high) */ -extern int bn_limit_bits_mont; -extern int bn_limit_num_mont; /* (1<<bn_limit_bits_mont) */ +EXTERN int bn_limit_bits_high; +EXTERN int bn_limit_num_high; /* (1<<bn_limit_bits_high) */ +EXTERN int bn_limit_bits_mont; +EXTERN int bn_limit_num_mont; /* (1<<bn_limit_bits_mont) */ BIGNUM *bn_expand2(BIGNUM *b, int bits); diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c index f866126f46..479d17ea52 100644 --- a/crypto/bn/bn_lib.c +++ b/crypto/bn/bn_lib.c @@ -71,14 +71,14 @@ const char *BN_version="Big Number" OPENSSL_VERSION_PTEXT; * 7 - 128 == 4096 * 8 - 256 == 8192 */ -int bn_limit_bits=0; -int bn_limit_num=8; /* (1<<bn_limit_bits) */ -int bn_limit_bits_low=0; -int bn_limit_num_low=8; /* (1<<bn_limit_bits_low) */ -int bn_limit_bits_high=0; -int bn_limit_num_high=8; /* (1<<bn_limit_bits_high) */ -int bn_limit_bits_mont=0; -int bn_limit_num_mont=8; /* (1<<bn_limit_bits_mont) */ +GLOBAL int bn_limit_bits=0; +GLOBAL int bn_limit_num=8; /* (1<<bn_limit_bits) */ +GLOBAL int bn_limit_bits_low=0; +GLOBAL int bn_limit_num_low=8; /* (1<<bn_limit_bits_low) */ +GLOBAL int bn_limit_bits_high=0; +GLOBAL int bn_limit_num_high=8; /* (1<<bn_limit_bits_high) */ +GLOBAL int bn_limit_bits_mont=0; +GLOBAL int bn_limit_num_mont=8; /* (1<<bn_limit_bits_mont) */ void BN_set_params(int mult, int high, int low, int mont) { diff --git a/crypto/bn/bnspeed.c b/crypto/bn/bnspeed.c index 0321f66d6c..31bf9fd795 100644 --- a/crypto/bn/bnspeed.c +++ b/crypto/bn/bnspeed.c @@ -69,11 +69,10 @@ #include <openssl/crypto.h> #include <openssl/err.h> -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -81,15 +80,15 @@ #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif diff --git a/crypto/bn/expspeed.c b/crypto/bn/expspeed.c index 9edc5833f8..996603ebc1 100644 --- a/crypto/bn/expspeed.c +++ b/crypto/bn/expspeed.c @@ -69,11 +69,10 @@ #include <openssl/crypto.h> #include <openssl/err.h> -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -81,15 +80,15 @@ #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif diff --git a/crypto/bn/vms-helper.c b/crypto/bn/vms-helper.c new file mode 100644 index 0000000000..73af337069 --- /dev/null +++ b/crypto/bn/vms-helper.c @@ -0,0 +1,66 @@ +/* vms-helper.c */ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#include <stdio.h> +#include "cryptlib.h" +#include "bn_lcl.h" + +bn_div_words_abort(int i) +{ +#if !defined(NO_STDIO) && !defined(WIN16) + fprintf(stderr,"Division would overflow (%d)\n",i); +#endif + abort(); +} diff --git a/crypto/cast/cast_lcl.h b/crypto/cast/cast_lcl.h index 6587952a96..cfe7aeaa1f 100644 --- a/crypto/cast/cast_lcl.h +++ b/crypto/cast/cast_lcl.h @@ -60,6 +60,8 @@ #include <stdlib.h> #endif +#include <openssl/e_os.h> /* EXTERN */ + #undef c2l #define c2l(c,l) (l =((unsigned long)(*((c)++))) , \ l|=((unsigned long)(*((c)++)))<< 8L, \ @@ -213,12 +215,11 @@ } #endif -extern CAST_LONG CAST_S_table0[256]; -extern CAST_LONG CAST_S_table1[256]; -extern CAST_LONG CAST_S_table2[256]; -extern CAST_LONG CAST_S_table3[256]; -extern CAST_LONG CAST_S_table4[256]; -extern CAST_LONG CAST_S_table5[256]; -extern CAST_LONG CAST_S_table6[256]; -extern CAST_LONG CAST_S_table7[256]; - +EXTERN CAST_LONG CAST_S_table0[256]; +EXTERN CAST_LONG CAST_S_table1[256]; +EXTERN CAST_LONG CAST_S_table2[256]; +EXTERN CAST_LONG CAST_S_table3[256]; +EXTERN CAST_LONG CAST_S_table4[256]; +EXTERN CAST_LONG CAST_S_table5[256]; +EXTERN CAST_LONG CAST_S_table6[256]; +EXTERN CAST_LONG CAST_S_table7[256]; diff --git a/crypto/cast/cast_s.h b/crypto/cast/cast_s.h index 8fe0152149..fb4a0eaadf 100644 --- a/crypto/cast/cast_s.h +++ b/crypto/cast/cast_s.h @@ -55,7 +55,7 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ -CAST_LONG CAST_S_table0[256]={ +GLOBAL CAST_LONG CAST_S_table0[256]={ 0x30fb40d4,0x9fa0ff0b,0x6beccd2f,0x3f258c7a, 0x1e213f2f,0x9c004dd3,0x6003e540,0xcf9fc949, 0xbfd4af27,0x88bbbdb5,0xe2034090,0x98d09675, @@ -121,7 +121,7 @@ CAST_LONG CAST_S_table0[256]={ 0x1a69e783,0x02cc4843,0xa2f7c579,0x429ef47d, 0x427b169c,0x5ac9f049,0xdd8f0f00,0x5c8165bf, }; -CAST_LONG CAST_S_table1[256]={ +GLOBAL CAST_LONG CAST_S_table1[256]={ 0x1f201094,0xef0ba75b,0x69e3cf7e,0x393f4380, 0xfe61cf7a,0xeec5207a,0x55889c94,0x72fc0651, 0xada7ef79,0x4e1d7235,0xd55a63ce,0xde0436ba, @@ -187,7 +187,7 @@ CAST_LONG CAST_S_table1[256]={ 0x43d79572,0x7e6dd07c,0x06dfdf1e,0x6c6cc4ef, 0x7160a539,0x73bfbe70,0x83877605,0x4523ecf1, }; -CAST_LONG CAST_S_table2[256]={ +GLOBAL CAST_LONG CAST_S_table2[256]={ 0x8defc240,0x25fa5d9f,0xeb903dbf,0xe810c907, 0x47607fff,0x369fe44b,0x8c1fc644,0xaececa90, 0xbeb1f9bf,0xeefbcaea,0xe8cf1950,0x51df07ae, @@ -253,7 +253,7 @@ CAST_LONG CAST_S_table2[256]={ 0xf7baefd5,0x4142ed9c,0xa4315c11,0x83323ec5, 0xdfef4636,0xa133c501,0xe9d3531c,0xee353783, }; -CAST_LONG CAST_S_table3[256]={ +GLOBAL CAST_LONG CAST_S_table3[256]={ 0x9db30420,0x1fb6e9de,0xa7be7bef,0xd273a298, 0x4a4f7bdb,0x64ad8c57,0x85510443,0xfa020ed1, 0x7e287aff,0xe60fb663,0x095f35a1,0x79ebf120, @@ -319,7 +319,7 @@ CAST_LONG CAST_S_table3[256]={ 0x7ae5290c,0x3cb9536b,0x851e20fe,0x9833557e, 0x13ecf0b0,0xd3ffb372,0x3f85c5c1,0x0aef7ed2, }; -CAST_LONG CAST_S_table4[256]={ +GLOBAL CAST_LONG CAST_S_table4[256]={ 0x7ec90c04,0x2c6e74b9,0x9b0e66df,0xa6337911, 0xb86a7fff,0x1dd358f5,0x44dd9d44,0x1731167f, 0x08fbf1fa,0xe7f511cc,0xd2051b00,0x735aba00, @@ -385,7 +385,7 @@ CAST_LONG CAST_S_table4[256]={ 0xe822fe15,0x88570983,0x750e6249,0xda627e55, 0x5e76ffa8,0xb1534546,0x6d47de08,0xefe9e7d4, }; -CAST_LONG CAST_S_table5[256]={ +GLOBAL CAST_LONG CAST_S_table5[256]={ 0xf6fa8f9d,0x2cac6ce1,0x4ca34867,0xe2337f7c, 0x95db08e7,0x016843b4,0xeced5cbc,0x325553ac, 0xbf9f0960,0xdfa1e2ed,0x83f0579d,0x63ed86b9, @@ -451,7 +451,7 @@ CAST_LONG CAST_S_table5[256]={ 0xa2d762cf,0x49c92f54,0x38b5f331,0x7128a454, 0x48392905,0xa65b1db8,0x851c97bd,0xd675cf2f, }; -CAST_LONG CAST_S_table6[256]={ +GLOBAL CAST_LONG CAST_S_table6[256]={ 0x85e04019,0x332bf567,0x662dbfff,0xcfc65693, 0x2a8d7f6f,0xab9bc912,0xde6008a1,0x2028da1f, 0x0227bce7,0x4d642916,0x18fac300,0x50f18b82, @@ -517,7 +517,7 @@ CAST_LONG CAST_S_table6[256]={ 0x518f36b2,0x84b1d370,0x0fedce83,0x878ddada, 0xf2a279c7,0x94e01be8,0x90716f4b,0x954b8aa3, }; -CAST_LONG CAST_S_table7[256]={ +GLOBAL CAST_LONG CAST_S_table7[256]={ 0xe216300d,0xbbddfffc,0xa7ebdabd,0x35648095, 0x7789f8b7,0xe6c1121b,0x0e241600,0x052ce8b5, 0x11a9cfb0,0xe5952f11,0xece7990a,0x9386d174, diff --git a/crypto/cast/cast_spd.c b/crypto/cast/cast_spd.c index 209de792d3..fbc8bb8e87 100644 --- a/crypto/cast/cast_spd.c +++ b/crypto/cast/cast_spd.c @@ -59,7 +59,7 @@ /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif @@ -71,7 +71,6 @@ extern int exit(); #endif #include <signal.h> -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -79,15 +78,15 @@ extern int exit(); #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif diff --git a/crypto/cast/castopts.c b/crypto/cast/castopts.c index f8da8e809e..56fb646c51 100644 --- a/crypto/cast/castopts.c +++ b/crypto/cast/castopts.c @@ -59,7 +59,7 @@ /* define PART1, PART2, PART3 or PART4 to build only with a few of the options. * This is for machines with 64k code segment size restrictions. */ -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif @@ -71,7 +71,6 @@ extern void exit(); #endif #include <signal.h> -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -79,15 +78,15 @@ extern void exit(); #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif diff --git a/crypto/conf/conf.c b/crypto/conf/conf.c index 28f08b3c39..177e76a175 100644 --- a/crypto/conf/conf.c +++ b/crypto/conf/conf.c @@ -105,7 +105,11 @@ LHASH *CONF_load(LHASH *h, char *file, long *line) goto err; } +#ifdef VMS + in=fopen(file,"r"); +#else in=fopen(file,"rb"); +#endif if (in == NULL) { SYSerr(SYS_F_FOPEN,get_last_sys_error()); diff --git a/crypto/cryptlib.h b/crypto/cryptlib.h index 990411eb42..9673852810 100644 --- a/crypto/cryptlib.h +++ b/crypto/cryptlib.h @@ -73,10 +73,17 @@ extern "C" { #include <openssl/err.h> #include <openssl/opensslconf.h> +#ifndef VMS #define X509_CERT_AREA OPENSSLDIR #define X509_CERT_DIR OPENSSLDIR "/certs" #define X509_CERT_FILE OPENSSLDIR "/cert.pem" #define X509_PRIVATE_DIR OPENSSLDIR "/private" +#else +#define X509_CERT_AREA "SSLROOT:[000000]" +#define X509_CERT_DIR "SSLCERTS:" +#define X509_CERT_FILE "SSLCERTS:cert.pem" +#define X509_PRIVATE_DIR "SSLPRIVATE:" +#endif #define X509_CERT_DIR_EVP "SSL_CERT_DIR" #define X509_CERT_FILE_EVP "SSL_CERT_FILE" diff --git a/crypto/crypto-lib.com b/crypto/crypto-lib.com new file mode 100644 index 0000000000..4178044191 --- /dev/null +++ b/crypto/crypto-lib.com @@ -0,0 +1,1218 @@ +$! +$! CRYPTO-LIB.COM +$! Written By: Robert Byer +$! Vice-President +$! A-Com Computing, Inc. +$! byer@mail.all-net.net +$! +$! Changes by Richard Levitte <richard@levitte.org> +$! +$! This command files compiles and creates the "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" +$! library for OpenSSL. The "xxx" denotes the machine architecture of AXP +$! or VAX. +$! +$! It was re-written so it would try to determine what "C" compiler to use +$! or you can specify which "C" compiler to use. +$! +$! Specify RSAREF as P1 to compile with the RSAREF library instead of +$! the regular one. If you specify NORSAREF it will compile with the +$! regular RSAREF routines. (Note: If you are in the United States +$! you MUST compile with RSAREF unless you have a license from RSA). +$! +$! Note: The RSAREF libraries are NOT INCLUDED and you have to +$! download it from "ftp://ftp.rsa.com/rsaref". You have to +$! get the ".tar-Z" file as the ".zip" file dosen't have the +$! directory structure stored. You have to extract the file +$! into the [.RSAREF] directory under the root directory as that +$! is where the scripts will look for the files. +$! +$! Specify DEBUG or NODEBUG as P2 to compile with or without debugger +$! information. +$! +$! Specify which compiler at P3 to try to compile under. +$! +$! 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 +$! "C" compiler to use. +$! +$! P4, if defined, sets a TCP/IP library to use, through one of the following +$! keywords: +$! +$! UCX for UCX +$! SOCKETSHR for SOCKETSHR+NETLIB +$! +$! P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) +$! +$! 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. +$! +$! +$! Define A TCP/IP Library That We Will Need To Link To. +$! (That Is, If We Need To Link To One.) +$! +$ TCPIP_LIB = "" +$! +$! Check Which Architecture We Are Using. +$! +$ IF (F$GETSYI("CPU").GE.128) +$ THEN +$! +$! The Architecture Is AXP +$! +$ ARCH := AXP +$! +$! Else... +$! +$ ELSE +$! +$! The Architecture Is VAX. +$! +$ ARCH := VAX +$! +$! End The Architecture Check. +$! +$ ENDIF +$! +$! Define The Different Encryption Types. +$! +$ ENCRYPT_TYPES = ",MD2,MD5,SHA,MDC2,HMAC,RIPEMD,"+ - + "DES,RC2,RC4,RC5,IDEA,BF,CAST,"+ - + "BN,RSA,DSA,DH,"+ - + "BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,"+ - + "EVP,EVP_2,ASN1,ASN1_2,PEM,X509,X509V3,"+ - + "CONF,TXT_DB,PKCS7,PKCS12,COMP" +$! +$! Check To Make Sure We Have Valid Command Line Parameters. +$! +$ GOSUB CHECK_OPTIONS +$! +$! 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." +$! +$! Define The OBJ Directory. +$! +$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.CRYPTO] +$! +$! Check To See If The Architecture Specific OBJ Directory Exists. +$! +$ IF (F$PARSE(OBJ_DIR).EQS."") +$ THEN +$! +$! It Dosen't Exist, So Create It. +$! +$ CREATE/DIR 'OBJ_DIR' +$! +$! End The Architecture Specific OBJ Directory Check. +$! +$ ENDIF +$! +$! Define The EXE Directory. +$! +$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.CRYPTO] +$! +$! Check To See If The Architecture Specific Directory Exists. +$! +$ IF (F$PARSE(EXE_DIR).EQS."") +$ THEN +$! +$! It Dosen't Exist, So Create It. +$! +$ CREATE/DIRECTORY 'EXE_DIR' +$! +$! End The Architecture Specific Directory Check. +$! +$ ENDIF +$! +$! Define The Library Name. +$! +$ LIB_NAME := 'EXE_DIR'LIBCRYPTO.OLB +$! +$! Check To See If We Already Have A "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" Library... +$! +$ IF (F$SEARCH(LIB_NAME).EQS."") +$ THEN +$! +$! Guess Not, Create The Library. +$! +$ LIBRARY/CREATE/OBJECT 'LIB_NAME' +$! +$! End The Library Check. +$! +$ ENDIF +$! +$! Define The Different Encryption "library" Strings. +$! +$ LIB_ = "cryptlib,mem,cversion,ex_data,tmdiff,cpt_err" +$ LIB_MD2 = "md2_dgst,md2_one" +$ LIB_MD5 = "md5_dgst,md5_one" +$ LIB_SHA = "sha_dgst,sha1dgst,sha_one,sha1_one" +$ LIB_MDC2 = "mdc2dgst,mdc2_one" +$ LIB_HMAC = "hmac" +$ LIB_RIPEMD = "rmd_dgst,rmd_one" +$ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ - + "ecb3_enc,cfb64enc,cfb64ede,cfb_enc,ofb64ede,"+ - + "enc_read,enc_writ,ofb64enc,"+ - + "ofb_enc,str2key,pcbc_enc,qud_cksm,rand_key,"+ - + "des_enc,fcrypt_b,read2pwd,"+ - + "fcrypt,xcbc_enc,read_pwd,rpc_enc,cbc_cksm,supp,ede_cbcm_enc" +$ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64" +$ LIB_RC4 = "rc4_skey,rc4_enc" +$ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64" +$ LIB_IDEA = "i_cbc,i_cfb64,i_ofb64,i_ecb,i_skey" +$ LIB_BF = "bf_skey,bf_ecb,bf_enc,bf_cfb64,bf_ofb64" +$ LIB_CAST = "c_skey,c_ecb,c_enc,c_cfb64,c_ofb64" +$ LIB_BN_ASM = "[.asm]vms.mar,vms-helper" +$ IF F$TRNLNM("OPENSSL_NO_ASM") .NES. "" THEN LIB_BN_ASM = "bn_asm" +$ LIB_BN = "bn_add,bn_div,bn_exp,bn_lib,bn_mul,"+ - + "bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ - + "bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+",bn_recp,bn_mont,"+ - + "bn_mpi,bn_exp2" +$ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ - + "rsa_pk1,rsa_ssl,rsa_none,rsa_oaep" +$ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,dsa_err" +$ LIB_DH = "dh_gen,dh_key,dh_lib,dh_check,dh_err" +$ LIB_BUFFER = "buffer,buf_err" +$ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ - + "bss_mem,bss_null,bss_fd,"+ - + "bss_file,bss_sock,bss_conn,"+ - + "bf_null,bf_buff,b_print,b_dump,"+ - + "b_sock,bss_acpt,bf_nbio,bss_rtcp" ! + ",bss_log" for syslog +$ LIB_STACK = "stack" +$ LIB_LHASH = "lhash,lh_stats" +$ LIB_RAND = "md_rand,randfile,rand_lib" +$ LIB_ERR = "err,err_all,err_prn" +$ LIB_OBJECTS = "o_names,obj_dat,obj_lib,obj_err" +$ LIB_EVP = "encode,digest,evp_enc,evp_key,"+ - + "e_ecb_d,e_cbc_d,e_cfb_d,e_ofb_d,"+ - + "e_ecb_i,e_cbc_i,e_cfb_i,e_ofb_i,"+ - + "e_ecb_3d,e_cbc_3d,e_rc4,names,"+ - + "e_cfb_3d,e_ofb_3d,e_xcbc_d,"+ - + "e_ecb_r2,e_cbc_r2,e_cfb_r2,e_ofb_r2,"+ - + "e_ecb_bf,e_cbc_bf,e_cfb_bf,e_ofb_bf" +$ LIB_EVP_2 = "e_ecb_c,e_cbc_c,e_cfb_c,e_ofb_c,"+ - + "e_ecb_r5,e_cbc_r5,e_cfb_r5,e_ofb_r5,"+ - + "m_null,m_md2,m_md5,m_sha,m_sha1,m_dss,m_dss1,m_mdc2,"+ - + "m_ripemd,"+ - + "p_open,p_seal,p_sign,p_verify,p_lib,p_enc,p_dec,"+ - + "bio_md,bio_b64,bio_enc,evp_err,e_null,"+ - + "c_all,evp_lib,bio_ok,evp_pkey,evp_pbe" +$ LIB_ASN1 = "a_object,a_bitstr,a_utctm,a_gentm,a_time,a_int,a_octet,"+ - + "a_print,a_type,a_set,a_dup,a_d2i_fp,a_i2d_fp,a_bmp,"+ - + "a_enum,a_vis,a_utf8,a_sign,a_digest,a_verify,"+ - + "x_algor,x_val,x_pubkey,x_sig,x_req,x_attrib,"+ - + "x_name,x_cinf,x_x509,x_crl,x_info,x_spki,nsseq,"+ - + "d2i_r_pr,i2d_r_pr,d2i_r_pu,i2d_r_pu,"+ - + "d2i_s_pr,i2d_s_pr,d2i_s_pu,i2d_s_pu,"+ - + "d2i_pu,d2i_pr,i2d_pu,i2d_pr" +$ LIB_ASN1_2 = "t_req,t_x509,t_crl,t_pkey,"+ - + "p7_i_s,p7_signi,p7_signd,p7_recip,p7_enc_c,p7_evp,"+ - + "p7_dgst,p7_s_e,p7_enc,p7_lib,"+ - + "f_int,f_string,i2d_dhp,i2d_dsap,d2i_dhp,d2i_dsap,n_pkey,"+ - + "f_enum,a_hdr,x_pkey,a_bool,x_exten,"+ - + "asn1_par,asn1_lib,asn1_err,a_meth,a_bytes,"+ - + "evp_asn1,asn_pack,p5_pbe,p5_pbev2,p8_pkey" +$ LIB_PEM = "pem_sign,pem_seal,pem_info,pem_lib,pem_all,pem_err" +$ LIB_X509 = "x509_def,x509_d2,x509_r2x,x509_cmp,"+ - + "x509_obj,x509_req,x509_vfy,"+ - + "x509_set,x509rset,x509_err,"+ - + "x509name,x509_v3,x509_ext,"+ - + "x509type,x509_lu,x_all,x509_txt,"+ - + "by_file,by_dir" +$ LIB_X509V3 = "v3_bcons,v3_bitst,v3_conf,v3_extku,v3_ia5,v3_lib,"+ - + "v3_prn,v3_utl,v3err,v3_genn,v3_alt,v3_skey,v3_akey,v3_pku,"+ - + "v3_int,v3_enum,v3_sxnet,v3_cpols,v3_crld" +$ LIB_CONF = "conf,conf_err" +$ LIB_TXT_DB = "txt_db" +$ LIB_PKCS7 = "pk7_lib,pkcs7err,pk7_doit" +$ LIB_PKCS12 = "p12_add,p12_attr,p12_bags,p12_crpt,p12_crt,p12_decr,"+ - + "p12_init,p12_key,p12_kiss,p12_lib,p12_mac,p12_mutl,"+ - + "p12_sbag,p12_utl,pk12err" +$ LIB_COMP = "comp_lib,"+ - + "c_rle,c_zlib" +$! +$! Setup exceptional compilations +$! +$ COMPILEWITH_CC3 = ",bss_rtcp," +$ COMPILEWITH_CC4 = ",a_utctm," +$ COMPILEWITH_CC5 = ",md2_dgst,md5_dgst,mdc2dgst,sha_dgst,sha1dgst," + - + "rmd_dgst,bf_enc," +$! +$! Check To See If We Are Going To Use RSAREF. +$! +$ IF (RSAREF.EQS."TRUE" .AND. ENCRYPT_TYPES - "RSA".NES.ENCRYPT_TYPES) +$ THEN +$! +$! Check To See If The File [-.RSAREF]RSAREF.C Is Actually There. +$! +$ IF (F$SEARCH("SYS$DISK:[-.RSAREF]RSAREF.C").EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File [-.RSAREF]RSAREF.C Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ GOTO EXIT +$! +$! End The [-.RSAREF]RSAREF.C Check. +$! +$ ENDIF +$! +$! Tell The User We Are Compiling The [-.RSAREF]RSAREF File. +$! +$ WRITE SYS$OUTPUT "Compiling The [-.RSAREF]RSAREF File." +$! +$! Compile [-.RSAREF]RSAREF.C +$! +$ CC/OBJECT='OBJ_DIR'RSAREF.OBJ SYS$DISK:[-.RSAREF]RSAREF.C +$! +$! Add It To The Library. +$! +$ LIBRARY/REPLACE 'LIB_NAME' 'OBJ_DIR'RSAREF.OBJ +$! +$! Delete The Object File. +$! +$ DELETE 'OBJ_DIR'RSAREF.OBJ;* +$! +$! Check To See If The File [-.RSAREF]RSAR_ERR.C Is Actually There. +$! +$ IF (F$SEARCH("SYS$DISK:[-.RSAREF]RSAR_ERR.C").EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File [-.RSAREF]RSAR_ERR.C Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ GOTO EXIT +$! +$! End The [-.RSAREF]RSAR_ERR.C File Check. +$! +$ ENDIF +$! +$! Tell The User We Are Compiling The [-.RSAREF]RSAR_ERR File. +$! +$ WRITE SYS$OUTPUT "Compiling The [-.RSAREF]RSAR_ERR File." +$! +$! Compile [-.RSAREF]RSAR_ERR.C +$! +$ CC/OBJECT='OBJ_DIR'RSAR_ERR.OBJ SYS$DISK:[-.RSAREF]RSAR_ERR.C +$! +$! Add It To The Library. +$! +$ LIBRARY/REPLACE 'LIB_NAME' 'OBJ_DIR'RSAR_ERR.OBJ +$! +$! Delete The Object File. +$! +$ DELETE 'OBJ_DIR'RSAR_ERR.OBJ;* +$! +$! End The RSAREF Check. +$! +$ ENDIF +$! +$! Figure Out What Other Modules We Are To Build. +$! +$ BUILD_SET: +$! +$! Define A Module Counter. +$! +$ MODULE_COUNTER = 0 +$! +$! Top Of The Loop. +$! +$ MODULE_NEXT: +$! +$! Extract The Module Name From The Encryption List. +$! +$ MODULE_NAME = F$ELEMENT(MODULE_COUNTER,",",ENCRYPT_TYPES) +$! +$! Check To See If We Are At The End Of The Module List. +$! +$ IF (MODULE_NAME.EQS.",") +$ THEN +$! +$! We Are At The End Of The Module List, Go To MODULE_DONE. +$! +$ GOTO MODULE_DONE +$! +$! End The Module List Check. +$! +$ ENDIF +$! +$! Increment The Moudle Counter. +$! +$ MODULE_COUNTER = MODULE_COUNTER + 1 +$! +$! Tell The User What Module We Are Building. +$! +$ IF (MODULE_NAME.NES."") +$ THEN +$ WRITE SYS$OUTPUT "Compiling The ",MODULE_NAME," Files." +$ ENDIF +$! +$! Define A File Counter And Set It To "0". +$! +$ FILE_COUNTER = 0 +$! +$! Create The Library Module Name. +$! +$ LIB_MODULE = "LIB_" + MODULE_NAME +$ IF (MODULE_NAME.EQS."ASN1_2") +$ THEN +$ MODULE_NAME = "ASN1" +$ ENDIF +$ IF (MODULE_NAME.EQS."EVP_2") +$ THEN +$ MODULE_NAME = "EVP" +$ ENDIF +$! +$! Check if the library module name actually is defined +$! +$ IF F$TYPE('LIB_MODULE') .EQS. "" +$ THEN +$ WRITE SYS$ERROR "" +$ WRITE SYS$ERROR "The module ",MODULE_NAME," does not exist. Continuing..." +$ WRITE SYS$ERROR "" +$ GOTO MODULE_NEXT +$ ENDIF +$! +$! Top Of The File Loop. +$! +$ NEXT_FILE: +$! +$! O.K, Extract The File Name From The File List. +$! +$ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",'LIB_MODULE') +$! +$! Check To See If We Are At The End Of The File List. +$! +$ IF (FILE_NAME.EQS.",") +$ THEN +$! +$! We Are At The End Of The File List, Goto FILE_DONE. +$! +$ GOTO FILE_DONE +$! +$! End The File List Check. +$! +$ ENDIF +$! +$! Increment The Counter. +$! +$ FILE_COUNTER = FILE_COUNTER + 1 +$! +$! Create The Source File Name. +$! +$ TMP_FILE_NAME = F$ELEMENT(1,"]",FILE_NAME) +$ IF TMP_FILE_NAME .EQS. "]" THEN TMP_FILE_NAME = FILE_NAME +$ IF F$ELEMENT(0,".",TMP_FILE_NAME) .EQS. TMP_FILE_NAME THEN - + FILE_NAME = FILE_NAME + ".c" +$ IF (MODULE_NAME.NES."") +$ THEN +$ SOURCE_FILE = "SYS$DISK:[." + MODULE_NAME+ "]" + FILE_NAME +$ ELSE +$ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME +$ ENDIF +$ SOURCE_FILE = SOURCE_FILE - "][" +$! +$! Create The Object File Name. +$! +$ OBJECT_FILE = OBJ_DIR + F$PARSE(FILE_NAME,,,"NAME","SYNTAX_ONLY") + ".OBJ" +$ ON WARNING THEN GOTO NEXT_FILE +$! +$! Check To See If The File We Want To Compile Is Actually There. +$! +$ IF (F$SEARCH(SOURCE_FILE).EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ GOTO EXIT +$! +$! End The File Exist Check. +$! +$ ENDIF +$! +$! Tell The User We Are Compiling The File. +$! +$ IF (MODULE_NAME.EQS."") +$ THEN + WRITE SYS$OUTPUT "Compiling The ",FILE_NAME," File." +$ ENDIF +$ IF (MODULE_NAME.NES."") +$ THEN +$ WRITE SYS$OUTPUT " ",FILE_NAME,"" +$ ENDIF +$! +$! Compile The File. +$! +$ ON ERROR THEN GOTO NEXT_FILE +$ 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 +$ CC3/OBJECT='OBJECT_FILE' 'SOURCE_FILE' +$ ELSE +$ IF COMPILEWITH_CC4 - FILE_NAME0 .NES. COMPILEWITH_CC4 +$ THEN +$ CC4/OBJECT='OBJECT_FILE' 'SOURCE_FILE' +$ ELSE +$ IF COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5 +$ THEN +$ CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE' +$ ELSE +$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE' +$ ENDIF +$ ENDIF +$ ENDIF +$ ENDIF +$! +$! Add It To The Library. +$! +$ LIBRARY/REPLACE 'LIB_NAME' 'OBJECT_FILE' +$! +$! Time To Clean Up The Object File. +$! +$ DELETE 'OBJECT_FILE';* +$! +$! Go Back And Do It Again. +$! +$ GOTO NEXT_FILE +$! +$! All Done With This Library Part. +$! +$ FILE_DONE: +$! +$! Go Back And Get The Next Module. +$! +$ GOTO MODULE_NEXT +$! +$! All Done With This Module. +$! +$ MODULE_DONE: +$! +$! Tell The User That We Are All Done. +$! +$ WRITE SYS$OUTPUT "All Done..." +$ EXIT: +$ GOSUB CLEANUP +$ EXIT +$! +$! Check For The Link Option FIle. +$! +$ CHECK_OPT_FILE: +$! +$! Check To See If We Need To Make A VAX C Option File. +$! +$ IF (COMPILER.EQS."VAXC") +$ THEN +$! +$! Check To See If We Already Have A VAX C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! We Need A VAX C Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable VAX C Runtime Library. +! +SYS$SHARE:VAXCRTL.EXE/SHARE +$EOD +$! +$! End The Option File Check. +$! +$ ENDIF +$! +$! End The VAXC Check. +$! +$ ENDIF +$! +$! Check To See If We Need A GNU C Option File. +$! +$ IF (COMPILER.EQS."GNUC") +$ THEN +$! +$! Check To See If We Already Have A GNU C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! We Need A GNU C Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable C Runtime Library. +! +GNU_CC:[000000]GCCLIB/LIBRARY +SYS$SHARE:VAXCRTL/SHARE +$EOD +$! +$! End The Option File Check. +$! +$ ENDIF +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Check To See If We Need A DEC C Option File. +$! +$ IF (COMPILER.EQS."DECC") +$ THEN +$! +$! Check To See If We Already Have A DEC C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! Figure Out If We Need An AXP Or A VAX Linker Option File. +$! +$ IF ARCH .EQS. "VAX" +$ THEN +$! +$! We Need A DEC C Linker Option File For VAX. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable DEC C Runtime Library. +! +SYS$SHARE:DECC$SHR.EXE/SHARE +$EOD +$! +$! Else... +$! +$ ELSE +$! +$! Create The AXP Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File For AXP To Link Agianst +! The Sharable C Runtime Library. +! +SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE +SYS$SHARE:CMA$OPEN_RTL/SHARE +$EOD +$! +$! End The VAX/AXP DEC C Option File Check. +$! +$ ENDIF +$! +$! End The Option File Search. +$! +$ ENDIF +$! +$! End The DEC C Check. +$! +$ ENDIF +$! +$! Tell The User What Linker Option File We Are Using. +$! +$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." +$! +$! Time To RETURN. +$! +$ RETURN +$! +$! Check The User's Options. +$! +$ CHECK_OPTIONS: +$! +$! Check To See If P1 Is Blank. +$! +$ IF (P1.EQS."NORSAREF") +$ THEN +$! +$! P1 Is NORSAREF, So Compile With The Regular RSA Libraries. +$! +$ RSAREF = "FALSE" +$ ELSE +$! +$! Check To See If We Are To Use The RSAREF Library. +$! +$ IF (P1.EQS."RSAREF") +$ THEN +$! +$! Check To Make Sure We Have The RSAREF Source Code Directory. +$! +$ IF (F$SEARCH("SYS$DISK:[-.RSAREF]SOURCE.DIR").EQS."") +$ THEN +$! +$! We Don't Have The RSAREF Souce Code Directory, So Tell The +$! User This. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "It appears that you don't have the RSAREF Souce Code." +$ WRITE SYS$OUTPUT "You need to go to 'ftp://ftp.rsa.com/rsaref'. You have to" +$ WRITE SYS$OUTPUT "get the '.tar-Z' file as the '.zip' file dosen't have the" +$ WRITE SYS$OUTPUT "directory structure stored. You have to extract the file" +$ WRITE SYS$OUTPUT "into the [.RSAREF] directory under the root directory" +$ WRITE SYS$OUTPUT "as that is where the scripts will look for the files." +$ WRITE SYS$OUTPUT "" +$! +$! Time To Exit. +$! +$ EXIT +$! +$! Else, Compile Using The RSAREF Library. +$! +$ ELSE +$ RSAREF = "TRUE" +$ ENDIF +$ ELSE +$! +$! They Entered An Invalid Option.. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " RSAREF : Compile With The RSAREF Library." +$ WRITE SYS$OUTPUT " NORSAREF : Compile With The Regular RSA Library." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P1 Check. +$! +$ ENDIF +$! +$! Check To See If P2 Is Blank. +$! +$ IF (P2.EQS."NODEBUG") +$ THEN +$! +$! 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." +$ ELSE +$! +$! Check To See If We Are To Compile With Debugger Information. +$! +$ IF (P2.EQS."DEBUG") +$ THEN +$! +$! Compile With Debugger Information. +$! +$ DEBUGGER = "DEBUG" +$ TRACEBACK = "TRACEBACK" +$ GCC_OPTIMIZE = "NOOPTIMIZE" +$ CC_OPTIMIZE = "NOOPTIMIZE" +$ MACRO_OPTIMIZE = "NOOPTIMIZE" +$ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile." +$ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." +$ ELSE +$! +$! They Entered An Invalid Option.. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information." +$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P2 Check. +$! +$ ENDIF +$! +$! Special Threads For OpenVMS v7.1 Or Later +$! +$! Written By: Richard Levitte +$! richard@levitte.org +$! +$! +$! Check To See If We Have A Option For P5. +$! +$ IF (P5.EQS."") +$ THEN +$! +$! Get The Version Of VMS We Are Using. +$! +$ ISSEVEN := +$ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION"))) +$ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP)) +$! +$! Check To See If The VMS Version Is v7.1 Or Later. +$! +$ IF (TMP.GE.71) +$ THEN +$! +$! We Have OpenVMS v7.1 Or Later, So Use The Special Threads. +$! +$ ISSEVEN := ,PTHREAD_USE_D4 +$! +$! End The VMS Version Check. +$! +$ ENDIF +$! +$! End The P5 Check. +$! +$ ENDIF +$! +$! Check To See If P3 Is Blank. +$! +$ IF (P3.EQS."") +$ THEN +$! +$! O.K., The User Didn't Specify A Compiler, Let's Try To +$! Find Out Which One To Use. +$! +$! Check To See If We Have GNU C. +$! +$ IF (F$TRNLNM("GNU_CC").NES."") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ P3 = "GNUC" +$! +$! Else... +$! +$ ELSE +$! +$! Check To See If We Have VAXC Or DECC. +$! +$ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ P3 = "DECC" +$! +$! Else... +$! +$ ELSE +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ P3 = "VAXC" +$! +$! End The VAXC Compiler Check. +$! +$ ENDIF +$! +$! End The DECC & VAXC Compiler Check. +$! +$ ENDIF +$! +$! End The Compiler Check. +$! +$ ENDIF +$! +$! Check To See If We Have A Option For P4. +$! +$ IF (P4.EQS."") +$ THEN +$! +$! Find out what socket library we have available +$! +$ IF F$PARSE("SOCKETSHR:") .NES. "" +$ THEN +$! +$! We have SOCKETSHR, and it is my opinion that it's the best to use. +$! +$ P4 = "SOCKETSHR" +$! +$! Tell the user +$! +$ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP" +$! +$! Else, let's look for something else +$! +$ ELSE +$! +$! Like UCX (the reason to do this before Multinet is that the UCX +$! emulation is easier to use...) +$! +$ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" - + .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" - + .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. "" +$ THEN +$! +$! Last resort: a UCX or UCX-compatible library +$! +$ P4 = "UCX" +$! +$! Tell the user +$! +$ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP" +$! +$! That was all... +$! +$ ENDIF +$ ENDIF +$ ENDIF +$! +$! Set Up Initial CC Definitions, Possibly With User Ones +$! +$ CCDEFS = "VMS=1,TCPIP_TYPE_''P4'" +$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS +$ CCEXTRAFLAGS = "" +$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS +$ CCDISABLEWARNINGS = "" +$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - + CCDISABLEWARNINGS = USER_CCDISABLEWARNINGS +$! +$! Check To See If The User Entered A Valid Paramter. +$! +$ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC") +$ THEN +$! +$! Check To See If The User Wanted DECC. +$! +$ IF (P3.EQS."DECC") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ COMPILER = "DECC" +$! +$! Tell The User We Are Using DECC. +$! +$ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." +$! +$! Use DECC... +$! +$ 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" + - + "/NOLIST/PREFIX=ALL/INCLUDE=SYS$DISK:[]" + CCEXTRAFLAGS +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT" +$! +$! End DECC Check. +$! +$ ENDIF +$! +$! Check To See If We Are To Use VAXC. +$! +$ IF (P3.EQS."VAXC") +$ THEN +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ COMPILER = "VAXC" +$! +$! Tell The User We Are Using VAX C. +$! +$ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler." +$! +$! Compile Using VAXC. +$! +$ CC = "CC" +$ IF ARCH.EQS."AXP" +$ THEN +$ WRITE SYS$OUTPUT "There is no VAX C on Alpha!" +$ EXIT +$ ENDIF +$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" +$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST/INCLUDE=SYS$DISK:[]" + - + CCEXTRAFLAGS +$ CCDEFS = """VAXC""," + CCDEFS +$! +$! Define <sys> As SYS$COMMON:[SYSLIB] +$! +$ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT" +$! +$! End VAXC Check +$! +$ ENDIF +$! +$! Check To See If We Are To Use GNU C. +$! +$ IF (P3.EQS."GNUC") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ COMPILER = "GNUC" +$! +$! Tell The User We Are Using GNUC. +$! +$ WRITE SYS$OUTPUT "Using GNU 'C' Compiler." +$! +$! Use GNU C... +$! +$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - + "/INCLUDE=SYS$DISK:[]" + CCEXTRAFLAGS +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT" +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Set up default defines +$! +$ CCDEFS = """FLAT_INC=1""," + CCDEFS +$! +$! Check To See If We Are To Compile With RSAREF Routines. +$! +$ IF (RSAREF.EQS."TRUE") +$ THEN +$! +$! Compile With RSAREF. +$! +$ CCDEFS = CCDEFS + ",""RSAref=1""" +$! +$! Tell The User This. +$! +$ WRITE SYS$OUTPUT "Compiling With RSAREF Routines." +$! +$! Else, We Don't Care. Compile Without The RSAREF Library. +$! +$ ELSE +$! +$! Tell The User We Are Compile Without The RSAREF Routines. +$! +$ WRITE SYS$OUTPUT "Compiling Without The RSAREF Routines. +$! +$! End The RSAREF Check. +$! +$ ENDIF +$! +$! Finish up the definition of CC. +$! +$ IF COMPILER .EQS. "DECC" +$ THEN +$ IF CCDISABLEWARNINGS .EQS. "" +$ THEN +$ CC4DISABLEWARNINGS = "DOLLARID" +$ ELSE +$ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID" +$ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" +$ ENDIF +$ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))" +$ ELSE +$ CCDISABLEWARNINGS = "" +$ CC4DISABLEWARNINGS = "" +$ ENDIF +$ CC3 = CC + "/DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS +$ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS +$ IF ARCH .EQS. "VAX" .AND. COMPILER .EQS. "DECC" .AND. P2 .NES. "DEBUG" +$ THEN +$ CC5 = CC + "/OPTIMIZE=NODISJOINT" +$ ELSE +$ CC5 = CC + "/NOOPTIMIZE" +$ ENDIF +$ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS +$! +$! Show user the result +$! +$ WRITE SYS$OUTPUT "Main C Compiling Command: ",CC +$! +$! Else The User Entered An Invalid Arguement. +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C." +$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C." +$ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! Build a MACRO command for the architecture at hand +$! +$ IF ARCH .EQS. "VAX" THEN MACRO = "MACRO/''DEBUGGER'" +$ IF ARCH .EQS. "AXP" THEN MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'" +$! +$! Show user the result +$! +$ WRITE SYS$OUTPUT "Main MACRO Compiling Command: ",MACRO +$! +$! Time to check the contents, and to make sure we get the correct library. +$! +$ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" +$ THEN +$! +$! Check to see if SOCKETSHR was chosen +$! +$ IF P4.EQS."SOCKETSHR" +$ THEN +$! +$! Set the library to use SOCKETSHR +$! +$ TCPIP_LIB = "[-.VMS]SOCKETSHR_SHR.OPT/OPT" +$! +$! Done with SOCKETSHR +$! +$ ENDIF +$! +$! Check to see if MULTINET was chosen +$! +$ IF P4.EQS."MULTINET" +$ THEN +$! +$! Set the library to use UCX emulation. +$! +$ P4 = "UCX" +$! +$! Done with MULTINET +$! +$ ENDIF +$! +$! Check to see if UCX was chosen +$! +$ IF P4.EQS."UCX" +$ THEN +$! +$! Set the library to use UCX. +$! +$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC.OPT/OPT" +$ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" +$ THEN +$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT" +$ ELSE +$ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - + TCPIP_LIB = "[-.VMS]UCX_SHR_VAXC.OPT/OPT" +$ ENDIF +$! +$! Done with UCX +$! +$ ENDIF +$! +$! Print info +$! +$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB +$! +$! Else The User Entered An Invalid Arguement. +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library." +$ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! Done with TCP/IP libraries +$! +$ ENDIF +$! +$! Check if the user wanted to compile just a subset of all the encryption +$! methods. +$! +$ IF P6 .NES. "" +$ THEN +$ ENCRYPT_TYPES = P6 +$ ENDIF +$! +$! Time To RETURN... +$! +$ RETURN +$! +$ INITIALISE: +$! +$! Save old value of the logical name OPENSSL +$! +$ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE") +$! +$! Save directory information +$! +$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;" +$ __TOP = __HERE - "CRYPTO]" +$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]" +$! +$! Set up the logical name OPENSSL to point at the include directory +$! +$ DEFINE OPENSSL/NOLOG '__INCLUDE' +$! +$! Done +$! +$ RETURN +$! +$ CLEANUP: +$! +$! Restore the logical name OPENSSL if it had a value +$! +$ IF __SAVE_OPENSSL .EQS. "" +$ THEN +$ DEASSIGN OPENSSL +$ ELSE +$ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL' +$ ENDIF +$! +$! Done +$! +$ RETURN diff --git a/crypto/crypto.h b/crypto/crypto.h index 007a4a2f77..4345200f18 100644 --- a/crypto/crypto.h +++ b/crypto/crypto.h @@ -231,7 +231,7 @@ typedef struct crypto_ex_data_func_st #endif /* MDEBUG */ /* Case insensiteve linking causes problems.... */ -#ifdef WIN16 +#if defined(WIN16) || defined(VMS) #define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings #endif diff --git a/crypto/des/des-lib.com b/crypto/des/des-lib.com new file mode 100644 index 0000000000..40a34bb0dd --- /dev/null +++ b/crypto/des/des-lib.com @@ -0,0 +1,1001 @@ +$! +$! DES-LIB.COM +$! Written By: Robert Byer +$! Vice-President +$! A-Com Computing, Inc. +$! byer@mail.all-net.net +$! +$! Changes by Richard Levitte <richard@levitte.org> +$! +$! This command files compiles and creates the +$! "[.xxx.EXE.CRYPTO.DES]LIBDES.OLB" library. The "xxx" denotes the machine +$! architecture of AXP or VAX. +$! +$! It was re-written to try to determine which "C" compiler to try to use +$! or the user can specify a compiler in P3. +$! +$! Specify one of the following to build just that part, specify "ALL" to +$! just build everything. +$! +$! ALL To Just Build "Everything". +$! LIBRARY To Just Build The [.xxx.EXE.CRYPTO.DES]LIBDES.OLB Library. +$! DESTEST To Just Build The [.xxx.EXE.CRYPTO.DES]DESTEST.EXE Program. +$! SPEED To Just Build The [.xxx.EXE.CRYPTO.DES]SPEED.EXE Program. +$! RPW To Just Build The [.xxx.EXE.CRYPTO.DES]RPW.EXE Program. +$! DES To Just Build The [.xxx.EXE.CRYPTO.DES]DES.EXE Program. +$! DES_OPTS To Just Build The [.xxx.EXE.CRYPTO.DES]DES_OPTS.EXE Program. +$! +$! Specify either DEBUG or NODEBUG as P2 to compile with or without +$! debugging information. +$! +$! Specify which compiler at P3 to try to compile under. +$! +$! 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 +$! "C" compiler to try to use. +$! +$! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) +$! +$! +$! Make sure we know what architecture we run on. +$! +$! +$! Check Which Architecture We Are Using. +$! +$ IF (F$GETSYI("CPU").GE.128) +$ THEN +$! +$! The Architecture Is AXP. +$! +$ ARCH := AXP +$! +$! Else... +$! +$ ELSE +$! +$! The Architecture Is VAX. +$! +$ ARCH := VAX +$! +$! End The Architecture Check. +$! +$ ENDIF +$! +$! Check To Make Sure We Have Valid Command Line Parameters. +$! +$ GOSUB CHECK_OPTIONS +$! +$! Tell The User What Kind of Machine We Run On. +$! +$ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine." +$! +$! Define The OBJ Directory Name. +$! +$ OBJ_DIR := SYS$DISK:[--.'ARCH'.OBJ.CRYPTO.DES] +$! +$! Check To See If The Architecture Specific OBJ Directory Exists. +$! +$ IF (F$PARSE(OBJ_DIR).EQS."") +$ THEN +$! +$! It Dosen't Exist, So Create It. +$! +$ CREATE/DIR 'OBJ_DIR' +$! +$! End The Architecture Specific OBJ Directory Check. +$! +$ ENDIF +$! +$! Define The EXE Directory Name. +$! +$ EXE_DIR :== SYS$DISK:[--.'ARCH'.EXE.CRYPTO.DES] +$! +$! Check To See If The Architecture Specific Directory Exists. +$! +$ IF (F$PARSE(EXE_DIR).EQS."") +$ THEN +$! +$! It Dosen't Exist, So Create It. +$! +$ CREATE/DIR 'EXE_DIR' +$! +$! End The Architecture Specific Directory Check. +$! +$ ENDIF +$! +$! Define The Library Name. +$! +$ LIB_NAME := 'EXE_DIR'LIBDES.OLB +$! +$! Check To See What We Are To Do. +$! +$ IF (BUILDALL.EQS."TRUE") +$ THEN +$! +$! Since Nothing Special Was Specified, Do Everything. +$! +$ GOSUB LIBRARY +$ GOSUB DESTEST +$ GOSUB SPEED +$ GOSUB RPW +$ GOSUB DES +$ GOSUB DES_OPTS +$! +$! Else... +$! +$ ELSE +$! +$! Build Just What The User Wants Us To Build. +$! +$ GOSUB 'BUILDALL' +$! +$! End The BUILDALL Check. +$! +$ ENDIF +$! +$! Time To EXIT. +$! +$ EXIT +$ LIBRARY: +$! +$! Tell The User That We Are Compiling. +$! +$ WRITE SYS$OUTPUT "Compiling The ",LIB_NAME," Files." +$! +$! Check To See If We Already Have A "[.xxx.EXE.CRYPTO.DES]LIBDES.OLB" Library... +$! +$ IF (F$SEARCH(LIB_NAME).EQS."") +$ THEN +$! +$! Guess Not, Create The Library. +$! +$ LIBRARY/CREATE/OBJECT 'LIB_NAME' +$! +$! End The Library Exist Check. +$! +$ ENDIF +$! +$! Define The DES Library Files. +$! +$ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ - + "ecb3_enc,cfb64enc,cfb64ede,cfb_enc,ofb64ede,"+ - + "enc_read,enc_writ,ofb64enc,"+ - + "ofb_enc,str2key,pcbc_enc,qud_cksm,rand_key,"+ - + "des_enc,fcrypt_b,read2pwd,"+ - + "fcrypt,xcbc_enc,read_pwd,rpc_enc,cbc_cksm,supp" +$! +$! Define A File Counter And Set It To "0". +$! +$ FILE_COUNTER = 0 +$! +$! Top Of The File Loop. +$! +$ NEXT_FILE: +$! +$! O.K, Extract The File Name From The File List. +$! +$ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",LIB_DES) +$! +$! Check To See If We Are At The End Of The File List. +$! +$ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE +$! +$! Increment The Counter. +$! +$ FILE_COUNTER = FILE_COUNTER + 1 +$! +$! Create The Source File Name. +$! +$ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C" +$! +$! Tell The User We Are Compiling The Source File. +$! +$ WRITE SYS$OUTPUT " ",FILE_NAME,".C" +$! +$! Create The Object File Name. +$! +$ OBJECT_FILE = OBJ_DIR + FILE_NAME + "." + ARCH + "OBJ" +$ ON WARNING THEN GOTO NEXT_FILE +$! +$! Check To See If The File We Want To Compile Actually Exists. +$! +$ IF (F$SEARCH(SOURCE_FILE).EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ EXIT +$! +$! End The File Exists Check. +$! +$ ENDIF +$! +$! Compile The File. +$! +$ ON ERROR THEN GOTO NEXT_FILE +$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE' +$! +$! Add It To The Library. +$! +$ LIBRARY/REPLACE/OBJECT 'LIB_NAME' 'OBJECT_FILE' +$! +$! Time To Clean Up The Object File. +$! +$ DELETE 'OBJECT_FILE';* +$! +$! Go Back And Do It Again. +$! +$ GOTO NEXT_FILE +$! +$! All Done With This Library Part. +$! +$ FILE_DONE: +$! +$! Tell The User That We Are All Done. +$! +$ WRITE SYS$OUTPUT "Library ",LIB_NAME," Built." +$! +$! All Done, Time To Return. +$! +$ RETURN +$! +$! Compile The DESTEST Program. +$! +$ DESTEST: +$! +$! Check To See If We Have The Proper Libraries. +$! +$ GOSUB LIB_CHECK +$! +$! Check To See If We Have A Linker Option File. +$! +$ GOSUB CHECK_OPT_FILE +$! +$! Check To See If The File We Want To Compile Actually Exists. +$! +$ IF (F$SEARCH("SYS$DISK:[]DESTEST.C").EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File DESTEST.C Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ EXIT +$! +$! End The DESTEST.C File Check. +$! +$ ENDIF +$! +$! Tell The User What We Are Building. +$! +$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DESTEST.EXE" +$! +$! Compile The DESTEST Program. +$! +$ CC/OBJECT='OBJ_DIR'DESTEST.OBJ SYS$DISK:[]DESTEST.C +$! +$! Link The DESTEST Program. +$! +$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'DESTEST.EXE - + 'OBJ_DIR'DESTEST.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION +$! +$! All Done, Time To Return. +$! +$ RETURN +$! +$! Compile The SPEED Program. +$! +$ SPEED: +$! +$! Check To See If We Have The Proper Libraries. +$! +$ GOSUB LIB_CHECK +$! +$! Check To See If We Have A Linker Option File. +$! +$ GOSUB CHECK_OPT_FILE +$! +$! Check To See If The File We Want To Compile Actually Exists. +$! +$ IF (F$SEARCH("SYS$DISK:[]SPEED.C").EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File SPEED.C Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ EXIT +$! +$! End The SPEED.C File Check. +$! +$ ENDIF +$! +$! Tell The User What We Are Building. +$! +$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"SPEED.EXE" +$! +$! Compile The SPEED Program. +$! +$ CC/OBJECT='OBJ_DIR'SPEED.OBJ SYS$DISK:[]SPEED.C +$! +$! Link The SPEED Program. +$! +$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'SPEED.EXE - + 'OBJ_DIR'SPEED.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION +$! +$! All Done, Time To Return. +$! +$ RETURN +$! +$! Compile The RPW Program. +$! +$ RPW: +$! +$! Check To See If We Have The Proper Libraries. +$! +$ GOSUB LIB_CHECK +$! +$! Check To See If We Have A Linker Option File. +$! +$ GOSUB CHECK_OPT_FILE +$! +$! Check To See If The File We Want To Compile Actually Exists. +$! +$ IF (F$SEARCH("SYS$DISK:[]RPW.C").EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File RPW.C Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ EXIT +$! +$! End The RPW.C File Check. +$! +$ ENDIF +$! +$! Tell The User What We Are Building. +$! +$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"RPW.EXE" +$! +$! Compile The RPW Program. +$! +$ CC/OBJECT='OBJ_DIR'RPW.OBJ SYS$DISK:[]RPW.C +$! +$! Link The RPW Program. +$! +$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'RPW.EXE - + 'OBJ_DIR'RPW.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION +$! +$! All Done, Time To Return. +$! +$ RETURN +$! +$! Compile The DES Program. +$! +$ DES: +$! +$! Check To See If We Have The Proper Libraries. +$! +$ GOSUB LIB_CHECK +$! +$! Check To See If We Have A Linker Option File. +$! +$ GOSUB CHECK_OPT_FILE +$! +$! Check To See If The File We Want To Compile Actually Exists. +$! +$ IF (F$SEARCH("SYS$DISK:[]DES.C").EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File DES.C Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ EXIT +$! +$! End The DES.C File Check. +$! +$ ENDIF +$! +$! Tell The User What We Are Building. +$! +$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DES.EXE" +$! +$! Compile The DES Program. +$! +$ CC/OBJECT='OBJ_DIR'DES.OBJ SYS$DISK:[]DES.C +$! +$! Link The DES Program. +$! +$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'DES.EXE - + 'OBJ_DIR'DES.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION +$! +$! All Done, Time To Return. +$! +$ RETURN +$! +$! Compile The DES_OPTS Program. +$! +$ DES_OPTS: +$! +$! Check To See If We Have The Proper Libraries. +$! +$ GOSUB LIB_CHECK +$! +$! Check To See If We Have A Linker Option File. +$! +$ GOSUB CHECK_OPT_FILE +$! +$! Check To See If The File We Want To Compile Actually Exists. +$! +$ IF (F$SEARCH("SYS$DISK:[]DES_OPTS.C").EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File DES_OPTS.C Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ EXIT +$! +$! End The DES_OPTS.C File Check. +$! +$ ENDIF +$! +$! Tell The User What We Are Building. +$! +$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DES_OPTS.EXE" +$! +$! Compile The DES_OPTS Program. +$! +$ CC/OBJECT='OBJ_DIR'DES_OPTS.OBJ SYS$DISK:[]DES_OPTS.C +$! +$! Link The DES_OPTS Program. +$! +$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS/EXE='EXE_DIR'DES_OPTS.EXE - + 'OBJ_DIR'DES_OPTS.OBJ,'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION +$! +$! All Done, Time To Return. +$! +$ RETURN +$ EXIT +$! +$! Check For The Link Option FIle. +$! +$ CHECK_OPT_FILE: +$! +$! Check To See If We Need To Make A VAX C Option File. +$! +$ IF (COMPILER.EQS."VAXC") +$ THEN +$! +$! Check To See If We Already Have A VAX C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! We Need A VAX C Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable VAX C Runtime Library. +! +SYS$SHARE:VAXCRTL.EXE/SHARE +$EOD +$! +$! End The Option File Check. +$! +$ ENDIF +$! +$! End The VAXC Check. +$! +$ ENDIF +$! +$! Check To See If We Need A GNU C Option File. +$! +$ IF (COMPILER.EQS."GNUC") +$ THEN +$! +$! Check To See If We Already Have A GNU C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! We Need A GNU C Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable C Runtime Library. +! +GNU_CC:[000000]GCCLIB/LIBRARY +SYS$SHARE:VAXCRTL/SHARE +$EOD +$! +$! End The Option File Check. +$! +$ ENDIF +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Check To See If We Need A DEC C Option File. +$! +$ IF (COMPILER.EQS."DECC") +$ THEN +$! +$! Check To See If We Already Have A DEC C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! Figure Out If We Need An AXP Or A VAX Linker Option File. +$! +$ IF (F$GETSYI("CPU").LT.128) +$ THEN +$! +$! We Need A DEC C Linker Option File For VAX. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable DEC C Runtime Library. +! +SYS$SHARE:DECC$SHR.EXE/SHARE +$EOD +$! +$! Else... +$! +$ ELSE +$! +$! Create The AXP Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File For AXP To Link Agianst +! The Sharable C Runtime Library. +! +SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE +SYS$SHARE:CMA$OPEN_RTL/SHARE +$EOD +$! +$! End The VAX/AXP DEC C Option File Check. +$! +$ ENDIF +$! +$! End The Option File Search. +$! +$ ENDIF +$! +$! End The DEC C Check. +$! +$ ENDIF +$! +$! Tell The User What Linker Option File We Are Using. +$! +$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." +$! +$! Time To RETURN. +$! +$ RETURN +$! +$! Library Check. +$! +$ LIB_CHECK: +$! +$! Look For The Library LIBDES.OLB. +$! +$ IF (F$SEARCH(LIB_NAME).EQS."") +$ THEN +$! +$! Tell The User We Can't Find The [.xxx.CRYPTO.DES]LIBDES.OLB Library. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Can't Find The Library ",LIB_NAME,"." +$ WRITE SYS$OUTPUT "We Can't Link Without It." +$ WRITE SYS$OUTPUT "" +$! +$! Since We Can't Link Without It, Exit. +$! +$ EXIT +$ ENDIF +$! +$! Time To Return. +$! +$ RETURN +$! +$! Check The User's Options. +$! +$ CHECK_OPTIONS: +$! +$! Check To See If We Are To "Just Build Everything". +$! +$ IF (P1.EQS."ALL") +$ THEN +$! +$! P1 Is "ALL", So Build Everything. +$! +$ BUILDALL = "TRUE" +$! +$! Else... +$! +$ ELSE +$! +$! Else, Check To See If P1 Has A Valid Arguement. +$! +$ 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. +$! +$ BUILDALL = P1 +$! +$! Else... +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ 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 " 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." +$ WRITE SYS$OUTPUT " RPW : To Compile Just The [.xxx.EXE.CRYPTO.DES]RPW.EXE Program." +$ WRITE SYS$OUTPUT " DES : To Compile Just The [.xxx.EXE.CRYPTO.DES]DES.EXE Program." +$ WRITE SYS$OUTPUT " DES_OPTS : To Compile Just The [.xxx.EXE.CRYTPO.DES]DES_OPTS.EXE Program." +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " Where 'xxx' Stands For: " +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " AXP : Alpha Architecture." +$ WRITE SYS$OUTPUT " VAX : VAX Architecture." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P1 Check. +$! +$ ENDIF +$! +$! Check To See If We Are To Compile Without Debugger Information. +$! +$ IF (P2.EQS."NODEBUG") +$ THEN +$! +$! P2 Is Blank, 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." +$! +$! Else... +$! +$ ELSE +$! +$! Check To See If We Are To Compile With Debugger Information. +$! +$ IF (P2.EQS."DEBUG") +$ THEN +$! +$! Compile With Debugger Information. +$! +$ DEBUGGER = "DEBUG" +$ TRACEBACK = "TRACEBACK" +$ GCC_OPTIMIZE = "NOOPTIMIZE" +$ CC_OPTIMIZE = "NOOPTIMIZE" +$ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile." +$ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." +$! +$! Else... +$! +$ ELSE +$! +$! Tell The User Entered An Invalid Option.. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information." +$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P2 Check. +$! +$ ENDIF +$! +$! Special Threads For OpenVMS v7.1 Or Later. +$! +$! Written By: Richard Levitte +$! richard@levitte.org +$! +$! +$! Check To See If We Have A Option For P4. +$! +$ IF (P4.EQS."") +$ THEN +$! +$! Get The Version Of VMS We Are Using. +$! +$ ISSEVEN := "" +$ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION"))) +$ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP)) +$! +$! Check To See If The VMS Version Is v7.1 Or Later. +$! +$ IF (TMP.GE.71) +$ THEN +$! +$! We Have OpenVMS v7.1 Or Later, So Use The Special Threads. +$! +$ ISSEVEN := ,PTHREAD_USE_D4 +$! +$! End The VMS Version Check. +$! +$ ENDIF +$! +$! End The P4 Check. +$! +$ ENDIF +$! +$! Check To See If P3 Is Blank. +$! +$ IF (P3.EQS."") +$ THEN +$! +$! O.K., The User Didn't Specify A Compiler, Let's Try To +$! Find Out Which One To Use. +$! +$! Check To See If We Have GNU C. +$! +$ IF (F$TRNLNM("GNU_CC").NES."") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ P3 = "GNUC" +$! +$! Else... +$! +$ ELSE +$! +$! Check To See If We Have VAXC Or DECC. +$! +$ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ P3 = "DECC" +$! +$! Else... +$! +$ ELSE +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ P3 = "VAXC" +$! +$! End The VAXC Compiler Check. +$! +$ ENDIF +$! +$! End The DECC & VAXC Compiler Check. +$! +$ ENDIF +$! +$! End The Compiler Check. +$! +$ ENDIF +$! +$! Set Up Initial CC Definitions, Possibly With User Ones +$! +$ CCDEFS = "VMS=1" +$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS +$ CCEXTRAFLAGS = "" +$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS +$ CCDISABLEWARNINGS = "" +$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - + CCDISABLEWARNINGS = USER_CCDISABLEWARNINGS +$! +$! Check To See If The User Entered A Valid Paramter. +$! +$ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC") +$ THEN +$! +$! Check To See If The User Wanted DECC. +$! +$ IF (P3.EQS."DECC") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ COMPILER = "DECC" +$! +$! Tell The User We Are Using DECC. +$! +$ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." +$! +$! Use DECC... +$! +$ 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" + - + "/NOLIST/PREFIX=ALL" + CCEXTRAFLAGS +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT" +$! +$! End DECC Check. +$! +$ ENDIF +$! +$! Check To See If We Are To Use VAXC. +$! +$ IF (P3.EQS."VAXC") +$ THEN +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ COMPILER = "VAXC" +$! +$! Tell The User We Are Using VAX C. +$! +$ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler." +$! +$! Compile Using VAXC. +$! +$ CC = "CC" +$ IF ARCH.EQS."AXP" +$ THEN +$ WRITE SYS$OUTPUT "There is no VAX C on Alpha!" +$ EXIT +$ ENDIF +$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" +$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS +$ CCDEFS = """VAXC""," + CCDEFS +$! +$! Define <sys> As SYS$COMMON:[SYSLIB] +$! +$ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT" +$! +$! End VAXC Check +$! +$ ENDIF +$! +$! Check To See If We Are To Use GNU C. +$! +$ IF (P3.EQS."GNUC") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ COMPILER = "GNUC" +$! +$! Tell The User We Are Using GNUC. +$! +$ WRITE SYS$OUTPUT "Using GNU 'C' Compiler." +$! +$! Use GNU C... +$! +$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT" +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Set up default defines +$! +$ CCDEFS = """FLAT_INC=1""," + CCDEFS +$! +$! Finish up the definition of CC. +$! +$ IF COMPILER .EQS. "DECC" +$ THEN +$ IF CCDISABLEWARNINGS .EQS. "" +$ THEN +$ CC4DISABLEWARNINGS = "DOLLARID" +$ ELSE +$ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID" +$ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" +$ ENDIF +$ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))" +$ ELSE +$ CCDISABLEWARNINGS = "" +$ CC4DISABLEWARNINGS = "" +$ ENDIF +$ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS +$! +$! Show user the result +$! +$ WRITE SYS$OUTPUT "Main Compiling Command: ",CC +$! +$! Else The User Entered An Invalid Arguement. +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C." +$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C." +$ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The P3 Check. +$! +$ ENDIF +$! +$! Time To RETURN... +$! +$ RETURN diff --git a/crypto/des/des.c b/crypto/des/des.c index 3aa34f4598..02c4828c5c 100644 --- a/crypto/des/des.c +++ b/crypto/des/des.c @@ -59,7 +59,19 @@ #include <stdio.h> #include <stdlib.h> #ifndef MSDOS +#ifndef VMS #include <unistd.h> +#else /* VMS */ +#ifdef __DECC +#include <unistd.h> +#if __CRTL_VER < 70000000 +#define RAND +#endif +#else /* not __DECC */ +#include <math.h> +#define RAND +#endif /* __DECC */ +#endif /* VMS */ #else #include <io.h> #define RAND diff --git a/crypto/des/des.h b/crypto/des/des.h index 392d8bbea0..55ab48db3c 100644 --- a/crypto/des/des.h +++ b/crypto/des/des.h @@ -69,6 +69,12 @@ extern "C" { #include <stdio.h> #include <openssl/opensslconf.h> /* DES_LONG */ +#include <openssl/e_os.h> /* EXTERN */ + +#ifdef VMS +#undef des_init_random_number_generator +#define des_init_random_number_generator des_init_random_num_generator +#endif typedef unsigned char des_cblock[8]; typedef unsigned char *des_cblocks; /* Unfortunately there's no way to say that @@ -132,9 +138,9 @@ typedef des_key_schedule bit_64; #define des_fixup_key_parity des_set_odd_parity #define des_check_key_parity check_parity -extern int des_check_key; /* defaults to false */ -extern int des_rw_mode; /* defaults to DES_PCBC_MODE */ -extern int des_set_weak_key_flag; /* set the weak key flag */ +EXTERN int des_check_key; /* defaults to false */ +EXTERN int des_rw_mode; /* defaults to DES_PCBC_MODE */ +EXTERN int des_set_weak_key_flag; /* set the weak key flag */ const char *des_options(void); void des_ecb3_encrypt(const des_cblock input, des_cblock output, diff --git a/crypto/des/des_locl.h b/crypto/des/des_locl.h index e4b4d6d9e3..7b086062c5 100644 --- a/crypto/des/des_locl.h +++ b/crypto/des/des_locl.h @@ -68,8 +68,10 @@ #include <stdio.h> #include <stdlib.h> #ifndef MSDOS +#if !defined(VMS) || defined(__DECC) #include <unistd.h> #endif +#endif #include <openssl/des.h> #include <openssl/opensslconf.h> @@ -84,6 +86,17 @@ #endif #endif +#ifdef VMS +#ifndef __DECC +#include <math.h> +#define RAND +#else +#if __CRTL_VER < 70000000 +#define RAND +#endif +#endif +#endif + #if defined(__STDC__) || defined(VMS) || defined(M_XENIX) || defined(MSDOS) #include <string.h> #endif @@ -418,7 +431,7 @@ PERM_OP(l,r,tt, 4,0x0f0f0f0fL); \ } -extern const DES_LONG des_SPtrans[8][64]; +EXTERN const DES_LONG des_SPtrans[8][64]; void fcrypt_body(DES_LONG *out,des_key_schedule ks, DES_LONG Eswap0, DES_LONG Eswap1); diff --git a/crypto/des/des_opts.c b/crypto/des/des_opts.c index 879b9a9364..524e4174f7 100644 --- a/crypto/des/des_opts.c +++ b/crypto/des/des_opts.c @@ -59,7 +59,7 @@ /* define PART1, PART2, PART3 or PART4 to build only with a few of the options. * This is for machines with 64k code segment size restrictions. */ -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif @@ -71,7 +71,6 @@ extern void exit(); #endif #include <signal.h> -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -79,19 +78,20 @@ extern void exit(); #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif + #if defined(sun) || defined(__ultrix) #define _POSIX_SOURCE #include <limits.h> diff --git a/crypto/des/des_ver.h b/crypto/des/des_ver.h index 7041a9271d..0bc1a3da7f 100644 --- a/crypto/des/des_ver.h +++ b/crypto/des/des_ver.h @@ -56,5 +56,5 @@ * [including the GNU Public Licence.] */ -extern char *DES_version; /* SSLeay version string */ -extern char *libdes_version; /* old libdes version string */ +EXTERN char *DES_version; /* SSLeay version string */ +EXTERN char *libdes_version; /* old libdes version string */ diff --git a/crypto/des/destest.c b/crypto/des/destest.c index 107635fcec..e6489ae9f5 100644 --- a/crypto/des/destest.c +++ b/crypto/des/destest.c @@ -65,7 +65,9 @@ #include <stdio.h> #include <stdlib.h> #ifndef MSDOS +#if !defined(VMS) || defined(__DECC) #include <unistd.h> +#endif /* VMS */ #else #include <io.h> #endif diff --git a/crypto/des/ecb_enc.c b/crypto/des/ecb_enc.c index d664bdeebb..199d87289a 100644 --- a/crypto/des/ecb_enc.c +++ b/crypto/des/ecb_enc.c @@ -60,8 +60,8 @@ #include "spr.h" #include <openssl/opensslv.h> -const char *libdes_version="libdes v 3.24 - 20-Apr-1996 - eay"; -const char *DES_version="DES" OPENSSL_VERSION_PTEXT; +GLOBAL const char *libdes_version="libdes v 3.24 - 20-Apr-1996 - eay"; +GLOBAL const char *DES_version="DES" OPENSSL_VERSION_PTEXT; const char *des_options(void) { diff --git a/crypto/des/enc_read.c b/crypto/des/enc_read.c index 5e256d03c2..eaf72d0d0a 100644 --- a/crypto/des/enc_read.c +++ b/crypto/des/enc_read.c @@ -63,7 +63,7 @@ /* This has some uglies in it but it works - even over sockets. */ /*extern int errno;*/ -int des_rw_mode=DES_PCBC_MODE; +GLOBAL int des_rw_mode=DES_PCBC_MODE; /* diff --git a/crypto/des/read_pwd.c b/crypto/des/read_pwd.c index 24e814ec76..70a15aea7f 100644 --- a/crypto/des/read_pwd.c +++ b/crypto/des/read_pwd.c @@ -86,6 +86,13 @@ #include <setjmp.h> #include <errno.h> +#ifdef VMS /* prototypes for sys$whatever */ +#include <starlet.h> +#ifdef __DECC +#pragma message disable DOLLARID +#endif +#endif + #ifdef WIN_CONSOLE_BUG #include <windows.h> #include <wincon.h> @@ -275,10 +282,10 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt, memcpy(&(tty_new),&(tty_orig),sizeof(tty_orig)); #endif #ifdef VMS - status = SYS$ASSIGN(&terminal,&channel,0,0); + status = sys$assign(&terminal,&channel,0,0); if (status != SS$_NORMAL) return(-1); - status=SYS$QIOW(0,channel,IO$_SENSEMODE,&iosb,0,0,tty_orig,12,0,0,0,0); + status=sys$qiow(0,channel,IO$_SENSEMODE,&iosb,0,0,tty_orig,12,0,0,0,0); if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL)) return(-1); #endif @@ -298,7 +305,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt, tty_new[0] = tty_orig[0]; tty_new[1] = tty_orig[1] | TT$M_NOECHO; tty_new[2] = tty_orig[2]; - status = SYS$QIOW(0,channel,IO$_SETMODE,&iosb,0,0,tty_new,12,0,0,0,0); + status = sys$qiow(0,channel,IO$_SETMODE,&iosb,0,0,tty_new,12,0,0,0,0); if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL)) return(-1); #endif @@ -344,19 +351,19 @@ error: perror("fgets(tty)"); #endif /* What can we do if there is an error? */ -#if defined(TTY_set) && !defined(VMS) +#if defined(TTY_set) && !defined(VMS) if (ps >= 2) TTY_set(fileno(tty),&tty_orig); #endif #ifdef VMS if (ps >= 2) - status = SYS$QIOW(0,channel,IO$_SETMODE,&iosb,0,0 + status = sys$qiow(0,channel,IO$_SETMODE,&iosb,0,0 ,tty_orig,12,0,0,0,0); #endif if (ps >= 1) popsig(); if (stdin != tty) fclose(tty); #ifdef VMS - status = SYS$DASSGN(channel); + status = sys$dassgn(channel); #endif return(!ok); } diff --git a/crypto/des/set_key.c b/crypto/des/set_key.c index 3ca6dde699..2e9c1169d5 100644 --- a/crypto/des/set_key.c +++ b/crypto/des/set_key.c @@ -68,7 +68,7 @@ #include "sk.h" static int check_parity(const des_cblock key); -int des_check_key=0; +GLOBAL int des_check_key=0; void des_set_odd_parity(des_cblock key) { diff --git a/crypto/des/speed.c b/crypto/des/speed.c index 5b8a8d7b0c..4aeced9612 100644 --- a/crypto/des/speed.c +++ b/crypto/des/speed.c @@ -59,7 +59,7 @@ /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif @@ -71,7 +71,6 @@ extern int exit(); #endif #include <signal.h> -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -79,15 +78,15 @@ extern int exit(); #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif diff --git a/crypto/des/spr.h b/crypto/des/spr.h index 81813f9f7a..7c10242b08 100644 --- a/crypto/des/spr.h +++ b/crypto/des/spr.h @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ -const DES_LONG des_SPtrans[8][64]={ +GLOBAL const DES_LONG des_SPtrans[8][64]={ { /* nibble 0 */ 0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L, diff --git a/crypto/des/str2key.c b/crypto/des/str2key.c index 7130626c0f..76b002a0f7 100644 --- a/crypto/des/str2key.c +++ b/crypto/des/str2key.c @@ -58,7 +58,7 @@ #include "des_locl.h" -extern int des_check_key; +EXTERN int des_check_key; void des_string_to_key(const char *str, des_cblock key) { diff --git a/crypto/des/vms.com b/crypto/des/vms.com deleted file mode 100755 index 62ca1fbda4..0000000000 --- a/crypto/des/vms.com +++ /dev/null @@ -1,90 +0,0 @@ -$! --- VMS.com --- -$! -$ GoSub defines -$ GoSub linker_options -$ If (P1 .nes. "") -$ Then -$ GoSub 'P1' -$ Else -$ GoSub lib -$ GoSub destest -$ GoSub rpw -$ GoSub speed -$ GoSub des -$ EndIF -$! -$ Exit -$! -$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -$! -$DEFINES: -$ OPT_FILE := "VAX_LINKER_OPTIONS.OPT" -$! -$ CC_OPTS := "/NODebug/OPTimize/NOWarn" -$! -$ LINK_OPTS := "/NODebug/NOTraceback/Contiguous" -$! -$ OBJS = "cbc_cksm.obj,cbc_enc.obj,ecb_enc.obj,pcbc_enc.obj," + - - "qud_cksm.obj,rand_key.obj,read_pwd.obj,set_key.obj," + - - "str2key.obj,enc_read.obj,enc_writ.obj,fcrypt.obj," + - - "cfb_enc.obj,ecb3_enc.obj,ofb_enc.obj" - - -$! -$ LIBDES = "cbc_cksm.c,cbc_enc.c,ecb_enc.c,enc_read.c," + - - "enc_writ.c,pcbc_enc.c,qud_cksm.c,rand_key.c," + - - "read_pwd.c,set_key.c,str2key.c,fcrypt.c," + - - "cfb_enc.c,ecb3_enc.c,ofb_enc.c" -$ Return -$! -$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -$! -$LINKER_OPTIONS: -$ If (f$search(OPT_FILE) .eqs. "") -$ Then -$ Create 'OPT_FILE' -$DECK -! Default system options file to link against the sharable C runtime library -! -Sys$Share:VAXcRTL.exe/Share -$EOD -$ EndIF -$ Return -$! -$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -$! -$LIB: -$ CC 'CC_OPTS' 'LIBDES' -$ If (f$search("LIBDES.OLB") .nes. "") -$ Then Library /Object /Replace libdes 'OBJS' -$ Else Library /Create /Object libdes 'OBJS' -$ EndIF -$ Return -$! -$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -$! -$DESTEST: -$ CC 'CC_OPTS' destest -$ Link 'link_opts' /Exec=destest destest.obj,libdes/LIBRARY,'opt_file'/Option -$ Return -$! -$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -$! -$RPW: -$ CC 'CC_OPTS' rpw -$ Link 'link_opts' /Exec=rpw rpw.obj,libdes/LIBRARY,'opt_file'/Option -$ Return -$! -$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -$! -$SPEED: -$ CC 'CC_OPTS' speed -$ Link 'link_opts' /Exec=speed speed.obj,libdes/LIBRARY,'opt_file'/Option -$ Return -$! -$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -$! -$DES: -$ CC 'CC_OPTS' des -$ Link 'link_opts' /Exec=des des.obj,libdes/LIBRARY,'opt_file'/Option -$ Return diff --git a/crypto/idea/idea_spd.c b/crypto/idea/idea_spd.c index 661626f8d9..9847da9c61 100644 --- a/crypto/idea/idea_spd.c +++ b/crypto/idea/idea_spd.c @@ -59,7 +59,7 @@ /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif @@ -71,7 +71,6 @@ extern int exit(); #endif #include <signal.h> -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -79,15 +78,15 @@ extern int exit(); #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif diff --git a/crypto/install.com b/crypto/install.com new file mode 100644 index 0000000000..4737a560b5 --- /dev/null +++ b/crypto/install.com @@ -0,0 +1,128 @@ +$! 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 +$ +$ 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_SSLVLIB WRK_SSLROOT:[VAX_LIB] +$ DEFINE/NOLOG WRK_SSLALIB WRK_SSLROOT:[ALPHA_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_SSLVLIB:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLVLIB: +$ IF F$PARSE("WRK_SSLALIB:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLALIB: +$ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLINCLUDE: +$ +$ SDIRS := ,MD2,MD5,SHA,MDC2,HMAC,RIPEMD,- + DES,RC2,RC4,RC5,IDEA,BF,CAST,- + BN,RSA,DSA,DH,- + BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,- + EVP,ASN1,PEM,X509,X509V3,- + CONF,TXT_DB,PKCS7,PKCS12,COMP +$ EXHEADER_ := crypto.h,tmdiff.h,opensslv.h,opensslconf.h +$ EXHEADER_MD2 := md2.h +$ EXHEADER_MD5 := md5.h +$ EXHEADER_SHA := sha.h +$ EXHEADER_MDC2 := mdc2.h +$ EXHEADER_HMAC := hmac.h +$ EXHEADER_RIPEMD := ripemd.h +$ EXHEADER_DES := des.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_BN := bn.h +$ EXHEADER_RSA := rsa.h +$ EXHEADER_DSA := dsa.h +$ EXHEADER_DH := dh.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_OBJECTS := objects.h +$ EXHEADER_EVP := evp.h +$ EXHEADER_ASN1 := asn1.h,asn1_mac.h +$ EXHEADER_PEM := pem.h,pem2.h +$ EXHEADER_X509 := x509.h,x509_vfy.h +$ EXHEADER_X509V3 := x509v3.h +$ EXHEADER_CONF := conf.h +$ EXHEADER_TXT_DB := txt_db.h +$ EXHEADER_PKCS7 := pkcs7.h +$ EXHEADER_PKCS12 := pkcs12.h +$ EXHEADER_COMP := comp.h +$ LIBS := LIBCRYPTO +$ +$ VEXE_DIR := [-.VAX.EXE.CRYPTO] +$ AEXE_DIR := [-.AXP.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 +$ 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(VEXE_DIR+E+".OLB") .NES. "" +$ THEN +$ COPY 'VEXE_DIR''E'.OLB WRK_SSLVLIB:'E'.OLB/log +$ SET FILE/PROT=W:RE WRK_SSLVLIB:'E'.OLB +$ ENDIF +$ ! Preparing for the time when we have shareable images +$ IF F$SEARCH(VEXE_DIR+E+".EXE") .NES. "" +$ THEN +$ COPY 'VEXE_DIR''E'.EXE WRK_SSLVLIB:'E'.EXE/log +$ SET FILE/PROT=W:RE WRK_SSLVLIB:'E'.EXE +$ ENDIF +$ IF F$SEARCH(AEXE_DIR+E+".OLB") .NES. "" +$ THEN +$ COPY 'AEXE_DIR''E'.OLB WRK_SSLALIB:'E'.OLB/log +$ SET FILE/PROT=W:RE WRK_SSLALIB:'E'.OLB +$ ENDIF +$ ! Preparing for the time when we have shareable images +$ IF F$SEARCH(AEXE_DIR+E+".EXE") .NES. "" +$ THEN +$ COPY 'AEXE_DIR''E'.EXE WRK_SSLALIB:'E'.EXE/log +$ SET FILE/PROT=W:RE WRK_SSLALIB:'E'.EXE +$ ENDIF +$ SET ON +$ GOTO LOOP_LIB +$ LOOP_LIB_END: +$ +$ EXIT diff --git a/crypto/libvms.com b/crypto/libvms.com deleted file mode 100755 index 44f90c65b0..0000000000 --- a/crypto/libvms.com +++ /dev/null @@ -1,31 +0,0 @@ -$! -$! Compile crypto.c as several subset modules and insert in crypto-xxx.olb. -$! If P1 is specifed, it specifies alternate list of subsets to compile. -$! -$ libname = "CRYPTO-AXP.OLB" -$ subset_list = "LIB,ASN1,BN,BUFFER,CONF,DES,DH,DSA,ERROR,EVP,IDEA,LHASH,MD," + - - "METH,OBJECTS,PEM,RAND,RC,RSA,SHA,STACK,TXT_DB,X509" -$ if p1 .nes. "" then subset_list = p1 -$! -$ if f$getsyi("CPU") .lt. 128 then libname = "CRYPTO-VAX.OLB" -$ if f$search(libname) .eqs. "" then library/create/object/log 'libname' -$! -$ cc = "cc/include=[-.include]/prefix=all" + P2 -$! -$ i = 0 -$ next_subset: -$ subset = f$element(i,",",subset_list) -$ if subset .eqs. "," then goto done -$ i = i + 1 -$ create crypto_'subset'.subset -#include "crypto.c" -$ ofile = "sys$disk:[]crypto_" + subset + ".obj" -$ on warning then goto next_subset -$ write sys$output "Compiling ", ofile -$ cc /object='ofile' crypto_'subset'.subset - - /define=(CRYPTO_SUBSET,CRYPTO_'subset'_SUBSET) -$ library/replace/log 'libname'/module=CRYPTO_'subset' 'ofile' -$ goto next_subset -$! -$ done: -$ exit diff --git a/crypto/opensslconf.h.in b/crypto/opensslconf.h.in index 4e28f3e666..5c9ee256e1 100644 --- a/crypto/opensslconf.h.in +++ b/crypto/opensslconf.h.in @@ -4,9 +4,11 @@ /* Generate 80386 code? */ #undef I386_ONLY +#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) #define OPENSSLDIR "/usr/local/ssl" #endif +#endif #if defined(HEADER_IDEA_H) && !defined(IDEA_INT) #define IDEA_INT unsigned int diff --git a/crypto/pem/pem.h b/crypto/pem/pem.h index effa9545a4..effba048ec 100644 --- a/crypto/pem/pem.h +++ b/crypto/pem/pem.h @@ -368,6 +368,16 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str); #ifndef SSLEAY_MACROS +#ifdef VMS +/* Too long names need to be abbreviated to at most 31 characters */ +#undef PEM_write_NETSCAPE_CERT_SEQUENCE +#define PEM_write_NETSCAPE_CERT_SEQUENCE PEM_write_NETSCAPE_CERT_SEQ +#undef PEM_read_bio_NETSCAPE_CERT_SEQUENCE +#define PEM_read_bio_NETSCAPE_CERT_SEQUENCE PEM_read_bio_NETSCAPE_CERT_SEQ +#undef PEM_write_bio_NETSCAPE_CERT_SEQUENCE +#define PEM_write_bio_NETSCAPE_CERT_SEQUENCE PEM_write_bio_NETSCAPE_CERT_SEQ +#endif + #ifndef WIN16 X509 *PEM_read_X509(FILE *fp,X509 **x,int (*cb)()); X509_REQ *PEM_read_X509_REQ(FILE *fp,X509_REQ **x,int (*cb)()); diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index 4c7648728c..f3d93ad321 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -113,7 +114,17 @@ int RAND_write_file(const char *file) FILE *out; int n; - out=fopen(file,"wb"); + /* Under VMS, fopen(file, "wb") will craete a new version of the + same file. This is not good, so let's try updating an existing + one, and create file only if it doesn't already exist. This + should be completely harmless on system that have no file + versions. -- Richard Levitte */ + out=fopen(file,"rb+"); + if (out == NULL && errno == ENOENT) + { + errno = 0; + out=fopen(file,"wb"); + } if (out == NULL) goto err; chmod(file,0600); n=RAND_DATA; @@ -156,7 +167,9 @@ char *RAND_file_name(char *buf, int size) if (((int)(strlen(s)+strlen(RFILE)+2)) > size) return(RFILE); strcpy(buf,s); +#ifndef VMS strcat(buf,"/"); +#endif strcat(buf,RFILE); ret=buf; } diff --git a/crypto/rc2/rc2speed.c b/crypto/rc2/rc2speed.c index 69a76af65b..f74375258f 100644 --- a/crypto/rc2/rc2speed.c +++ b/crypto/rc2/rc2speed.c @@ -59,7 +59,7 @@ /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif @@ -71,7 +71,6 @@ extern int exit(); #endif #include <signal.h> -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -79,15 +78,15 @@ extern int exit(); #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif diff --git a/crypto/rc4/rc4speed.c b/crypto/rc4/rc4speed.c index e1365170ab..5f77fbc241 100644 --- a/crypto/rc4/rc4speed.c +++ b/crypto/rc4/rc4speed.c @@ -59,7 +59,7 @@ /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif @@ -71,7 +71,6 @@ extern int exit(); #endif #include <signal.h> -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -79,15 +78,15 @@ extern int exit(); #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif diff --git a/crypto/rc5/rc5speed.c b/crypto/rc5/rc5speed.c index d8ebee6012..efca9c0e5a 100644 --- a/crypto/rc5/rc5speed.c +++ b/crypto/rc5/rc5speed.c @@ -59,7 +59,7 @@ /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ -#ifndef MSDOS +#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) #define TIMES #endif @@ -71,7 +71,6 @@ extern int exit(); #endif #include <signal.h> -#ifndef VMS #ifndef _IRIX #include <time.h> #endif @@ -79,15 +78,15 @@ extern int exit(); #include <sys/types.h> #include <sys/times.h> #endif -#else /* VMS */ -#include <types.h> -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include <sys/timeb.h> #endif diff --git a/crypto/tmdiff.c b/crypto/tmdiff.c index ecc0006bdb..60fea0dab1 100644 --- a/crypto/tmdiff.c +++ b/crypto/tmdiff.c @@ -67,27 +67,27 @@ #ifndef MSDOS # ifndef WIN32 -# define TIMES +# if !defined(VMS) || defined(__DECC) +# define TIMES +# endif # endif #endif -#ifndef VMS -# ifndef _IRIX -# include <time.h> -# endif -# ifdef TIMES -# include <sys/types.h> -# include <sys/times.h> -# endif -#else /* VMS */ -# include <types.h> - struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } -#endif /* VMS */ +#ifndef _IRIX +# include <time.h> +#endif +#ifdef TIMES +# include <sys/types.h> +# include <sys/times.h> +#endif + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(VMS) && defined(__DECC) && !defined(__TMS) +#undef TIMES +#endif #if defined(sun) || defined(__ultrix) #define _POSIX_SOURCE diff --git a/crypto/x509/x509.h b/crypto/x509/x509.h index 0402ae769c..79828daab4 100644 --- a/crypto/x509/x509.h +++ b/crypto/x509/x509.h @@ -63,6 +63,11 @@ extern "C" { #endif +#ifdef VMS +#undef X509_REVOKED_get_ext_by_critical +#define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic +#endif + #include <openssl/stack.h> #include <openssl/asn1.h> #include <openssl/safestack.h> diff --git a/crypto/x509/x509_vfy.h b/crypto/x509/x509_vfy.h index faacb01fb8..7b447c99b7 100644 --- a/crypto/x509/x509_vfy.h +++ b/crypto/x509/x509_vfy.h @@ -259,6 +259,21 @@ struct x509_store_state_st /* X509_STORE_CTX */ /* The application is not happy */ #define X509_V_ERR_APPLICATION_VERIFICATION 50 + /* These functions are being redefined in another directory, + and clash when the linker is case-insensitive, so let's + hide them a little, by giving them an extra 'o' at the + beginning of the name... */ +#ifdef VMS +#undef X509v3_cleanup_extensions +#define X509v3_cleanup_extensions oX509v3_cleanup_extensions +#undef X509v3_add_extension +#define X509v3_add_extension oX509v3_add_extension +#undef X509v3_add_netscape_extensions +#define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions +#undef X509v3_add_standard_extensions +#define X509v3_add_standard_extensions oX509v3_add_standard_extensions +#endif + #ifdef HEADER_LHASH_H X509_OBJECT *X509_OBJECT_retrieve_by_subject(LHASH *h,int type,X509_NAME *name); #endif @@ -192,27 +192,68 @@ extern "C" { #else /* The non-microsoft world world */ +# if defined(__VMS) && !defined(VMS) +# define VMS 1 +# endif + # ifdef VMS -# include <unixlib.h> + /* some programs don't include stdlib, so exit() and others give implicit + function warnings */ +# include <stdlib.h> +# if defined(__DECC) +# include <unistd.h> +# else +# include <unixlib.h> +# endif +# define OPENSSL_CONF "openssl.cnf" +# define SSLEAY_CONF OPENSSL_CONF +# define RFILE ".rnd" +# define LIST_SEPARATOR_CHAR ',' +# define NUL_DEV "NLA0:" + /* We need to do this, because DEC C converts exit code 0 to 1, but not 1 + to 0. We will convert 1 to 3! Also, add the inhibit message bit... */ +# ifndef MONOLITH +# define EXIT(n) do { int __VMS_EXIT = n; \ + if (__VMS_EXIT == 1) __VMS_EXIT = 3; \ + __VMS_EXIT |= 0x10000000; \ + exit(n); return(n); } while(0) +# else +# define EXIT(n) do { int __VMS_EXIT = n; \ + if (__VMS_EXIT == 1) __VMS_EXIT = 3; \ + __VMS_EXIT |= 0x10000000; \ + return(n); } while(0) +# endif # else # include <unistd.h> -# endif -# define OPENSSL_CONF "openssl.cnf" -# define SSLEAY_CONF OPENSSL_CONF -# define RFILE ".rnd" -# define LIST_SEPARATOR_CHAR ':' -# ifndef MONOLITH -# define EXIT(n) exit(n); return(n) -# else -# define EXIT(n) return(n) +# define OPENSSL_CONF "openssl.cnf" +# define SSLEAY_CONF OPENSSL_CONF +# define RFILE ".rnd" +# define LIST_SEPARATOR_CHAR ':' +# define NUL_DEV "/dev/null" +# ifndef MONOLITH +# define EXIT(n) exit(n); return(n) +# else +# define EXIT(n) return(n) +# endif # endif -# define NUL_DEV "/dev/null" # define SSLeay_getpid() getpid() #endif +/* Definitions of GLOBAL and EXTERN, to define and declare certain global + symbols that, with some compilers under VMS, have to be defined and + declared explicitely with globaldef and globalref. On other OS:es, + these macros are defined with something sensible. */ +#if defined(VMS) && !defined(__DECC) +#define EXTERN globalref +#define GLOBAL globaldef +#else +#define EXTERN extern +#define GLOBAL +#endif + /*************/ #ifdef USE_SOCKETS @@ -236,16 +277,21 @@ extern HINSTANCE _hInstance; # else +# include <sys/types.h> # ifndef VMS - /* unix world */ -# include <netdb.h> -# include <sys/types.h> +# include <sys/param.h> +# endif +# include <sys/time.h> /* Needed under linux for FD_XXX */ + +# include <netdb.h> +# if defined(VMS) && !defined(__DECC) +# include <socket.h> +# include <in.h> +# else # include <sys/socket.h> # ifdef FILIO_H # include <sys/filio.h> /* Added for FIONBIO under unixware */ # endif -# include <sys/param.h> -# include <sys/time.h> /* Needed under linux for FD_XXX */ # include <netinet/in.h> # endif @@ -261,11 +307,21 @@ extern HINSTANCE _hInstance; # if defined(sun) # include <sys/filio.h> # else -# include <sys/ioctl.h> +# ifndef VMS +# include <sys/ioctl.h> +# else + /* ioctl is only in VMS > 7.0 and when socketshr is not used */ +# if !defined(TCPIP_TYPE_SOCKETSHR) && defined(__VMS_VER) && (__VMS_VER > 70000000) +# include <sys/ioctl.h> +# endif +# endif # endif # ifdef VMS # include <unixio.h> +# if defined(TCPIP_TYPE_SOCKETSHR) +# include <socketshr.h> +# endif # endif # define SSLeay_Read(a,b,c) read((a),(b),(c)) diff --git a/install.com b/install.com new file mode 100644 index 0000000000..436b5bc095 --- /dev/null +++ b/install.com @@ -0,0 +1,88 @@ +$! 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 +$ +$ ARCH = "AXP" +$ IF F$GETSYI("CPU") .LT. 128 THEN ARCH = "VAX" +$ +$ 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_SSLVLIB WRK_SSLROOT:[VAX_LIB] +$ DEFINE/NOLOG WRK_SSLALIB WRK_SSLROOT:[ALPHA_LIB] +$ DEFINE/NOLOG WRK_SSLLIB WRK_SSLROOT:[LIB] +$ DEFINE/NOLOG WRK_SSLINCLUDE WRK_SSLROOT:[INCLUDE] +$ DEFINE/NOLOG WRK_SSLVEXE WRK_SSLROOT:[VAX_EXE] +$ DEFINE/NOLOG WRK_SSLAEXE WRK_SSLROOT:[ALPHA_EXE] +$ DEFINE/NOLOG WRK_SSLCERTS WRK_SSLROOT:[CERTS] +$ DEFINE/NOLOG WRK_SSLPRIVATE WRK_SSLROOT:[PRIVATE] +$ +$ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLROOT:[000000] +$ IF F$PARSE("WRK_SSLVEXE:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLVEXE: +$ IF F$PARSE("WRK_SSLAEXE:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLAEXE: +$ IF F$PARSE("WRK_SSLVLIB:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLVLIB: +$ IF F$PARSE("WRK_SSLALIB:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLALIB: +$ 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,RSAREF,APPS,VMS!,TEST,TOOLS +$ EXHEADER := e_os.h +$ +$ COPY 'EXHEADER' WRK_SSLINCLUDE: /LOG +$ +$ 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: +$ +$ DEASSIGN WRK_SSLROOT +$ DEASSIGN WRK_SSLVLIB +$ DEASSIGN WRK_SSLALIB +$ DEASSIGN WRK_SSLLIB +$ DEASSIGN WRK_SSLINCLUDE +$ DEASSIGN WRK_SSLVEXE +$ DEASSIGN WRK_SSLAEXE +$ DEASSIGN WRK_SSLCERTS +$ DEASSIGN WRK_SSLPRIVATE +$ +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " Installation done!" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " You might want to purge ",ROOT,"...]" +$ WRITE SYS$OUTPUT "" +$ +$ EXIT diff --git a/makevms.com b/makevms.com index 2f4792aa9a..30d53848ac 100755 --- a/makevms.com +++ b/makevms.com @@ -1,65 +1,898 @@ $! -$! This procedure compiles the SSL sources into 2 libraries: -$! [.CRYPTO]CRYPTO-xxx.OLB ! crypto-graphics subroutines -$! [.SSL]SSL-xxx.OLB ! SSL protocol. -$! -$! where 'xxx' specifies the machine achitecture: AXP or VAX -$! -$! To perform 1 sub-option, specify P1 as one of: -$! INCLUDE CRYPTO SSL SSL_TASK -$! -$! Requirements: -$! DECC 4.0 (may work with other versions) -$! OpenVMS 6.1 (may work with other versions) -$! -$ original_default = f$environment("DEFAULT") -$ proc = f$environment("PROCEDURE") -$ proc_dir = f$parse("1.1;1",proc) - "1.1;1" -$ set default 'proc_dir' -$! -$! Copy all include files to [.include] -$! -$ set noon -$ if P1 .nes. "" then goto do_'p1' -$ do_include -$ write sys$output "Rebuilding [.include] directory..." -$ delete [.include]*.h;* -$ backup [.*...]*.h; includes.bck/save -$ backup includes.bck/save [.include] -$ delete includes.bck; -$ if p1 .nes. "" then goto cleanup -$! -$! Build crypto lib. -$! -$ do_crypto: -$ write sys$Output "Making CRYPTO library" -$ set default [.crypto] -$ @libvms -$ set default [-] -$ if p1 .nes. "" then goto cleanup -$! -$! Build SSL lib. -$! -$ do_ssl: -$ write sys$output "Making SSL library" -$ set default [.ssl] -$ libname = "ssl-axp.olb" -$ if f$getsyi("CPU") .lt. 128 then libname = "ssl-vax.olb" -$ if f$search(libname) .eqs. "" then library/create/log 'libname' -$ cc ssl.c/include=[-.include]/prefix=all -$ library/replace 'libname' ssl.obj -$ set default [-] -$ if p1 .nes. "" then goto cleanup -$! -$ do_ssl_task: -$ write sys$output "Building SSL_TASK.EXE, the DECnet-based SSL engine" -$ set default [.ssl] -$ libname = "ssl-axp.olb" -$ if f$getsyi("CPU") .lt. 128 then libname = "ssl-vax.olb" -$ cc ssl_task/include=[-.include]/prefix=all -$ cryptolib = "[-.crypto]crypto-" + f$element(1,"-",libname) -$ link ssl_task,'libname'/library,'cryptolib'/library -$! -$ cleanup: -$ set default 'original_default' -$ write sys$output "Done" +$! MAKEVMS.COM +$! Original Author: UNKNOWN +$! Rewritten By: Robert Byer +$! Vice-President +$! A-Com Computing, Inc. +$! byer@mail.all-net.net +$! +$! Changes by Richard Levitte <richard@levitte.org> +$! +$! This procedure creates the SSL libraries of "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" +$! "[.xxx.EXE.SSL]LIBSSL.OLB" and if specified "[.xxx.EXE.RSAREF]LIBRSAGLUE.OLB". +$! The "xxx" denotes the machine architecture of AXP or VAX. +$! +$! This procedures accepts two command line options listed below. +$! +$! Specify one of the following build options for P1. +$! +$! ALL Just build "everything". +$! DATE Just build the "[.INCLUDE.OPENSSL]DATE.H" file. +$! SOFTLINKS Just fix the Unix soft links. +$! RSAREF Just build the "[.xxx.EXE.RSAREF]LIBRSAGLUE.OLB" library. +$! CRYPTO Just build the "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" library. +$! SSL Just build the "[.xxx.EXE.SSL]LIBSSL.OLB" library. +$! SSL_TASK Just build the "[.xxx.EXE.SSL]SSL_TASK.EXE" program. +$! TEST Just build the "[.xxx.EXE.TEST]" test programs for OpenSSL. +$! APPS Just build the "[.xxx.EXE.APPS]" application programs for OpenSSL. +$! +$! +$! Specify RSAREF as P2 to compile using the RSAREF Library. +$! If you specify NORSAREF, it will compile without using RSAREF. +$! (If in the United States, You Must Compile Using RSAREF). +$! +$! Note: The RSAREF libraries are NOT INCLUDED and you have to +$! download it from "ftp://ftp.rsa.com/rsaref". You have to +$! get the ".tar-Z" file as the ".zip" file dosen'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. +$! +$! Speficy DEBUG or NODEBUG as P3 to compile with or without debugging +$! information. +$! +$! Specify which compiler at P4 to try to compile under. +$! +$! VAXC For VAX C. +$! DECC For DEC C. +$! GNUC For GNU C. +$! LINK To only link the programs from existing object files. +$! +$! If you don't speficy a compiler, it will try to determine which +$! "C" compiler to use. +$! +$! P5, if defined, sets a TCP/IP library to use, through one of the following +$! keywords: +$! +$! UCX for UCX or UCX emulation +$! SOCKETSHR for SOCKETSHR+NETLIB +$! +$! P6, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) +$! +$! +$! Check Which Architecture We Are Using. +$! +$ IF (F$GETSYI("CPU").GE.128) +$ THEN +$! +$! The Architecture Is AXP. +$! +$ ARCH := AXP +$! +$! Else... +$! +$ ELSE +$! +$! The Architecture Is VAX. +$! +$ ARCH := VAX +$! +$! End The Architecture Check. +$! +$ ENDIF +$! +$! Check To Make Sure We Have Valid Command Line Parameters. +$! +$ GOSUB CHECK_OPTIONS +$! +$! Check To See What We Are To Do. +$! +$ IF (BUILDALL.EQS."TRUE") +$ THEN +$! +$! Since Nothing Special Was Specified, Do Everything. +$! First, Fix The Unix Softlinks. +$! +$ GOSUB SOFTLINKS +$! +$! Create The "DATE.H" Include File. +$! +$ GOSUB DATE +$! +$! Check To See If We Are Going To Be Building The +$! [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library. +$! +$ IF (RSAREF.EQS."RSAREF") +$ THEN +$! +$! Build The [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library. +$! +$ GOSUB RSAREF +$! +$! End The RSAREF Check. +$! +$ ENDIF +$! +$! Build The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library. +$! +$ GOSUB CRYPTO +$! +$! Build The [.xxx.EXE.SSL]LIBSSL.OLB Library. +$! +$ GOSUB SSL +$! +$! Build The [.xxx.EXE.SSL]SSL_TASK.EXE DECNet SSL Engine. +$! +$ GOSUB SSL_TASK +$! +$! Build The [.xxx.EXE.TEST] OpenSSL Test Utilities. +$! +$ GOSUB TEST +$! +$! Build The [.xxx.EXE.APPS] OpenSSL Application Utilities. +$! +$ GOSUB APPS +$! +$! Else... +$! +$ ELSE +$! +$! Build Just What The User Wants Us To Build. +$! +$ GOSUB 'BUILDALL' +$ ENDIF +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! Rebuild The "[.INCLUDE.OPENSSL]DATE.H" file. +$! +$ DATE: +$! +$! Tell The User We Are Creating The [.CRYPTO]DATE.H File. +$! +$ WRITE SYS$OUTPUT "Creating [.CRYPTO]DATE.H Include File." +$! +$! Create The [.CRYPTO]DATE.H File. +$! +$ OPEN/WRITE H_FILE SYS$DISK:[.CRYPTO]DATE.H +$! +$! Get The Current Date & Time. +$! +$ TIME = F$TIME() +$! +$! Write The [.CRYPTO]DATE.H File. +$! +$ WRITE H_FILE "#define DATE ""''TIME'"" " +$! +$! Close The [.CRYPTO]DATE.H File. +$! +$ CLOSE H_FILE +$! +$! That's All, Time To RETURN. +$! +$ RETURN +$! +$! Copy a lot of files around. +$! +$ SOFTLINKS: +$! +$! Tell The User We Are Partly Rebuilding The [.TEST] Directory. +$! +$ WRITE SYS$OUTPUT "Rebuilding The '[.APPS]MD5.C' And '[.APPS]RMD160.C' Files." +$! +$ DELETE SYS$DISK:[.APPS]MD5.C;*,RMD160.C;* +$! +$! Copy MD5.C from [.CRYPTO.MD5] into [.APPS] +$! +$ COPY SYS$DISK:[.CRYPTO.MD5]MD5.C SYS$DISK:[.APPS] +$! +$! Copy RMD160.C from [.CRYPTO.RIPEMD] into [.APPS] +$! +$ COPY SYS$DISK:[.CRYPTO.RIPEMD]RMD160.C SYS$DISK:[.APPS] +$! +$! Tell The User We Are Partly Rebuilding The [.TEST] Directory. +$! +$ WRITE SYS$OUTPUT "Rebuilding The '[.TEST]*.C' Files." +$! +$! First, We Have To "Rebuild" The "[.TEST]" Directory, So Delete +$! All The "C" Files That Are Currently There Now. +$! +$ DELETE SYS$DISK:[.TEST]*.C;* +$! +$! Copy all the *TEST.C files from [.CRYPTO...] into [.TEST] +$! +$ COPY SYS$DISK:[.CRYPTO.*]%*TEST.C SYS$DISK:[.TEST] +$! +$! Copy all the *TEST.C files from [.SSL...] into [.TEST] +$! +$ COPY SYS$DISK:[.SSL]%*TEST.C SYS$DISK:[.TEST] +$! +$! Tell The User We Are Rebuilding The [.INCLUDE.OPENSSL] Directory. +$! +$ WRITE SYS$OUTPUT "Rebuilding The '[.INCLUDE.OPENSSL]' Directory." +$! +$! First, make sure the directory exists +$! +$ IF F$PARSE("SYS$DISK:[.INCLUDE.OPENSSL]") .EQS. "" THEN - + CREATE/DIRECTORY SYS$DISK:[.INCLUDE.OPENSSL] +$! +$! Copy All The ".H" Files From The Main Directory. +$! +$ EXHEADER := e_os.h +$ COPY 'EXHEADER' SYS$DISK:[.INCLUDE.OPENSSL] +$! +$! Copy All The ".H" Files From The [.CRYPTO] Directory Tree. +$! +$ SDIRS := ,MD2,MD5,SHA,MDC2,HMAC,RIPEMD,- + DES,RC2,RC4,RC5,IDEA,BF,CAST,- + BN,RSA,DSA,DH,- + BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,- + EVP,ASN1,PEM,X509,X509V3,- + CONF,TXT_DB,PKCS7,PKCS12,COMP +$ EXHEADER_ := crypto.h,tmdiff.h,opensslv.h,opensslconf.h +$ EXHEADER_MD2 := md2.h +$ EXHEADER_MD5 := md5.h +$ EXHEADER_SHA := sha.h +$ EXHEADER_MDC2 := mdc2.h +$ EXHEADER_HMAC := hmac.h +$ EXHEADER_RIPEMD := ripemd.h +$ EXHEADER_DES := des.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_BN := bn.h +$ EXHEADER_RSA := rsa.h +$ EXHEADER_DSA := dsa.h +$ EXHEADER_DH := dh.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_OBJECTS := objects.h +$ EXHEADER_EVP := evp.h +$ EXHEADER_ASN1 := asn1.h,asn1_mac.h +$ EXHEADER_PEM := pem.h,pem2.h +$ EXHEADER_X509 := x509.h,x509_vfy.h +$ EXHEADER_X509V3 := x509v3.h +$ EXHEADER_CONF := conf.h +$ EXHEADER_TXT_DB := txt_db.h +$ EXHEADER_PKCS7 := pkcs7.h +$ EXHEADER_PKCS12 := pkcs12.h +$ EXHEADER_COMP := comp.h +$ +$ I = 0 +$ LOOP_SDIRS: +$ D = F$EDIT(F$ELEMENT(I, ",", SDIRS),"TRIM") +$ I = I + 1 +$ IF D .EQS. "," THEN GOTO LOOP_SDIRS_END +$ tmp = EXHEADER_'D' +$ IF D .EQS. "" +$ THEN +$ COPY [.CRYPTO]'tmp' SYS$DISK:[.INCLUDE.OPENSSL] /LOG +$ ELSE +$ COPY [.CRYPTO.'D']'tmp' SYS$DISK:[.INCLUDE.OPENSSL] /LOG +$ ENDIF +$ GOTO LOOP_SDIRS +$ LOOP_SDIRS_END: +$! +$! Copy All The ".H" Files From The [.RSAREF] Directory. +$! +$ EXHEADER := rsaref.h +$ COPY SYS$DISK:[.RSAREF]'EXHEADER' SYS$DISK:[.INCLUDE.OPENSSL] +$! +$! Copy All The ".H" Files From The [.SSL] Directory. +$! +$ EXHEADER := ssl.h,ssl2.h,ssl3.h,ssl23.h,tls1.h +$ COPY SYS$DISK:[.SSL]'EXHEADER' SYS$DISK:[.INCLUDE.OPENSSL] +$! +$! Purge all doubles +$! +$ PURGE SYS$DISK:[.INCLUDE.OPENSSL]*.H +$! +$! That's All, Time To RETURN. +$! +$ RETURN +$! +$! Build The "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" Library. +$! +$ CRYPTO: +$! +$! Tell The User What We Are Doing. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Building The [.",ARCH,".EXE.CRYPTO]LIBCRYPTO.OLB Library." +$! +$! Go To The [.CRYPTO] Directory. +$! +$ SET DEFAULT SYS$DISK:[.CRYPTO] +$! +$! Build The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library. +$! +$ @CRYPTO-LIB 'RSAREF' 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" 'ISSEVEN' +$! +$! Go Back To The Main Directory. +$! +$ SET DEFAULT [-] +$! +$! Time To RETURN. +$! +$ RETURN +$! +$! Build The [.xxx.EXE.RSAREF]LIBRSAGLUE Library. +$! +$ RSAREF: +$! +$! Tell The User What We Are Doing. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Building The [.",ARCH,".EXE.RSAREF]LIBRSAGLUE.OLB Library." +$! +$! Go To The [.RSAREF] Directory. +$! +$ SET DEFAULT SYS$DISK:[.RSAREF] +$! +$! Build The [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library. +$! +$ @RSAREF-LIB LIBRARY 'DEBUGGER' "''COMPILER'" 'ISSEVEN' +$! +$! Go Back To The Main Directory. +$! +$ SET DEFAULT [-] +$! +$! Time To Return. +$! +$ RETURN +$! +$! Build The "[.xxx.EXE.SSL]LIBSSL.OLB" Library. +$! +$ SSL: +$! +$! Tell The User What We Are Doing. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Building The [.",ARCH,".EXE.SSL]LIBSSL.OLB Library." +$! +$! Go To The [.SSL] Directory. +$! +$ SET DEFAULT SYS$DISK:[.SSL] +$! +$! Build The [.xxx.EXE.SSL]LIBSSL.OLB Library. +$! +$ @SSL-LIB LIBRARY 'RSAREF' 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" 'ISSEVEN' +$! +$! Go Back To The Main Directory. +$! +$ SET DEFAULT [-] +$! +$! Time To Return. +$! +$ RETURN +$! +$! Build The "[.xxx.EXE.SSL]SSL_TASK.EXE" Program. +$! +$ SSL_TASK: +$! +$! Tell The User What We Are Doing. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Building DECNet Based SSL Engine, [.",ARCH,".EXE.SSL]SSL_TASK.EXE" +$! +$! Go To The [.SSL] Directory. +$! +$ SET DEFAULT SYS$DISK:[.SSL] +$! +$! Build The [.xxx.EXE.SSL]SSL_TASK.EXE +$! +$ @SSL-LIB SSL_TASK 'RSAREF' 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" 'ISSEVEN' +$! +$! Go Back To The Main Directory. +$! +$ SET DEFAULT [-] +$! +$! That's All, Time To RETURN. +$! +$ RETURN +$! +$! Build The OpenSSL Test Programs. +$! +$ TEST: +$! +$! Tell The User What We Are Doing. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Building The OpenSSL [.",ARCH,".EXE.TEST] Test Utilities." +$! +$! Go To The [.TEST] Directory. +$! +$ SET DEFAULT SYS$DISK:[.TEST] +$! +$! Build The Test Programs. +$! +$ @MAKETESTS 'RSAREF' 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" 'ISSEVEN' +$! +$! Go Back To The Main Directory. +$! +$ SET DEFAULT [-] +$! +$! That's All, Time To RETURN. +$! +$ RETURN +$! +$! Build The OpenSSL Application Programs. +$! +$ APPS: +$! +$! Tell The User What We Are Doing. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Building OpenSSL [.",ARCH,".EXE.APPS] Applications." +$! +$! Go To The [.APPS] Directory. +$! +$ SET DEFAULT SYS$DISK:[.APPS] +$! +$! Build The Application Programs. +$! +$ @MAKEAPPS 'RSAREF' 'DEBUGGER' "''COMPILER'" "''TCPIP_TYPE'" 'ISSEVEN' +$! +$! Go Back To The Main Directory. +$! +$ SET DEFAULT [-] +$! +$! That's All, Time To RETURN. +$! +$ RETURN +$! +$! Check The User's Options. +$! +$ CHECK_OPTIONS: +$! +$! Check To See If P1 Is Blank. +$! +$ IF (P1.EQS."ALL") +$ THEN +$! +$! P1 Is ALL, So Build Everything. +$! +$ BUILDALL = "TRUE" +$! +$! Else... +$! +$ ELSE +$! +$! Else, Check To See If P1 Has A Valid Arguement. +$! +$ IF (P1.EQS."DATE").OR.(P1.EQS."SOFTLINKS").OR.(P1.EQS."CRYPTO") - + .OR.(P1.EQS."SSL").OR.(P1.EQS."RSAREF").OR.(P1.EQS."SSL_TASK") - + .OR.(P1.EQS."TEST").OR.(P1.EQS."APPS") +$ THEN +$! +$! A Valid Arguement. +$! +$ BUILDALL = P1 +$! +$! Else... +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ 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 " DATE : Just build the [.INCLUDE.OPENSSL]DATE.H file." +$ WRITE SYS$OUTPUT " SOFTLINKS: Just Fix The Unix soft links." +$ WRITE SYS$OUTPUT " RSAREF : To Build Just The [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library." +$ WRITE SYS$OUTPUT " CRYPTO : To Build Just The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library." +$ WRITE SYS$OUTPUT " SSL : To Build Just The [.xxx.EXE.SSL]LIBSSL.OLB Library." +$ WRITE SYS$OUTPUT " SSL_TASK : To Build Just The [.xxx.EXE.SSL]SSL_TASK.EXE Program." +$ WRITE SYS$OUTPUT " TEST : To Build Just The OpenSSL Test Programs." +$ WRITE SYS$OUTPUT " APPS : To Build Just The OpenSSL Application Programs." +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " Where 'xxx' Stands For:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " AXP : Alpha Architecture." +$ WRITE SYS$OUTPUT " VAX : VAX Architecture." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Argument Check. +$! +$ ENDIF +$! +$! End The P1 Check. +$! +$ ENDIF +$! +$! Check To See If P2 Is Blank. +$! +$ IF (P2.EQS."NORSAREF") +$ THEN +$! +$! P2 Is NORSAREF, So Compile Without RSAREF. +$! +$ RSAREF = "NORSAREF" +$! +$! Else... +$! +$ ELSE +$! +$! Check To See If We Are To Compile Using The RSAREF Library. +$! +$ IF (P2.EQS."RSAREF") +$ THEN +$! +$! Compile With RSAREF Library. +$! +$ RSAREF = "RSAREF" +$! +$! Else... +$! +$ ELSE +$! +$! Tell The User Entered An Invalid Option.. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " RSAREF : To Compile With The RSAREF Library." +$ WRITE SYS$OUTPUT " NORSAREF : To Compile With The Regular RSA Library." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguemnt Check. +$! +$ ENDIF +$! +$! End The P2 Check. +$! +$ ENDIF +$! +$! Check To See If P3 Is Blank. +$! +$ IF (P3.EQS."NODEBUG") +$ THEN +$! +$! P3 Is NODEBUG, So Compile Without Debugger Information. +$! +$ DEBUGGER = "NODEBUG" +$! +$! Else... +$! +$ ELSE +$! +$! Check To See If We Are To Compile With Debugger Information. +$! +$ IF (P3.EQS."DEBUG") +$ THEN +$! +$! Compile With Debugger Information. +$! +$ DEBUGGER = "DEBUG" +$! +$! Else... +$! +$ ELSE +$! +$! Tell The User Entered An Invalid Option.. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information." +$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P3 Check. +$! +$ ENDIF +$! +$! Check To See If P4 Is Blank. +$! +$ IF (P4.EQS."") +$ THEN +$! +$! O.K., The User Didn't Specify A Compiler, Let's Try To +$! Find Out Which One To Use. +$! +$! Check To See If We Have GNU C. +$! +$ IF (F$TRNLNM("GNU_CC").NES."") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ COMPILER = "GNUC" +$! +$! Tell The User We Are Using GNUC. +$! +$ WRITE SYS$OUTPUT "Using GNU 'C' Compiler." +$! +$! End The GNU C Compiler Check. +$! +$ ENDIF +$! +$! Check To See If We Have VAXC Or DECC. +$! +$ IF (F$GETSYI("CPU").GE.128).OR.(F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ COMPILER = "DECC" +$! +$! Tell The User We Are Using DECC. +$! +$ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." +$! +$! Else... +$! +$ ELSE +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ COMPILER = "VAXC" +$! +$! Tell The User We Are Using VAX C. +$! +$ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler." +$! +$! End The DECC & VAXC Compiler Check. +$! +$ ENDIF +$! +$! Else... +$! +$ ELSE +$! +$! Check To See If The User Entered A Valid Paramter. +$! +$ IF (P4.EQS."VAXC").OR.(P4.EQS."DECC").OR.(P4.EQS."GNUC").OR.(P4.EQS."LINK") +$ THEN +$! +$! Check To See If The User Wanted To Just LINK. +$! +$ IF (P4.EQS."LINK") +$ THEN +$! +$! Looks Like LINK-only +$! +$ COMPILER = "LINK" +$! +$! Tell The User We Are Only Linking. +$! +$ WRITE SYS$OUTPUT "LINK Only. This actually NOT YET SUPPORTED!" +$! +$! End LINK Check. +$! +$ ENDIF +$! +$! Check To See If The User Wanted DECC. +$! +$ IF (P4.EQS."DECC") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ COMPILER = "DECC" +$! +$! Tell The User We Are Using DECC. +$! +$ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." +$! +$! End DECC Check. +$! +$ ENDIF +$! +$! Check To See If We Are To Use VAXC. +$! +$ IF (P4.EQS."VAXC") +$ THEN +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ COMPILER = "VAXC" +$! +$! Tell The User We Are Using VAX C. +$! +$ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler." +$! +$! End VAXC Check +$! +$ ENDIF +$! +$! Check To See If We Are To Use GNU C. +$! +$ IF (P4.EQS."GNUC") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ COMPILER = "GNUC" +$! +$! Tell The User We Are Using GNUC. +$! +$ WRITE SYS$OUTPUT "Using GNU 'C' Compiler." +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Else The User Entered An Invalid Arguement. +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C." +$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C." +$ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P4 Check. +$! +$ ENDIF +$! +$! Time to check the contents of P5, and to make sure we get the correct library. +$! +$ IF P5.EQS."SOCKETSHR" .OR. P5.EQS."MULTINET" .OR. P5.EQS."UCX" +$ THEN +$! +$! Check to see if SOCKETSHR was chosen +$! +$ IF P5.EQS."SOCKETSHR" +$ THEN +$! +$! Set the library to use SOCKETSHR +$! +$ TCPIP_LIB = "[-.VMS]SOCKETSHR_SHR.OPT/OPT" +$! +$! Tell the user +$! +$ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP" +$! +$! Done with SOCKETSHR +$! +$ ENDIF +$! +$! Check to see if MULTINET was chosen +$! +$ IF P5.EQS."MULTINET" +$ THEN +$! +$! Set the library to use UCX emulation. +$! +$ P5 = "UCX" +$! +$! Tell the user +$! +$ WRITE SYS$OUTPUT "Using MultiNet via UCX emulation for TCP/IP" +$! +$! Done with MULTINET +$! +$ ENDIF +$! +$! Check to see if UCX was chosen +$! +$ IF P5.EQS."UCX" +$ THEN +$! +$! Set the library to use UCX. +$! +$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC.OPT/OPT" +$! +$! Tell the user +$! +$ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP" +$! +$! Done with UCX +$! +$ ENDIF +$! +$! Set the TCPIP_TYPE symbol +$! +$ TCPIP_TYPE = P5 +$! +$! Print info +$! +$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB +$! +$! Else The User Entered An Invalid Arguement. +$! +$ ELSE +$ IF P5 .NES. "" +$ THEN +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P5," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library." +$ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$ ELSE +$! +$! Set the TCPIP_TYPE symbol +$! +$ TCPIP_TYPE = P5 +$ ENDIF +$! +$! Done with TCP/IP libraries +$! +$ ENDIF +$! +$! Special Threads For OpenVMS v7.1 Or Later +$! +$! Written By: Richard Levitte +$! richard@levitte.org +$! +$! +$! Check To See If We Have A Option For P6. +$! +$ IF (P6.EQS."") +$ THEN +$! +$! Get The Version Of VMS We Are Using. +$! +$ ISSEVEN := +$ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION"))) +$ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP)) +$! +$! Check To See If The VMS Version Is v7.1 Or Later. +$! +$ IF (TMP.GE.71) +$ THEN +$! +$! We Have OpenVMS v7.1 Or Later, So Use The Special Threads. +$! +$ ISSEVEN := ,PTHREAD_USE_D4 +$! +$! End The VMS Version Check. +$! +$ ENDIF +$! +$! End The P6 Check. +$! +$ ENDIF +$! +$! Time To RETURN... +$! +$ RETURN diff --git a/rsaref/Makefile.ssl b/rsaref/Makefile.ssl index ca5c85548c..e1ce8e431f 100644 --- a/rsaref/Makefile.ssl +++ b/rsaref/Makefile.ssl @@ -17,7 +17,7 @@ AR= ar r CFLAGS= $(INCLUDES) $(CFLAG) -GENERAL=Makefile +GENERAL=Makefile rsaref-lib.com install.com TEST= APPS= diff --git a/rsaref/install.com b/rsaref/install.com new file mode 100644 index 0000000000..c32cea5da8 --- /dev/null +++ b/rsaref/install.com @@ -0,0 +1,69 @@ +$! 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 +$ +$ 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_SSLVLIB WRK_SSLROOT:[VAX_LIB] +$ DEFINE/NOLOG WRK_SSLALIB WRK_SSLROOT:[ALPHA_LIB] +$ +$ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLROOT:[000000] +$ IF F$PARSE("WRK_SSLVLIB:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLVLIB: +$ IF F$PARSE("WRK_SSLALIB:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLALIB: +$ +$ LIBS := LIBRSAGLUE +$ +$ VEXE_DIR := [-.VAX.EXE.CRYPTO] +$ AEXE_DIR := [-.AXP.EXE.CRYPTO] +$ +$ 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(VEXE_DIR+E+".OLB") .NES. "" +$ THEN +$ COPY 'VEXE_DIR''E'.OLB WRK_SSLVLIB:'E'.OLB/log +$ SET FILE/PROT=W:RE WRK_SSLVLIB:'E'.OLB +$ ENDIF +$ ! Preparing for the time when we have shareable images +$ IF F$SEARCH(VEXE_DIR+E+".EXE") .NES. "" +$ THEN +$ COPY 'VEXE_DIR''E'.EXE WRK_SSLVLIB:'E'.EXE/log +$ SET FILE/PROT=W:RE WRK_SSLVLIB:'E'.EXE +$ ENDIF +$ IF F$SEARCH(AEXE_DIR+E+".OLB") .NES. "" +$ THEN +$ COPY 'AEXE_DIR''E'.OLB WRK_SSLALIB:'E'.OLB/log +$ SET FILE/PROT=W:RE WRK_SSLALIB:'E'.OLB +$ ENDIF +$ ! Preparing for the time when we have shareable images +$ IF F$SEARCH(AEXE_DIR+E+".EXE") .NES. "" +$ THEN +$ COPY 'AEXE_DIR''E'.EXE WRK_SSLALIB:'E'.EXE/log +$ SET FILE/PROT=W:RE WRK_SSLALIB:'E'.EXE +$ ENDIF +$ SET ON +$ GOTO LOOP_LIB +$ LOOP_LIB_END: +$ +$ EXIT diff --git a/rsaref/rsaref-lib.com b/rsaref/rsaref-lib.com new file mode 100644 index 0000000000..5abf73191f --- /dev/null +++ b/rsaref/rsaref-lib.com @@ -0,0 +1,901 @@ +$! +$! RSAREF-LIB.COM +$! Written By: Robert Byer +$! Vice-President +$! A-Com Computing, Inc. +$! byer@mail.all-net.net +$! +$! Changes by Richard Levitte <richard@levitte.org> +$! +$! This command files compiles and creates the "[.xxx.EXE.RSAREF]LIBRSAGLUE.OLB" +$! library. The "xxx" denotes the machine architecture of AXP or VAX. +$! +$! Specify one of the following to build just that part or "ALL" to +$! just build everything. +$! +$! ALL To Just Build "Everything". +$! LIBRARY To Just Build The [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library. +$! DHDEMO To Just Build The [.xxx.EXE.RSAREF]DHDEMO.EXE Program. +$! RDEMO To Just Build The [.xxx.EXE.RSAREF]RDEMO.EXE Program. +$! +$! Specify DEBUG or NODEBUG as P2 to compile with or without debugging +$! information. +$! +$! Specify which compiler at P3 to try to compile under. +$! +$! VAXC For VAX C. +$! DECC For DEC C. +$! GNUC For GNU C. +$! +$! If you don't speficy a compiler, it will prompt you for one. +$! +$! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) +$! +$! +$! Check Which Architecture We Are Using. +$! +$ IF (F$GETSYI("CPU").GE.128) +$ THEN +$! +$! The Architecture Is AXP +$! +$ ARCH := AXP +$! +$! Else... +$! +$ ELSE +$! +$! The Architecture Is VAX. +$! +$ ARCH := VAX +$! +$! End The Architecture Check. +$! +$ ENDIF +$! +$! Check To Make Sure We Have Valid Command Line Parameters. +$! +$ GOSUB CHECK_OPTIONS +$! +$! 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." +$! +$! Define The OBJ Directory Name. +$! +$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.RSAREF] +$! +$! Check To See If The Architecture Specific OBJ Directory Exists. +$! +$ IF (F$PARSE(OBJ_DIR).EQS."") +$ THEN +$! +$! It Dosen't Exist, So Create It. +$! +$ CREATE/DIR 'OBJ_DIR' +$! +$! End The Architecture Specific OBJ Directory Check. +$! +$ ENDIF +$! +$! Define The EXE Directory Name. +$! +$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.RSAREF] +$! +$! Check To See If The Architecture Specific EXE Directory Exists. +$! +$ IF (F$PARSE(EXE_DIR).EQS."") +$ THEN +$! +$! It Dosen't Exist, So Create It. +$! +$ CREATE/DIR 'EXE_DIR' +$! +$! End The Architecture Specific EXE Directory Check. +$! +$ ENDIF +$! +$! Define The Library Name. +$! +$ LIB_NAME := 'EXE_DIR'LIBRSAGLUE.OLB +$! +$! Check To See What We Are To Do. +$! +$ IF (BUILDALL.EQS."TRUE") +$ THEN +$! +$! Since Nothing Special Was Specified, Do Everything. +$! +$ GOSUB LIBRARY +$ GOSUB DHDEMO +$ GOSUB RDEMO +$! +$! Else... +$! +$ ELSE +$! +$! Build Just What The User Wants Us To Build. +$! +$ GOSUB 'BUILDALL' +$! +$! End The BUILDALL Check. +$! +$ ENDIF +$! +$! Time To EXIT. +$! +$ EXIT: +$ GOSUB CLEANUP +$ EXIT +$! +$ LIBRARY: +$! +$! Tell The User That We Are Compiling. +$! +$ WRITE SYS$OUTPUT "Compiling The ",LIB_NAME," Files." +$! +$! Check To See If We Already Have A "LIBRSAGLUE.OLB" Library... +$! +$ IF (F$SEARCH(LIB_NAME).EQS."") +$ THEN +$! +$! Guess Not, Create The Library. +$! +$ LIBRARY/CREATE/OBJECT 'LIB_NAME' +$! +$! End The Library Exist Check. +$! +$ ENDIF +$! +$! Define The RSAREF Library Files. +$! +$ LIB_RSAREF = "DESC,DIGIT,MD2C,MD5C,NN,PRIME,RSA,R_DH,R_ENCODE,R_ENHANC," + - + "R_KEYGEN,R_RANDOM,R_STDLIB" +$! +$! Define A File Counter And Set It To "0". +$! +$ FILE_COUNTER = 0 +$! +$! Top Of The File Loop. +$! +$ NEXT_FILE: +$! +$! O.K, Extract The File Name From The File List. +$! +$ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",LIB_RSAREF) +$! +$! Check To See If We Are At The End Of The File List. +$! +$ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE +$! +$! Increment The Counter. +$! +$ FILE_COUNTER = FILE_COUNTER + 1 +$! +$! Create The Source File Name. +$! +$ SOURCE_FILE = "SYS$DISK:[.SOURCE]" + FILE_NAME + ".C" +$! +$! Tell The User We Are Compiling The Source File. +$! +$ WRITE SYS$OUTPUT " ",FILE_NAME,".C" +$! +$! Create The Object File Name. +$! +$ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ" +$ ON WARNING THEN GOTO NEXT_FILE +$! +$! Check To See If The File We Want To Compile Actually Exists. +$! +$ IF (F$SEARCH(SOURCE_FILE).EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ EXIT +$! +$! End The File Exist Check. +$! +$ ENDIF +$! +$! Compile The File. +$! +$ ON ERROR THEN GOTO NEXT_FILE +$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE' +$! +$! Add It To The Library. +$! +$ LIBRARY/REPLACE/OBJECT 'LIB_NAME' 'OBJECT_FILE' +$! +$! Time To Clean Up The Object File. +$! +$ DELETE 'OBJECT_FILE';* +$! +$! Go Back And Do It Again. +$! +$ GOTO NEXT_FILE +$! +$! All Done With This Library Part. +$! +$ FILE_DONE: +$! +$! Tell The User That We Are All Done. +$! +$ WRITE SYS$OUTPUT "Library ",LIB_NAME," Built." +$! +$! All Done, Time To Return. +$! +$ RETURN +$! +$! Compile The [.xxx.EXE.RSAREF]DHDEMO Program. +$! +$ DHDEMO: +$! +$! Check To See If We Have The Proper Libraries. +$! +$ GOSUB LIB_CHECK +$! +$! Check To See If We Have A Linker Option File. +$! +$ GOSUB CHECK_OPT_FILE +$! +$! Check To See If The File We Want To Compile Actually Exists. +$! +$ IF (F$SEARCH("SYS$DISK:[.RDEMO]DHDEMO.C").EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File [.RDEMO]DHDEMO.C Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ EXIT +$! +$! End The [.RDEMO]DHDEMO.C File Check. +$! +$ ENDIF +$! +$! Tell The User What We Are Building. +$! +$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DHDEMO.EXE" +$! +$! Compile The DHDEMO Program. +$! +$ CC/OBJECT='OBJ_DIR'DHDEMO.OBJ SYS$DISK:[.RDEMO]DHDEMO.C +$! +$! Link The DHDEMO Program. +$! +$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS - + /EXE='EXE_DIR'DHDEMO.EXE 'OBJ_DIR'DHDEMO.OBJ, - + 'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION +$! +$! All Done, Time To Return. +$! +$ RETURN +$! +$! Compile The RDEMO Program. +$! +$ RDEMO: +$! +$! Check To See If We Have The Proper Libraries. +$! +$ GOSUB LIB_CHECK +$! +$! Check To See If We Have A Linker Option File. +$! +$ GOSUB CHECK_OPT_FILE +$! +$! Check To See If The File We Want To Compile Actually Exists. +$! +$ IF (F$SEARCH("SYS$DISK:[.RDEMO]RDEMO.C").EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File [.RDEMO]RDEMO.C Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ EXIT +$! +$! End The [.RDEMO]RDEMO.C File Check. +$! +$ ENDIF +$! +$! Tell The User What We Are Building. +$! +$ WRITE SYS$OUTPUT "Building ",EXE_DIR,"RDEMO.EXE" +$! +$! Compile The RDEMO Program. +$! +$ CC/OBJECT='OBJ_DIR'RDEMO.OBJ SYS$DISK:[.RDEMO]RDEMO.C +$! +$! Link The RDEMO Program. +$! +$ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS - + /EXE='EXE_DIR'RDEMO.EXE 'OBJ_DIR'RDEMO.OBJ, - + 'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION +$! +$! All Done, Time To Return. +$! +$ RETURN +$! +$! Check For The Link Option FIle. +$! +$ CHECK_OPT_FILE: +$! +$! Check To See If We Need To Make A VAX C Option File. +$! +$ IF (COMPILER.EQS."VAXC") +$ THEN +$! +$! Check To See If We Already Have A VAX C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! We Need A VAX C Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable VAX C Runtime Library. +! +SYS$SHARE:VAXCRTL.EXE/SHARE +$EOD +$! +$! End The Option File Check. +$! +$ ENDIF +$! +$! End The VAXC Check. +$! +$ ENDIF +$! +$! Check To See If We Need A GNU C Option File. +$! +$ IF (COMPILER.EQS."GNUC") +$ THEN +$! +$! Check To See If We Already Have A GNU C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! We Need A GNU C Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable C Runtime Library. +! +GNU_CC:[000000]GCCLIB/LIBRARY +SYS$SHARE:VAXCRTL/SHARE +$EOD +$! +$! End The Option File Check. +$! +$ ENDIF +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Check To See If We Need A DEC C Option File. +$! +$ IF (COMPILER.EQS."DECC") +$ THEN +$! +$! Check To See If We Already Have A DEC C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! Figure Out If We Need An AXP Or A VAX Linker Option File. +$! +$ IF (ARCH.EQS."VAX") +$ THEN +$! +$! We Need A DEC C Linker Option File For VAX. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable DEC C Runtime Library. +! +SYS$SHARE:DECC$SHR.EXE/SHARE +$EOD +$! +$! Else... +$! +$ ELSE +$! +$! Create The AXP Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File For AXP To Link Agianst +! The Sharable C Runtime Library. +! +SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE +SYS$SHARE:CMA$OPEN_RTL/SHARE +$EOD +$! +$! End The VAX/AXP DEC C Option File Check. +$! +$ ENDIF +$! +$! End The Option File Search. +$! +$ ENDIF +$! +$! End The DEC C Check. +$! +$ ENDIF +$! +$! Tell The User What Linker Option File We Are Using. +$! +$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." +$! +$! Time To RETURN. +$! +$ RETURN +$ LIB_CHECK: +$! +$! Look For The Library LIBRSAGLUE.OLB. +$! +$ IF (F$SEARCH(LIB_NAME).EQS."") +$ THEN +$! +$! Tell The User We Can't Find The [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Can't Find The Library ",LIB_NAME,"." +$ WRITE SYS$OUTPUT "We Can't Link Without It." +$ WRITE SYS$OUTPUT "" +$! +$! And Ask If They Would Like To Build It. +$! +$ INQUIRE YESNO "Would You Like To Build The Library Now (Y/N)?" +$! +$! Check The Answer. +$! +$ IF (YESNO.EQS."Y").OR.(YESNO.EQS."y") +$ THEN +$! +$! Then Build The Library. +$! +$ GOSUB LIBRARY +$! +$! When Done With That, RETURN To Finish What Ever We Were Doing +$! That Needed The Library. +$! +$ RETURN +$! +$! Else... +$! +$ ELSE +$! +$! Since We Can't Link Without It, Exit. +$! +$ EXIT +$! +$! End The Answer Check. +$! +$ ENDIF +$! +$! End The Library Check. +$! +$ ENDIF +$! +$! Time To Return. +$! +$ RETURN +$! +$! Check The User's Options. +$! +$ CHECK_OPTIONS: +$! +$! Check To See If P1 Is Blank. +$! +$ IF (P1.EQS."ALL") +$ THEN +$! +$! P1 Is Blank, So Build Everything. +$! +$ BUILDALL = "TRUE" +$! +$! Else... +$! +$ ELSE +$! +$! Else, Check To See If P1 Has A Valid Arguement. +$! +$ IF (P1.EQS."LIBRARY").OR.(P1.EQS."DHDEMO").OR.(P1.EQS."RDEMO") +$ THEN +$! +$! A Valid Arguement. +$! +$ BUILDALL = P1 +$! +$! Else.... +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " ALL : To Just Build Everything." +$ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library." +$ WRITE SYS$OUTPUT " DHDEMO : To Compile Just The [.xxx.EXE.RSAREF]DHDEMO Program." +$ WRITE SYS$OUTPUT " RDEMO : To Compile Just The [.xxx.EXE.RSAREF]RDEMO Program. +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " Where 'xxx' Stands For:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " AXP : Alpha Architecture." +$ WRITE SYS$OUTPUT " VAX : VAX Architecture." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P1 Check. +$! +$ ENDIF +$! +$! Check To See If P2 Is Blank. +$! +$ IF (P2.EQS."NODEBUG") +$ THEN +$! +$! 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." +$ ELSE +$! +$! Check To See If We Are To Compile With Debugger Information. +$! +$ IF (P2.EQS."DEBUG") +$ THEN +$! +$! Compile With Debugger Information. +$! +$ DEBUGGER = "DEBUG" +$ TRACEBACK = "TRACEBACK" +$ GCC_OPTIMIZE = "NOOPTIMIZE" +$ CC_OPTIMIZE = "NOOPTIMIZE" +$ 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.. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information." +$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P2 Check. +$! +$ ENDIF +$! +$! Special Threads For OpenVMS v7.1 Or Later. +$! +$! Written By: Richard Levitte +$! richard@levitte.org +$! +$! +$! Check To See If We Have A Option For P4. +$! +$ IF (P4.EQS."") +$ THEN +$! +$! Get The Version Of VMS We Are Using. +$! +$ ISSEVEN := +$ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION"))) +$ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP)) +$! +$! Check To See If The VMS Version Is v7.1 Or Later. +$! +$ IF (TMP.GE.71) +$ THEN +$! +$! We Have OpenVMS v7.1 Or Later, So Use The Special Threads. +$! +$ ISSEVEN := ,PTHREAD_USE_D4 +$! +$! End The VMS Version Check. +$! +$ ENDIF +$! +$! End The P4 Check. +$! +$ ENDIF +$! +$! Check To See If P3 Is Blank. +$! +$ IF (P3.EQS."") +$ THEN +$! +$! O.K., The User Didn't Specify A Compiler, Let's Try To +$! Find Out Which One To Use. +$! +$! Check To See If We Have GNU C. +$! +$ IF (F$TRNLNM("GNU_CC").NES."") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ COMPILER = "GNUC" +$! +$! End The GNU C Compiler Check. +$! +$ ELSE +$! +$! Check To See If We Have VAXC Or DECC. +$! +$ IF (ARCH.EQS."ALPHA").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ COMPILER = "DECC" +$! +$! Tell The User We Are Using DECC. +$! +$ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." +$! +$! Else... +$! +$ ELSE +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ COMPILER = "VAXC" +$! +$! End The VAXC Compiler Check. +$! +$ ENDIF +$! +$! End The DECC & VAXC Compiler Check. +$! +$ ENDIF +$! +$! End The Compiler Check. +$! +$ ENDIF +$! +$! Set Up Initial CC Definitions, Possibly With User Ones +$! +$ CCDEFS = "VMS=1" +$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS +$ CCEXTRAFLAGS = "" +$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS +$ CCDISABLEWARNINGS = "" +$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - + CCDISABLEWARNINGS = USER_CCDISABLEWARNINGS +$! +$! Check To See If The User Entered A Valid Paramter. +$! +$ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC") +$ THEN +$! +$! Check To See If The User Wanted DECC. +$! +$ IF (P3.EQS."DECC") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ COMPILER = "DECC" +$! +$! Tell The User We Are Using DECC. +$! +$ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." +$! +$! Use DECC... +$! +$ 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" + - + "/NOLIST/PREFIX=ALL" + - + "/INCLUDE=(SYS$DISK:[-.CRYPTO],SYS$DISK:[.SOURCE])" + CCEXTRAFLAGS +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT" +$! +$! End DECC Check. +$! +$ ENDIF +$! +$! Check To See If We Are To Use VAXC. +$! +$ IF (P3.EQS."VAXC") +$ THEN +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ COMPILER = "VAXC" +$! +$! Tell The User We Are Using VAX C. +$! +$ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler." +$! +$! Compile Using VAXC. +$! +$ CC = "CC" +$ IF ARCH.EQS."AXP" +$ THEN +$ WRITE SYS$OUTPUT "There is no VAX C on Alpha!" +$ 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:[.SOURCE])" + CCEXTRAFLAGS +$ CCDEFS = CCDEFS + ",""VAXC""" +$! +$! Define <sys> As SYS$COMMON:[SYSLIB] +$! +$ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT" +$! +$! End VAXC Check +$! +$ ENDIF +$! +$! Check To See If We Are To Use GNU C. +$! +$ IF (P3.EQS."GNUC") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ COMPILER = "GNUC" +$! +$! Tell The User We Are Using GNUC. +$! +$ WRITE SYS$OUTPUT "Using GNU 'C' Compiler." +$! +$! Use GNU C... +$! +$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - + "/INCLUDE=(SYS$DISK:[-.CRYPTO],SYS$DISK:[.SOURCE])" + CCEXTRAFLAGS +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT" +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Set up default defines +$! +$ CCDEFS = """FLAT_INC=1""," + CCDEFS +$ CCDEFS = CCDEFS + ",""RSAref=1""" +$! +$! Finish up the definition of CC. +$! +$ IF COMPILER .EQS. "DECC" +$ THEN +$ IF CCDISABLEWARNINGS .NES. "" +$ THEN +$ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" +$ ENDIF +$ ELSE +$ CCDISABLEWARNINGS = "" +$ ENDIF +$ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS +$! +$! Show user the result +$! +$ WRITE SYS$OUTPUT "Main Compiling Command: ",CC +$! +$! Else The User Entered An Invalid Arguement. +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C." +$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C." +$ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The P3 Check. +$! +$ ENDIF +$! +$! Time To RETURN... +$! +$ RETURN +$! +$ INITIALISE: +$! +$! Save old value of the logical name OPENSSL +$! +$ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE") +$! +$! Save directory information +$! +$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;" +$ __TOP = __HERE - "RSAREF]" +$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]" +$! +$! Set up the logical name OPENSSL to point at the include directory +$! +$ DEFINE OPENSSL/NOLOG '__INCLUDE' +$! +$! Done +$! +$ RETURN +$! +$ CLEANUP: +$! +$! Restore the logical name OPENSSL if it had a value +$! +$ IF __SAVE_OPENSSL .EQS. "" +$ THEN +$ DEASSIGN OPENSSL +$ ELSE +$ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL' +$ ENDIF +$! +$! Done +$! +$ RETURN diff --git a/ssl/Makefile.ssl b/ssl/Makefile.ssl index ab346110dd..b0979d6121 100644 --- a/ssl/Makefile.ssl +++ b/ssl/Makefile.ssl @@ -17,7 +17,7 @@ AR= ar r CFLAGS= $(INCLUDES) $(CFLAG) -GENERAL=Makefile README +GENERAL=Makefile README ssl-lib.com install.com TEST=ssltest.c APPS= diff --git a/ssl/install.com b/ssl/install.com new file mode 100644 index 0000000000..2b62f4e499 --- /dev/null +++ b/ssl/install.com @@ -0,0 +1,102 @@ +$! 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 +$ +$ 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_SSLVLIB WRK_SSLROOT:[VAX_LIB] +$ DEFINE/NOLOG WRK_SSLALIB WRK_SSLROOT:[ALPHA_LIB] +$ DEFINE/NOLOG WRK_SSLINCLUDE WRK_SSLROOT:[INCLUDE] +$ DEFINE/NOLOG WRK_SSLVEXE WRK_SSLROOT:[VAX_EXE] +$ DEFINE/NOLOG WRK_SSLAEXE WRK_SSLROOT:[ALPHA_EXE] +$ +$ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLROOT:[000000] +$ IF F$PARSE("WRK_SSLVLIB:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLVLIB: +$ IF F$PARSE("WRK_SSLALIB:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLALIB: +$ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLINCLUDE: +$ IF F$PARSE("WRK_SSLVEXE:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLVEXE: +$ IF F$PARSE("WRK_SSLAEXE:") .EQS. "" THEN - + CREATE/DIR/LOG WRK_SSLAEXE: +$ +$ EXHEADER := ssl.h,ssl2.h,ssl3.h,ssl23.h,tls1.h +$ E_EXE := ssl_task +$ LIBS := LIBSSL +$ +$ VEXE_DIR := [-.VAX.EXE.SSL] +$ AEXE_DIR := [-.AXP.EXE.SSL] +$ +$ COPY '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 +$ IF F$SEARCH(VEXE_DIR+E+".EXE") .NES. "" +$ THEN +$ COPY 'VEXE_DIR''E'.EXE WRK_SSLVEXE:'E'.EXE/log +$ SET FILE/PROT=W:RE WRK_SSLVEXE:'E'.EXE +$ ENDIF +$ IF F$SEARCH(AEXE_DIR+E+".EXE") .NES. "" +$ THEN +$ COPY 'AEXE_DIR''E'.EXE WRK_SSLAEXE:'E'.EXE/log +$ SET FILE/PROT=W:RE WRK_SSLAEXE:'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 +$ IF F$SEARCH(VEXE_DIR+E+".OLB") .NES. "" +$ THEN +$ COPY 'VEXE_DIR''E'.OLB WRK_SSLVLIB:'E'.OLB/log +$ SET FILE/PROT=W:RE WRK_SSLVLIB:'E'.OLB +$ ENDIF +$ ! Preparing for the time when we have shareable images +$ IF F$SEARCH(VEXE_DIR+E+".EXE") .NES. "" +$ THEN +$ COPY 'VEXE_DIR''E'.EXE WRK_SSLVLIB:'E'.EXE/log +$ SET FILE/PROT=W:RE WRK_SSLVLIB:'E'.EXE +$ ENDIF +$ IF F$SEARCH(AEXE_DIR+E+".OLB") .NES. "" +$ THEN +$ COPY 'AEXE_DIR''E'.OLB WRK_SSLALIB:'E'.OLB/log +$ SET FILE/PROT=W:RE WRK_SSLALIB:'E'.OLB +$ ENDIF +$ ! Preparing for the time when we have shareable images +$ IF F$SEARCH(AEXE_DIR+E+".EXE") .NES. "" +$ THEN +$ COPY 'AEXE_DIR''E'.EXE WRK_SSLALIB:'E'.EXE/log +$ SET FILE/PROT=W:RE WRK_SSLALIB:'E'.EXE +$ ENDIF +$ SET ON +$ GOTO LOOP_LIB +$ LOOP_LIB_END: +$ +$ EXIT diff --git a/ssl/s2_lib.c b/ssl/s2_lib.c index 39ab1b6c75..55798b48a7 100644 --- a/ssl/s2_lib.c +++ b/ssl/s2_lib.c @@ -68,7 +68,7 @@ const char *ssl2_version_str="SSLv2" OPENSSL_VERSION_PTEXT; #define SSL2_NUM_CIPHERS (sizeof(ssl2_ciphers)/sizeof(SSL_CIPHER)) -SSL_CIPHER ssl2_ciphers[]={ +GLOBAL SSL_CIPHER ssl2_ciphers[]={ /* NULL_WITH_MD5 v3 */ #if 0 { diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 2fa3c4c0f8..0d4317973b 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -67,7 +67,8 @@ const char *ssl3_version_str="SSLv3" OPENSSL_VERSION_PTEXT; #define SSL3_NUM_CIPHERS (sizeof(ssl3_ciphers)/sizeof(SSL_CIPHER)) static long ssl3_default_timeout(void ); -SSL_CIPHER ssl3_ciphers[]={ + +GLOBAL SSL_CIPHER ssl3_ciphers[]={ /* The RSA ciphers */ /* Cipher 01 */ { diff --git a/ssl/ssl-lib.com b/ssl/ssl-lib.com new file mode 100644 index 0000000000..9c8090db50 --- /dev/null +++ b/ssl/ssl-lib.com @@ -0,0 +1,1199 @@ +$! +$! SSL-LIB.COM +$! Written By: Robert Byer +$! Vice-President +$! A-Com Computing, Inc. +$! byer@mail.all-net.net +$! +$! Changes by Richard Levitte <richard@levitte.org> +$! +$! This command file compiles and creates the "[.xxx.EXE.SSL]LIBSSL.OLB" +$! library for OpenSSL. The "xxx" denotes the machine architecture of AXP +$! or VAX. +$! +$! It is written to detect what type of machine you are compiling on +$! (i.e. AXP or VAX) and which "C" compiler you have (i.e. VAXC, DECC +$! or GNU C) or you can specify which compiler to use. +$! +$! Specify the following as P1 to build just that part or ALL to just +$! build everything. +$! +$! LIBRARY To just compile the [.xxx.EXE.SSL]LIBSSL.OLB Library. +$! SSL_TASK To just compile the [.xxx.EXE.SSL]SSL_TASK.EXE +$! +$! Specify RSAREF as P2 to compile with the RSAREF library instead of +$! the regular one. If you specify NORSAREF it will compile with the +$! regular RSAREF routines. (Note: If you are in the United States +$! you MUST compile with RSAREF unless you have a license from RSA). +$! +$! Note: The RSAREF libraries are NOT INCLUDED and you have to +$! download it from "ftp://ftp.rsa.com/rsaref". You have to +$! get the ".tar-Z" file as the ".zip" file dosen't have the +$! directory structure stored. You have to extract the file +$! into the [.RSAREF] directory under the root directory as that +$! is where the scripts will look for the files. +$! +$! Specify DEBUG or NODEBUG as P3 to compile with or without debugger +$! information. +$! +$! Specify which compiler at P4 to try to compile under. +$! +$! 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 +$! "C" compiler to use. +$! +$! P5, if defined, sets a TCP/IP library to use, through one of the following +$! keywords: +$! +$! UCX for UCX +$! SOCKETSHR for SOCKETSHR+NETLIB +$! +$! P6, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) +$! +$! +$! Define A TCP/IP Library That We Will Need To Link To. +$! (That Is, If We Need To Link To One.) +$! +$ TCPIP_LIB = "" +$! +$! Check Which Architecture We Are Using. +$! +$ IF (F$GETSYI("CPU").GE.128) +$ THEN +$! +$! The Architecture Is AXP. +$! +$ ARCH := AXP +$! +$! Else... +$! +$ ELSE +$! +$! The Architecture Is VAX. +$! +$ ARCH := VAX +$! +$! End The Architecture Check. +$! +$ ENDIF +$! +$! Check To Make Sure We Have Valid Command Line Parameters. +$! +$ GOSUB CHECK_OPTIONS +$! +$! 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." +$! +$! Define The OBJ Directory. +$! +$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.SSL] +$! +$! Check To See If The Architecture Specific OBJ Directory Exists. +$! +$ IF (F$PARSE(OBJ_DIR).EQS."") +$ THEN +$! +$! It Dosen't Exist, So Create It. +$! +$ CREATE/DIR 'OBJ_DIR' +$! +$! End The Architecture Specific OBJ Directory Check. +$! +$ ENDIF +$! +$! Define The EXE Directory. +$! +$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.SSL] +$! +$! Check To See If The Architecture Specific Directory Exists. +$! +$ IF (F$PARSE(EXE_DIR).EQS."") +$ THEN +$! +$! It Dosen't Exist, So Create It. +$! +$ CREATE/DIR 'EXE_DIR' +$! +$! End The Architecture Specific Directory Check. +$! +$ ENDIF +$! +$! Define The Library Name. +$! +$ SSL_LIB := 'EXE_DIR'LIBSSL.OLB +$! +$! Define The CRYPTO-LIB We Are To Use. +$! +$ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB +$! +$! Define The RSAREF-LIB We Are To Use. +$! +$ RSAREF_LIB := SYS$DISK:[-.'ARCH'.EXE.RSAREF]LIBRSAGLUE.OLB +$! +$! Check To See What We Are To Do. +$! +$ IF (BUILDALL.EQS."TRUE") +$ THEN +$! +$! Since Nothing Special Was Specified, Do Everything. +$! +$ GOSUB LIBRARY +$ GOSUB SSL_TASK +$! +$! Else... +$! +$ ELSE +$! +$! Build Just What The User Wants Us To Build. +$! +$ GOSUB 'BUILDALL' +$! +$! End The BUILDALL Check. +$! +$ ENDIF +$! +$! Time To EXIT. +$! +$ EXIT: +$ GOSUB CLEANUP +$ EXIT +$! +$! Compile The Library. +$! +$ LIBRARY: +$! +$! Check To See If We Already Have A "[.xxx.EXE.SSL]LIBSSL.OLB" Library... +$! +$ IF (F$SEARCH(SSL_LIB).EQS."") +$ THEN +$! +$! Guess Not, Create The Library. +$! +$ LIBRARY/CREATE/OBJECT 'SSL_LIB' +$! +$! End The Library Exist Check. +$! +$ ENDIF +$! +$! Define The Different SSL "library" Files. +$! +$ LIB_SSL = "s2_meth,s2_srvr,s2_clnt,s2_lib,s2_enc,s2_pkt,"+ - + "s3_meth,s3_srvr,s3_clnt,s3_lib,s3_enc,s3_pkt,s3_both,"+ - + "s23_meth,s23_srvr,s23_clnt,s23_lib,s23_pkt,"+ - + "t1_meth,t1_srvr,t1_clnt,t1_lib,t1_enc,"+ - + "ssl_lib,ssl_err2,ssl_cert,ssl_sess,"+ - + "ssl_ciph,ssl_stat,ssl_rsa,"+ - + "ssl_asn1,ssl_txt,ssl_algs,"+ - + "bio_ssl,ssl_err" +$! +$! Tell The User That We Are Compiling The Library. +$! +$ WRITE SYS$OUTPUT "Building The ",SSL_LIB," Library." +$! +$! Define A File Counter And Set It To "0" +$! +$ FILE_COUNTER = 0 +$! +$! Top Of The File Loop. +$! +$ NEXT_FILE: +$! +$! O.K, Extract The File Name From The File List. +$! +$ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",LIB_SSL) +$! +$! Check To See If We Are At The End Of The File List. +$! +$ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE +$! +$! Increment The Counter. +$! +$ FILE_COUNTER = FILE_COUNTER + 1 +$! +$! Create The Source File Name. +$! +$ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C" +$! +$! Create The Object File Name. +$! +$ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ" +$ ON WARNING THEN GOTO NEXT_FILE +$! +$! Check To See If The File We Want To Compile Is Actually There. +$! +$ IF (F$SEARCH(SOURCE_FILE).EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ EXIT +$! +$! End The File Exists Check. +$! +$ ENDIF +$! +$! Tell The User What File We Are Compiling. +$! +$ WRITE SYS$OUTPUT " ",FILE_NAME,".c" +$! +$! Compile The File. +$! +$ ON ERROR THEN GOTO NEXT_FILE +$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE' +$! +$! Add It To The Library. +$! +$ LIBRARY/REPLACE/OBJECT 'SSL_LIB' 'OBJECT_FILE' +$! +$! Time To Clean Up The Object File. +$! +$ DELETE 'OBJECT_FILE';* +$! +$! Go Back And Get The Next File Name. +$! +$ GOTO NEXT_FILE +$! +$! All Done With This Library. +$! +$ FILE_DONE: +$! +$! Tell The User That We Are All Done. +$! +$ WRITE SYS$OUTPUT "Library ",SSL_LIB," Compiled." +$! +$! Time To RETURN. +$! +$ RETURN +$ SSL_TASK: +$! +$! Check To See If We Have The Proper Libraries. +$! +$ GOSUB LIB_CHECK +$! +$! Check To See If We Have A Linker Option File. +$! +$ GOSUB CHECK_OPT_FILE +$! +$! Check To See If The File We Want To Compile Is Actually There. +$! +$ IF (F$SEARCH("SYS$DISK:[]SSL_TASK.C").EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File SSL_TASK.C Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ EXIT +$! +$! End The SSL_TASK.C File Check. +$! +$ ENDIF +$! +$! Tell The User We Are Creating The SSL_TASK. +$! +$ WRITE SYS$OUTPUT "Creating SSL_TASK OSU HTTP SSL Engine." +$! +$! Compile The File. +$! +$ CC5/OBJECT='OBJ_DIR'SSL_TASK.OBJ SYS$DISK:[]SSL_TASK.C +$! +$! Link The Program, Check To See If We Need To Link With RSAREF Or Not. +$! +$ IF (RSAREF.EQS."TRUE") +$ THEN +$! +$! Check To See If We Are To Link With A Specific TCP/IP Library. +$! +$ IF (TCPIP_LIB.NES."") +$ THEN +$! +$! Link With The RSAREF Library And A Specific TCP/IP Library. +$! +$ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR'SSL_TASK.EXE - + 'OBJ_DIR'SSL_TASK.OBJ, - + 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY,'RSAREF_LIB'/LIBRARY, - + 'TCPIP_LIB','OPT_FILE'/OPTION +$! +$! Else... +$! +$ ELSE +$! +$! Link With The RSAREF Library And NO TCP/IP Library. +$! +$ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR'SSL_TASK.EXE - + 'OBJ_DIR'SSL_TASK.OBJ, - + 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY,'RSAREF_LIB'/LIBRARY, - + 'OPT_FILE'/OPTION +$! +$! End The TCP/IP Library Check. +$! +$ ENDIF +$! +$! Else... +$! +$ ELSE +$! +$! Don't Link With The RSAREF Routines. +$! +$! +$! 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'/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 The RSAREF Routines And Link With A 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 +$! +$! End The RSAREF Link Check. +$! +$ ENDIF +$! +$! Time To Return. +$! +$ RETURN +$! +$! Check For The Link Option FIle. +$! +$ CHECK_OPT_FILE: +$! +$! Check To See If We Need To Make A VAX C Option File. +$! +$ IF (COMPILER.EQS."VAXC") +$ THEN +$! +$! Check To See If We Already Have A VAX C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! We Need A VAX C Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable VAX C Runtime Library. +! +SYS$SHARE:VAXCRTL.EXE/SHARE +$EOD +$! +$! End The Option File Check. +$! +$ ENDIF +$! +$! End The VAXC Check. +$! +$ ENDIF +$! +$! Check To See If We Need A GNU C Option File. +$! +$ IF (COMPILER.EQS."GNUC") +$ THEN +$! +$! Check To See If We Already Have A GNU C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! We Need A GNU C Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable C Runtime Library. +! +GNU_CC:[000000]GCCLIB/LIBRARY +SYS$SHARE:VAXCRTL/SHARE +$EOD +$! +$! End The Option File Check. +$! +$ ENDIF +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Check To See If We Need A DEC C Option File. +$! +$ IF (COMPILER.EQS."DECC") +$ THEN +$! +$! Check To See If We Already Have A DEC C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! Figure Out If We Need An AXP Or A VAX Linker Option File. +$! +$ IF (ARCH.EQS."VAX") +$ THEN +$! +$! We Need A DEC C Linker Option File For VAX. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable DEC C Runtime Library. +! +SYS$SHARE:DECC$SHR.EXE/SHARE +$EOD +$! +$! Else... +$! +$ ELSE +$! +$! Create The AXP Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File For AXP To Link Agianst +! The Sharable C Runtime Library. +! +SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE +SYS$SHARE:CMA$OPEN_RTL/SHARE +$EOD +$! +$! End The VAX/AXP DEC C Option File Check. +$! +$ ENDIF +$! +$! End The Option File Search. +$! +$ ENDIF +$! +$! End The DEC C Check. +$! +$ ENDIF +$! +$! Tell The User What Linker Option File We Are Using. +$! +$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." +$! +$! Time To RETURN. +$! +$ RETURN +$ LIB_CHECK: +$! +$! Look For The VAX Library LIBSSL.OLB. +$! +$ IF (F$SEARCH(SSL_LIB).EQS."") +$ THEN +$! +$! Tell The User We Can't Find The LIBSSL.OLB Library. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"." +$ WRITE SYS$OUTPUT "We Can't Link Without It." +$ WRITE SYS$OUTPUT "" +$! +$! Since We Can't Link Without It, Exit. +$! +$ EXIT +$! +$! End The LIBSSL.OLB Library Check. +$! +$ ENDIF +$! +$! Look For The Library LIBCRYPTO.OLB. +$! +$ IF (F$SEARCH(CRYPTO_LIB).EQS."") +$ THEN +$! +$! Tell The User We Can't Find The LIBCRYPTO.OLB Library. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"." +$ WRITE SYS$OUTPUT "We Can't Link Without It." +$ WRITE SYS$OUTPUT "" +$! +$! Since We Can't Link Without It, Exit. +$! +$ EXIT +$! +$! End The LIBCRYPTO.OLB Library Check. +$! +$ ENDIF +$! +$! Check To See If We Need The RSAREF Library. +$! +$ IF (RSAREF.EQS."TRUE") +$ THEN +$! +$! Look For The Library LIBRSAGLUE.OLB. +$! +$ IF (F$SEARCH(RSAREF_LIB).EQS."") +$ THEN +$! +$! Tell The User We Can't Find The LIBRSAGLUE.OLB Library. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Can't Find The Library ",RSAREF_LIB,"." +$ WRITE SYS$OUTPUT "We Can't Link Without It." +$ WRITE SYS$OUTPUT "" +$! +$! Since We Can't Link Without It, Exit. +$! +$ EXIT +$! +$! End The LIBRSAGLUE.OLB Library Check. +$! +$ ENDIF +$! +$! End The RSAREF Library Check. +$! +$ ENDIF +$! +$! Time To Return. +$! +$ RETURN +$! +$! Check The User's Options. +$! +$ CHECK_OPTIONS: +$! +$! Check To See If P1 Is Blank. +$! +$ IF (P1.EQS."ALL") +$ THEN +$! +$! P1 Is Blank, So Build Everything. +$! +$ BUILDALL = "TRUE" +$! +$! Else... +$! +$ ELSE +$! +$! Else, Check To See If P1 Has A Valid Arguement. +$! +$ IF (P1.EQS."LIBRARY").OR.(P1.EQS."SSL_TASK") +$ THEN +$! +$! A Valid Arguement. +$! +$ BUILDALL = P1 +$! +$! Else... +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ 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 " LIBRARY : To Compile Just The [.xxx.EXE.SSL]LIBSSL.OLB Library." +$ WRITE SYS$OUTPUT " SSL_TASK : To Compile Just The [.xxx.EXE.SSL]SSL_TASK.EXE Program." +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " Where 'xxx' Stands For:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " AXP : Alpha Architecture." +$ WRITE SYS$OUTPUT " VAX : VAX Architecture." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P1 Check. +$! +$ ENDIF +$! +$! Check To See If P2 Is Blank. +$! +$ IF (P2.EQS."NORSAREF") +$ THEN +$! +$! P2 Is NORSAREF, So Compile With The Regular RSA Libraries. +$! +$ RSAREF = "FALSE" +$! +$! Else... +$! +$ ELSE +$! +$! Check To See If We Are To Use The RSAREF Library. +$! +$ IF (P2.EQS."RSAREF") +$ THEN +$! +$! Check To Make Sure We Have The RSAREF Source Code Directory. +$! +$ IF (F$SEARCH("SYS$DISK:[-.RSAREF]SOURCE.DIR").EQS."") +$ THEN +$! +$! We Don't Have The RSAREF Souce Code Directory, So Tell The +$! User This. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "It appears that you don't have the RSAREF Souce Code." +$ WRITE SYS$OUTPUT "You need to go to 'ftp://ftp.rsa.com/rsaref'. You have to" +$ WRITE SYS$OUTPUT "get the '.tar-Z' file as the '.zip' file dosen't have the" +$ WRITE SYS$OUTPUT "directory structure stored. You have to extract the file" +$ WRITE SYS$OUTPUT "into the [.RSAREF] directory under the root directory" +$ WRITE SYS$OUTPUT "as that is where the scripts will look for the files." +$ WRITE SYS$OUTPUT "" +$! +$! Time To Exit. +$! +$ EXIT +$! +$! Else, Compile Using The RSAREF Library. +$! +$ ELSE +$ RSAREF = "TRUE" +$ ENDIF +$ ELSE +$! +$! They Entered An Invalid Option.. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " RSAREF : Compile With The RSAREF Library." +$ WRITE SYS$OUTPUT " NORSAREF : Compile With The Regular RSA Library." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P2 Check. +$! +$ ENDIF +$! +$! Check To See If P3 Is Blank. +$! +$ IF (P3.EQS."NODEBUG") +$ THEN +$! +$! P3 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." +$! +$! Else... +$! +$ ELSE +$! +$! Check To See If We Are To Compile With Debugger Information. +$! +$ IF (P3.EQS."DEBUG") +$ THEN +$! +$! Compile With Debugger Information. +$! +$ DEBUGGER = "DEBUG" +$ TRACEBACK = "TRACEBACK" +$ GCC_OPTIMIZE = "NOOPTIMIZE" +$ CC_OPTIMIZE = "NOOPTIMIZE" +$ 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.. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information." +$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P3 Check. +$! +$ ENDIF +$! +$! Special Threads For OpenVMS v7.1 Or Later +$! +$! Written By: Richard Levitte +$! richard@levitte.org +$! +$! +$! Check To See If We Have A Option For P6. +$! +$ IF (P6.EQS."") +$ THEN +$! +$! Get The Version Of VMS We Are Using. +$! +$ ISSEVEN := +$ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION"))) +$ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP)) +$! +$! Check To See If The VMS Version Is v7.1 Or Later. +$! +$ IF (TMP.GE.71) +$ THEN +$! +$! We Have OpenVMS v7.1 Or Later, So Use The Special Threads. +$! +$ ISSEVEN := ,PTHREAD_USE_D4 +$! +$! End The VMS Version Check. +$! +$ ENDIF +$! +$! End The P6 Check. +$! +$ ENDIF +$! +$! Check To See If P4 Is Blank. +$! +$ IF (P4.EQS."") +$ THEN +$! +$! O.K., The User Didn't Specify A Compiler, Let's Try To +$! Find Out Which One To Use. +$! +$! Check To See If We Have GNU C. +$! +$ IF (F$TRNLNM("GNU_CC").NES."") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ P4 = "GNUC" +$! +$! End The GNU C Compiler Check. +$! +$ ELSE +$! +$! Check To See If We Have VAXC Or DECC. +$! +$ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ P4 = "DECC" +$! +$! Else... +$! +$ ELSE +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ P4 = "VAXC" +$! +$! End The VAXC Compiler Check. +$! +$ ENDIF +$! +$! End The DECC & VAXC Compiler Check. +$! +$ ENDIF +$! +$! End The Compiler Check. +$! +$ ENDIF +$! +$! Check To See If We Have A Option For P5. +$! +$ IF (P5.EQS."") +$ THEN +$! +$! Find out what socket library we have available +$! +$ IF F$PARSE("SOCKETSHR:") .NES. "" +$ THEN +$! +$! We have SOCKETSHR, and it is my opinion that it's the best to use. +$! +$ P5 = "SOCKETSHR" +$! +$! Tell the user +$! +$ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP" +$! +$! Else, let's look for something else +$! +$ ELSE +$! +$! Like UCX (the reason to do this before Multinet is that the UCX +$! emulation is easier to use...) +$! +$ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" - + .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" - + .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. "" +$ THEN +$! +$! Last resort: a UCX or UCX-compatible library +$! +$ P5 = "UCX" +$! +$! Tell the user +$! +$ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP" +$! +$! That was all... +$! +$ ENDIF +$ ENDIF +$ ENDIF +$! +$! Set Up Initial CC Definitions, Possibly With User Ones +$! +$ CCDEFS = "VMS=1,TCPIP_TYPE_''P5'" +$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS +$ CCEXTRAFLAGS = "" +$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS +$ CCDISABLEWARNINGS = "" +$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - + CCDISABLEWARNINGS = USER_CCDISABLEWARNINGS +$! +$! Check To See If The User Entered A Valid Paramter. +$! +$ IF (P4.EQS."VAXC").OR.(P4.EQS."DECC").OR.(P4.EQS."GNUC") +$ THEN +$! +$! Check To See If The User Wanted DECC. +$! +$ IF (P4.EQS."DECC") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ COMPILER = "DECC" +$! +$! Tell The User We Are Using DECC. +$! +$ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." +$! +$! Use DECC... +$! +$ 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" + - + "/NOLIST/PREFIX=ALL" + - + "/INCLUDE=(SYS$DISK:[-.CRYPTO],SYS$DISK:[.SOURCE])" + CCEXTRAFLAGS +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT" +$! +$! End DECC Check. +$! +$ ENDIF +$! +$! Check To See If We Are To Use VAXC. +$! +$ IF (P4.EQS."VAXC") +$ THEN +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ COMPILER = "VAXC" +$! +$! Tell The User We Are Using VAX C. +$! +$ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler." +$! +$! Compile Using VAXC. +$! +$ CC = "CC" +$ IF ARCH.EQS."AXP" +$ THEN +$ WRITE SYS$OUTPUT "There is no VAX C on Alpha!" +$ 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:[.SOURCE])" + CCEXTRAFLAGS +$ CCDEFS = CCDEFS + ",""VAXC""" +$! +$! Define <sys> As SYS$COMMON:[SYSLIB] +$! +$ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT" +$! +$! End VAXC Check +$! +$ ENDIF +$! +$! Check To See If We Are To Use GNU C. +$! +$ IF (P4.EQS."GNUC") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ COMPILER = "GNUC" +$! +$! Tell The User We Are Using GNUC. +$! +$ WRITE SYS$OUTPUT "Using GNU 'C' Compiler." +$! +$! Use GNU C... +$! +$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - + "/INCLUDE=(SYS$DISK:[-.CRYPTO],SYS$DISK:[.SOURCE])" + CCEXTRAFLAGS +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT" +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Set up default defines +$! +$ CCDEFS = """FLAT_INC=1""," + CCDEFS +$! +$! Check To See If We Are To Compile With RSAREF Routines. +$! +$ IF (RSAREF.EQS."TRUE") +$ THEN +$! +$! Compile With RSAREF. +$! +$ CCDEFS = CCDEFS + ",""RSAref=1""" +$! +$! Tell The User This. +$! +$ WRITE SYS$OUTPUT "Compiling With RSAREF Routines." +$! +$! Else, We Don't Care. Compile Without The RSAREF Library. +$! +$ ELSE +$! +$! Tell The User We Are Compile Without The RSAREF Routines. +$! +$ WRITE SYS$OUTPUT "Compiling Without The RSAREF Routines. +$! +$! End The RSAREF Check. +$! +$ ENDIF +$! +$! Finish up the definition of CC. +$! +$ IF COMPILER .EQS. "DECC" +$ THEN +$ IF CCDISABLEWARNINGS .EQS. "" +$ THEN +$ CC4DISABLEWARNINGS = "DOLLARID" +$ ELSE +$ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID" +$ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" +$ ENDIF +$ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))" +$ ELSE +$ CCDISABLEWARNINGS = "" +$ CC4DISABLEWARNINGS = "" +$ ENDIF +$ CC2 = CC + "/DEFINE=(" + CCDEFS + ",_POSIX_C_SOURCE)" + CCDISABLEWARNINGS +$ CC3 = CC + "/DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS +$ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS +$ IF COMPILER .EQS. "DECC" +$ THEN +$ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS +$ CC5 = CC3 - CCDISABLEWARNINGS + CC4DISABLEWARNINGS +$ ELSE +$ CC4 = CC +$ CC5 = CC3 +$ ENDIF +$! +$! Show user the result +$! +$ WRITE SYS$OUTPUT "Main Compiling Command: ",CC +$! +$! Else The User Entered An Invalid Arguement. +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C." +$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C." +$ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$ ENDIF +$! +$! Time to check the contents, and to make sure we get the correct library. +$! +$ IF P5.EQS."SOCKETSHR" .OR. P5.EQS."MULTINET" .OR. P5.EQS."UCX" +$ THEN +$! +$! Check to see if SOCKETSHR was chosen +$! +$ IF P5.EQS."SOCKETSHR" +$ THEN +$! +$! Set the library to use SOCKETSHR +$! +$ TCPIP_LIB = "[-.VMS]SOCKETSHR_SHR.OPT/OPT" +$! +$! Done with SOCKETSHR +$! +$ ENDIF +$! +$! Check to see if MULTINET was chosen +$! +$ IF P5.EQS."MULTINET" +$ THEN +$! +$! Set the library to use UCX emulation. +$! +$ P5 = "UCX" +$! +$! Done with MULTINET +$! +$ ENDIF +$! +$! Check to see if UCX was chosen +$! +$ IF P5.EQS."UCX" +$ THEN +$! +$! Set the library to use UCX. +$! +$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC.OPT/OPT" +$ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" +$ THEN +$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT" +$ ELSE +$ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - + TCPIP_LIB = "[-.VMS]UCX_SHR_VAXC.OPT/OPT" +$ ENDIF +$! +$! Done with UCX +$! +$ ENDIF +$! +$! Print info +$! +$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB +$! +$! Else The User Entered An Invalid Arguement. +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P5," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library." +$ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! Done with TCP/IP libraries +$! +$ ENDIF +$! +$! Time To RETURN... +$! +$ RETURN +$! +$ INITIALISE: +$! +$! Save old value of the logical name OPENSSL +$! +$ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE") +$! +$! Save directory information +$! +$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;" +$ __TOP = __HERE - "SSL]" +$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]" +$! +$! Set up the logical name OPENSSL to point at the include directory +$! +$ DEFINE OPENSSL/NOLOG '__INCLUDE' +$! +$! Done +$! +$ RETURN +$! +$ CLEANUP: +$! +$! Restore the logical name OPENSSL if it had a value +$! +$ IF __SAVE_OPENSSL .EQS. "" +$ THEN +$ DEASSIGN OPENSSL +$ ELSE +$ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL' +$ ENDIF +$! +$! Done +$! +$ RETURN @@ -61,7 +61,7 @@ #include <string.h> #define USE_SOCKETS -#include "../e_os.h" +#include <openssl/e_os.h> #include <openssl/buffer.h> #include <openssl/stack.h> @@ -698,10 +698,6 @@ struct ssl_st #define SSL_get_timeout(a) SSL_SESSION_get_timeout(a) #define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b)) -/* VMS linker has a 31 char name limit */ -#define SSL_CTX_set_cert_verify_callback(a,b,c) \ - SSL_CTX_set_cert_verify_cb((a),(b),(c)) - #if 1 /*SSLEAY_MACROS*/ #define d2i_SSL_SESSION_bio(bp,s_id) (SSL_SESSION *)ASN1_d2i_bio( \ (char *(*)())SSL_SESSION_new,(char *(*)())d2i_SSL_SESSION, \ @@ -818,6 +814,21 @@ struct ssl_st #define SSL_CTX_add_extra_chain_cert(ctx,x509) \ SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509) +/* VMS uses only 31 characters for symbols. */ +#ifdef VMS +#undef SSL_CTX_set_cert_verify_callback +#define SSL_CTX_set_cert_verify_callback SSL_CTX_set_cert_verify_cb +#undef SSL_CTX_use_certificate_chain_file +#define SSL_CTX_use_certificate_chain_file SSL_CTX_use_cert_chain_file +#undef SSL_CTX_set_default_verify_paths +#define SSL_CTX_set_default_verify_paths SSL_CTX_set_def_verify_paths +#undef SSL_get_ex_data_X509_STORE_CTX_idx +#define SSL_get_ex_data_X509_STORE_CTX_idx SSL_get_ex_data_X509_STOR_CTX_i +#undef SSL_add_file_cert_subjects_to_stack +#define SSL_add_file_cert_subjects_to_stack SSL_add_file_cert_sub_to_stack +#undef SSL_add_dir_cert_subjects_to_stack +#define SSL_add_dir_cert_subjects_to_stack SSL_add_dir_cert_sub_to_stack +#endif #ifdef HEADER_BIO_H BIO_METHOD *BIO_f_ssl(void); @@ -933,7 +944,7 @@ int (*SSL_CTX_get_verify_callback(SSL_CTX *ctx))(int,X509_STORE_CTX *); void SSL_CTX_set_verify(SSL_CTX *ctx,int mode, int (*callback)(int, X509_STORE_CTX *)); void SSL_CTX_set_verify_depth(SSL_CTX *ctx,int depth); -void SSL_CTX_set_cert_verify_cb(SSL_CTX *ctx, int (*cb)(),char *arg); +void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb)(),char *arg); #ifndef NO_RSA int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); #endif diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index 9bfa3ecf2e..3e5eba7605 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -107,8 +107,10 @@ #include <stdio.h> #include <sys/types.h> #ifndef WIN32 +#ifndef VMS #include <dirent.h> #endif +#endif #include <openssl/objects.h> #include <openssl/bio.h> #include <openssl/pem.h> @@ -640,6 +642,7 @@ err: */ #ifndef WIN32 +#ifndef VMS /* XXXX This may be fixed in the future */ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, const char *dir) @@ -673,3 +676,4 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, } #endif +#endif diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 6a9de2bf49..666dba54cf 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -70,7 +70,7 @@ static STACK *ssl_ctx_meth=NULL; static int ssl_meth_num=0; static int ssl_ctx_meth_num=0; -SSL3_ENC_METHOD ssl3_undef_enc_method={ +GLOBAL SSL3_ENC_METHOD ssl3_undef_enc_method={ ssl_undefined_function, ssl_undefined_function, ssl_undefined_function, diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 16edcee8e5..fa48f0ef8b 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -334,9 +334,14 @@ typedef struct ssl3_comp_st COMP_METHOD *method; /* The method :-) */ } SSL3_COMP; -extern SSL3_ENC_METHOD ssl3_undef_enc_method; -extern SSL_CIPHER ssl2_ciphers[]; -extern SSL_CIPHER ssl3_ciphers[]; +EXTERN SSL3_ENC_METHOD ssl3_undef_enc_method; +EXTERN SSL_CIPHER ssl2_ciphers[]; +EXTERN SSL_CIPHER ssl3_ciphers[]; + +#ifdef VMS +#undef SSL_COMP_get_compression_methods +#define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods +#endif SSL_METHOD *ssl_bad_method(int ver); diff --git a/ssl/ssl_task.c b/ssl/ssl_task.c index 05f9325904..65ac1fb582 100644 --- a/ssl/ssl_task.c +++ b/ssl/ssl_task.c @@ -124,7 +124,7 @@ int LIB$INIT_TIMER(), LIB$SHOW_TIMER(); #include <string.h> /* from ssltest.c */ #include <errno.h> #include <openssl/buffer.h> -#include "../e_os.h" +#include <openssl/e_os.h> #include <openssl/x509.h> #include <openssl/ssl.h> #include <openssl/err.h> @@ -224,8 +224,12 @@ int main ( int argc, char **argv ) printf("cipher list: %s\n", cipher ? cipher : "{undefined}" ); SSL_load_error_strings(); + SSLeay_add_all_algorithms(); +/* DRM, this was the original, but there is no such thing as SSLv2() s_ctx=SSL_CTX_new(SSLv2()); +*/ + s_ctx=SSL_CTX_new(SSLv2_server_method()); if (s_ctx == NULL) goto end; @@ -267,8 +271,12 @@ int doit(io_channel chan, SSL_CTX *s_ctx ) c_to_s=BIO_new(BIO_s_rtcp()); s_to_c=BIO_new(BIO_s_rtcp()); if ((s_to_c == NULL) || (c_to_s == NULL)) goto err; +/* original, DRM 24-SEP-1997 BIO_set_fd ( c_to_s, "", chan ); BIO_set_fd ( s_to_c, "", chan ); +*/ + BIO_set_fd ( c_to_s, 0, chan ); + BIO_set_fd ( s_to_c, 0, chan ); c_bio=BIO_new(BIO_f_ssl()); s_bio=BIO_new(BIO_f_ssl()); diff --git a/ssl/ssltest.c b/ssl/ssltest.c index 54f2458345..01e6a76456 100644 --- a/ssl/ssltest.c +++ b/ssl/ssltest.c @@ -74,8 +74,13 @@ #define NO_SSL2 #endif -#define TEST_SERVER_CERT "../apps/server.pem" -#define TEST_CLIENT_CERT "../apps/client.pem" +#ifdef VMS +# define TEST_SERVER_CERT "SYS$DISK:[-.APPS]SERVER.PEM" +# define TEST_CLIENT_CERT "SYS$DISK:[-.APPS]CLIENT.PEM" +#else +# define TEST_SERVER_CERT "../apps/server.pem" +# define TEST_CLIENT_CERT "../apps/client.pem" +#endif int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx); #ifndef NO_RSA diff --git a/test/Makefile.ssl b/test/Makefile.ssl index ef12e629c9..9478f6a8e5 100644 --- a/test/Makefile.ssl +++ b/test/Makefile.ssl @@ -19,7 +19,10 @@ EX_LIBS= #-lnsl -lsocket CFLAGS= $(INCLUDES) $(CFLAG) -GENERAL=Makefile.ssl +GENERAL=Makefile.ssl maketests.com \ + tests.com testenc.com tx509.com trsa.com tcrl.com tsid.com treq.com \ + tpkcs7.com tpkcs7d.com tverify.com testgen.com testss.com testssl.com \ + testca.com VMSca-response.1 VMSca-response.2 DLIBCRYPTO= ../libcrypto.a DLIBSSL= ../libssl.a diff --git a/test/VMSca-response.1 b/test/VMSca-response.1 new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/test/VMSca-response.1 @@ -0,0 +1 @@ + diff --git a/test/VMSca-response.2 b/test/VMSca-response.2 new file mode 100644 index 0000000000..9b48ee4cf9 --- /dev/null +++ b/test/VMSca-response.2 @@ -0,0 +1,2 @@ +y +y diff --git a/test/maketests.com b/test/maketests.com new file mode 100644 index 0000000000..e4b052e688 --- /dev/null +++ b/test/maketests.com @@ -0,0 +1,1053 @@ +$! +$! MAKETESTS.COM +$! Written By: Robert Byer +$! Vice-President +$! A-Com Computing, Inc. +$! byer@mail.all-net.net +$! +$! Changes by Richard Levitte <richard@levitte.org> +$! +$! This command files compiles and creates all the various different +$! "test" programs for the different types of encryption for OpenSSL. +$! It was written so it would try to determine what "C" compiler to +$! use or you can specify which "C" compiler to use. +$! +$! The test "executeables" will be placed in a directory called +$! [.xxx.EXE.TEST] where "xxx" denotes AXP or VAX depending on your machines +$! architecture. +$! +$! Specify RSAREF as P1 to compile with the RSAREF library instead of +$! the regular one. If you specify NORSAREF it will compile with the +$! regular RSAREF routines. (Note: If you are in the United States +$! you MUST compile with RSAREF unless you have a license from RSA). +$! +$! Note: The RSAREF libraries are NOT INCLUDED and you have to +$! download it from "ftp://ftp.rsa.com/rsaref". You have to +$! get the ".tar-Z" file as the ".zip" file dosen't have the +$! directory structure stored. You have to extract the file +$! into the [.RSAREF] directory under the root directory as that +$! is where the scripts will look for the files. +$! +$! Specify DEBUG or NODEBUG P2 to compile with or without debugger +$! information. +$! +$! Specify which compiler at P3 to try to compile under. +$! +$! 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 +$! "C" compiler to use. +$! +$! P4, if defined, sets a TCP/IP library to use, through one of the following +$! keywords: +$! +$! UCX for UCX +$! SOCKETSHR for SOCKETSHR+NETLIB +$! +$! P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) +$! +$! +$! Define A TCP/IP Library That We Will Need To Link To. +$! (That is, If Wee Need To Link To One.) +$! +$ TCPIP_LIB = "" +$! +$! Check Which Architecture We Are Using. +$! +$ IF (F$GETSYI("CPU").GE.128) +$ THEN +$! +$! The Architecture Is AXP. +$! +$ ARCH := AXP +$! +$! Else... +$! +$ ELSE +$! +$! The Architecture Is VAX. +$! +$ ARCH := VAX +$! +$! End The Architecture Check. +$! +$ ENDIF +$! +$! Check To Make Sure We Have Valid Command Line Parameters. +$! +$ GOSUB CHECK_OPTIONS +$! +$! 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." +$! +$! Define The CRYPTO-LIB We Are To Use. +$! +$ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB +$! +$! Define The RSAREF-LIB We Are To Use. +$! +$ RSAREF_LIB := SYS$DISK:[-.'ARCH'.EXE.RSAREF]LIBRSAGLUE.OLB +$! +$! Define The SSL We Are To Use. +$! +$ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL.OLB +$! +$! Define The OBJ Directory. +$! +$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.TEST] +$! +$! Check To See If The Architecture Specific OBJ Directory Exists. +$! +$ IF (F$PARSE(OBJ_DIR).EQS."") +$ THEN +$! +$! The EXE Directory Dosen't Exist, So Create It. +$! +$ CREATE/DIRECTORY 'OBJ_DIR' +$! +$! End The Architecture Specific OBJ Directory Check. +$! +$ ENDIF +$! +$! Define The EXE Directory. +$! +$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.TEST] +$! +$! Check To See If The Architecture Specific EXE Directory Exists. +$! +$ IF (F$PARSE(EXE_DIR).EQS."") +$ THEN +$! +$! The EXE Directory Dosen't Exist, So Create It. +$! +$ CREATE/DIRECTORY 'EXE_DIR' +$! +$! End The Architecture Specific EXE Directory Check. +$! +$ ENDIF +$! +$! Check To See If We Have The Proper Libraries. +$! +$ GOSUB LIB_CHECK +$! +$! Check To See If We Have A Linker Option File. +$! +$ GOSUB CHECK_OPT_FILE +$! +$! Define The TEST Files. +$! +$ TEST_FILES = "BNTEST,IDEATEST,MD2TEST,MD5TEST,HMACTEST,"+ - + "RC2TEST,RC4TEST,RC5TEST,"+ - + "DESTEST,SHATEST,SHA1TEST,MDC2TEST,RMDTEST,"+ - + "RANDTEST,DHTEST,"+ - + "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_OAEP_TEST" +$ TCPIP_PROGRAMS = ",," +$ IF COMPILER .EQS. "VAXC" THEN - + TCPIP_PROGRAMS = ",SSLTEST," +$! +$! Define A File Counter And Set It To "0". +$! +$ FILE_COUNTER = 0 +$! +$! Top Of The File Loop. +$! +$ NEXT_FILE: +$! +$! O.K, Extract The File Name From The File List. +$! +$ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",TEST_FILES) +$! +$! Check To See If We Are At The End Of The File List. +$! +$ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE +$! +$! Increment The Counter. +$! +$ FILE_COUNTER = FILE_COUNTER + 1 +$! +$! Create The Source File Name. +$! +$ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C" +$! +$! Create The Object File Name. +$! +$ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ" +$! +$! Create The Executable File Name. +$! +$ EXE_FILE = EXE_DIR + FILE_NAME + ".EXE" +$ ON WARNING THEN GOTO NEXT_FILE +$! +$! Check To See If The File We Want To Compile Actually Exists. +$! +$ IF (F$SEARCH(SOURCE_FILE).EQS."") +$ THEN +$! +$! Tell The User That The File Dosen't Exist. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist." +$ WRITE SYS$OUTPUT "" +$! +$! Exit The Build. +$! +$ GOTO EXIT +$ ENDIF +$! +$! Tell The User What We Are Building. +$! +$ WRITE SYS$OUTPUT "Building The ",FILE_NAME," Test Program." +$! +$! Compile The File. +$! +$ ON ERROR THEN GOTO NEXT_FILE +$ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE' +$ ON WARNING THEN GOTO NEXT_FILE +$! +$! Check If What We Are About To Compile Works Without A TCP/IP Library. +$! +$ IF ((TCPIP_LIB.EQS."").AND.((TCPIP_PROGRAMS-FILE_NAME).NES.TCPIP_PROGRAMS)) +$ THEN +$! +$! Inform The User That A TCP/IP Library Is Needed To Compile This Program. +$! +$ WRITE SYS$OUTPUT FILE_NAME," Needs A TCP/IP Library. Can't Link. Skipping..." +$ GOTO NEXT_FILE +$! +$! End The TCP/IP Library Check. +$! +$ ENDIF +$! +$! Link The Program, Check To See If We Need To Link With RSAREF Or Not. +$! +$ IF (RSAREF.EQS."TRUE") +$ THEN +$! +$! Check To See If We Are To Link With A Specific TCP/IP Library. +$! +$ IF (TCPIP_LIB.NES."") +$ THEN +$! +$! Link With The RSAREF Library And A Specific TCP/IP Library. +$! +$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' - + 'OBJECT_FILE',- + 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY,'RSAREF_LIB'/LIBRARY, - + 'TCPIP_LIB','OPT_FILE'/OPTION +$! +$! Else... +$! +$ ELSE +$! +$! Link With The RSAREF Library And NO TCP/IP Library. +$! +$ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' - + 'OBJECT_FILE', - + 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY,'RSAREF_LIB'/LIBRARY, - + 'OPT_FILE'/OPTION +$! +$! End The TCP/IP Library Check. +$! +$ ENDIF +$! +$! Else... +$! +$ ELSE +$! +$! Don't Link With The RSAREF Routines. +$! +$! +$! 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' /EXE='EXE_FILE' - + 'OBJECT_FILE', - + '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' - + 'OBJECT_FILE', - + 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, - + 'OPT_FILE'/OPTION +$! +$! End The TCP/IP Library Check. +$! +$ ENDIF +$! +$! End The RSAREF Link Check. +$! +$ ENDIF +$! +$! Go Back And Do It Again. +$! +$ GOTO NEXT_FILE +$! +$! All Done With This Library Part. +$! +$ FILE_DONE: +$! +$! All Done, Time To Exit. +$! +$ EXIT: +$ GOSUB CLEANUP +$ EXIT +$! +$! Check For The Link Option FIle. +$! +$ CHECK_OPT_FILE: +$! +$! Check To See If We Need To Make A VAX C Option File. +$! +$ IF (COMPILER.EQS."VAXC") +$ THEN +$! +$! Check To See If We Already Have A VAX C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! We Need A VAX C Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable VAX C Runtime Library. +! +SYS$SHARE:VAXCRTL.EXE/SHARE +$EOD +$! +$! End The Option File Check. +$! +$ ENDIF +$! +$! End The VAXC Check. +$! +$ ENDIF +$! +$! Check To See If We Need A GNU C Option File. +$! +$ IF (COMPILER.EQS."GNUC") +$ THEN +$! +$! Check To See If We Already Have A GNU C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! We Need A GNU C Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable C Runtime Library. +! +GNU_CC:[000000]GCCLIB/LIBRARY +SYS$SHARE:VAXCRTL/SHARE +$EOD +$! +$! End The Option File Check. +$! +$ ENDIF +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Check To See If We Need A DEC C Option File. +$! +$ IF (COMPILER.EQS."DECC") +$ THEN +$! +$! Check To See If We Already Have A DEC C Linker Option File. +$! +$ IF (F$SEARCH(OPT_FILE).EQS."") +$ THEN +$! +$! Figure Out If We Need An AXP Or A VAX Linker Option File. +$! +$ IF (ARCH.EQS."VAX") +$ THEN +$! +$! We Need A DEC C Linker Option File For VAX. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File To Link Agianst +! The Sharable DEC C Runtime Library. +! +SYS$SHARE:DECC$SHR.EXE/SHARE +$EOD +$! +$! Else... +$! +$ ELSE +$! +$! Create The AXP Linker Option File. +$! +$ CREATE 'OPT_FILE' +$DECK +! +! Default System Options File For AXP To Link Agianst +! The Sharable C Runtime Library. +! +SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE +SYS$SHARE:CMA$OPEN_RTL/SHARE +$EOD +$! +$! End The VAX/AXP DEC C Option File Check. +$! +$ ENDIF +$! +$! End The Option File Search. +$! +$ ENDIF +$! +$! End The DEC C Check. +$! +$ ENDIF +$! +$! Tell The User What Linker Option File We Are Using. +$! +$ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." +$! +$! Time To RETURN. +$! +$ RETURN +$! +$! Check To See If We Have The Appropiate Libraries. +$! +$ LIB_CHECK: +$! +$! Look For The Library LIBCRYPTO.OLB. +$! +$ IF (F$SEARCH(CRYPTO_LIB).EQS."") +$ THEN +$! +$! Tell The User We Can't Find The LIBCRYPTO.OLB Library. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"." +$ WRITE SYS$OUTPUT "We Can't Link Without It." +$ WRITE SYS$OUTPUT "" +$! +$! Since We Can't Link Without It, Exit. +$! +$ EXIT +$! +$! End The Crypto Library Check. +$! +$ ENDIF +$! +$! See If We Need The RSAREF Library... +$! +$ IF (RSAREF.EQS."TRUE") +$ THEN +$! +$! Look For The Library LIBRSAGLUE.OLB. +$! +$ IF (F$SEARCH(RSAREF_LIB).EQS."") +$ THEN +$! +$! Tell The User We Can't Find The LIBRSAGLUE.OLB Library. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Can't Find The Library ",RSAREF_LIB,"." +$ WRITE SYS$OUTPUT "We Can't Link Without It." +$ WRITE SYS$OUTPUT "" +$! +$! Since We Can't Link Without It, Exit. +$! +$ EXIT +$ ENDIF +$! +$! End The RSAREF Library Check. +$! +$ ENDIF +$! +$! Look For The Library LIBSSL.OLB. +$! +$ IF (F$SEARCH(SSL_LIB).EQS."") +$ THEN +$! +$! Tell The User We Can't Find The LIBSSL.OLB Library. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"." +$ WRITE SYS$OUTPUT "Some Of The Test Programs Need To Link To It." +$ WRITE SYS$OUTPUT "" +$! +$! Since We Can't Link Without It, Exit. +$! +$ EXIT +$! +$! End The SSL Library Check. +$! +$ ENDIF +$! +$! Time To Return. +$! +$ RETURN +$! +$! Check The User's Options. +$! +$ CHECK_OPTIONS: +$! +$! Check To See If P1 Is Blank. +$! +$ IF (P1.EQS."NORSAREF") +$ THEN +$! +$! P1 Is NORSAREF, So Compile With The Regular RSA Libraries. +$! +$ RSAREF = "FALSE" +$ ELSE +$! +$! Check To See If We Are To Use The RSAREF Library. +$! +$ IF (P1.EQS."RSAREF") +$ THEN +$! +$! Check To Make Sure We Have The RSAREF Source Code Directory. +$! +$ IF (F$SEARCH("SYS$DISK:[-.RSAREF]SOURCE.DIR").EQS."") +$ THEN +$! +$! We Don't Have The RSAREF Souce Code Directory, So Tell The +$! User This. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "It appears that you don't have the RSAREF Souce Code." +$ WRITE SYS$OUTPUT "You need to go to 'ftp://ftp.rsa.com/rsaref'. You have to" +$ WRITE SYS$OUTPUT "get the '.tar-Z' file as the '.zip' file dosen't have the" +$ WRITE SYS$OUTPUT "directory structure stored. You have to extract the file" +$ WRITE SYS$OUTPUT "into the [.RSAREF] directory under the root directory" +$ WRITE SYS$OUTPUT "as that is where the scripts will look for the files." +$ WRITE SYS$OUTPUT "" +$! +$! Time To Exit. +$! +$ EXIT +$! +$! Else, Compile Using The RSAREF Library. +$! +$ ELSE +$ RSAREF = "TRUE" +$ ENDIF +$ ELSE +$! +$! They Entered An Invalid Option.. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " RSAREF : Compile With The RSAREF Library." +$ WRITE SYS$OUTPUT " NORSAREF : Compile With The Regular RSA Library." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P1 Check. +$! +$ ENDIF +$! +$! Check To See If P2 Is Blank. +$! +$ IF (P2.EQS."NODEBUG") +$ THEN +$! +$! 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." +$! +$! Else... +$! +$ ELSE +$! +$! Check To See If We Are To Compile With Debugger Information. +$! +$ IF (P2.EQS."DEBUG") +$ THEN +$! +$! Compile With Debugger Information. +$! +$ DEBUGGER = "DEBUG" +$ TRACEBACK = "TRACEBACK" +$ GCC_OPTIMIZE = "NOOPTIMIZE" +$ CC_OPTIMIZE = "NOOPTIMIZE" +$ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile." +$ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." +$! +$! Else... +$! +$ ELSE +$! +$! Tell The User Entered An Invalid Option.. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information." +$ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! End The Valid Arguement Check. +$! +$ ENDIF +$! +$! End The P3 Check. +$! +$ ENDIF +$! +$! Check To See If P3 Is Blank. +$! +$ IF (P3.EQS."") +$ THEN +$! +$! O.K., The User Didn't Specify A Compiler, Let's Try To +$! Find Out Which One To Use. +$! +$! Check To See If We Have GNU C. +$! +$ IF (F$TRNLNM("GNU_CC").NES."") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ P3 = "GNUC" +$! +$! End The GNU C Compiler Check. +$! +$ ELSE +$! +$! Check To See If We Have VAXC Or DECC. +$! +$ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ P3 = "DECC" +$! +$! Else... +$! +$ ELSE +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ P3 = "VAXC" +$! +$! End The VAXC Compiler Check. +$! +$ ENDIF +$! +$! End The DECC & VAXC Compiler Check. +$! +$ ENDIF +$! +$! End The Compiler Check. +$! +$ ENDIF +$! +$! Check To See If We Have A Option For P4. +$! +$ IF (P4.EQS."") +$ THEN +$! +$! Find out what socket library we have available +$! +$ IF F$PARSE("SOCKETSHR:") .NES. "" +$ THEN +$! +$! We have SOCKETSHR, and it is my opinion that it's the best to use. +$! +$ P4 = "SOCKETSHR" +$! +$! Tell the user +$! +$ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP" +$! +$! Else, let's look for something else +$! +$ ELSE +$! +$! Like UCX (the reason to do this before Multinet is that the UCX +$! emulation is easier to use...) +$! +$ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" - + .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" - + .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. "" +$ THEN +$! +$! Last resort: a UCX or UCX-compatible library +$! +$ P4 = "UCX" +$! +$! Tell the user +$! +$ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP" +$! +$! That was all... +$! +$ ENDIF +$ ENDIF +$ ENDIF +$! +$! Set Up Initial CC Definitions, Possibly With User Ones +$! +$ CCDEFS = "VMS=1,TCPIP_TYPE_''P4'" +$ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS +$ CCEXTRAFLAGS = "" +$ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS +$ CCDISABLEWARNINGS = "" +$ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - + CCDISABLEWARNINGS = USER_CCDISABLEWARNINGS +$! +$! Check To See If The User Entered A Valid Paramter. +$! +$ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC") +$ THEN +$! +$! Check To See If The User Wanted DECC. +$! +$ IF (P3.EQS."DECC") +$ THEN +$! +$! Looks Like DECC, Set To Use DECC. +$! +$ COMPILER = "DECC" +$! +$! Tell The User We Are Using DECC. +$! +$ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." +$! +$! Use DECC... +$! +$ 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" + - + "/NOLIST/PREFIX=ALL" + CCEXTRAFLAGS +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT" +$! +$! End DECC Check. +$! +$ ENDIF +$! +$! Check To See If We Are To Use VAXC. +$! +$ IF (P3.EQS."VAXC") +$ THEN +$! +$! Looks Like VAXC, Set To Use VAXC. +$! +$ COMPILER = "VAXC" +$! +$! Tell The User We Are Using VAX C. +$! +$ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler." +$! +$! Compile Using VAXC. +$! +$ CC = "CC" +$ IF ARCH.EQS."AXP" +$ THEN +$ WRITE SYS$OUTPUT "There is no VAX C on Alpha!" +$ EXIT +$ ENDIF +$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" +$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS +$ CCDEFS = CCDEFS + ",""VAXC""" +$! +$! Define <sys> As SYS$COMMON:[SYSLIB] +$! +$ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT" +$! +$! End VAXC Check +$! +$ ENDIF +$! +$! Check To See If We Are To Use GNU C. +$! +$ IF (P3.EQS."GNUC") +$ THEN +$! +$! Looks Like GNUC, Set To Use GNUC. +$! +$ COMPILER = "GNUC" +$! +$! Tell The User We Are Using GNUC. +$! +$ WRITE SYS$OUTPUT "Using GNU 'C' Compiler." +$! +$! Use GNU C... +$! +$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS +$! +$! Define The Linker Options File Name. +$! +$ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT" +$! +$! End The GNU C Check. +$! +$ ENDIF +$! +$! Set up default defines +$! +$ CCDEFS = """FLAT_INC=1""," + CCDEFS +$! +$! Check To See If We Are To Compile With RSAREF Routines. +$! +$ IF (RSAREF.EQS."TRUE") +$ THEN +$! +$! Compile With RSAREF. +$! +$ CCDEFS = CCDEFS + ",""RSAref=1""" +$! +$! Tell The User This. +$! +$ WRITE SYS$OUTPUT "Compiling With RSAREF Routines." +$! +$! Else, We Don't Care. Compile Without The RSAREF Library. +$! +$ ELSE +$! +$! Tell The User We Are Compile Without The RSAREF Routines. +$! +$ WRITE SYS$OUTPUT "Compiling Without The RSAREF Routines. +$! +$! End The RSAREF Check. +$! +$ ENDIF +$! +$! Finish up the definition of CC. +$! +$ IF COMPILER .EQS. "DECC" +$ THEN +$ IF CCDISABLEWARNINGS .EQS. "" +$ THEN +$ CC4DISABLEWARNINGS = "DOLLARID" +$ ELSE +$ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID" +$ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" +$ ENDIF +$ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))" +$ ELSE +$ CCDISABLEWARNINGS = "" +$ CC4DISABLEWARNINGS = "" +$ ENDIF +$ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS +$! +$! Show user the result +$! +$ WRITE SYS$OUTPUT "Main Compiling Command: ",CC +$! +$! Else The User Entered An Invalid Arguement. +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C." +$ WRITE SYS$OUTPUT " DECC : To Compile With DEC C." +$ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$ ENDIF +$! +$! Time to check the contents, and to make sure we get the correct library. +$! +$ IF P4.EQS."SOCKETSHR" .OR. P4.EQS."MULTINET" .OR. P4.EQS."UCX" +$ THEN +$! +$! Check to see if SOCKETSHR was chosen +$! +$ IF P4.EQS."SOCKETSHR" +$ THEN +$! +$! Set the library to use SOCKETSHR +$! +$ TCPIP_LIB = "[-.VMS]SOCKETSHR_SHR.OPT/OPT" +$! +$! Done with SOCKETSHR +$! +$ ENDIF +$! +$! Check to see if MULTINET was chosen +$! +$ IF P4.EQS."MULTINET" +$ THEN +$! +$! Set the library to use UXC emulation. +$! +$ P4 = "UCX" +$! +$! Done with MULTINET +$! +$ ENDIF +$! +$! Check to see if UCX was chosen +$! +$ IF P4.EQS."UCX" +$ THEN +$! +$! Set the library to use UCX. +$! +$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC.OPT/OPT" +$ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" +$ THEN +$ TCPIP_LIB = "[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT" +$ ELSE +$ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - + TCPIP_LIB = "[-.VMS]UCX_SHR_VAXC.OPT/OPT" +$ ENDIF +$! +$! Done with UCX +$! +$ ENDIF +$! +$! Print info +$! +$ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB +$! +$! Else The User Entered An Invalid Arguement. +$! +$ ELSE +$! +$! Tell The User We Don't Know What They Want. +$! +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT "The Option ",P4," Is Invalid. The Valid Options Are:" +$ WRITE SYS$OUTPUT "" +$ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library." +$ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library." +$ WRITE SYS$OUTPUT "" +$! +$! Time To EXIT. +$! +$ EXIT +$! +$! Done with TCP/IP libraries +$! +$ ENDIF +$! +$! Special Threads For OpenVMS v7.1 Or Later +$! +$! Written By: Richard Levitte +$! richard@levitte.org +$! +$! +$! Check To See If We Have A Option For P5. +$! +$ IF (P5.EQS."") +$ THEN +$! +$! Get The Version Of VMS We Are Using. +$! +$ ISSEVEN := +$ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION"))) +$ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP)) +$! +$! Check To See If The VMS Version Is v7.1 Or Later. +$! +$ IF (TMP.GE.71) +$ THEN +$! +$! We Have OpenVMS v7.1 Or Later, So Use The Special Threads. +$! +$ ISSEVEN := ,PTHREAD_USE_D4 +$! +$! End The VMS Version Check. +$! +$ ENDIF +$! +$! End The P5 Check. +$! +$ ENDIF +$! +$! Time To RETURN... +$! +$ RETURN +$! +$ INITIALISE: +$! +$! Save old value of the logical name OPENSSL +$! +$ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE") +$! +$! Save directory information +$! +$ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;" +$ __TOP = __HERE - "TEST]" +$ __INCLUDE = __TOP + "INCLUDE.OPENSSL]" +$! +$! Set up the logical name OPENSSL to point at the include directory +$! +$ DEFINE OPENSSL/NOLOG '__INCLUDE' +$! +$! Done +$! +$ RETURN +$! +$ CLEANUP: +$! +$! Restore the logical name OPENSSL if it had a value +$! +$ IF __SAVE_OPENSSL .EQS. "" +$ THEN +$ DEASSIGN OPENSSL +$ ELSE +$ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL' +$ ENDIF +$! +$! Done +$! +$ RETURN diff --git a/test/tcrl.com b/test/tcrl.com new file mode 100644 index 0000000000..cef21467bb --- /dev/null +++ b/test/tcrl.com @@ -0,0 +1,78 @@ +$! TCRL.COM -- Tests crl keys +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ cmd := mcr 'exe_dir'openssl crl +$ +$ t := testcrl.pem +$ if p1 .nes. "" then t = p1 +$ +$ write sys$output "testing CRL conversions" +$ copy 't' fff.p +$ +$ write sys$output "p -> d" +$ 'cmd' -in fff.p -inform p -outform d -out f.d +$ if $severity .ne. 1 then exit 3 +$! write sys$output "p -> t" +$! 'cmd' -in fff.p -inform p -outform t -out f.t +$! if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in fff.p -inform p -outform p -out f.p +$ if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> d" +$ 'cmd' -in f.d -inform d -outform d -out ff.d1 +$ if $severity .ne. 1 then exit 3 +$! write sys$output "t -> d" +$! 'cmd' -in f.t -inform t -outform d -out ff.d2 +$! if $severity .ne. 1 then exit 3 +$ write sys$output "p -> d" +$ 'cmd' -in f.p -inform p -outform d -out ff.d3 +$ if $severity .ne. 1 then exit 3 +$ +$! write sys$output "d -> t" +$! 'cmd' -in f.d -inform d -outform t -out ff.t1 +$! if $severity .ne. 1 then exit 3 +$! write sys$output "t -> t" +$! 'cmd' -in f.t -inform t -outform t -out ff.t2 +$! if $severity .ne. 1 then exit 3 +$! write sys$output "p -> t" +$! 'cmd' -in f.p -inform p -outform t -out ff.t3 +$! if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> p" +$ 'cmd' -in f.d -inform d -outform p -out ff.p1 +$ if $severity .ne. 1 then exit 3 +$! write sys$output "t -> p" +$! 'cmd' -in f.t -inform t -outform p -out ff.p2 +$! if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in f.p -inform p -outform p -out ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: fff.p f.p +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$! difference/output=nl: fff.p ff.p2 +$! if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$! difference/output=nl: f.t ff.t1 +$! if $severity .ne. 1 then exit 3 +$! difference/output=nl: f.t ff.t2 +$! if $severity .ne. 1 then exit 3 +$! difference/output=nl: f.t ff.t3 +$! if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: f.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$! difference/output=nl: f.p ff.p2 +$! if $severity .ne. 1 then exit 3 +$ difference/output=nl: f.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ delete f.*;*,ff.*;*,fff.*;* diff --git a/test/testca.com b/test/testca.com new file mode 100644 index 0000000000..ea75479cd5 --- /dev/null +++ b/test/testca.com @@ -0,0 +1,76 @@ +$! TESTCA.COM +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ openssl := mcr 'exe_dir'openssl +$ +$ SSLEAY_CONFIG="-config ""CAss.cnf""" +$ +$ set noon +$ if f$search("demoCA.dir") .nes. "" +$ then +$ call deltree [.demoCA]*.* +$ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) demoCA.dir;* +$ delete demoCA.dir;* +$ endif +$ set on +$ open/read sys$ca_input VMSca-response.1 +$ @[-.apps]CA.com -input sys$ca_input -newca +$ close sys$ca_input +$ if $severity .ne. 1 then exit 3 +$ +$ +$ SSLEAY_CONFIG="-config ""Uss.cnf""" +$ @[-.apps]CA.com -newreq +$ if $severity .ne. 1 then exit 3 +$ +$ +$ SSLEAY_CONFIG="-config [-.apps]openssl-vms.cnf" +$ open/read sys$ca_input VMSca-response.2 +$ @[-.apps]CA.com -input sys$ca_input -sign +$ close sys$ca_input +$ if $severity .ne. 1 then exit 3 +$ +$ +$ @[-.apps]CA.com -verify newcert.pem +$ if $severity .ne. 1 then exit 3 +$ +$ set noon +$ call deltree [.demoCA]*.* +$ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) demoCA.dir;* +$ delete demoCA.dir;*,newcert.pem;*,newreq.pem;* +$ set on +$! #usage: CA -newcert|-newreq|-newca|-sign|-verify +$ +$ exit +$ +$ deltree: subroutine ! P1 is a name of a directory +$ on control_y then goto dt_STOP +$ on warning then goto dt_exit +$ _dt_def = f$trnlnm("SYS$DISK")+f$directory() +$ if f$parse(p1) .eqs. "" then exit +$ set default 'f$parse(p1,,,"DEVICE")''f$parse(p1,,,"DIRECTORY")' +$ p1 = f$parse(p1,,,"NAME") + f$parse(p1,,,"TYPE") +$ _fp = f$parse(".DIR",p1) +$ dt_loop: +$ _f = f$search(_fp) +$ if _f .eqs. "" then goto dt_loopend +$ call deltree [.'f$parse(_f,,,"NAME")']*.* +$ goto dt_loop +$ dt_loopend: +$ _fp = f$parse(p1,".;*") +$ if f$search(_fp) .eqs. "" then goto dt_exit +$ set noon +$ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) '_fp' +$ set on +$ delete/nolog '_fp' +$ dt_exit: +$ set default '_dt_def' +$ exit +$ dt_STOP: +$ set default '_dt_def' +$ stop/id="" +$ exit +$ endsubroutine diff --git a/test/testenc.com b/test/testenc.com new file mode 100644 index 0000000000..0756e8bada --- /dev/null +++ b/test/testenc.com @@ -0,0 +1,50 @@ +$! TESTENC.COM -- Test encoding and decoding +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ testsrc := makefile.ssl +$ test := p.txt +$ cmd := mcr 'exe_dir'openssl +$ +$ copy 'testsrc' 'test' +$ +$ write sys$output "cat" +$ 'cmd' enc -in 'test' -out 'test'-cipher +$ 'cmd' enc -in 'test'-cipher -out 'test'-clear +$ difference/output=nl: 'test' 'test'-clear +$ if $severity .ne. 1 then exit 3 +$ delete 'test'-cipher;*,'test'-clear;* +$ +$ write sys$output "base64" +$ 'cmd' enc -a -e -in 'test' -out 'test'-cipher +$ 'cmd' enc -a -d -in 'test'-cipher -out 'test'-clear +$ difference/output=nl: 'test' 'test'-clear +$ if $severity .ne. 1 then exit 3 +$ delete 'test'-cipher;*,'test'-clear;* +$ +$ define/user sys$output 'test'-cipher-commands +$ 'cmd' list-cipher-commands +$ open/read f 'test'-cipher-commands +$ loop_cipher_commands: +$ read/end=loop_cipher_commands_end f i +$ write sys$output i +$ 'cmd' 'i' -bufsize 113 -e -k test -in 'test' -out 'test'-'i'-cipher +$ 'cmd' 'i' -bufsize 157 -d -k test -in 'test'-'i'-cipher -out 'test'-'i'-clear +$ difference/output=nl: 'test' 'test'-'i'-clear +$ if $severity .ne. 1 then exit 3 +$ delete 'test'-'i'-cipher;*,'test'-'i'-clear;* +$ +$ write sys$output i," base64" +$ 'cmd' 'i' -bufsize 113 -a -e -k test -in 'test' -out 'test'-'i'-cipher +$ 'cmd' 'i' -bufsize 157 -a -d -k test -in 'test'-'i'-cipher -out 'test'-'i'-clear +$ difference/output=nl: 'test' 'test'-'i'-clear +$ if $severity .ne. 1 then exit 3 +$ delete 'test'-'i'-cipher;*,'test'-'i'-clear;* +$ +$ goto loop_cipher_commands +$ loop_cipher_commands_end: +$ close f +$ delete 'test'-cipher-commands;* +$ delete 'test';* diff --git a/test/testgen.com b/test/testgen.com new file mode 100644 index 0000000000..c7a78f7637 --- /dev/null +++ b/test/testgen.com @@ -0,0 +1,33 @@ +$! TETSGEN.COM +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ T := testcert +$ KEY = 512 +$ CA := [-.certs]testca.pem +$ +$ set noon +$ delete 'T'.1;*,'T'.2;*,'T'.key;* +$ set on +$ +$ write sys$output "generating certificate request" +$ +$ 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 "This could take some time." +$ +$ mcr 'exe_dir'openssl req -config test.cnf -new -out testreq.pem +$ if $severity .ne. 1 +$ then +$ write sys$output "problems creating request" +$ exit 3 +$ endif +$ +$ mcr 'exe_dir'openssl req -verify -in testreq.pem -noout +$ if $severity .ne. 1 +$ then +$ write sys$output "signature on req is wrong" +$ exit 3 +$ endif diff --git a/test/tests.com b/test/tests.com new file mode 100644 index 0000000000..147b8aa838 --- /dev/null +++ b/test/tests.com @@ -0,0 +1,203 @@ +$! TESTS.COM -- Performs the necessary tests +$! +$! P1 tests to be performed. Empty means all. +$ +$ __proc = f$element(0,";",f$environment("procedure")) +$ __here = f$parse(f$parse("A.;",__proc) - "A.;","[]A.;") - "A.;" +$ __save_default = f$environment("default") +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ texe_dir := sys$disk:[-.'__arch'.exe.test] +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ set default '__here' +$ on control_y then goto exit +$ on error then goto exit +$ +$ if p1 .nes. "" +$ then +$ tests = p1 +$ else +$ tests := - + test_des,test_idea,test_sha,test_md5,test_hmac,test_md2,test_mdc2,- + test_rc2,test_rc4,test_rc5,test_bf,test_cast,- + test_rand,test_bn,test_enc,test_x509,test_rsa,test_crl,test_sid,- + test_reqgen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- + test_ss,test_ssl,test_ca +$ endif +$ tests = f$edit(tests,"COLLAPSE") +$ +$ BNTEST := bntest +$ EXPTEST := exptest +$ IDEATEST := ideatest +$ SHATEST := shatest +$ SHA1TEST := sha1test +$ MDC2TEST := mdc2test +$ RMDTEST := rmdtest +$ MD2TEST := md2test +$ MD5TEST := md5test +$ HMACTEST := hmactest +$ RC2TEST := rc2test +$ RC4TEST := rc4test +$ RC5TEST := rc5test +$ BFTEST := bftest +$ CASTTEST := casttest +$ DESTEST := destest +$ RANDTEST := randtest +$ DHTEST := dhtest +$ DSATEST := dsatest +$ METHTEST := methtest +$ SSLTEST := ssltest +$ RSATEST := rsa_oaep_test +$ +$ tests_i = 0 +$ loop_tests: +$ tests_e = f$element(tests_i,",",tests) +$ tests_i = tests_i + 1 +$ if tests_e .eqs. "," then goto exit +$ goto 'tests_e' +$ +$ test_des: +$ mcr 'texe_dir''destest' +$ goto loop_tests +$ test_idea: +$ mcr 'texe_dir''ideatest' +$ goto loop_tests +$ test_sha: +$ mcr 'texe_dir''shatest' +$ mcr 'texe_dir''sha1test' +$ goto loop_tests +$ test_mdc2: +$ mcr 'texe_dir''mdc2test' +$ goto loop_tests +$ test_md5: +$ mcr 'texe_dir''md5test' +$ goto loop_tests +$ test_hmac: +$ mcr 'texe_dir''hmactest' +$ goto loop_tests +$ test_md2: +$ mcr 'texe_dir''md2test' +$ goto loop_tests +$ test_rmd: +$ mcr 'texe_dir''rmdtest' +$ goto loop_tests +$ test_bf: +$ mcr 'texe_dir''bftest' +$ goto loop_tests +$ test_cast: +$ mcr 'texe_dir''casttest' +$ goto loop_tests +$ test_rc2: +$ mcr 'texe_dir''rc2test' +$ goto loop_tests +$ test_rc4: +$ mcr 'texe_dir''rc4test' +$ goto loop_tests +$ test_rc5: +$ mcr 'texe_dir''rc5test' +$ goto loop_tests +$ test_rand: +$ mcr 'texe_dir''randtest' +$ goto loop_tests +$ test_enc: +$ @testenc.com +$ goto loop_tests +$ test_x509: +$ define sys$error nla0: +$ write sys$output "test normal x509v1 certificate" +$ @tx509.com +$ write sys$output "test first x509v3 certificate" +$ @tx509.com v3-cert1.pem +$ write sys$output "test second x509v3 certificate" +$ @tx509.com v3-cert2.pem +$ deassign sys$error +$ goto loop_tests +$ test_rsa: +$ define sys$error nla0: +$ @trsa.com +$ deassign sys$error +$ mcr 'texe_dir''rsatest' +$ goto loop_tests +$ test_crl: +$ define sys$error nla0: +$ @tcrl.com +$ deassign sys$error +$ goto loop_tests +$ test_sid: +$ define sys$error nla0: +$ @tsid.com +$ deassign sys$error +$ goto loop_tests +$ test_req: +$ define sys$error nla0: +$ @treq.com +$ @treq.com testreq2.pem +$ deassign sys$error +$ goto loop_tests +$ test_pkcs7: +$ define sys$error nla0: +$ @tpkcs7.com +$ @tpkcs7d.com +$ deassign sys$error +$ goto loop_tests +$ test_bn: +$ write sys$output "starting big number library test, could take a while..." +$ create bntest-vms.fdl +FILE + ORGANIZATION sequential +RECORD + FORMAT stream_lf +$ create/fdl=bntest-vms.fdl bntest-vms.sh +$ open/append foo bntest-vms.sh +$ type/output=foo: sys$input: +<< __FOO__ bc | awk '{ \ +if ($$0 != "0") {print "error"; exit(1); } \ +if (((NR+1)%64) == 0) print NR+1," tests done"; }' +$ define/user sys$output bntest-vms.tmp +$ mcr 'texe_dir''bntest' +$ copy bntest-vms.tmp foo: +$ delete bntest-vms.tmp;* +$ type/output=foo: sys$input: +__FOO__ +$ close foo +$ write sys$output "-- copy the [.test]bntest-vms.sh file to a Unix system and run it" +$ write sys$output "-- through sh or bash to verify that the bignum operations went well." +$ write sys$output "" +$ write sys$output "test a^b%c implementations" +$ mcr 'texe_dir''exptest' +$ goto loop_tests +$ 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 +$ goto loop_tests +$ test_dh: +$ write sys$output "Generate as set of DH parameters" +$ mcr 'texe_dir''dhtest' +$ goto loop_tests +$ test_dsa: +$ write sys$output "Generate as set of DSA parameters" +$ mcr 'texe_dir''dsatest' +$ goto loop_tests +$ test_reqgen: +$ write sys$output "Generate and verify a certificate request" +$ @testgen.com +$ goto loop_tests +$ test_ss: +$ write sys$output "Generate and certify a test certificate" +$ @testss.com +$ goto loop_tests +$ test_ssl: +$ write sys$output "test SSL protocol" +$ @testssl.com +$ goto loop_tests +$ test_ca: +$ write sys$output "Generate and certify a test certificate via the 'ca' program" +$ @testca.com +$ goto loop_tests +$ +$ +$ exit: +$ set default '__save_default' +$ exit diff --git a/test/testss.com b/test/testss.com new file mode 100644 index 0000000000..34eaa7b7ad --- /dev/null +++ b/test/testss.com @@ -0,0 +1,104 @@ +$! TESTSS.COM +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ digest="-mdc2" +$ reqcmd := mcr 'exe_dir'openssl req +$ x509cmd := mcr 'exe_dir'openssl x509 'digest' +$ verifycmd := mcr 'exe_dir'openssl verify +$ +$ CAkey="""keyCA.ss""" +$ CAcert="""certCA.ss""" +$ CAreq="""reqCA.ss""" +$ CAconf="""CAss.cnf""" +$ CAreq2="""req2CA.ss""" ! temp +$ +$ Uconf="""Uss.cnf""" +$ Ukey="""keyU.ss""" +$ Ureq="""reqU.ss""" +$ Ucert="""certU.ss""" +$ +$ write sys$output "" +$ write sys$output "make a certificate request using 'req'" +$ 'reqcmd' -config 'CAconf' -out 'CAreq' -keyout 'CAkey' -new ! -out err.ss +$ if $severity .ne. 1 +$ then +$ write sys$output "error using 'req' to generate a certificate request" +$ exit 3 +$ endif +$ write sys$output "" +$ write sys$output "convert the certificate request into a self signed certificate using 'x509'" +$ define /user sys$output err.ss +$ 'x509cmd' "-CAcreateserial" -in 'CAreq' -days 30 -req -out 'CAcert' -signkey 'CAkey' +$ if $severity .ne. 1 +$ then +$ write sys$output "error using 'x509' to self sign a certificate request" +$ exit 3 +$ endif +$ +$ write sys$output "" +$ write sys$output "convert a certificate into a certificate request using 'x509'" +$ define /user sys$output err.ss +$ 'x509cmd' -in 'CAcert' -x509toreq -signkey 'CAkey' -out 'CAreq2' +$ if $severity .ne. 1 +$ then +$ write sys$output "error using 'x509' convert a certificate to a certificate request" +$ exit 3 +$ endif +$ +$ 'reqcmd' -verify -in 'CAreq' -noout +$ if $severity .ne. 1 +$ then +$ write sys$output "first generated request is invalid" +$ exit 3 +$ endif +$ +$ 'reqcmd' -verify -in 'CAreq2' -noout +$ if $severity .ne. 1 +$ then +$ write sys$output "second generated request is invalid" +$ exit 3 +$ endif +$ +$ 'verifycmd' "-CAfile" 'CAcert' 'CAcert' +$ if $severity .ne. 1 +$ then +$ write sys$output "first generated cert is invalid" +$ exit 3 +$ endif +$ +$ write sys$output "" +$ write sys$output "make another certificate request using 'req'" +$ define /user sys$output err.ss +$ 'reqcmd' -config 'Uconf' -out 'Ureq' -keyout 'Ukey' -new +$ if $severity .ne. 1 +$ then +$ write sys$output "error using 'req' to generate a certificate request" +$ exit 3 +$ endif +$ +$ write sys$output "" +$ write sys$output "sign certificate request with the just created CA via 'x509'" +$ define /user sys$output err.ss +$ 'x509cmd' "-CAcreateserial" -in 'Ureq' -days 30 -req -out 'Ucert' "-CA" 'CAcert' "-CAkey" 'CAkey' +$ if $severity .ne. 1 +$ then +$ write sys$output "error using 'x509' to sign a certificate request" +$ exit 3 +$ endif +$ +$ 'verifycmd' "-CAfile" 'CAcert' 'Ucert' +$ write sys$output "" +$ write sys$output "Certificate details" +$ 'x509cmd' -subject -issuer -startdate -enddate -noout -in 'Ucert' +$ +$ write sys$output "" +$ write sys$output "The generated CA certificate is ",CAcert +$ write sys$output "The generated CA private key is ",CAkey +$ +$ write sys$output "The generated user certificate is ",Ucert +$ write sys$output "The generated user private key is ",Ukey +$ +$ delete err.ss;* diff --git a/test/testssl.com b/test/testssl.com new file mode 100644 index 0000000000..06c9f657a7 --- /dev/null +++ b/test/testssl.com @@ -0,0 +1,63 @@ +$! TESTSSL.COM +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.test] +$ +$ copy/concatenate [-.certs]*.pem certs.tmp +$ +$ write sys$output "test sslv2" +$ mcr 'exe_dir'ssltest -ssl2 +$ if $severity .ne. 1 then goto exit3 +$ +$ write sys$output "test sslv2 with server authentication" +$ mcr 'exe_dir'ssltest -ssl2 -server_auth "-CAfile" certs.tmp +$ if $severity .ne. 1 then goto exit3 +$ +$ write sys$output "test sslv2 with client authentication" +$ mcr 'exe_dir'ssltest -ssl2 -client_auth "-CAfile" certs.tmp +$ if $severity .ne. 1 then goto exit3 +$ +$ write sys$output "test sslv2 with both client and server authentication" +$ mcr 'exe_dir'ssltest -ssl2 -server_auth -client_auth "-CAfile" certs.tmp +$ if $severity .ne. 1 then goto exit3 +$ +$ write sys$output "test sslv3" +$ mcr 'exe_dir'ssltest -ssl3 +$ if $severity .ne. 1 then goto exit3 +$ +$ write sys$output "test sslv3 with server authentication" +$ mcr 'exe_dir'ssltest -ssl3 -server_auth "-CAfile" certs.tmp +$ if $severity .ne. 1 then goto exit3 +$ +$ write sys$output "test sslv3 with client authentication" +$ mcr 'exe_dir'ssltest -ssl3 -client_auth "-CAfile" certs.tmp +$ if $severity .ne. 1 then goto exit3 +$ +$ write sys$output "test sslv3 with both client and server authentication" +$ mcr 'exe_dir'ssltest -ssl3 -server_auth -client_auth "-CAfile" certs.tmp +$ if $severity .ne. 1 then goto exit3 +$ +$ write sys$output "test sslv2/sslv3" +$ mcr 'exe_dir'ssltest +$ if $severity .ne. 1 then goto exit3 +$ +$ write sys$output "test sslv2/sslv3 with server authentication" +$ mcr 'exe_dir'ssltest -server_auth "-CAfile" certs.tmp +$ if $severity .ne. 1 then goto exit3 +$ +$ write sys$output "test sslv2/sslv3 with client authentication" +$ mcr 'exe_dir'ssltest -client_auth "-CAfile" certs.tmp +$ if $severity .ne. 1 then goto exit3 +$ +$ write sys$output "test sslv2/sslv3 with both client and server authentication" +$ mcr 'exe_dir'ssltest -server_auth -client_auth "-CAfile" certs.tmp +$ if $severity .ne. 1 then goto exit3 +$ +$ RET = 1 +$ goto exit +$ exit3: +$ RET = 3 +$ exit: +$ delete certs.tmp;* +$ exit 'RET' diff --git a/test/tpkcs7.com b/test/tpkcs7.com new file mode 100644 index 0000000000..5ed920ac34 --- /dev/null +++ b/test/tpkcs7.com @@ -0,0 +1,49 @@ +$! TPKCS7.COM -- Tests pkcs7 keys +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ cmd := mcr 'exe_dir'openssl pkcs7 +$ +$ t := testp7.pem +$ if p1 .nes. "" then t = p1 +$ +$ write sys$output "testing PKCS7 conversions" +$ copy 't' fff.p +$ +$ write sys$output "p -> d" +$ 'cmd' -in fff.p -inform p -outform d -out f.d +$ if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in fff.p -inform p -outform p -out f.p +$ if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> d" +$ 'cmd' -in f.d -inform d -outform d -out ff.d1 +$ if $severity .ne. 1 then exit 3 +$ write sys$output "p -> d" +$ 'cmd' -in f.p -inform p -outform d -out ff.d3 +$ if $severity .ne. 1 then exit 3 +$ +$ +$ write sys$output "d -> p" +$ 'cmd' -in f.d -inform d -outform p -out ff.p1 +$ if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in f.p -inform p -outform p -out ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: fff.p f.p +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: f.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: f.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ delete f.*;*,ff.*;*,fff.*;* diff --git a/test/tpkcs7d.com b/test/tpkcs7d.com new file mode 100644 index 0000000000..08d33eaa69 --- /dev/null +++ b/test/tpkcs7d.com @@ -0,0 +1,42 @@ +$! TPKCS7.COM -- Tests pkcs7 keys +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ cmd := mcr 'exe_dir'openssl pkcs7 +$ +$ t := pkcs7-1.pem +$ if p1 .nes. "" then t = p1 +$ +$ write sys$output "testing PKCS7 conversions (2)" +$ copy 't' fff.p +$ +$ write sys$output "p -> d" +$ 'cmd' -in fff.p -inform p -outform d -out f.d +$ if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in fff.p -inform p -outform p -out f.p +$ if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> d" +$ 'cmd' -in f.d -inform d -outform d -out ff.d1 +$ if $severity .ne. 1 then exit 3 +$ write sys$output "p -> d" +$ 'cmd' -in f.p -inform p -outform d -out ff.d3 +$ if $severity .ne. 1 then exit 3 +$ +$ +$ write sys$output "d -> p" +$ 'cmd' -in f.d -inform d -outform p -out ff.p1 +$ if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in f.p -inform p -outform p -out ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: f.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: f.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ delete f.*;*,ff.*;*,fff.*;* diff --git a/test/treq.com b/test/treq.com new file mode 100644 index 0000000000..6483fa0672 --- /dev/null +++ b/test/treq.com @@ -0,0 +1,78 @@ +$! TREQ.COM -- Tests req keys +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ cmd := mcr 'exe_dir'openssl req +$ +$ t := testreq.pem +$ if p1 .nes. "" then t = p1 +$ +$ write sys$output "testing req conversions" +$ copy 't' fff.p +$ +$ write sys$output "p -> d" +$ 'cmd' -in fff.p -inform p -outform d -out f.d +$ if $severity .ne. 1 then exit 3 +$! write sys$output "p -> t" +$! 'cmd' -in fff.p -inform p -outform t -out f.t +$! if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in fff.p -inform p -outform p -out f.p +$ if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> d" +$ 'cmd' -verify -in f.d -inform d -outform d -out ff.d1 +$ if $severity .ne. 1 then exit 3 +$! write sys$output "t -> d" +$! 'cmd' -verify -in f.t -inform t -outform d -out ff.d2 +$! if $severity .ne. 1 then exit 3 +$ write sys$output "p -> d" +$ 'cmd' -verify -in f.p -inform p -outform d -out ff.d3 +$ if $severity .ne. 1 then exit 3 +$ +$! write sys$output "d -> t" +$! 'cmd' -in f.d -inform d -outform t -out ff.t1 +$! if $severity .ne. 1 then exit 3 +$! write sys$output "t -> t" +$! 'cmd' -in f.t -inform t -outform t -out ff.t2 +$! if $severity .ne. 1 then exit 3 +$! write sys$output "p -> t" +$! 'cmd' -in f.p -inform p -outform t -out ff.t3 +$! if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> p" +$ 'cmd' -in f.d -inform d -outform p -out ff.p1 +$ if $severity .ne. 1 then exit 3 +$! write sys$output "t -> p" +$! 'cmd' -in f.t -inform t -outform p -out ff.p2 +$! if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in f.p -inform p -outform p -out ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: fff.p f.p +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$! difference/output=nl: fff.p ff.p2 +$! if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$! difference/output=nl: f.t ff.t1 +$! if $severity .ne. 1 then exit 3 +$! difference/output=nl: f.t ff.t2 +$! if $severity .ne. 1 then exit 3 +$! difference/output=nl: f.t ff.t3 +$! if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: f.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$! difference/output=nl: f.p ff.p2 +$! if $severity .ne. 1 then exit 3 +$ difference/output=nl: f.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ delete f.*;*,ff.*;*,fff.*;* diff --git a/test/trsa.com b/test/trsa.com new file mode 100644 index 0000000000..9c9083d02b --- /dev/null +++ b/test/trsa.com @@ -0,0 +1,78 @@ +$! TRSA.COM -- Tests rsa keys +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ cmd := mcr 'exe_dir'openssl rsa +$ +$ t := testrsa.pem +$ if p1 .nes. "" then t = p1 +$ +$ write sys$output "testing RSA conversions" +$ copy 't' fff.p +$ +$ write sys$output "p -> d" +$ 'cmd' -in fff.p -inform p -outform d -out f.d +$ if $severity .ne. 1 then exit 3 +$! write sys$output "p -> t" +$! 'cmd' -in fff.p -inform p -outform t -out f.t +$! if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in fff.p -inform p -outform p -out f.p +$ if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> d" +$ 'cmd' -in f.d -inform d -outform d -out ff.d1 +$ if $severity .ne. 1 then exit 3 +$! write sys$output "t -> d" +$! 'cmd' -in f.t -inform t -outform d -out ff.d2 +$! if $severity .ne. 1 then exit 3 +$ write sys$output "p -> d" +$ 'cmd' -in f.p -inform p -outform d -out ff.d3 +$ if $severity .ne. 1 then exit 3 +$ +$! write sys$output "d -> t" +$! 'cmd' -in f.d -inform d -outform t -out ff.t1 +$! if $severity .ne. 1 then exit 3 +$! write sys$output "t -> t" +$! 'cmd' -in f.t -inform t -outform t -out ff.t2 +$! if $severity .ne. 1 then exit 3 +$! write sys$output "p -> t" +$! 'cmd' -in f.p -inform p -outform t -out ff.t3 +$! if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> p" +$ 'cmd' -in f.d -inform d -outform p -out ff.p1 +$ if $severity .ne. 1 then exit 3 +$! write sys$output "t -> p" +$! 'cmd' -in f.t -inform t -outform p -out ff.p2 +$! if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in f.p -inform p -outform p -out ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: fff.p f.p +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$! difference/output=nl: fff.p ff.p2 +$! if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$! difference/output=nl: f.t ff.t1 +$! if $severity .ne. 1 then exit 3 +$! difference/output=nl: f.t ff.t2 +$! if $severity .ne. 1 then exit 3 +$! difference/output=nl: f.t ff.t3 +$! if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: f.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$! difference/output=nl: f.p ff.p2 +$! if $severity .ne. 1 then exit 3 +$ difference/output=nl: f.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ delete f.*;*,ff.*;*,fff.*;* diff --git a/test/tsid.com b/test/tsid.com new file mode 100644 index 0000000000..28d83e5c4e --- /dev/null +++ b/test/tsid.com @@ -0,0 +1,78 @@ +$! TSID.COM -- Tests sid keys +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ cmd := mcr 'exe_dir'openssl sess_id +$ +$ t := testsid.pem +$ if p1 .nes. "" then t = p1 +$ +$ write sys$output "testing session-id conversions" +$ copy 't' fff.p +$ +$ write sys$output "p -> d" +$ 'cmd' -in fff.p -inform p -outform d -out f.d +$ if $severity .ne. 1 then exit 3 +$! write sys$output "p -> t" +$! 'cmd' -in fff.p -inform p -outform t -out f.t +$! if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in fff.p -inform p -outform p -out f.p +$ if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> d" +$ 'cmd' -in f.d -inform d -outform d -out ff.d1 +$ if $severity .ne. 1 then exit 3 +$! write sys$output "t -> d" +$! 'cmd' -in f.t -inform t -outform d -out ff.d2 +$! if $severity .ne. 1 then exit 3 +$ write sys$output "p -> d" +$ 'cmd' -in f.p -inform p -outform d -out ff.d3 +$ if $severity .ne. 1 then exit 3 +$ +$! write sys$output "d -> t" +$! 'cmd' -in f.d -inform d -outform t -out ff.t1 +$! if $severity .ne. 1 then exit 3 +$! write sys$output "t -> t" +$! 'cmd' -in f.t -inform t -outform t -out ff.t2 +$! if $severity .ne. 1 then exit 3 +$! write sys$output "p -> t" +$! 'cmd' -in f.p -inform p -outform t -out ff.t3 +$! if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> p" +$ 'cmd' -in f.d -inform d -outform p -out ff.p1 +$ if $severity .ne. 1 then exit 3 +$! write sys$output "t -> p" +$! 'cmd' -in f.t -inform t -outform p -out ff.p2 +$! if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in f.p -inform p -outform p -out ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: fff.p f.p +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$! difference/output=nl: fff.p ff.p2 +$! if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$! difference/output=nl: f.t ff.t1 +$! if $severity .ne. 1 then exit 3 +$! difference/output=nl: f.t ff.t2 +$! if $severity .ne. 1 then exit 3 +$! difference/output=nl: f.t ff.t3 +$! if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: f.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$! difference/output=nl: f.p ff.p2 +$! if $severity .ne. 1 then exit 3 +$ difference/output=nl: f.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ delete f.*;*,ff.*;*,fff.*;* diff --git a/test/tverify.com b/test/tverify.com new file mode 100644 index 0000000000..f97e71478f --- /dev/null +++ b/test/tverify.com @@ -0,0 +1,26 @@ +$! TVERIFY.COM +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ copy/concatenate [-.certs]*.pem certs.tmp +$ +$ old_f := +$ loop_certs: +$ c := NO +$ certs := +$ loop_certs2: +$ f = f$search("[-.certs]*.pem") +$ if f .nes. "" .and. f .nes. old_f +$ then +$ certs = certs + " [-.certs]" + f$parse(f,,,"NAME") + ".pem" +$ if f$length(certs) .lt. 180 then goto loop_certs2 +$ c := YES +$ endif +$ certs = certs - " " +$ +$ mcr 'exe_dir'openssl verify "-CAfile" certs.tmp 'certs' +$ if c then goto loop_certs +$ +$ delete certs.tmp;* diff --git a/test/tx509.com b/test/tx509.com new file mode 100644 index 0000000000..bbcf0a384b --- /dev/null +++ b/test/tx509.com @@ -0,0 +1,78 @@ +$! TX509.COM -- Tests x509 certificates +$ +$ __arch := VAX +$ if f$getsyi("cpu") .ge. 128 then __arch := AXP +$ exe_dir := sys$disk:[-.'__arch'.exe.apps] +$ +$ cmd := mcr 'exe_dir'openssl x509 +$ +$ t := testx509.pem +$ if p1 .nes. "" then t = p1 +$ +$ write sys$output "testing X509 conversions" +$ copy 't' fff.p +$ +$ write sys$output "p -> d" +$ 'cmd' -in fff.p -inform p -outform d -out f.d +$ if $severity .ne. 1 then exit 3 +$ write sys$output "p -> n" +$ 'cmd' -in fff.p -inform p -outform n -out f.n +$ if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in fff.p -inform p -outform p -out f.p +$ if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> d" +$ 'cmd' -in f.d -inform d -outform d -out ff.d1 +$ if $severity .ne. 1 then exit 3 +$ write sys$output "n -> d" +$ 'cmd' -in f.n -inform n -outform d -out ff.d2 +$ if $severity .ne. 1 then exit 3 +$ write sys$output "p -> d" +$ 'cmd' -in f.p -inform p -outform d -out ff.d3 +$ if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> n" +$ 'cmd' -in f.d -inform d -outform n -out ff.n1 +$ if $severity .ne. 1 then exit 3 +$ write sys$output "n -> n" +$ 'cmd' -in f.n -inform n -outform n -out ff.n2 +$ if $severity .ne. 1 then exit 3 +$ write sys$output "p -> n" +$ 'cmd' -in f.p -inform p -outform n -out ff.n3 +$ if $severity .ne. 1 then exit 3 +$ +$ write sys$output "d -> p" +$ 'cmd' -in f.d -inform d -outform p -out ff.p1 +$ if $severity .ne. 1 then exit 3 +$ write sys$output "n -> p" +$ 'cmd' -in f.n -inform n -outform p -out ff.p2 +$ if $severity .ne. 1 then exit 3 +$ write sys$output "p -> p" +$ 'cmd' -in f.p -inform p -outform p -out ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: fff.p f.p +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p2 +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: fff.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: f.n ff.n1 +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: f.n ff.n2 +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: f.n ff.n3 +$ if $severity .ne. 1 then exit 3 +$ +$ difference/output=nl: f.p ff.p1 +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: f.p ff.p2 +$ if $severity .ne. 1 then exit 3 +$ difference/output=nl: f.p ff.p3 +$ if $severity .ne. 1 then exit 3 +$ +$ delete f.*;*,ff.*;*,fff.*;* |