cvs rdiff -r vendor_ver_097g -r nw_merged_ver_097g openssl_097 cvs server: Diffing openssl_097 Index: openssl_097/Configure diff -c openssl_097/Configure:1.1.1.8 openssl_097/Configure:1.1.1.1.2.9 *** openssl_097/Configure:1.1.1.8 Mon Apr 11 13:52:46 2005 --- openssl_097/Configure Tue Apr 12 10:41:20 2005 *************** *** 539,544 **** --- 539,551 ---- "Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32", "Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:cygwin-shared:-D_WINDLL::.dll", + # NetWare from David Ward (dsward@novell.com) - requires MetroWerks NLM development tools + # netware-clib => legacy CLib c-runtime support + "netware-clib", "mwccnlm:::::${x86_gcc_opts}:::", + # netware-libc => LibC/NKS support + "netware-libc", "mwccnlm:::::BN_LLONG ${x86_gcc_opts}:::", + "netware-libc-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -I/ndk/libc/include/winsock -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall::::${x86_gcc_opts}:::", + # DJGPP "DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall -DDEVRANDOM=\"/dev/urandom\\x24\":::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::", *************** *** 590,597 **** ); ! my @WinTargets=qw(VC-NT VC-CE VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS ! BC-32 BC-16 Mingw32 OS2-EMX); my $idx = 0; my $idx_cc = $idx++; --- 597,604 ---- ); ! my @MK1MF_Builds=qw(VC-NT VC-CE VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS ! BC-32 BC-16 Mingw32 OS2-EMX netware-clib netware-libc); my $idx = 0; my $idx_cc = $idx++; *************** *** 948,954 **** &usage if (!defined($table{$target})); ! my $IsWindows=scalar grep /^$target$/,@WinTargets; $exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target eq "mingw"); $exe_ext=".pm" if ($target eq "vos-gcc" or $target eq "debug-vos-gcc" or $target eq "vos-vcc" or $target eq "debug-vos-vcc"); --- 955,961 ---- &usage if (!defined($table{$target})); ! my $IsMK1MF=scalar grep /^$target$/,@MK1MF_Builds; $exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target eq "mingw"); $exe_ext=".pm" if ($target eq "vos-gcc" or $target eq "debug-vos-gcc" or $target eq "vos-vcc" or $target eq "debug-vos-vcc"); *************** *** 966,972 **** $openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/; ! print "IsWindows=$IsWindows\n"; my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); my $cc = $fields[$idx_cc]; --- 973,979 ---- $openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/; ! print "IsMK1MF=$IsMK1MF\n"; my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); my $cc = $fields[$idx_cc]; *************** *** 1521,1527 **** print "BF_PTR used\n" if $bf_ptr == 1; print "BF_PTR2 used\n" if $bf_ptr == 2; ! if($IsWindows) { open (OUT,">crypto/buildinf.h") || die "Can't open buildinf.h"; printf OUT <crypto/buildinf.h") || die "Can't open buildinf.h"; printf OUT <MINFO + generates a listing of source files (used by mk1mf) + + perl util\mk1mf.pl no-asm [other config opts] [netware-clib|netware-libc >netware\nlm.mak + generates the makefile for NetWare + + gmake -f netware\nlm.mak + build with the make tool (nmake.exe also works) + + NOTE: If you are building using the assembly option, you must also run the + various Perl scripts to generate the assembly files. See build.bat + for an example of running the various assembly scripts. You must use the + "no-asm" option to build without assembly. The configure and mk1mf scripts + also have various other options. See the scripts for more information. + + + The output from the build is placed in the following directories: + + CLIB Debug build: + out_nw_clib.dbg - static libs & test nlm(s) + tmp_nw_clib.dbg - temporary build files + outinc_nw_clib - necessary include files + + CLIB Non-debug build: + out_nw_clib - static libs & test nlm(s) + tmp_nw_clib - temporary build files + outinc_nw_clib - necesary include files + + LibC Debug build: + out_nw_libc.dbg - static libs & test nlm(s) + tmp_nw_libc.dbg - temporary build files + outinc_nw_libc - necessary include files + + LibC Non-debug build: + out_nw_libc - static libs & test nlm(s) + tmp_nw_libc - temporary build files + outinc_nw_libc - necesary include files + + + TESTING: + -------- + The build process creates the OpenSSL static libs ( crypto.lib, ssl.lib, + rsaglue.lib ) and several test programs. You should copy the test programs + to your NetWare server and run the tests. + + The batch file "netware\cpy_tests.bat" will copy all the necessary files + to your server for testing. In order to run the batch file, you need a + drive mapped to your target server. It will create an "OpenSSL" directory + on the drive and copy the test files to it. CAUTION: If a directory with the + name of "OpenSSL" already exists, it will be deleted. + + To run cpy_tests.bat: + + netware\cpy_tests [output directory] [NetWare drive] + + output directory - "out_nw_clib.dbg", "out_nw_libc", etc. + NetWare drive - drive letter of mapped drive + + CLIB ex: netware\cpy_tests out_nw_clib m: + LibC ex: netware\cpy_tests out_nw_libc m: + + + The Perl script, "do_tests.pl", in the "OpenSSL" directory on the server + should be used to execute the tests. Before running the script, make sure + your SEARCH PATH includes the "OpenSSL" directory. For example, if you + copied the files to the "sys:" volume you use the command: + + SEARCH ADD SYS:\OPENSSL + + + To run do_tests.pl type (at the console prompt): + + perl \openssl\do_tests.pl [options] + + options: + -p - pause after executing each test + + The do_tests.pl script generates a log file "\openssl\test_out\tests.log" + which should be reviewed for errors. Any errors will be denoted by the word + "ERROR" in the log. + + NOTE: Currently (11/2002), the LibC test nlms report an error while loading + when launched from the perl script (do_tests.pl). The problems are + being addressed by the LibC development team and should be fixed in the + next release. Until the problems are corrected, the LibC test nlms + will have to be executed manually. + + + DEVELOPING WITH THE OPENSSL SDK: + -------------------------------- + Now that everything is built and tested, you are ready to use the OpenSSL + libraries in your development. + + There is no real installation procedure, just copy the static libs and + headers to your build location. The libs (crypto.lib & ssl.lib) are + located in the appropriate "out_nw_XXXX" directory + (out_nw_clib, out_nw_libc, etc). + + The headers are located in the appropriate "outinc_nw_XXX" directory + (outinc_nw_clib, outinc_nw_libc). + + One suggestion is to create the following directory + structure for the OpenSSL SDK: + + \openssl + |- bin + | |- openssl.nlm + | |- (other tests you want) + | + |- lib + | | - crypto.lib + | | - ssl.lib + | + |- include + | | - openssl + | | | - (all the headers in "outinc_nw\openssl") + + + The program "openssl.nlm" can be very useful. It has dozens of + options and you may want to keep it handy for debugging, testing, etc. + + When building your apps using OpenSSL, define "NETWARE". It is needed by + some of the OpenSSL headers. One way to do this is with a compile option, + for example "-DNETWARE". + + + + NOTES: + ------ + + Resource leaks in Tests + ------------------------ + Some OpenSSL tests do not clean up resources and NetWare reports + the resource leaks when the tests unload. If this really bugs you, + you can stop the messages by setting the developer option off at the console + prompt (set developer option = off). Or better yet, fix the tests to + clean up the resources! + + + Multi-threaded Development + --------------------------- + The NetWare version of OpenSSL is thread-safe however, multi-threaded + applications must provide the necessary locking function callbacks. This + is described in doc\threads.doc. The file "openssl\crypto\threads\mttest.c" + is a multi-threaded test program and demonstrates the locking functions. + + + What is openssl2.nlm? + --------------------- + The openssl program has numerous options and can be used for many different + things. Many of the options operate in an interactive mode requiring the + user to enter data. Because of this, a default screen is created for the + program. However, when running the test script it is not desirable to + have a seperate screen. Therefore, the build also creates openssl2.nlm. + Openssl2.nlm is functionally identical but uses the console screen. + Openssl2 can be used when a non-interactive mode is desired. + + NOTE: There are may other possibilities (command line options, etc) + which could have been used to address the screen issue. The openssl2.nlm + option was chosen because it impacted only the build not the code. + + + Why only static libraries? + -------------------------- + Globals, globals, and more globals. The OpenSSL code uses many global + variables that are allocated and initialized when used for the first time. + + On NetWare, most applications (at least historically) run in the kernel. + When running in the kernel, there is one instance of global variables. + For regular application type NLM(s) this isn't a problem because they are + the only ones using the globals. However, for a library NLM (an NLM which + exposes functions and has no threads of execution), the globals cause + problems. Applications could inadvertently step on each other if they + change some globals. Even worse, the first application that triggers a + global to be allocated and initialized has the allocated memory charged to + itself. Now when that application unloads, NetWare will clean up all the + applicaton's memory. The global pointer variables inside OpenSSL now + point to freed memory. An abend waiting to happen! + + To work correctly in the kernel, library NLM(s) that use globals need to + provide a set of globals (instance data) for each application. Another + option is to require the library only be loaded in a protected address + space along with the application using it. + + Modifying the OpenSSL code to provide a set of globals (instance data) for + each application isn't technically difficult, but due to the large number + globals it would require substantial code changes and it wasn't done. Hence, + the build currently only builds static libraries which are then linked + into each application. + + NOTE: If you are building a library NLM that uses the OpenSSL static + libraries, you will still have to deal with the global variable issue. + This is because when you link in the OpenSSL code you bring in all the + globals. One possible solution for the global pointer variables is to + register memory functions with OpenSSL which allocate memory and charge it + to your library NLM (see the function CRYPTO_set_mem_functions). However, + be aware that now all memory allocated by OpenSSL is charged to your NLM. + + + CodeWarrior Tools and W2K + --------------------------- + There have been problems reported with the CodeWarrior Linker + (mwldnlm.exe) in the PDK 2.1 for NetWare when running on Windows 2000. The + problems cause the link step to fail. The only work around is to obtain an + updated linker from Metrowerks. It is expected Metrowerks will release + PDK 3.0 (in beta testing at this time - May, 2001) in the near future which + will fix these problems. + + + Makefile "vclean" + ------------------ + The generated makefile has a "vclean" target which cleans up the build + directories. If you have been building successfully and suddenly + experience problems, use "vclean" (gmake -f netware\nlm.mak vclean) and retry. + + + "Undefined Symbol" Linker errors + -------------------------------- + There have been linker errors reported when doing a CLIB build. The problems + occur because some versions of the CLIB SDK import files inadvertently + left out some symbols. One symbol in particular is "_lrotl". The missing + functions are actually delivered in the binaries, but they were left out of + the import files. The issues should be fixed in the September 2001 release + of the NDK. If you experience the problems you can temporarily + work around it by manually adding the missing symbols to your version of + "clib.imp". + Index: openssl_097/e_os.h diff -c openssl_097/e_os.h:1.1.1.4 openssl_097/e_os.h:1.1.1.1.2.8 *** openssl_097/e_os.h:1.1.1.4 Fri Apr 1 14:49:38 2005 --- openssl_097/e_os.h Mon Apr 11 11:22:18 2005 *************** *** 181,186 **** --- 181,191 ---- #define closesocket(s) close(s) #define readsocket(s,b,n) read((s),(b),(n)) #define writesocket(s,b,n) write((s),(char *)(b),(n)) + #elif defined(OPENSSL_SYS_NETWARE) + #define get_last_socket_error() WSAGetLastError() + #define clear_socket_error() WSASetLastError(0) + #define readsocket(s,b,n) recv((s),(b),(n),0) + #define writesocket(s,b,n) send((s),(b),(n),0) #else #define get_last_socket_error() errno #define clear_socket_error() errno=0 *************** *** 321,326 **** --- 326,351 ---- __VMS_EXIT |= 0x10000000; \ exit(__VMS_EXIT); } while(0) # define NO_SYS_PARAM_H + + # elif defined(OPENSSL_SYS_NETWARE) + # include + # include + # define NO_SYS_TYPES_H + # undef DEVRANDOM + # ifdef NETWARE_CLIB + # define getpid GetThreadID + # endif + # define NO_SYSLOG + # define _setmode setmode + # define _kbhit kbhit + # define _O_TEXT O_TEXT + # define _O_BINARY O_BINARY + # define OPENSSL_CONF "openssl.cnf" + # define SSLEAY_CONF OPENSSL_CONF + # define RFILE ".rnd" + # define LIST_SEPARATOR_CHAR ';' + # define EXIT(n) { if (n) printf("ERROR: %d\n", (int)n); exit(n); } + # else /* !defined VMS */ # ifdef OPENSSL_SYS_MPE *************** *** 393,398 **** --- 418,436 ---- # define SHUTDOWN(fd) MacSocket_close(fd) # define SHUTDOWN2(fd) MacSocket_close(fd) + # elif defined(OPENSSL_SYS_NETWARE) + /* NetWare uses the WinSock2 interfaces + */ + # if defined(NETWARE_CLIB) + # include + # elif defined(NETWARE_LIBC) + # include + # endif + # define SSLeay_Write(a,b,c) send((a),(b),(c),0) + # define SSLeay_Read(a,b,c) recv((a),(b),(c),0) + # define SHUTDOWN(fd) { shutdown((fd),0); closesocket(fd); } + # define SHUTDOWN2(fd) { shutdown((fd),2); closesocket(fd); } + # else # ifndef NO_SYS_PARAM_H *************** *** 520,525 **** --- 558,567 ---- # define strncasecmp OPENSSL_strncasecmp # define OPENSSL_IMPLEMENTS_strncasecmp #elif defined(OPENSSL_SYS_OS2) && defined(__EMX__) + # define strcasecmp stricmp + # define strncasecmp strnicmp + #elif defined(OPENSSL_SYS_NETWARE) + # include # define strcasecmp stricmp # define strncasecmp strnicmp #else Index: openssl_097/e_os2.h diff -c openssl_097/e_os2.h:1.1.1.2 openssl_097/e_os2.h:1.1.1.1.2.2 *** openssl_097/e_os2.h:1.1.1.2 Fri Oct 29 09:35:58 2004 --- openssl_097/e_os2.h Sat Oct 30 10:28:41 2004 *************** *** 76,81 **** --- 76,87 ---- # define OPENSSL_SYS_MACINTOSH_CLASSIC #endif + /* ----------------------- NetWare ----------------------------------------- */ + #if defined(NETWARE) || defined(OPENSSL_SYSNAME_NETWARE) + # undef OPENSSL_SYS_UNIX + # define OPENSSL_SYS_NETWARE + #endif + /* ---------------------- Microsoft operating systems ---------------------- */ /* The 16 bit environments are pretty straightforward */ cvs server: Diffing openssl_097/MacOS cvs server: Diffing openssl_097/MacOS/GetHTTPS.src cvs server: Diffing openssl_097/Netware Index: openssl_097/Netware/build.bat diff -c /dev/null openssl_097/Netware/build.bat:1.1.2.1 *** /dev/null Tue Apr 12 11:40:52 2005 --- openssl_097/Netware/build.bat Tue May 6 14:07:50 2003 *************** *** 0 **** --- 1,204 ---- + @echo off + + rem ======================================================================== + rem Batch file to automate building OpenSSL for NetWare. + rem + rem usage: + rem build [target] [debug opts] [assembly opts] [configure opts] + rem + rem target - "netware-clib" - CLib NetWare build + rem - "netware-libc" - LibC NKS NetWare build + rem + rem debug opts - "debug" - build debug + rem + rem assembly opts - "nw-mwasm" - use Metrowerks assembler + rem "nw-nasm" - use NASM assembler + rem "no-asm" - don't use assembly + rem + rem configure opts- all unrecognized arguments are passed to the + rem perl configure script + rem + rem If no arguments are specified the default is to build non-debug with + rem no assembly. NOTE: there is no default BLD_TARGET. + rem + + + + rem No assembly is the default - Uncomment section below to change + rem the assembler default + set ASM_MODE= + set ASSEMBLER= + set NO_ASM=no-asm + + rem Uncomment to default to the Metrowerks assembler + rem set ASM_MODE=nw-mwasm + rem set ASSEMBLER=Metrowerks + rem set NO_ASM= + + rem Uncomment to default to the NASM assembler + rem set ASM_MODE=nw-nasm + rem set ASSEMBLER=NASM + rem set NO_ASM= + + rem No default Bld target + set BLD_TARGET=no_target + rem set BLD_TARGET=netware-clib + rem set BLD_TARGET=netware-libc + + + rem Default to build non-debug + set DEBUG= + + rem Uncomment to default to debug build + rem set DEBUG=debug + + + set CONFIG_OPTS= + set ARG_PROCESSED=NO + + + rem Process command line args + :opts + if "a%1" == "a" goto endopt + if "%1" == "no-asm" set NO_ASM=no-asm + if "%1" == "no-asm" set ARG_PROCESSED=YES + if "%1" == "debug" set DEBUG=debug + if "%1" == "debug" set ARG_PROCESSED=YES + if "%1" == "nw-nasm" set ASM_MODE=nw-nasm + if "%1" == "nw-nasm" set ASSEMBLER=NASM + if "%1" == "nw-nasm" set NO_ASM= + if "%1" == "nw-nasm" set ARG_PROCESSED=YES + if "%1" == "nw-mwasm" set ASM_MODE=nw-mwasm + if "%1" == "nw-mwasm" set ASSEMBLER=Metrowerks + if "%1" == "nw-mwasm" set NO_ASM= + if "%1" == "nw-mwasm" set ARG_PROCESSED=YES + if "%1" == "netware-clib" set BLD_TARGET=netware-clib + if "%1" == "netware-clib" set ARG_PROCESSED=YES + if "%1" == "netware-libc" set BLD_TARGET=netware-libc + if "%1" == "netware-libc" set ARG_PROCESSED=YES + + rem If we didn't recognize the argument, consider it an option for config + if "%ARG_PROCESSED%" == "NO" set CONFIG_OPTS=%CONFIG_OPTS% %1 + if "%ARG_PROCESSED%" == "YES" set ARG_PROCESSED=NO + + shift + goto opts + :endopt + + rem make sure a valid BLD_TARGET was specified + if "%BLD_TARGET%" == "no_target" goto no_target + + rem build the nlm make file name which includes target and debug info + set NLM_MAKE= + if "%BLD_TARGET%" == "netware-clib" set NLM_MAKE=netware\nlm_clib + if "%BLD_TARGET%" == "netware-libc" set NLM_MAKE=netware\nlm_libc + if "%DEBUG%" == "" set NLM_MAKE=%NLM_MAKE%.mak + if "%DEBUG%" == "debug" set NLM_MAKE=%NLM_MAKE%_dbg.mak + + if "%NO_ASM%" == "no-asm" set ASM_MODE= + if "%NO_ASM%" == "no-asm" set ASSEMBLER= + if "%NO_ASM%" == "no-asm" set CONFIG_OPTS=%CONFIG_OPTS% no-asm + if "%NO_ASM%" == "no-asm" goto do_config + + + rem ================================================== + echo Generating x86 for %ASSEMBLER% assembler + + echo Bignum + cd crypto\bn\asm + perl x86.pl %ASM_MODE% > bn-nw.asm + cd ..\..\.. + + echo DES + cd crypto\des\asm + perl des-586.pl %ASM_MODE% > d-nw.asm + cd ..\..\.. + + echo "crypt(3)" + + cd crypto\des\asm + perl crypt586.pl %ASM_MODE% > y-nw.asm + cd ..\..\.. + + echo Blowfish + + cd crypto\bf\asm + perl bf-586.pl %ASM_MODE% > b-nw.asm + cd ..\..\.. + + echo CAST5 + cd crypto\cast\asm + perl cast-586.pl %ASM_MODE% > c-nw.asm + cd ..\..\.. + + echo RC4 + cd crypto\rc4\asm + perl rc4-586.pl %ASM_MODE% > r4-nw.asm + cd ..\..\.. + + echo MD5 + cd crypto\md5\asm + perl md5-586.pl %ASM_MODE% > m5-nw.asm + cd ..\..\.. + + echo SHA1 + cd crypto\sha\asm + perl sha1-586.pl %ASM_MODE% > s1-nw.asm + cd ..\..\.. + + echo RIPEMD160 + cd crypto\ripemd\asm + perl rmd-586.pl %ASM_MODE% > rm-nw.asm + cd ..\..\.. + + echo RC5\32 + cd crypto\rc5\asm + perl rc5-586.pl %ASM_MODE% > r5-nw.asm + cd ..\..\.. + + rem =============================================================== + rem + :do_config + + echo . + echo configure options: %CONFIG_OPTS% %BLD_TARGET% + echo . + perl configure %CONFIG_OPTS% %BLD_TARGET% + + perl util\mkfiles.pl >MINFO + + echo . + echo mk1mf.pl options: %DEBUG% %ASM_MODE% %CONFIG_OPTS% %BLD_TARGET% + echo . + perl util\mk1mf.pl %DEBUG% %ASM_MODE% %CONFIG_OPTS% %BLD_TARGET% >%NLM_MAKE% + + echo The makefile "%NLM_MAKE%" has been created use your maketool to + echo build (ex: gmake -f %NLM_MAKE%) + goto end + + rem =============================================================== + rem + :no_target + echo . + echo . No build target specified!!! + echo . + echo . usage: build [target] [debug opts] [assembly opts] [configure opts] + echo . + echo . target - "netware-clib" - CLib NetWare build + echo . - "netware-libc" - LibC NKS NetWare build + echo . + echo . debug opts - "debug" - build debug + echo . + echo . assembly opts - "nw-mwasm" - use Metrowerks assembler + echo . "nw-nasm" - use NASM assembler + echo . "no-asm" - don't use assembly + echo . + echo . configure opts- all unrecognized arguments are passed to the + echo . perl configure script + echo . + echo . If no debug or assembly opts are specified the default is to build + echo . non-debug without assembly + echo . + + + :end Index: openssl_097/Netware/cpy_tests.bat diff -c /dev/null openssl_097/Netware/cpy_tests.bat:1.1.2.1 *** /dev/null Tue Apr 12 11:40:52 2005 --- openssl_097/Netware/cpy_tests.bat Tue May 6 14:07:51 2003 *************** *** 0 **** --- 1,112 ---- + @echo off + + rem Batch file to copy OpenSSL stuff to a NetWare server for testing + + rem This batch file will create an "opensssl" directory at the root of the + rem specified NetWare drive and copy the required files to run the tests. + rem It should be run from inside the "openssl\netware" subdirectory. + + rem Usage: + rem cpy_tests.bat + rem - out_nw.dbg | out_nw + rem - any mapped drive letter + rem + rem example ( copy from debug build to m: dirve ): + rem cpy_tests.bat out_nw.dbg m: + rem + rem CAUTION: If a directory named OpenSSL exists on the target drive + rem it will be deleted first. + + + if "%1" == "" goto usage + if "%2" == "" goto usage + + rem Assume running in \openssl directory unless cpy_tests.bat exists then + rem it must be the \openssl\netware directory + set loc=. + if exist cpy_tests.bat set loc=.. + + rem make sure the local build subdirectory specified is valid + if not exist %loc%\%1\NUL goto invalid_dir + + rem make sure target drive is valid + if not exist %2\NUL goto invalid_drive + + rem If an OpenSSL directory exists on the target drive, remove it + if exist %2\openssl\NUL goto remove_openssl + goto do_copy + + :remove_openssl + echo . + echo OpenSSL directory exists on %2 - it will be removed! + pause + rmdir %2\openssl /s /q + + :do_copy + rem make an "openssl" directory and others at the root of the NetWare drive + mkdir %2\openssl + mkdir %2\openssl\test_out + mkdir %2\openssl\apps + mkdir %2\openssl\certs + mkdir %2\openssl\test + + + rem copy the test nlms + copy %loc%\%1\*.nlm %2\openssl\ + + rem copy the test perl script + copy %loc%\netware\do_tests.pl %2\openssl\ + + rem copy the certs directory stuff + xcopy %loc%\certs\*.* %2\openssl\certs\ /s + + rem copy the test directory stuff + copy %loc%\test\CAss.cnf %2\openssl\test\ + copy %loc%\test\Uss.cnf %2\openssl\test\ + copy %loc%\test\pkcs7.pem %2\openssl\test\ + copy %loc%\test\pkcs7-1.pem %2\openssl\test\ + copy %loc%\test\testcrl.pem %2\openssl\test\ + copy %loc%\test\testp7.pem %2\openssl\test\ + copy %loc%\test\testreq2.pem %2\openssl\test\ + copy %loc%\test\testrsa.pem %2\openssl\test\ + copy %loc%\test\testsid.pem %2\openssl\test\ + copy %loc%\test\testx509.pem %2\openssl\test\ + copy %loc%\test\v3-cert1.pem %2\openssl\test\ + copy %loc%\test\v3-cert2.pem %2\openssl\test\ + + rem copy the apps directory stuff + copy %loc%\apps\client.pem %2\openssl\apps\ + copy %loc%\apps\server.pem %2\openssl\apps\ + copy %loc%\apps\openssl.cnf %2\openssl\apps\ + + echo . + echo Tests copied + echo Run the test script at the console by typing: + echo "Perl \openssl\do_tests.pl" + echo . + echo Make sure the Search path includes the OpenSSL subdirectory + + goto end + + :invalid_dir + echo. + echo Invalid build directory specified: %1 + echo. + goto usage + + :invalid_drive + echo. + echo Invalid drive: %2 + echo. + goto usage + + :usage + echo. + echo usage: cpy_tests.bat [test subdirectory] [NetWare drive] + echo [test subdirectory] - out_nw_clib.dbg, out_nw_libc.dbg, etc. + echo [NetWare drive] - any mapped drive letter + echo. + echo example: cpy_test out_nw_clib.dbg M: + echo (copy from clib debug build area to M: drive) + + :end Index: openssl_097/Netware/do_tests.pl diff -c /dev/null openssl_097/Netware/do_tests.pl:1.1.2.3 *** /dev/null Tue Apr 12 11:40:52 2005 --- openssl_097/Netware/do_tests.pl Mon Apr 11 11:22:19 2005 *************** *** 0 **** --- 1,587 ---- + # perl script to run OpenSSL tests + + + my $base_path = "\\openssl"; + + my $output_path = "$base_path\\test_out"; + my $cert_path = "$base_path\\certs"; + my $test_path = "$base_path\\test"; + my $app_path = "$base_path\\apps"; + + my $tmp_cert = "$output_path\\cert.tmp"; + my $OpenSSL_config = "$app_path\\openssl.cnf"; + my $log_file = "$output_path\\tests.log"; + + my $pause = 0; + + + # process the command line args to see if they wanted us to pause + # between executing each command + foreach $i (@ARGV) + { + if ($i =~ /^-p$/) + { $pause=1; } + } + + + + main(); + + + ############################################################################ + sub main() + { + # delete all the output files in the output directory + unlink <$output_path\\*.*>; + + # open the main log file + open(OUT, ">$log_file") || die "unable to open $log_file\n"; + + + algorithm_tests(); + encryption_tests(); + pem_tests(); + verify_tests(); + ca_tests(); + ssl_tests(); + + close(OUT); + + print("\nCompleted running tests.\n\n"); + print("Check log file for errors: $log_file\n"); + } + + ############################################################################ + sub algorithm_tests + { + my $i; + my $outFile; + my @tests = ( rsa_test, destest, ideatest, bftest, shatest, sha1test, + md5test, dsatest, ectest, md2test, mdc2test, rc2test, rc4test, randtest, + dhtest, exptest ); + + print( "\nRUNNING CRYPTO ALGORITHM TESTS:\n\n"); + + print( OUT "\n========================================================\n"); + print( OUT "CRYPTO ALGORITHM TESTS:\n\n"); + + foreach $i (@tests) + { + $outFile = "$output_path\\$i.out"; + system("$i > $outFile"); + log_desc("Test: $i\.nlm:"); + log_output("", $outFile ); + } + } + + ############################################################################ + sub encryption_tests + { + my $i; + my $outFile; + my @enc_tests = ( "enc", "rc4", "des-cfb", "des-ede-cfb", "des-ede3-cfb", + "des-ofb", "des-ede-ofb", "des-ede3-ofb", + "des-ecb", "des-ede", "des-ede3", "des-cbc", + "des-ede-cbc", "des-ede3-cbc", "idea-ecb", "idea-cfb", + "idea-ofb", "idea-cbc", "rc2-ecb", "rc2-cfb", + "rc2-ofb", "rc2-cbc", "bf-ecb", "bf-cfb", + "bf-ofb", "bf-cbc" ); + + my $input = "$base_path\\do_tests.pl"; + my $cipher = "$output_path\\cipher.out"; + my $clear = "$output_path\\clear.out"; + + print( "\nRUNNING ENCRYPTION & DECRYPTION TESTS:\n\n"); + + print( OUT "\n========================================================\n"); + print( OUT "FILE ENCRYPTION & DECRYPTION TESTS:\n\n"); + + foreach $i (@enc_tests) + { + log_desc("Testing: $i"); + + # do encryption + $outFile = "$output_path\\enc.out"; + system("openssl2 $i -e -bufsize 113 -k test -in $input -out $cipher > $outFile" ); + log_output("Encrypting: $input --> $cipher", $outFile); + + # do decryption + $outFile = "$output_path\\dec.out"; + system("openssl2 $i -d -bufsize 157 -k test -in $cipher -out $clear > $outFile"); + log_output("Decrypting: $cipher --> $clear", $outFile); + + # compare files + $x = compare_files( $input, $clear, 1); + if ( $x == 0 ) + { + print( "SUCCESS - files match: $input, $clear\n"); + print( OUT "SUCCESS - files match: $input, $clear\n"); + } + else + { + print( "ERROR: files don't match\n"); + print( OUT "ERROR: files don't match\n"); + } + + do_wait(); + + # Now do the same encryption but use Base64 + + # do encryption B64 + $outFile = "$output_path\\B64enc.out"; + system("openssl2 $i -a -e -bufsize 113 -k test -in $input -out $cipher > $outFile"); + log_output("Encrypting(B64): $cipher --> $clear", $outFile); + + # do decryption B64 + $outFile = "$output_path\\B64dec.out"; + system("openssl2 $i -a -d -bufsize 157 -k test -in $cipher -out $clear > $outFile"); + log_output("Decrypting(B64): $cipher --> $clear", $outFile); + + # compare files + $x = compare_files( $input, $clear, 1); + if ( $x == 0 ) + { + print( "SUCCESS - files match: $input, $clear\n"); + print( OUT "SUCCESS - files match: $input, $clear\n"); + } + else + { + print( "ERROR: files don't match\n"); + print( OUT "ERROR: files don't match\n"); + } + + do_wait(); + + } # end foreach + + # delete the temporary files + unlink($cipher); + unlink($clear); + } + + + ############################################################################ + sub pem_tests + { + my $i; + my $tmp_out; + my $outFile = "$output_path\\pem.out"; + + my %pem_tests = ( + "crl" => "testcrl.pem", + "pkcs7" => "testp7.pem", + "req" => "testreq2.pem", + "rsa" => "testrsa.pem", + "x509" => "testx509.pem", + "x509" => "v3-cert1.pem", + "sess_id" => "testsid.pem" ); + + + print( "\nRUNNING PEM TESTS:\n\n"); + + print( OUT "\n========================================================\n"); + print( OUT "PEM TESTS:\n\n"); + + foreach $i (keys(%pem_tests)) + { + log_desc( "Testing: $i"); + + my $input = "$test_path\\$pem_tests{$i}"; + + $tmp_out = "$output_path\\$pem_tests{$i}"; + + if ($i ne "req" ) + { + system("openssl2 $i -in $input -out $tmp_out > $outFile"); + log_output( "openssl2 $i -in $input -out $tmp_out", $outFile); + } + else + { + system("openssl2 $i -in $input -out $tmp_out -config $OpenSSL_config > $outFile"); + log_output( "openssl2 $i -in $input -out $tmp_out -config $OpenSSL_config", $outFile ); + } + + $x = compare_files( $input, $tmp_out); + if ( $x == 0 ) + { + print( "SUCCESS - files match: $input, $tmp_out\n"); + print( OUT "SUCCESS - files match: $input, $tmp_out\n"); + } + else + { + print( "ERROR: files don't match\n"); + print( OUT "ERROR: files don't match\n"); + } + do_wait(); + + } # end foreach + } + + + ############################################################################ + sub verify_tests + { + my $i; + my $outFile = "$output_path\\verify.out"; + + my @cert_files = <$cert_path\\*.pem>; + + print( "\nRUNNING VERIFY TESTS:\n\n"); + + print( OUT "\n========================================================\n"); + print( OUT "VERIFY TESTS:\n\n"); + + make_tmp_cert_file(); + + foreach $i (@cert_files) + { + system("openssl2 verify -CAfile $tmp_cert $i >$outFile"); + log_desc("Verifying cert: $i"); + log_output("openssl2 verify -CAfile $tmp_cert $i", $outFile); + } + } + + + ############################################################################ + sub ssl_tests + { + my $outFile = "$output_path\\ssl_tst.out"; + my($CAcert) = "$output_path\\certCA.ss"; + my($Ukey) = "$output_path\\keyU.ss"; + my($Ucert) = "$output_path\\certU.ss"; + my($ssltest)= "ssltest -key $Ukey -cert $Ucert -c_key $Ukey -c_cert $Ucert -CAfile $CAcert"; + + print( "\nRUNNING SSL TESTS:\n\n"); + + print( OUT "\n========================================================\n"); + print( OUT "SSL TESTS:\n\n"); + + system("ssltest -ssl2 >$outFile"); + log_desc("Testing sslv2:"); + log_output("ssltest -ssl2", $outFile); + + system("$ssltest -ssl2 -server_auth >$outFile"); + log_desc("Testing sslv2 with server authentication:"); + log_output("$ssltest -ssl2 -server_auth", $outFile); + + system("$ssltest -ssl2 -client_auth >$outFile"); + log_desc("Testing sslv2 with client authentication:"); + log_output("$ssltest -ssl2 -client_auth", $outFile); + + system("$ssltest -ssl2 -server_auth -client_auth >$outFile"); + log_desc("Testing sslv2 with both client and server authentication:"); + log_output("$ssltest -ssl2 -server_auth -client_auth", $outFile); + + system("ssltest -ssl3 >$outFile"); + log_desc("Testing sslv3:"); + log_output("ssltest -ssl3", $outFile); + + system("$ssltest -ssl3 -server_auth >$outFile"); + log_desc("Testing sslv3 with server authentication:"); + log_output("$ssltest -ssl3 -server_auth", $outFile); + + system("$ssltest -ssl3 -client_auth >$outFile"); + log_desc("Testing sslv3 with client authentication:"); + log_output("$ssltest -ssl3 -client_auth", $outFile); + + system("$ssltest -ssl3 -server_auth -client_auth >$outFile"); + log_desc("Testing sslv3 with both client and server authentication:"); + log_output("$ssltest -ssl3 -server_auth -client_auth", $outFile); + + system("ssltest >$outFile"); + log_desc("Testing sslv2/sslv3:"); + log_output("ssltest", $outFile); + + system("$ssltest -server_auth >$outFile"); + log_desc("Testing sslv2/sslv3 with server authentication:"); + log_output("$ssltest -server_auth", $outFile); + + system("$ssltest -client_auth >$outFile"); + log_desc("Testing sslv2/sslv3 with client authentication:"); + log_output("$ssltest -client_auth ", $outFile); + + system("$ssltest -server_auth -client_auth >$outFile"); + log_desc("Testing sslv2/sslv3 with both client and server authentication:"); + log_output("$ssltest -server_auth -client_auth", $outFile); + + system("ssltest -bio_pair -ssl2 >$outFile"); + log_desc("Testing sslv2 via BIO pair:"); + log_output("ssltest -bio_pair -ssl2", $outFile); + + system("ssltest -bio_pair -dhe1024dsa -v >$outFile"); + log_desc("Testing sslv2/sslv3 with 1024 bit DHE via BIO pair:"); + log_output("ssltest -bio_pair -dhe1024dsa -v", $outFile); + + system("$ssltest -bio_pair -ssl2 -server_auth >$outFile"); + log_desc("Testing sslv2 with server authentication via BIO pair:"); + log_output("$ssltest -bio_pair -ssl2 -server_auth", $outFile); + + system("$ssltest -bio_pair -ssl2 -client_auth >$outFile"); + log_desc("Testing sslv2 with client authentication via BIO pair:"); + log_output("$ssltest -bio_pair -ssl2 -client_auth", $outFile); + + system("$ssltest -bio_pair -ssl2 -server_auth -client_auth >$outFile"); + log_desc("Testing sslv2 with both client and server authentication via BIO pair:"); + log_output("$ssltest -bio_pair -ssl2 -server_auth -client_auth", $outFile); + + system("ssltest -bio_pair -ssl3 >$outFile"); + log_desc("Testing sslv3 via BIO pair:"); + log_output("ssltest -bio_pair -ssl3", $outFile); + + system("$ssltest -bio_pair -ssl3 -server_auth >$outFile"); + log_desc("Testing sslv3 with server authentication via BIO pair:"); + log_output("$ssltest -bio_pair -ssl3 -server_auth", $outFile); + + system("$ssltest -bio_pair -ssl3 -client_auth >$outFile"); + log_desc("Testing sslv3 with client authentication via BIO pair:"); + log_output("$ssltest -bio_pair -ssl3 -client_auth", $outFile); + + system("$ssltest -bio_pair -ssl3 -server_auth -client_auth >$outFile"); + log_desc("Testing sslv3 with both client and server authentication via BIO pair:"); + log_output("$ssltest -bio_pair -ssl3 -server_auth -client_auth", $outFile); + + system("ssltest -bio_pair >$outFile"); + log_desc("Testing sslv2/sslv3 via BIO pair:"); + log_output("ssltest -bio_pair", $outFile); + + system("$ssltest -bio_pair -server_auth >$outFile"); + log_desc("Testing sslv2/sslv3 with server authentication via BIO pair:"); + log_output("$ssltest -bio_pair -server_auth", $outFile); + + system("$ssltest -bio_pair -client_auth >$outFile"); + log_desc("Testing sslv2/sslv3 with client authentication via BIO pair:"); + log_output("$ssltest -bio_pair -client_auth", $outFile); + + system("$ssltest -bio_pair -server_auth -client_auth >$outFile"); + log_desc("Testing sslv2/sslv3 with both client and server authentication via BIO pair:"); + log_output("$ssltest -bio_pair -server_auth -client_auth", $outFile); + } + + + ############################################################################ + sub ca_tests + { + my $outFile = "$output_path\\ca_tst.out"; + + my($CAkey) = "$output_path\\keyCA.ss"; + my($CAcert) = "$output_path\\certCA.ss"; + my($CAserial) = "$output_path\\certCA.srl"; + my($CAreq) = "$output_path\\reqCA.ss"; + my($CAreq2) = "$output_path\\req2CA.ss"; + + my($CAconf) = "$test_path\\CAss.cnf"; + + my($Uconf) = "$test_path\\Uss.cnf"; + + my($Ukey) = "$output_path\\keyU.ss"; + my($Ureq) = "$output_path\\reqU.ss"; + my($Ucert) = "$output_path\\certU.ss"; + + print( "\nRUNNING CA TESTS:\n\n"); + + print( OUT "\n========================================================\n"); + print( OUT "CA TESTS:\n"); + + system("openssl2 req -config $CAconf -out $CAreq -keyout $CAkey -new >$outFile"); + log_desc("Make a certificate request using req:"); + log_output("openssl2 req -config $CAconf -out $CAreq -keyout $CAkey -new", $outFile); + + system("openssl2 x509 -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey >$outFile"); + log_desc("Convert the certificate request into a self signed certificate using x509:"); + log_output("openssl2 x509 -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey", $outFile); + + system("openssl2 x509 -in $CAcert -x509toreq -signkey $CAkey -out $CAreq2 >$outFile"); + log_desc("Convert a certificate into a certificate request using 'x509':"); + log_output("openssl2 x509 -in $CAcert -x509toreq -signkey $CAkey -out $CAreq2", $outFile); + + system("openssl2 req -config $OpenSSL_config -verify -in $CAreq -noout >$outFile"); + log_output("openssl2 req -config $OpenSSL_config -verify -in $CAreq -noout", $outFile); + + system("openssl2 req -config $OpenSSL_config -verify -in $CAreq2 -noout >$outFile"); + log_output( "openssl2 req -config $OpenSSL_config -verify -in $CAreq2 -noout", $outFile); + + system("openssl2 verify -CAfile $CAcert $CAcert >$outFile"); + log_output("openssl2 verify -CAfile $CAcert $CAcert", $outFile); + + system("openssl2 req -config $Uconf -out $Ureq -keyout $Ukey -new >$outFile"); + log_desc("Make another certificate request using req:"); + log_output("openssl2 req -config $Uconf -out $Ureq -keyout $Ukey -new", $outFile); + + system("openssl2 x509 -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey -CAserial $CAserial >$outFile"); + log_desc("Sign certificate request with the just created CA via x509:"); + log_output("openssl2 x509 -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey -CAserial $CAserial", $outFile); + + system("openssl2 verify -CAfile $CAcert $Ucert >$outFile"); + log_output("openssl2 verify -CAfile $CAcert $Ucert", $outFile); + + system("openssl2 x509 -subject -issuer -startdate -enddate -noout -in $Ucert >$outFile"); + log_desc("Certificate details"); + log_output("openssl2 x509 -subject -issuer -startdate -enddate -noout -in $Ucert", $outFile); + + print(OUT "-- \n"); + print(OUT "The generated CA certificate is $CAcert\n"); + print(OUT "The generated CA private key is $CAkey\n"); + print(OUT "The current CA signing serial number is in $CAserial\n"); + + print(OUT "The generated user certificate is $Ucert\n"); + print(OUT "The generated user private key is $Ukey\n"); + print(OUT "--\n"); + } + + ############################################################################ + sub log_output( $ $ ) + { + my( $desc, $file ) = @_; + my($error) = 0; + my($key); + my($msg); + + if ($desc) + { + print("$desc\n"); + print(OUT "$desc\n"); + } + + # loop waiting for test program to complete + while ( stat($file) == 0) + { print(". "); sleep(1); } + + + # copy test output to log file + open(IN, "<$file"); + while () + { + print(OUT $_); + if ( $_ =~ /ERROR/ ) + { + $error = 1; + } + } + # close and delete the temporary test output file + close(IN); + unlink($file); + + if ( $error == 0 ) + { + $msg = "Test Succeeded"; + } + else + { + $msg = "Test Failed"; + } + + print(OUT "$msg\n"); + + if ($pause) + { + print("$msg - press ENTER to continue..."); + $key = getc; + print("\n"); + } + + # Several of the testing scripts run a loop loading the + # same NLM with different options. + # On slow NetWare machines there appears to be some delay in the + # OS actually unloading the test nlms and the OS complains about. + # the NLM already being loaded. This additional pause is to + # to help provide a little more time for unloading before trying to + # load again. + sleep(1); + } + + + ############################################################################ + sub log_desc( $ ) + { + my( $desc ) = @_; + + print("\n"); + print("$desc\n"); + + print(OUT "\n"); + print(OUT "$desc\n"); + print(OUT "======================================\n"); + } + + ############################################################################ + sub compare_files( $ $ $ ) + { + my( $file1, $file2, $binary ) = @_; + my( $n1, $n2, $b1, $b2 ); + my($ret) = 1; + + open(IN0, $file1) || die "\nunable to open $file1\n"; + open(IN1, $file2) || die "\nunable to open $file2\n"; + + if ($binary) + { + binmode IN0; + binmode IN1; + } + + for (;;) + { + $n1 = read(IN0, $b1, 512); + $n2 = read(IN1, $b2, 512); + + if ($n1 != $n2) {last;} + if ($b1 != $b2) {last;} + + if ($n1 == 0) + { + $ret = 0; + last; + } + } + close(IN0); + close(IN1); + return($ret); + } + + ############################################################################ + sub do_wait() + { + my($key); + + if ($pause) + { + print("Press ENTER to continue..."); + $key = getc; + print("\n"); + } + } + + + ############################################################################ + sub make_tmp_cert_file() + { + my @cert_files = <$cert_path\\*.pem>; + + # delete the file if it already exists + unlink($tmp_cert); + + open( TMP_CERT, ">$tmp_cert") || die "\nunable to open $tmp_cert\n"; + + print("building temporary cert file\n"); + + # create a temporary cert file that contains all the certs + foreach $i (@cert_files) + { + open( IN_CERT, $i ) || die "\nunable to open $i\n"; + + for(;;) + { + $n = sysread(IN_CERT, $data, 1024); + + if ($n == 0) + { + close(IN_CERT); + last; + }; + + syswrite(TMP_CERT, $data, $n); + } + } + + close( TMP_CERT ); + } Index: openssl_097/Netware/globals.txt diff -c /dev/null openssl_097/Netware/globals.txt:1.1.2.1 *** /dev/null Tue Apr 12 11:40:52 2005 --- openssl_097/Netware/globals.txt Tue May 6 14:07:53 2003 *************** *** 0 **** --- 1,254 ---- + An initial review of the OpenSSL code was done to determine how many + global variables where present. The idea was to determine the amount of + work required to pull the globals into an instance data structure in + order to build a Library NLM for NetWare. This file contains the results + of the review. Each file is listed along with the globals in the file. + The initial review was done very quickly so this list is probably + not a comprehensive list. + + + cryptlib.c + =========================================== + + static STACK *app_locks=NULL; + + static STACK_OF(CRYPTO_dynlock) *dyn_locks=NULL; + + static void (MS_FAR *locking_callback)(int mode,int type, + const char *file,int line)=NULL; + static int (MS_FAR *add_lock_callback)(int *pointer,int amount, + int type,const char *file,int line)=NULL; + static unsigned long (MS_FAR *id_callback)(void)=NULL; + static struct CRYPTO_dynlock_value *(MS_FAR *dynlock_create_callback) + (const char *file,int line)=NULL; + static void (MS_FAR *dynlock_lock_callback)(int mode, + struct CRYPTO_dynlock_value *l, const char *file,int line)=NULL; + static void (MS_FAR *dynlock_destroy_callback)(struct CRYPTO_dynlock_value *l, + const char *file,int line)=NULL; + + + mem.c + =========================================== + static int allow_customize = 1; /* we provide flexible functions for */ + static int allow_customize_debug = 1;/* exchanging memory-related functions at + + /* may be changed as long as `allow_customize' is set */ + static void *(*malloc_locked_func)(size_t) = malloc; + static void (*free_locked_func)(void *) = free; + static void *(*malloc_func)(size_t) = malloc; + static void *(*realloc_func)(void *, size_t)= realloc; + static void (*free_func)(void *) = free; + + /* use default functions from mem_dbg.c */ + static void (*malloc_debug_func)(void *,int,const char *,int,int) + = CRYPTO_dbg_malloc; + static void (*realloc_debug_func)(void *,void *,int,const char *,int,int) + = CRYPTO_dbg_realloc; + static void (*free_debug_func)(void *,int) = CRYPTO_dbg_free; + static void (*set_debug_options_func)(long) = CRYPTO_dbg_set_options; + static long (*get_debug_options_func)(void) = CRYPTO_dbg_get_options; + + + mem_dbg.c + =========================================== + static int mh_mode=CRYPTO_MEM_CHECK_OFF; + static unsigned long order = 0; /* number of memory requests */ + static LHASH *mh=NULL; /* hash-table of memory requests (address as key) */ + + static LHASH *amih=NULL; /* hash-table with those app_mem_info_st's */ + static long options = /* extra information to be recorded */ + static unsigned long disabling_thread = 0; + + + err.c + =========================================== + static LHASH *error_hash=NULL; + static LHASH *thread_hash=NULL; + + several files have routines with static "init" to track if error strings + have been loaded ( may not want seperate error strings for each process ) + The "init" variable can't be left "global" because the error has is a ptr + that is malloc'ed. The malloc'ed error has is dependant on the "init" + vars. + + files: + pem_err.c + cpt_err.c + pk12err.c + asn1_err.c + bio_err.c + bn_err.c + buf_err.c + comp_err.c + conf_err.c + cpt_err.c + dh_err.c + dsa_err.c + dso_err.c + evp_err.c + obj_err.c + pkcs7err.c + rand_err.c + rsa_err.c + rsar_err.c + ssl_err.c + x509_err.c + v3err.c + err.c + + These file have similar "init" globals but they are for other stuff not + error strings: + + bn_lib.c + ecc_enc.c + s23_clnt.c + s23_meth.c + s23_srvr.c + s2_clnt.c + s2_lib.c + s2_meth.c + s2_srvr.c + s3_clnt.c + s3_lib.c + s3_srvr.c + t1_clnt.c + t1_meth.c + t1_srvr.c + + rand_lib.c + =========================================== + static RAND_METHOD *rand_meth= &rand_ssleay_meth; + + md_rand.c + =========================================== + static int state_num=0,state_index=0; + static unsigned char state[STATE_SIZE+MD_DIGEST_LENGTH]; + static unsigned char md[MD_DIGEST_LENGTH]; + static long md_count[2]={0,0}; + static double entropy=0; + static int initialized=0; + + /* This should be set to 1 only when ssleay_rand_add() is called inside + an already locked state, so it doesn't try to lock and thereby cause + a hang. And it should always be reset back to 0 before unlocking. */ + static int add_do_not_lock=0; + + obj_dat.c + ============================================ + static int new_nid=NUM_NID; + static LHASH *added=NULL; + + b_sock.c + =========================================== + static unsigned long BIO_ghbn_hits=0L; + static unsigned long BIO_ghbn_miss=0L; + static struct ghbn_cache_st + { + char name[129]; + struct hostent *ent; + unsigned long order; + } ghbn_cache[GHBN_NUM]; + + static int wsa_init_done=0; + + + bio_lib.c + =========================================== + static STACK_OF(CRYPTO_EX_DATA_FUNCS) *bio_meth=NULL; + static int bio_meth_num=0; + + + bn_lib.c + ======================================== + static int bn_limit_bits=0; + static int bn_limit_num=8; /* (1< 4) && (p[n-4] == '.') && + ((p[n-3] == 'n') || (p[n-3] == 'N')) && + ((p[n-2] == 'l') || (p[n-2] == 'L')) && + ((p[n-1] == 'm') || (p[n-1] == 'M'))) + n-=4; + #else /* strip off trailing .exe if present. */ if ((n > 4) && (p[n-4] == '.') && ((p[n-3] == 'e') || (p[n-3] == 'E')) && ((p[n-2] == 'x') || (p[n-2] == 'X')) && ((p[n-1] == 'e') || (p[n-1] == 'E'))) n-=4; + #endif + if (n > size-1) n=size-1; Index: openssl_097/apps/apps.h diff -c openssl_097/apps/apps.h:1.1.1.4 openssl_097/apps/apps.h:1.1.1.1.2.4 *** openssl_097/apps/apps.h:1.1.1.4 Fri Oct 29 09:35:59 2004 --- openssl_097/apps/apps.h Sat Oct 30 10:28:50 2004 *************** *** 165,171 **** --- 165,173 ---- #endif + #ifndef OPENSSL_SYS_NETWARE #include + #endif #ifdef SIGPIPE #define do_pipe_sig() signal(SIGPIPE,SIG_IGN) Index: openssl_097/apps/ca.c diff -c openssl_097/apps/ca.c:1.1.1.6 openssl_097/apps/ca.c:1.1.1.1.2.6 *** openssl_097/apps/ca.c:1.1.1.6 Fri Apr 1 14:49:39 2005 --- openssl_097/apps/ca.c Mon Apr 11 11:22:23 2005 *************** *** 83,89 **** # else # include # endif ! # elif !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_WINDOWS) # include # endif #endif --- 83,89 ---- # else # include # endif ! # elif !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_NETWARE) # include # endif #endif Index: openssl_097/apps/s_apps.h diff -c openssl_097/apps/s_apps.h:1.1.1.2 openssl_097/apps/s_apps.h:1.1.1.1.2.2 *** openssl_097/apps/s_apps.h:1.1.1.2 Tue Nov 11 15:59:40 2003 --- openssl_097/apps/s_apps.h Wed Nov 12 17:51:24 2003 *************** *** 108,115 **** * Hudson (tjh@cryptsoft.com). * */ ! #include #include #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) --- 108,116 ---- * Hudson (tjh@cryptsoft.com). * */ ! #if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */ #include + #endif #include #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) Index: openssl_097/apps/s_client.c diff -c openssl_097/apps/s_client.c:1.1.1.4 openssl_097/apps/s_client.c:1.1.1.1.2.5 *** openssl_097/apps/s_client.c:1.1.1.4 Fri Apr 1 14:49:40 2005 --- openssl_097/apps/s_client.c Mon Apr 11 11:22:29 2005 *************** *** 259,265 **** char *engine_id=NULL; ENGINE *e=NULL; #endif ! #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) struct timeval tv; #endif --- 259,265 ---- char *engine_id=NULL; ENGINE *e=NULL; #endif ! #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) struct timeval tv; #endif *************** *** 649,655 **** if (!ssl_pending) { ! #if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) if (tty_on) { if (read_tty) FD_SET(fileno(stdin),&readfds); --- 649,655 ---- if (!ssl_pending) { ! #if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) if (tty_on) { if (read_tty) FD_SET(fileno(stdin),&readfds); *************** *** 699,704 **** --- 699,714 ---- } else i=select(width,(void *)&readfds,(void *)&writefds, NULL,NULL); } + #elif defined(OPENSSL_SYS_NETWARE) + if(!write_tty) { + if(read_tty) { + tv.tv_sec = 1; + tv.tv_usec = 0; + i=select(width,(void *)&readfds,(void *)&writefds, + NULL,&tv); + } else i=select(width,(void *)&readfds,(void *)&writefds, + NULL,NULL); + } #else i=select(width,(void *)&readfds,(void *)&writefds, NULL,NULL); *************** *** 779,785 **** goto shut; } } ! #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) /* Assume Windows/DOS can always write */ else if (!ssl_pending && write_tty) #else --- 789,795 ---- goto shut; } } ! #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) /* Assume Windows/DOS can always write */ else if (!ssl_pending && write_tty) #else *************** *** 866,871 **** --- 876,883 ---- #else else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) #endif + #elif defined (OPENSSL_SYS_NETWARE) + else if (_kbhit()) #else else if (FD_ISSET(fileno(stdin),&readfds)) #endif Index: openssl_097/apps/s_server.c diff -c openssl_097/apps/s_server.c:1.1.1.3 openssl_097/apps/s_server.c:1.1.1.1.2.4 *** openssl_097/apps/s_server.c:1.1.1.3 Tue Nov 11 15:59:40 2003 --- openssl_097/apps/s_server.c Wed Nov 12 17:51:26 2003 *************** *** 113,125 **** #include #include #include ! #include #include #include #ifdef OPENSSL_NO_STDIO #define APPS_WIN16 #endif /* 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 --- 113,129 ---- #include #include #include ! #include #include #ifdef OPENSSL_NO_STDIO #define APPS_WIN16 #endif + #if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */ + #include + #endif + /* 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 *************** *** 913,919 **** unsigned long l; SSL *con=NULL; BIO *sbio; ! #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) struct timeval tv; #endif --- 917,923 ---- unsigned long l; SSL *con=NULL; BIO *sbio; ! #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) struct timeval tv; #endif *************** *** 987,993 **** if (!read_from_sslcon) { FD_ZERO(&readfds); ! #if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) FD_SET(fileno(stdin),&readfds); #endif FD_SET(s,&readfds); --- 991,997 ---- if (!read_from_sslcon) { FD_ZERO(&readfds); ! #if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) FD_SET(fileno(stdin),&readfds); #endif FD_SET(s,&readfds); *************** *** 997,1003 **** * the compiler: if you do have a cast then you can either * go for (int *) or (void *). */ ! #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) /* Under DOS (non-djgpp) and Windows we can't select on stdin: only * on sockets. As a workaround we timeout the select every * second and check for any keypress. In a proper Windows --- 1001,1007 ---- * the compiler: if you do have a cast then you can either * go for (int *) or (void *). */ ! #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) /* Under DOS (non-djgpp) and Windows we can't select on stdin: only * on sockets. As a workaround we timeout the select every * second and check for any keypress. In a proper Windows *************** *** 1417,1423 **** else { BIO_printf(bio_s_out,"read R BLOCK\n"); ! #if !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__) sleep(1); #endif continue; --- 1421,1429 ---- else { BIO_printf(bio_s_out,"read R BLOCK\n"); ! #if defined(OPENSSL_SYS_NETWARE) ! delay(1000); ! #elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__) sleep(1); #endif continue; Index: openssl_097/apps/s_socket.c diff -c openssl_097/apps/s_socket.c:1.1.1.3 openssl_097/apps/s_socket.c:1.1.1.1.2.3 *** openssl_097/apps/s_socket.c:1.1.1.3 Fri Apr 1 14:49:40 2005 --- openssl_097/apps/s_socket.c Mon Apr 11 11:22:29 2005 *************** *** 82,88 **** #include static struct hostent *GetHostByName(char *name); ! #ifdef OPENSSL_SYS_WINDOWS static void ssl_sock_cleanup(void); #endif static int ssl_sock_init(void); --- 82,88 ---- #include static struct hostent *GetHostByName(char *name); ! #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE) static void ssl_sock_cleanup(void); #endif static int ssl_sock_init(void); *************** *** 98,103 **** --- 98,107 ---- #define SOCKET_PROTOCOL IPPROTO_TCP #endif + #ifdef OPENSSL_SYS_NETWARE + static int wsa_init_done=0; + #endif + #ifdef OPENSSL_SYS_WINDOWS static struct WSAData wsa_state; static int wsa_init_done=0; *************** *** 146,151 **** --- 150,164 ---- WSACleanup(); } } + #elif defined(OPENSSL_SYS_NETWARE) + static void sock_cleanup(void) + { + if (wsa_init_done) + { + wsa_init_done=0; + WSACleanup(); + } + } #endif static int ssl_sock_init(void) *************** *** 180,185 **** --- 193,219 ---- SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopHookProc); #endif /* OPENSSL_SYS_WIN16 */ } + #elif defined(OPENSSL_SYS_NETWARE) + WORD wVerReq; + WSADATA wsaData; + int err; + + if (!wsa_init_done) + { + + #ifdef SIGINT + signal(SIGINT,(void (*)(int))sock_cleanup); + #endif + + wsa_init_done=1; + wVerReq = MAKEWORD( 2, 0 ); + err = WSAStartup(wVerReq,&wsaData); + if (err != 0) + { + BIO_printf(bio_err,"unable to start WINSOCK2, error code=%d\n",err); + return(0); + } + } #endif /* OPENSSL_SYS_WINDOWS */ return(1); } *************** *** 341,347 **** ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len); if (ret == INVALID_SOCKET) { ! #ifdef OPENSSL_SYS_WINDOWS i=WSAGetLastError(); BIO_printf(bio_err,"accept error %d\n",i); #else --- 375,381 ---- ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len); if (ret == INVALID_SOCKET) { ! #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE) i=WSAGetLastError(); BIO_printf(bio_err,"accept error %d\n",i); #else Index: openssl_097/apps/s_time.c diff -c openssl_097/apps/s_time.c:1.1.1.2 openssl_097/apps/s_time.c:1.1.1.1.2.2 *** openssl_097/apps/s_time.c:1.1.1.2 Tue Mar 23 16:49:44 2004 --- openssl_097/apps/s_time.c Wed Mar 24 16:07:28 2004 *************** *** 85,91 **** #include OPENSSL_UNISTD #endif ! #if !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) #define TIMES #endif --- 85,91 ---- #include OPENSSL_UNISTD #endif ! #if !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) #define TIMES #endif *************** *** 105,111 **** #undef TIMES #endif ! #if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS) #include #endif --- 105,111 ---- #undef TIMES #endif ! #if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_NETWARE) #include #endif *************** *** 384,390 **** ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ; return((ret == 0.0)?1e-6:ret); } ! #elif defined(OPENSSL_SYS_VXWORKS) { static unsigned long tick_start, tick_end; --- 384,404 ---- ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ; return((ret == 0.0)?1e-6:ret); } ! #elif defined(OPENSSL_SYS_NETWARE) ! static clock_t tstart,tend; ! ! if (s == START) ! { ! tstart=clock(); ! return(0); ! } ! else ! { ! tend=clock(); ! ret=(double)((double)(tend)-(double)(tstart)); ! return((ret < 0.001)?0.001:ret); ! } ! #elif defined(OPENSSL_SYS_VXWORKS) { static unsigned long tick_start, tick_end; Index: openssl_097/apps/speed.c diff -c openssl_097/apps/speed.c:1.1.1.4 openssl_097/apps/speed.c:1.1.1.1.2.5 *** openssl_097/apps/speed.c:1.1.1.4 Fri Oct 29 09:36:00 2004 --- openssl_097/apps/speed.c Sat Oct 30 10:28:58 2004 *************** *** 73,79 **** #include #include ! #include #include #include #include "apps.h" --- 73,79 ---- #include #include ! #include #include #include "apps.h" *************** *** 89,94 **** --- 89,98 ---- #include OPENSSL_UNISTD #endif + #ifndef OPENSSL_SYS_NETWARE + #include + #endif + #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENSSL_SYS_MACOSX) # define USE_TOD #elif !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) *************** *** 98,103 **** --- 102,113 ---- # define TIMEB #endif + #if defined(OPENSSL_SYS_NETWARE) + #undef TIMES + #undef TIMEB + #include + #endif + #ifndef _IRIX # include #endif *************** *** 122,128 **** #include #endif ! #if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(OPENSSL_SYS_VXWORKS) #error "It seems neither struct tms nor struct timeb is supported in this platform!" #endif --- 132,138 ---- #include #endif ! #if !defined(TIMES) && !defined(TIMEB) && !defined(USE_TOD) && !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_NETWARE) #error "It seems neither struct tms nor struct timeb is supported in this platform!" #endif *************** *** 205,211 **** # endif #endif ! #if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) # define HAVE_FORK 1 #endif --- 215,221 ---- # endif #endif ! #if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) && !defined(OPENSSL_SYS_NETWARE) # define HAVE_FORK 1 #endif *************** *** 260,265 **** --- 270,301 ---- #define START 0 #define STOP 1 + #if defined(OPENSSL_SYS_NETWARE) + + /* for NetWare the best we can do is use clock() which returns the + * time, in hundredths of a second, since the NLM began executing + */ + static double Time_F(int s) + { + double ret; + + static clock_t tstart,tend; + + if (s == START) + { + tstart=clock(); + return(0); + } + else + { + tend=clock(); + ret=(double)((double)(tend)-(double)(tstart)); + return((ret < 0.001)?0.001:ret); + } + } + + #else + static double Time_F(int s) { double ret; *************** *** 367,372 **** --- 403,409 ---- # endif #endif } + #endif /* if defined(OPENSSL_SYS_NETWARE) */ int MAIN(int, char **); cvs server: Diffing openssl_097/apps/demoCA cvs server: Diffing openssl_097/apps/demoCA/private cvs server: Diffing openssl_097/apps/set cvs server: Diffing openssl_097/bugs cvs server: Diffing openssl_097/certs cvs server: Diffing openssl_097/certs/demo cvs server: Diffing openssl_097/certs/expired cvs server: Diffing openssl_097/cm_config cvs server: Diffing openssl_097/cm_config/aix cvs server: Diffing openssl_097/cm_config/hpux cvs server: Diffing openssl_097/cm_config/linux cvs server: Diffing openssl_097/cm_config/solaris cvs server: Diffing openssl_097/crypto Index: openssl_097/crypto/cryptlib.h diff -c openssl_097/crypto/cryptlib.h:1.1.1.1 openssl_097/crypto/cryptlib.h:1.1.1.1.2.1 *** openssl_097/crypto/cryptlib.h:1.1.1.1 Mon May 5 14:54:59 2003 --- openssl_097/crypto/cryptlib.h Mon Nov 29 15:23:03 2004 *************** *** 74,79 **** --- 74,84 ---- extern "C" { #endif + #ifdef OPENSSL_SYS_NETWARE + #undef OPENSSLDIR + #define OPENSSLDIR "sys:/system/ssl" + #endif + #ifndef OPENSSL_SYS_VMS #define X509_CERT_AREA OPENSSLDIR #define X509_CERT_DIR OPENSSLDIR "/certs" Index: openssl_097/crypto/md32_common.h diff -c openssl_097/crypto/md32_common.h:1.1.1.3 openssl_097/crypto/md32_common.h:1.1.1.1.2.4 *** openssl_097/crypto/md32_common.h:1.1.1.3 Fri Apr 1 14:49:41 2005 --- openssl_097/crypto/md32_common.h Mon Apr 11 11:22:42 2005 *************** *** 188,193 **** --- 188,195 ---- # elif defined(__MWERKS__) # if defined(__POWERPC__) # define ROTATE(a,n) __rlwinm(a,n,0,31) + # elif defined(OPENSSL_SYS_NETWARE) + # define ROTATE(a,n) _lrotl(a,n) # elif defined(__MC68K__) /* Motorola specific tweak. */ # define ROTATE(a,n) ( n<24 ? __rol(a,n) : __ror(a,32-n) ) Index: openssl_097/crypto/tmdiff.c diff -c openssl_097/crypto/tmdiff.c:1.1.1.1 openssl_097/crypto/tmdiff.c:1.1.1.1.2.1 *** openssl_097/crypto/tmdiff.c:1.1.1.1 Mon May 5 14:54:59 2003 --- openssl_097/crypto/tmdiff.c Tue May 6 14:08:01 2003 *************** *** 72,78 **** # define TIMES #endif ! #ifndef _IRIX # include #endif #ifdef TIMES --- 72,82 ---- # define TIMES #endif ! #ifdef OPENSSL_SYS_NETWARE ! #undef TIMES ! #endif ! ! #if !defined(_IRIX) || defined (OPENSSL_SYS_NETWARE) # include #endif #ifdef TIMES *************** *** 94,100 **** #include #endif ! #if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS) #include #endif --- 98,104 ---- #include #endif ! #if !defined(TIMES) && !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_NETWARE) #include #endif *************** *** 128,133 **** --- 132,139 ---- # ifdef OPENSSL_SYS_WIN32 HANDLE thread_id; FILETIME ms_win32; + # elif defined (OPENSSL_SYS_NETWARE) + clock_t ms_clock; # else # ifdef OPENSSL_SYS_VXWORKS unsigned long ticks; *************** *** 170,175 **** --- 176,183 ---- #else # ifdef OPENSSL_SYS_WIN32 GetThreadTimes(tm->thread_id,&tmpa,&tmpb,&tmpc,&(tm->ms_win32)); + # elif defined (OPENSSL_SYS_NETWARE) + tm->ms_clock = clock(); # else # ifdef OPENSSL_SYS_VXWORKS tm->ticks = tickGet(); *************** *** 204,209 **** --- 212,219 ---- lb+=b->ms_win32.dwLowDateTime; ret=((double)(lb-la))/1e7; } + # elif defined (OPENSSL_SYS_NETWARE) + ret= (double)(b->ms_clock - a->ms_clock); # else # ifdef OPENSSL_SYS_VXWORKS ret = (double)(b->ticks - a->ticks) / (double)sysClkRateGet(); *************** *** 229,234 **** --- 239,246 ---- # ifdef OPENSSL_SYS_WIN32 d =(b->ms_win32.dwHighDateTime&0x000fffff)*10+b->ms_win32.dwLowDateTime/1e7; d-=(a->ms_win32.dwHighDateTime&0x000fffff)*10+a->ms_win32.dwLowDateTime/1e7; + # elif defined (OPENSSL_SYS_NETWARE) + d= (double)(b->ms_clock - a->ms_clock); # else # ifdef OPENSSL_SYS_VXWORKS d = (b->ticks - a->ticks); Index: openssl_097/crypto/uid.c diff -c openssl_097/crypto/uid.c:1.1.1.1 openssl_097/crypto/uid.c:1.1.1.1.2.1 *** openssl_097/crypto/uid.c:1.1.1.1 Mon May 5 14:54:59 2003 --- openssl_097/crypto/uid.c Mon May 19 12:05:57 2003 *************** *** 65,71 **** return issetugid(); } ! #elif defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) int OPENSSL_issetugid(void) { --- 65,71 ---- return issetugid(); } ! #elif defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) int OPENSSL_issetugid(void) { cvs server: Diffing openssl_097/crypto/aes cvs server: Diffing openssl_097/crypto/asn1 cvs server: Diffing openssl_097/crypto/bf Index: openssl_097/crypto/bf/bf_opts.c diff -c openssl_097/crypto/bf/bf_opts.c:1.1.1.1 openssl_097/crypto/bf/bf_opts.c:1.1.1.1.2.1 *** openssl_097/crypto/bf/bf_opts.c:1.1.1.1 Mon May 5 14:55:00 2003 --- openssl_097/crypto/bf/bf_opts.c Tue May 6 14:08:01 2003 *************** *** 69,75 **** --- 69,78 ---- #include OPENSSL_UNISTD_IO OPENSSL_DECLARE_EXIT + #ifndef OPENSSL_SYS_NETWARE #include + #endif + #ifndef _IRIX #include #endif Index: openssl_097/crypto/bf/bfspeed.c diff -c openssl_097/crypto/bf/bfspeed.c:1.1.1.1 openssl_097/crypto/bf/bfspeed.c:1.1.1.1.2.1 *** openssl_097/crypto/bf/bfspeed.c:1.1.1.1 Mon May 5 14:55:00 2003 --- openssl_097/crypto/bf/bfspeed.c Tue May 6 14:08:02 2003 *************** *** 69,75 **** --- 69,78 ---- #include OPENSSL_UNISTD_IO OPENSSL_DECLARE_EXIT + #ifndef OPENSSL_SYS_NETWARE #include + #endif + #ifndef _IRIX #include #endif Index: openssl_097/crypto/bf/bftest.c diff -c openssl_097/crypto/bf/bftest.c:1.1.1.1 openssl_097/crypto/bf/bftest.c:1.1.1.1.2.1 *** openssl_097/crypto/bf/bftest.c:1.1.1.1 Mon May 5 14:55:00 2003 --- openssl_097/crypto/bf/bftest.c Tue May 6 14:08:03 2003 *************** *** 277,282 **** --- 277,285 ---- else ret=test(); + #ifdef OPENSSL_SYS_NETWARE + if (ret) printf("ERROR: %d\n", ret); + #endif EXIT(ret); return(0); } cvs server: Diffing openssl_097/crypto/bf/asm cvs server: Diffing openssl_097/crypto/bio Index: openssl_097/crypto/bio/b_sock.c diff -c openssl_097/crypto/bio/b_sock.c:1.1.1.3 openssl_097/crypto/bio/b_sock.c:1.1.1.1.2.3 *** openssl_097/crypto/bio/b_sock.c:1.1.1.3 Tue Mar 23 16:49:47 2004 --- openssl_097/crypto/bio/b_sock.c Wed Mar 24 16:07:48 2004 *************** *** 79,85 **** #define MAX_LISTEN 32 #endif ! #ifdef OPENSSL_SYS_WINDOWS static int wsa_init_done=0; #endif --- 79,85 ---- #define MAX_LISTEN 32 #endif ! #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE) static int wsa_init_done=0; #endif *************** *** 473,478 **** --- 473,503 ---- if (sock_init()) return (-1); #endif + + #if defined(OPENSSL_SYS_NETWARE) + WORD wVerReq; + WSADATA wsaData; + int err; + + if (!wsa_init_done) + { + + #ifdef SIGINT + signal(SIGINT,(void (*)(int))BIO_sock_cleanup); + #endif + + wsa_init_done=1; + wVerReq = MAKEWORD( 2, 0 ); + err = WSAStartup(wVerReq,&wsaData); + if (err != 0) + { + SYSerr(SYS_F_WSASTARTUP,err); + BIOerr(BIO_F_BIO_SOCK_INIT,BIO_R_WSASTARTUP); + return(-1); + } + } + #endif + return(1); } *************** *** 486,491 **** --- 511,522 ---- WSACancelBlockingCall(); #endif WSACleanup(); + } + #elif defined(OPENSSL_SYS_NETWARE) + if (wsa_init_done) + { + wsa_init_done=0; + WSACleanup(); } #endif } Index: openssl_097/crypto/bio/bss_file.c diff -c openssl_097/crypto/bio/bss_file.c:1.1.1.5 openssl_097/crypto/bio/bss_file.c:1.1.1.1.2.6 *** openssl_097/crypto/bio/bss_file.c:1.1.1.5 Fri Apr 1 14:49:44 2005 --- openssl_097/crypto/bio/bss_file.c Mon Apr 11 11:23:00 2005 *************** *** 220,225 **** --- 220,232 ---- _setmode(fd,_O_TEXT); else _setmode(fd,_O_BINARY); + #elif defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_CLIB) + /* Under CLib there are differences in file modes + */ + if (num & BIO_FP_TEXT) + _setmode(fileno((FILE *)ptr),O_TEXT); + else + _setmode(fileno((FILE *)ptr),O_BINARY); #elif defined(OPENSSL_SYS_MSDOS) int fd = fileno((FILE*)ptr); /* Set correct text/binary mode */ *************** *** 272,278 **** else strcat(p,"t"); #endif ! fp=fopen(ptr,p); if (fp == NULL) { SYSerr(SYS_F_FOPEN,get_last_sys_error()); --- 279,291 ---- else strcat(p,"t"); #endif ! #if defined(OPENSSL_SYS_NETWARE) ! if (!(num & BIO_FP_TEXT)) ! strcat(p,"b"); ! else ! strcat(p,"t"); ! #endif ! fp=fopen(ptr,p); if (fp == NULL) { SYSerr(SYS_F_FOPEN,get_last_sys_error()); Index: openssl_097/crypto/bio/bss_log.c diff -c openssl_097/crypto/bio/bss_log.c:1.1.1.1 openssl_097/crypto/bio/bss_log.c:1.1.1.1.2.1 *** openssl_097/crypto/bio/bss_log.c:1.1.1.1 Mon May 5 14:55:01 2003 --- openssl_097/crypto/bio/bss_log.c Tue May 6 14:08:05 2003 *************** *** 78,83 **** --- 78,85 ---- # include #elif defined(__ultrix) # include + #elif defined(OPENSSL_SYS_NETWARE) + # define NO_SYSLOG #elif (!defined(MSDOS) || defined(WATT32)) && !defined(OPENSSL_SYS_VXWORKS) && !defined(NO_SYSLOG) # include #endif Index: openssl_097/crypto/bio/bss_sock.c diff -c openssl_097/crypto/bio/bss_sock.c:1.1.1.1 openssl_097/crypto/bio/bss_sock.c:1.1.1.1.2.1 *** openssl_097/crypto/bio/bss_sock.c:1.1.1.1 Mon May 5 14:55:01 2003 --- openssl_097/crypto/bio/bss_sock.c Tue May 6 14:08:05 2003 *************** *** 248,254 **** { switch (err) { ! #if defined(OPENSSL_SYS_WINDOWS) # if defined(WSAEWOULDBLOCK) case WSAEWOULDBLOCK: # endif --- 248,254 ---- { switch (err) { ! #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE) # if defined(WSAEWOULDBLOCK) case WSAEWOULDBLOCK: # endif cvs server: Diffing openssl_097/crypto/bn Index: openssl_097/crypto/bn/exptest.c diff -c openssl_097/crypto/bn/exptest.c:1.1.1.2 openssl_097/crypto/bn/exptest.c:1.1.1.1.2.2 *** openssl_097/crypto/bn/exptest.c:1.1.1.2 Mon May 5 15:31:00 2003 --- openssl_097/crypto/bn/exptest.c Tue May 6 14:33:48 2003 *************** *** 181,186 **** --- 181,189 ---- err: ERR_load_crypto_strings(); ERR_print_errors(out); + #ifdef OPENSSL_SYS_NETWARE + printf("ERROR\n"); + #endif EXIT(1); return(1); } cvs server: Diffing openssl_097/crypto/bn/asm cvs server: Diffing openssl_097/crypto/bn/asm/alpha cvs server: Diffing openssl_097/crypto/bn/asm/alpha.works cvs server: Diffing openssl_097/crypto/bn/asm/x86 cvs server: Diffing openssl_097/crypto/buffer Index: openssl_097/crypto/buffer/buffer.h diff -c openssl_097/crypto/buffer/buffer.h:1.1.1.1 openssl_097/crypto/buffer/buffer.h:1.1.1.1.2.1 *** openssl_097/crypto/buffer/buffer.h:1.1.1.1 Mon May 5 14:55:04 2003 --- openssl_097/crypto/buffer/buffer.h Tue May 6 14:08:07 2003 *************** *** 64,70 **** --- 64,73 ---- #endif #include + + #if !defined(NO_SYS_TYPES_H) #include + #endif typedef struct buf_mem_st { cvs server: Diffing openssl_097/crypto/cast Index: openssl_097/crypto/cast/cast_spd.c diff -c openssl_097/crypto/cast/cast_spd.c:1.1.1.1 openssl_097/crypto/cast/cast_spd.c:1.1.1.1.2.1 *** openssl_097/crypto/cast/cast_spd.c:1.1.1.1 Mon May 5 14:55:04 2003 --- openssl_097/crypto/cast/cast_spd.c Tue May 6 14:08:07 2003 *************** *** 69,75 **** --- 69,78 ---- #include OPENSSL_UNISTD_IO OPENSSL_DECLARE_EXIT + #ifndef OPENSSL_SYS_NETWARE #include + #endif + #ifndef _IRIX #include #endif Index: openssl_097/crypto/cast/castopts.c diff -c openssl_097/crypto/cast/castopts.c:1.1.1.1 openssl_097/crypto/cast/castopts.c:1.1.1.1.2.1 *** openssl_097/crypto/cast/castopts.c:1.1.1.1 Mon May 5 14:55:04 2003 --- openssl_097/crypto/cast/castopts.c Tue May 6 14:08:08 2003 *************** *** 69,75 **** --- 69,78 ---- #include OPENSSL_UNISTD_IO OPENSSL_DECLARE_EXIT + #ifndef OPENSSL_SYS_NETWARE #include + #endif + #ifndef _IRIX #include #endif cvs server: Diffing openssl_097/crypto/cast/asm cvs server: Diffing openssl_097/crypto/comp cvs server: Diffing openssl_097/crypto/conf cvs server: Diffing openssl_097/crypto/des Index: openssl_097/crypto/des/des_opts.c diff -c openssl_097/crypto/des/des_opts.c:1.1.1.1 openssl_097/crypto/des/des_opts.c:1.1.1.1.2.1 *** openssl_097/crypto/des/des_opts.c:1.1.1.1 Mon May 5 14:55:05 2003 --- openssl_097/crypto/des/des_opts.c Tue May 6 14:08:09 2003 *************** *** 71,77 **** --- 71,81 ---- #include extern void exit(); #endif + + #ifndef OPENSSL_SYS_NETWARE #include + #endif + #ifndef _IRIX #include #endif Index: openssl_097/crypto/des/destest.c diff -c openssl_097/crypto/des/destest.c:1.1.1.4 openssl_097/crypto/des/destest.c:1.1.1.1.2.4 *** openssl_097/crypto/des/destest.c:1.1.1.4 Fri Oct 29 09:36:07 2004 --- openssl_097/crypto/des/destest.c Sat Oct 30 10:29:37 2004 *************** *** 820,825 **** --- 820,828 ---- printf("fast crypt error, %s should be yA1Rp/1hZXIJk\n",str); err=1; } + #ifdef OPENSSL_SYS_NETWARE + if (err) printf("ERROR: %d\n", err); + #endif printf("\n"); return(err); } Index: openssl_097/crypto/des/read_pwd.c diff -c openssl_097/crypto/des/read_pwd.c:1.1.1.1 openssl_097/crypto/des/read_pwd.c:1.1.1.1.2.2 *** openssl_097/crypto/des/read_pwd.c:1.1.1.1 Mon May 5 14:55:05 2003 --- openssl_097/crypto/des/read_pwd.c Thu May 22 10:07:32 2003 *************** *** 56,62 **** --- 56,140 ---- * [including the GNU Public Licence.] */ + #if defined (OPENSSL_SYS_NETWARE) + #include + + #if defined(NETWARE_CLIB) + #include + #else /* NETWARE_LIBC*/ + #include + #endif + + int des_read_pw_string(char *buf, int length, const char *prompt, + int verify) + { + char buff[BUFSIZ]; + int ret; + + ret=des_read_pw(buf,buff,(length>BUFSIZ)?BUFSIZ:length,prompt,verify); + memset(buff,0,BUFSIZ); + return(ret); + } + + int des_read_pw(char *buf, char *buff, int size, const char *prompt, + int verify) + { + int ok=0; + int i; + + printf("\n%s ", prompt); + + for(i=0; i + #define crypt(c,s) (des_crypt((c),(s))) + #endif + #ifndef _IRIX #include #endif cvs server: Diffing openssl_097/crypto/des/asm cvs server: Diffing openssl_097/crypto/des/t cvs server: Diffing openssl_097/crypto/des/times cvs server: Diffing openssl_097/crypto/dh Index: openssl_097/crypto/dh/dhtest.c diff -c openssl_097/crypto/dh/dhtest.c:1.1.1.2 openssl_097/crypto/dh/dhtest.c:1.1.1.1.2.2 *** openssl_097/crypto/dh/dhtest.c:1.1.1.2 Mon May 5 15:31:05 2003 --- openssl_097/crypto/dh/dhtest.c Tue May 6 14:33:50 2003 *************** *** 188,196 **** if(b != NULL) DH_free(b); if(a != NULL) DH_free(a); BIO_free(out); ! CRYPTO_cleanup_all_ex_data(); ! ERR_remove_state(0); ! CRYPTO_mem_leaks_fp(stderr); EXIT(ret); return(ret); } --- 188,196 ---- if(b != NULL) DH_free(b); if(a != NULL) DH_free(a); BIO_free(out); ! #ifdef OPENSSL_SYS_NETWARE ! if (ret) printf("ERROR: %d\n", ret); ! #endif EXIT(ret); return(ret); } cvs server: Diffing openssl_097/crypto/dsa Index: openssl_097/crypto/dsa/dsatest.c diff -c openssl_097/crypto/dsa/dsatest.c:1.1.1.3 openssl_097/crypto/dsa/dsatest.c:1.1.1.1.2.3 *** openssl_097/crypto/dsa/dsatest.c:1.1.1.3 Mon May 5 15:31:05 2003 --- openssl_097/crypto/dsa/dsatest.c Tue May 6 14:33:53 2003 *************** *** 211,216 **** --- 211,219 ---- BIO_free(bio_err); bio_err = NULL; } + #ifdef OPENSSL_SYS_NETWARE + if (!ret) printf("ERROR\n"); + #endif EXIT(!ret); return(0); } cvs server: Diffing openssl_097/crypto/dso cvs server: Diffing openssl_097/crypto/ec cvs server: Diffing openssl_097/crypto/engine Index: openssl_097/crypto/engine/hw_aep.c diff -c openssl_097/crypto/engine/hw_aep.c:1.1.1.1 openssl_097/crypto/engine/hw_aep.c:1.1.1.1.2.1 *** openssl_097/crypto/engine/hw_aep.c:1.1.1.1 Mon May 5 14:55:07 2003 --- openssl_097/crypto/engine/hw_aep.c Thu May 22 10:07:32 2003 *************** *** 848,854 **** --- 848,858 ---- CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); + #ifndef NETWARE_CLIB curr_pid = getpid(); + #else + curr_pid = GetThreadID(); + #endif /*Check if this is the first time this is being called from the current process*/ cvs server: Diffing openssl_097/crypto/engine/vendor_defns cvs server: Diffing openssl_097/crypto/err Index: openssl_097/crypto/err/err.c diff -c openssl_097/crypto/err/err.c:1.1.1.6 openssl_097/crypto/err/err.c:1.1.1.1.2.7 *** openssl_097/crypto/err/err.c:1.1.1.6 Fri Apr 1 14:49:50 2005 --- openssl_097/crypto/err/err.c Mon Apr 11 11:23:18 2005 *************** *** 1075,1077 **** --- 1075,1101 ---- err: va_end(args); } + + static void thread_free(ERR_STATE *es) + { + if (es == NULL) + return; + + ERR_STATE_free(es); + } + + static IMPLEMENT_LHASH_DOALL_FN(thread_free,ERR_STATE *) + + void ERR_free_state_table(void) + { + + CRYPTO_w_lock(CRYPTO_LOCK_ERR); + if (int_thread_hash) + { + lh_doall(int_thread_hash, LHASH_DOALL_FN(thread_free)); + lh_free(int_thread_hash); + int_thread_hash = NULL; + } + CRYPTO_w_unlock(CRYPTO_LOCK_ERR); + } + Index: openssl_097/crypto/err/err.h diff -c openssl_097/crypto/err/err.h:1.1.1.4 openssl_097/crypto/err/err.h:1.1.1.1.2.4 *** openssl_097/crypto/err/err.h:1.1.1.4 Fri Apr 1 14:49:50 2005 --- openssl_097/crypto/err/err.h Mon Apr 11 11:23:19 2005 *************** *** 277,282 **** --- 277,283 ---- void ERR_remove_state(unsigned long pid); /* if zero we look it up */ ERR_STATE *ERR_get_state(void); + void ERR_free_state_table(void); #ifndef OPENSSL_NO_LHASH LHASH *ERR_get_string_table(void); cvs server: Diffing openssl_097/crypto/evp cvs server: Diffing openssl_097/crypto/hmac cvs server: Diffing openssl_097/crypto/idea Index: openssl_097/crypto/idea/idea_spd.c diff -c openssl_097/crypto/idea/idea_spd.c:1.1.1.1 openssl_097/crypto/idea/idea_spd.c:1.1.1.1.2.1 *** openssl_097/crypto/idea/idea_spd.c:1.1.1.1 Mon May 5 14:55:09 2003 --- openssl_097/crypto/idea/idea_spd.c Tue May 6 14:08:16 2003 *************** *** 69,75 **** --- 69,78 ---- #include OPENSSL_UNISTD_IO OPENSSL_DECLARE_EXIT + #ifndef OPENSSL_SYS_NETWARE #include + #endif + #ifndef _IRIX #include #endif Index: openssl_097/crypto/idea/ideatest.c diff -c openssl_097/crypto/idea/ideatest.c:1.1.1.1 openssl_097/crypto/idea/ideatest.c:1.1.1.1.2.1 *** openssl_097/crypto/idea/ideatest.c:1.1.1.1 Mon May 5 14:55:09 2003 --- openssl_097/crypto/idea/ideatest.c Tue May 6 14:08:17 2003 *************** *** 169,174 **** --- 169,177 ---- else printf("ok\n"); + #ifdef OPENSSL_SYS_NETWARE + if (err) printf("ERROR: %d\n", err); + #endif EXIT(err); return(err); } cvs server: Diffing openssl_097/crypto/krb5 cvs server: Diffing openssl_097/crypto/lhash cvs server: Diffing openssl_097/crypto/md2 Index: openssl_097/crypto/md2/md2test.c diff -c openssl_097/crypto/md2/md2test.c:1.1.1.3 openssl_097/crypto/md2/md2test.c:1.1.1.1.2.3 *** openssl_097/crypto/md2/md2test.c:1.1.1.3 Tue Nov 11 15:59:52 2003 --- openssl_097/crypto/md2/md2test.c Wed Nov 12 17:51:48 2003 *************** *** 124,129 **** --- 124,132 ---- R++; P++; } + #ifdef OPENSSL_SYS_NETWARE + if (err) printf("ERROR: %d\n", err); + #endif EXIT(err); } cvs server: Diffing openssl_097/crypto/md4 cvs server: Diffing openssl_097/crypto/md5 Index: openssl_097/crypto/md5/md5test.c diff -c openssl_097/crypto/md5/md5test.c:1.1.1.1 openssl_097/crypto/md5/md5test.c:1.1.1.1.2.1 *** openssl_097/crypto/md5/md5test.c:1.1.1.1 Mon May 5 14:55:10 2003 --- openssl_097/crypto/md5/md5test.c Tue May 6 14:08:18 2003 *************** *** 120,125 **** --- 120,129 ---- R++; P++; } + + #ifdef OPENSSL_SYS_NETWARE + if (err) printf("ERROR: %d\n", err); + #endif EXIT(err); return(0); } cvs server: Diffing openssl_097/crypto/md5/asm cvs server: Diffing openssl_097/crypto/mdc2 Index: openssl_097/crypto/mdc2/mdc2test.c diff -c openssl_097/crypto/mdc2/mdc2test.c:1.1.1.1 openssl_097/crypto/mdc2/mdc2test.c:1.1.1.1.2.2 *** openssl_097/crypto/mdc2/mdc2test.c:1.1.1.1 Mon May 5 14:55:11 2003 --- openssl_097/crypto/mdc2/mdc2test.c Thu Jun 10 14:52:11 2004 *************** *** 139,144 **** --- 139,147 ---- else printf("pad2 - ok\n"); + #ifdef OPENSSL_SYS_NETWARE + if (ret) printf("ERROR: %d\n", ret); + #endif EVP_MD_CTX_cleanup(&c); EXIT(ret); return(ret); cvs server: Diffing openssl_097/crypto/objects cvs server: Diffing openssl_097/crypto/ocsp cvs server: Diffing openssl_097/crypto/pem cvs server: Diffing openssl_097/crypto/perlasm Index: openssl_097/crypto/perlasm/x86asm.pl diff -c openssl_097/crypto/perlasm/x86asm.pl:1.1.1.3 openssl_097/crypto/perlasm/x86asm.pl:1.1.1.1.2.3 *** openssl_097/crypto/perlasm/x86asm.pl:1.1.1.3 Fri Apr 1 14:49:53 2005 --- openssl_097/crypto/perlasm/x86asm.pl Mon Apr 11 11:23:56 2005 *************** *** 18,24 **** ($type,$fn,$i386)=@_; $filename=$fn; ! $elf=$cpp=$sol=$aout=$win32=$gaswin=0; if ( ($type eq "elf")) { $elf=1; require "x86unix.pl"; } elsif ( ($type eq "a.out")) --- 18,24 ---- ($type,$fn,$i386)=@_; $filename=$fn; ! $elf=$cpp=$sol=$aout=$win32=$gaswin=$netware=0; if ( ($type eq "elf")) { $elf=1; require "x86unix.pl"; } elsif ( ($type eq "a.out")) *************** *** 33,38 **** --- 33,42 ---- { $win32=1; require "x86ms.pl"; } elsif ( ($type eq "win32n")) { $win32=1; require "x86nasm.pl"; } + elsif ( ($type eq "nw-nasm")) + { $netware=1; require "x86nasm_nw.pl"; } + elsif ( ($type eq "nw-mwasm")) + { $netware=1; require "x86mwasm_nw.pl"; } else { print STDERR <<"EOF"; *************** *** 43,48 **** --- 47,54 ---- cpp - format so x86unix.cpp can be used win32 - Windows 95/Windows NT win32n - Windows 95/Windows NT NASM format + nw-nasm - NetWare NASM format + nw-mwasm- NetWare Metrowerks Assembler EOF exit(1); } Index: openssl_097/crypto/perlasm/x86mwasm_nw.pl diff -c /dev/null openssl_097/crypto/perlasm/x86mwasm_nw.pl:1.1.2.4 *** /dev/null Tue Apr 12 11:41:34 2005 --- openssl_097/crypto/perlasm/x86mwasm_nw.pl Mon Apr 11 11:23:57 2005 *************** *** 0 **** --- 1,369 ---- + #!/usr/local/bin/perl + + # x86 CodeWarrior assembler for NetWare + + # This file is a slightly modified version of x86nasm.pl. The Metrowerks + # compiler for NetWare doesn't prefix symbols with an underscore. + # + + $label="L000"; + + %lb=( 'eax', 'al', + 'ebx', 'bl', + 'ecx', 'cl', + 'edx', 'dl', + 'ax', 'al', + 'bx', 'bl', + 'cx', 'cl', + 'dx', 'dl', + ); + + %hb=( 'eax', 'ah', + 'ebx', 'bh', + 'ecx', 'ch', + 'edx', 'dh', + 'ax', 'ah', + 'bx', 'bh', + 'cx', 'ch', + 'dx', 'dh', + ); + + sub main'asm_init_output + { + @out=(); + &comment("NetWare: assembly for CodeWarrior assembler (mwasmnlm)"); + } + sub main'asm_get_output { return(@out); } + sub main'get_labels { return(@labels); } + + sub main'external_label + { + push(@labels,@_); + foreach (@_) { + push(@out, ".extern\t$_\n"); + } + } + + sub main'LB + { + (defined($lb{$_[0]})) || die "$_[0] does not have a 'low byte'\n"; + return($lb{$_[0]}); + } + + sub main'HB + { + (defined($hb{$_[0]})) || die "$_[0] does not have a 'high byte'\n"; + return($hb{$_[0]}); + } + + sub main'BP + { + &get_mem("BYTE",@_); + } + + sub main'DWP + { + &get_mem("DWORD",@_); + } + + sub main'BC + { + return "@_"; + } + + sub main'DWC + { + return "@_"; + } + + sub main'stack_push + { + my($num)=@_; + $stack+=$num*4; + &main'sub("esp",$num*4); + } + + sub main'stack_pop + { + my($num)=@_; + $stack-=$num*4; + &main'add("esp",$num*4); + } + + sub get_mem + { + my($size,$addr,$reg1,$reg2,$idx)=@_; + my($t,$post); + my($ret)="$size PTR ["; + $addr =~ s/^\s+//; + if ($addr =~ /^(.+)\+(.+)$/) + { + $reg2=&conv($1); + $addr="$2"; + } + elsif ($addr =~ /^[_a-zA-Z]/) + { + $addr="$addr"; + } + + if ($addr =~ /^.+\-.+$/) { $addr="($addr)"; } + + $reg1="$regs{$reg1}" if defined($regs{$reg1}); + $reg2="$regs{$reg2}" if defined($regs{$reg2}); + if (($addr ne "") && ($addr ne 0)) + { + if ($addr !~ /^-/) + { $ret.="${addr}+"; } + else { $post=$addr; } + } + if ($reg2 ne "") + { + $t=""; + $t="*$idx" if ($idx != 0); + $reg1="+".$reg1 if ("$reg1$post" ne ""); + $ret.="$reg2$t$reg1$post]"; + } + else + { + $ret.="$reg1$post]" + } + $ret =~ s/\+\]/]/; # in case $addr was the only argument + return($ret); + } + + sub main'mov { &out2("mov",@_); } + sub main'movb { &out2("mov",@_); } + sub main'and { &out2("and",@_); } + sub main'or { &out2("or",@_); } + sub main'shl { &out2("shl",@_); } + sub main'shr { &out2("shr",@_); } + sub main'xor { &out2("xor",@_); } + sub main'xorb { &out2("xor",@_); } + sub main'add { &out2("add",@_); } + sub main'adc { &out2("adc",@_); } + sub main'sub { &out2("sub",@_); } + sub main'rotl { &out2("rol",@_); } + sub main'rotr { &out2("ror",@_); } + sub main'exch { &out2("xchg",@_); } + sub main'cmp { &out2("cmp",@_); } + sub main'lea { &out2("lea",@_); } + sub main'mul { &out1("mul",@_); } + sub main'div { &out1("div",@_); } + sub main'dec { &out1("dec",@_); } + sub main'inc { &out1("inc",@_); } + sub main'jmp { &out1("jmp",@_); } + sub main'jmp_ptr { &out1p("jmp",@_); } + + sub main'je { &out1("je ",@_); } + sub main'jle { &out1("jle ",@_); } + sub main'jz { &out1("jz ",@_); } + sub main'jge { &out1("jge ",@_); } + sub main'jl { &out1("jl ",@_); } + sub main'ja { &out1("ja ",@_); } + sub main'jae { &out1("jae ",@_); } + sub main'jb { &out1("jb ",@_); } + sub main'jbe { &out1("jbe ",@_); } + sub main'jc { &out1("jc ",@_); } + sub main'jnc { &out1("jnc ",@_); } + sub main'jnz { &out1("jnz ",@_); } + sub main'jne { &out1("jne ",@_); } + sub main'jno { &out1("jno ",@_); } + + sub main'push { &out1("push",@_); $stack+=4; } + sub main'pop { &out1("pop",@_); $stack-=4; } + sub main'bswap { &out1("bswap",@_); &using486(); } + sub main'not { &out1("not",@_); } + sub main'call { &out1("call",$_[0]); } + sub main'ret { &out0("ret"); } + sub main'nop { &out0("nop"); } + sub main'movz { &out2("movzx",@_); } + + sub out2 + { + my($name,$p1,$p2)=@_; + my($l,$t); + + push(@out,"\t$name\t"); + if ($name eq "lea") + { + $p1 =~ s/^[^\[]*\[/\[/; + $p2 =~ s/^[^\[]*\[/\[/; + } + $t=&conv($p1).","; + $l=length($t); + push(@out,$t); + $l=4-($l+9)/8; + push(@out,"\t" x $l); + push(@out,&conv($p2)); + push(@out,"\n"); + } + + sub out0 + { + my($name)=@_; + + push(@out,"\t$name\n"); + } + + sub out1 + { + my($name,$p1)=@_; + my($l,$t); + push(@out,"\t$name\t".&conv($p1)."\n"); + } + + sub conv + { + my($p)=@_; + $p =~ s/0x([0-9A-Fa-f]+)/0$1h/; + return $p; + } + + sub using486 + { + return if $using486; + $using486++; + grep(s/\.386/\.486/,@out); + } + + sub main'file + { + push(@out, ".section .text\n"); + } + + sub main'function_begin + { + my($func,$extra)=@_; + + push(@labels,$func); + my($tmp)=<<"EOF"; + .global $func + $func: + push ebp + push ebx + push esi + push edi + EOF + push(@out,$tmp); + $stack=20; + } + + sub main'function_begin_B + { + my($func,$extra)=@_; + my($tmp)=<<"EOF"; + .global $func + $func: + EOF + push(@out,$tmp); + $stack=4; + } + + sub main'function_end + { + my($func)=@_; + + my($tmp)=<<"EOF"; + pop edi + pop esi + pop ebx + pop ebp + ret + EOF + push(@out,$tmp); + $stack=0; + %label=(); + } + + sub main'function_end_B + { + $stack=0; + %label=(); + } + + sub main'function_end_A + { + my($func)=@_; + + my($tmp)=<<"EOF"; + pop edi + pop esi + pop ebx + pop ebp + ret + EOF + push(@out,$tmp); + } + + sub main'file_end + { + } + + sub main'wparam + { + my($num)=@_; + + return(&main'DWP($stack+$num*4,"esp","",0)); + } + + sub main'swtmp + { + return(&main'DWP($_[0]*4,"esp","",0)); + } + + # Should use swtmp, which is above esp. Linix can trash the stack above esp + #sub main'wtmp + # { + # my($num)=@_; + # + # return(&main'DWP(-(($num+1)*4),"esp","",0)); + # } + + sub main'comment + { + foreach (@_) + { + push(@out,"\t; $_\n"); + } + } + + sub main'label + { + if (!defined($label{$_[0]})) + { + $label{$_[0]}="${label}${_[0]}"; + $label++; + } + return($label{$_[0]}); + } + + sub main'set_label + { + if (!defined($label{$_[0]})) + { + $label{$_[0]}="${label}${_[0]}"; + $label++; + } + push(@out,"$label{$_[0]}:\n"); + } + + sub main'data_word + { + push(@out,"\t.long\t$_[0]\n"); + } + + sub out1p + { + my($name,$p1)=@_; + my($l,$t); + + push(@out,"\t$name\t ".&conv($p1)."\n"); + } + + sub main'picmeup + { + local($dst,$sym)=@_; + &main'lea($dst,&main'DWP($sym)); + } + + sub main'blindpop { &out1("pop",@_); } Index: openssl_097/crypto/perlasm/x86nasm_nw.pl diff -c /dev/null openssl_097/crypto/perlasm/x86nasm_nw.pl:1.1.2.4 *** /dev/null Tue Apr 12 11:41:34 2005 --- openssl_097/crypto/perlasm/x86nasm_nw.pl Mon Apr 11 11:23:58 2005 *************** *** 0 **** --- 1,370 ---- + #!/usr/local/bin/perl + + # x86 nasm assembler for NetWare + + # This file is a slightly modified version of x86nasm.pl. The Metrowerks + # compiler for NetWare doesn't prefix symbols with an underscore. + # + + $label="L000"; + + %lb=( 'eax', 'al', + 'ebx', 'bl', + 'ecx', 'cl', + 'edx', 'dl', + 'ax', 'al', + 'bx', 'bl', + 'cx', 'cl', + 'dx', 'dl', + ); + + %hb=( 'eax', 'ah', + 'ebx', 'bh', + 'ecx', 'ch', + 'edx', 'dh', + 'ax', 'ah', + 'bx', 'bh', + 'cx', 'ch', + 'dx', 'dh', + ); + + sub main'asm_init_output + { + @out=(); + &comment("NetWare: assembly for NASM assembler (nasmw)"); + } + sub main'asm_get_output { return(@out); } + sub main'get_labels { return(@labels); } + + sub main'external_label + { + push(@labels,@_); + foreach (@_) { + push(@out, "extern\t$_\n"); + } + } + + sub main'LB + { + (defined($lb{$_[0]})) || die "$_[0] does not have a 'low byte'\n"; + return($lb{$_[0]}); + } + + sub main'HB + { + (defined($hb{$_[0]})) || die "$_[0] does not have a 'high byte'\n"; + return($hb{$_[0]}); + } + + sub main'BP + { + &get_mem("BYTE",@_); + } + + sub main'DWP + { + &get_mem("DWORD",@_); + } + + sub main'BC + { + return "BYTE @_"; + } + + sub main'DWC + { + return "DWORD @_"; + } + + sub main'stack_push + { + my($num)=@_; + $stack+=$num*4; + &main'sub("esp",$num*4); + } + + sub main'stack_pop + { + my($num)=@_; + $stack-=$num*4; + &main'add("esp",$num*4); + } + + sub get_mem + { + my($size,$addr,$reg1,$reg2,$idx)=@_; + my($t,$post); + my($ret)="$size ["; + $addr =~ s/^\s+//; + if ($addr =~ /^(.+)\+(.+)$/) + { + $reg2=&conv($1); + $addr="$2"; + } + elsif ($addr =~ /^[_a-zA-Z]/) + { + $addr="$addr"; + } + + if ($addr =~ /^.+\-.+$/) { $addr="($addr)"; } + + $reg1="$regs{$reg1}" if defined($regs{$reg1}); + $reg2="$regs{$reg2}" if defined($regs{$reg2}); + if (($addr ne "") && ($addr ne 0)) + { + if ($addr !~ /^-/) + { $ret.="${addr}+"; } + else { $post=$addr; } + } + if ($reg2 ne "") + { + $t=""; + $t="*$idx" if ($idx != 0); + $reg1="+".$reg1 if ("$reg1$post" ne ""); + $ret.="$reg2$t$reg1$post]"; + } + else + { + $ret.="$reg1$post]" + } + $ret =~ s/\+\]/]/; # in case $addr was the only argument + return($ret); + } + + sub main'mov { &out2("mov",@_); } + sub main'movb { &out2("mov",@_); } + sub main'and { &out2("and",@_); } + sub main'or { &out2("or",@_); } + sub main'shl { &out2("shl",@_); } + sub main'shr { &out2("shr",@_); } + sub main'xor { &out2("xor",@_); } + sub main'xorb { &out2("xor",@_); } + sub main'add { &out2("add",@_); } + sub main'adc { &out2("adc",@_); } + sub main'sub { &out2("sub",@_); } + sub main'rotl { &out2("rol",@_); } + sub main'rotr { &out2("ror",@_); } + sub main'exch { &out2("xchg",@_); } + sub main'cmp { &out2("cmp",@_); } + sub main'lea { &out2("lea",@_); } + sub main'mul { &out1("mul",@_); } + sub main'div { &out1("div",@_); } + sub main'dec { &out1("dec",@_); } + sub main'inc { &out1("inc",@_); } + sub main'jmp { &out1("jmp",@_); } + sub main'jmp_ptr { &out1p("jmp",@_); } + + # This is a bit of a kludge: declare all branches as NEAR. + sub main'je { &out1("je NEAR",@_); } + sub main'jle { &out1("jle NEAR",@_); } + sub main'jz { &out1("jz NEAR",@_); } + sub main'jge { &out1("jge NEAR",@_); } + sub main'jl { &out1("jl NEAR",@_); } + sub main'ja { &out1("ja NEAR",@_); } + sub main'jae { &out1("jae NEAR",@_); } + sub main'jb { &out1("jb NEAR",@_); } + sub main'jbe { &out1("jbe NEAR",@_); } + sub main'jc { &out1("jc NEAR",@_); } + sub main'jnc { &out1("jnc NEAR",@_); } + sub main'jnz { &out1("jnz NEAR",@_); } + sub main'jne { &out1("jne NEAR",@_); } + sub main'jno { &out1("jno NEAR",@_); } + + sub main'push { &out1("push",@_); $stack+=4; } + sub main'pop { &out1("pop",@_); $stack-=4; } + sub main'bswap { &out1("bswap",@_); &using486(); } + sub main'not { &out1("not",@_); } + sub main'call { &out1("call",$_[0]); } + sub main'ret { &out0("ret"); } + sub main'nop { &out0("nop"); } + sub main'movz { &out2("movzx",@_); } + + sub out2 + { + my($name,$p1,$p2)=@_; + my($l,$t); + + push(@out,"\t$name\t"); + if ($name eq "lea") + { + $p1 =~ s/^[^\[]*\[/\[/; + $p2 =~ s/^[^\[]*\[/\[/; + } + $t=&conv($p1).","; + $l=length($t); + push(@out,$t); + $l=4-($l+9)/8; + push(@out,"\t" x $l); + push(@out,&conv($p2)); + push(@out,"\n"); + } + + sub out0 + { + my($name)=@_; + + push(@out,"\t$name\n"); + } + + sub out1 + { + my($name,$p1)=@_; + my($l,$t); + push(@out,"\t$name\t".&conv($p1)."\n"); + } + + sub conv + { + my($p)=@_; + $p =~ s/0x([0-9A-Fa-f]+)/0$1h/; + return $p; + } + + sub using486 + { + return if $using486; + $using486++; + grep(s/\.386/\.486/,@out); + } + + sub main'file + { + push(@out, "segment .text\n"); + } + + sub main'function_begin + { + my($func,$extra)=@_; + + push(@labels,$func); + my($tmp)=<<"EOF"; + global $func + $func: + push ebp + push ebx + push esi + push edi + EOF + push(@out,$tmp); + $stack=20; + } + + sub main'function_begin_B + { + my($func,$extra)=@_; + my($tmp)=<<"EOF"; + global $func + $func: + EOF + push(@out,$tmp); + $stack=4; + } + + sub main'function_end + { + my($func)=@_; + + my($tmp)=<<"EOF"; + pop edi + pop esi + pop ebx + pop ebp + ret + EOF + push(@out,$tmp); + $stack=0; + %label=(); + } + + sub main'function_end_B + { + $stack=0; + %label=(); + } + + sub main'function_end_A + { + my($func)=@_; + + my($tmp)=<<"EOF"; + pop edi + pop esi + pop ebx + pop ebp + ret + EOF + push(@out,$tmp); + } + + sub main'file_end + { + } + + sub main'wparam + { + my($num)=@_; + + return(&main'DWP($stack+$num*4,"esp","",0)); + } + + sub main'swtmp + { + return(&main'DWP($_[0]*4,"esp","",0)); + } + + # Should use swtmp, which is above esp. Linix can trash the stack above esp + #sub main'wtmp + # { + # my($num)=@_; + # + # return(&main'DWP(-(($num+1)*4),"esp","",0)); + # } + + sub main'comment + { + foreach (@_) + { + push(@out,"\t; $_\n"); + } + } + + sub main'label + { + if (!defined($label{$_[0]})) + { + $label{$_[0]}="\$${label}${_[0]}"; + $label++; + } + return($label{$_[0]}); + } + + sub main'set_label + { + if (!defined($label{$_[0]})) + { + $label{$_[0]}="${label}${_[0]}"; + $label++; + } + push(@out,"$label{$_[0]}:\n"); + } + + sub main'data_word + { + push(@out,"\tDD\t$_[0]\n"); + } + + sub out1p + { + my($name,$p1)=@_; + my($l,$t); + + push(@out,"\t$name\t ".&conv($p1)."\n"); + } + + sub main'picmeup + { + local($dst,$sym)=@_; + &main'lea($dst,&main'DWP($sym)); + } + + sub main'blindpop { &out1("pop",@_); } cvs server: Diffing openssl_097/crypto/pkcs12 cvs server: Diffing openssl_097/crypto/pkcs7 cvs server: Diffing openssl_097/crypto/pkcs7/p7 cvs server: Diffing openssl_097/crypto/pkcs7/t cvs server: Diffing openssl_097/crypto/rand Index: openssl_097/crypto/rand/Makefile diff -c openssl_097/crypto/rand/Makefile:1.1.1.2 openssl_097/crypto/rand/Makefile:1.1.2.3 *** openssl_097/crypto/rand/Makefile:1.1.1.2 Fri Apr 1 14:49:55 2005 --- openssl_097/crypto/rand/Makefile Mon Apr 11 11:24:05 2005 *************** *** 23,31 **** LIB=$(TOP)/libcrypto.a LIBSRC=md_rand.c randfile.c rand_lib.c rand_err.c rand_egd.c \ ! rand_win.c rand_unix.c rand_os2.c LIBOBJ=md_rand.o randfile.o rand_lib.o rand_err.o rand_egd.o \ ! rand_win.o rand_unix.o rand_os2.o SRC= $(LIBSRC) --- 23,31 ---- LIB=$(TOP)/libcrypto.a LIBSRC=md_rand.c randfile.c rand_lib.c rand_err.c rand_egd.c \ ! rand_win.c rand_unix.c rand_os2.c rand_nw.c LIBOBJ=md_rand.o randfile.o rand_lib.o rand_err.o rand_egd.o \ ! rand_win.o rand_unix.o rand_os2.o rand_nw.o SRC= $(LIBSRC) Index: openssl_097/crypto/rand/rand_egd.c diff -c openssl_097/crypto/rand/rand_egd.c:1.1.1.4 openssl_097/crypto/rand/rand_egd.c:1.1.1.1.2.4 *** openssl_097/crypto/rand/rand_egd.c:1.1.1.4 Fri Apr 1 14:49:55 2005 --- openssl_097/crypto/rand/rand_egd.c Mon Apr 11 11:24:06 2005 *************** *** 95,101 **** * RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255. */ ! #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_VOS) int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes) { return(-1); --- 95,101 ---- * RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255. */ ! #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_VOS) || defined(OPENSSL_SYS_NETWARE) int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes) { return(-1); Index: openssl_097/crypto/rand/rand_nw.c diff -c /dev/null openssl_097/crypto/rand/rand_nw.c:1.1.2.3 *** /dev/null Tue Apr 12 11:41:37 2005 --- openssl_097/crypto/rand/rand_nw.c Thu Jun 10 14:37:47 2004 *************** *** 0 **** --- 1,176 ---- + /* crypto/rand/rand_nw.c */ + /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * 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 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 acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS 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 AUTHOR OR 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. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + /* ==================================================================== + * Copyright (c) 1998-2000 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 "cryptlib.h" + #include + #include "rand_lcl.h" + + #if defined (OPENSSL_SYS_NETWARE) + + #if defined(NETWARE_LIBC) + #include + #endif + + extern long RunningProcess; + + /* the FAQ indicates we need to provide at least 20 bytes (160 bits) of seed + */ + int RAND_poll(void) + { + unsigned long l; + unsigned long tsc; + int i; + + /* There are several options to gather miscellaneous data + * but for now we will loop checking the time stamp counter (rdtsc) and + * the SuperHighResolutionTimer. Each iteration will collect 8 bytes + * of data but it is treated as only 1 byte of entropy. The call to + * ThreadSwitchWithDelay() will introduce additional variability into + * the data returned by rdtsc. + * + * Applications can agument the seed material by adding additional + * stuff with RAND_add() and should probably do so. + */ + l = GetProcessSwitchCount(); + RAND_add(&l,sizeof(l),1); + + l=RunningProcess; + RAND_add(&l,sizeof(l),1); + + for( i=2; i #define USE_SOCKETS #include "e_os.h" *************** *** 115,121 **** #include #include "rand_lcl.h" ! #if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS)) #include #include --- 116,122 ---- #include #include "rand_lcl.h" ! #if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)) #include #include Index: openssl_097/crypto/rand/randfile.c diff -c openssl_097/crypto/rand/randfile.c:1.1.1.3 openssl_097/crypto/rand/randfile.c:1.1.1.1.2.1 *** openssl_097/crypto/rand/randfile.c:1.1.1.3 Fri Oct 29 09:36:16 2004 --- openssl_097/crypto/rand/randfile.c Wed Mar 24 16:08:32 2004 *************** *** 166,176 **** } #if defined(O_CREAT) && !defined(OPENSSL_SYS_WIN32) - { /* For some reason Win32 can't write to files created this way */ /* chmod(..., 0600) is too late to protect the file, * permissions should be restrictive from the start */ int fd = open(file, O_CREAT, 0600); if (fd != -1) out = fdopen(fd, "wb"); --- 166,176 ---- } #if defined(O_CREAT) && !defined(OPENSSL_SYS_WIN32) /* For some reason Win32 can't write to files created this way */ /* chmod(..., 0600) is too late to protect the file, * permissions should be restrictive from the start */ + { int fd = open(file, O_CREAT, 0600); if (fd != -1) out = fdopen(fd, "wb"); Index: openssl_097/crypto/rand/randtest.c diff -c openssl_097/crypto/rand/randtest.c:1.1.1.1 openssl_097/crypto/rand/randtest.c:1.1.1.1.2.1 *** openssl_097/crypto/rand/randtest.c:1.1.1.1 Mon May 5 14:55:13 2003 --- openssl_097/crypto/rand/randtest.c Tue May 6 14:08:26 2003 *************** *** 211,216 **** --- 211,219 ---- printf("test 4 done\n"); err: err=((err)?1:0); + #ifdef OPENSSL_SYS_NETWARE + if (err) printf("ERROR: %d\n", err); + #endif EXIT(err); return(err); } cvs server: Diffing openssl_097/crypto/rc2 Index: openssl_097/crypto/rc2/rc2speed.c diff -c openssl_097/crypto/rc2/rc2speed.c:1.1.1.1 openssl_097/crypto/rc2/rc2speed.c:1.1.1.1.2.1 *** openssl_097/crypto/rc2/rc2speed.c:1.1.1.1 Mon May 5 14:55:13 2003 --- openssl_097/crypto/rc2/rc2speed.c Tue May 6 14:08:27 2003 *************** *** 69,75 **** --- 69,78 ---- #include OPENSSL_UNISTD_IO OPENSSL_DECLARE_EXIT + #ifndef OPENSSL_SYS_NETWARE #include + #endif + #ifndef _IRIX #include #endif Index: openssl_097/crypto/rc2/rc2test.c diff -c openssl_097/crypto/rc2/rc2test.c:1.1.1.1 openssl_097/crypto/rc2/rc2test.c:1.1.1.1.2.1 *** openssl_097/crypto/rc2/rc2test.c:1.1.1.1 Mon May 5 14:55:13 2003 --- openssl_097/crypto/rc2/rc2test.c Tue May 6 14:08:27 2003 *************** *** 205,210 **** --- 205,213 ---- printf("ok\n"); #endif + #ifdef OPENSSL_SYS_NETWARE + if (err) printf("ERROR: %d\n", err); + #endif EXIT(err); return(err); } cvs server: Diffing openssl_097/crypto/rc4 Index: openssl_097/crypto/rc4/rc4speed.c diff -c openssl_097/crypto/rc4/rc4speed.c:1.1.1.1 openssl_097/crypto/rc4/rc4speed.c:1.1.1.1.2.1 *** openssl_097/crypto/rc4/rc4speed.c:1.1.1.1 Mon May 5 14:55:13 2003 --- openssl_097/crypto/rc4/rc4speed.c Tue May 6 14:08:28 2003 *************** *** 69,75 **** --- 69,78 ---- #include OPENSSL_UNISTD_IO OPENSSL_DECLARE_EXIT + #ifndef OPENSSL_SYS_NETWARE #include + #endif + #ifndef _IRIX #include #endif Index: openssl_097/crypto/rc4/rc4test.c diff -c openssl_097/crypto/rc4/rc4test.c:1.1.1.1 openssl_097/crypto/rc4/rc4test.c:1.1.1.1.2.1 *** openssl_097/crypto/rc4/rc4test.c:1.1.1.1 Mon May 5 14:55:13 2003 --- openssl_097/crypto/rc4/rc4test.c Tue May 6 14:08:29 2003 *************** *** 197,202 **** --- 197,205 ---- } } printf("done\n"); + #ifdef OPENSSL_SYS_NETWARE + if (err) printf("ERROR: %d\n", err); + #endif EXIT(err); return(0); } cvs server: Diffing openssl_097/crypto/rc4/asm cvs server: Diffing openssl_097/crypto/rc5 Index: openssl_097/crypto/rc5/rc5speed.c diff -c openssl_097/crypto/rc5/rc5speed.c:1.1.1.1 openssl_097/crypto/rc5/rc5speed.c:1.1.1.1.2.1 *** openssl_097/crypto/rc5/rc5speed.c:1.1.1.1 Mon May 5 14:55:14 2003 --- openssl_097/crypto/rc5/rc5speed.c Tue May 6 14:08:29 2003 *************** *** 69,75 **** --- 69,78 ---- #include OPENSSL_UNISTD_IO OPENSSL_DECLARE_EXIT + #ifndef OPENSSL_SYS_NETWARE #include + #endif + #ifndef _IRIX #include #endif cvs server: Diffing openssl_097/crypto/rc5/asm cvs server: Diffing openssl_097/crypto/ripemd cvs server: Diffing openssl_097/crypto/ripemd/asm cvs server: Diffing openssl_097/crypto/rsa Index: openssl_097/crypto/rsa/rsa_test.c diff -c openssl_097/crypto/rsa/rsa_test.c:1.1.1.3 openssl_097/crypto/rsa/rsa_test.c:1.1.1.1.2.3 *** openssl_097/crypto/rsa/rsa_test.c:1.1.1.3 Mon May 5 15:31:16 2003 --- openssl_097/crypto/rsa/rsa_test.c Tue May 6 14:34:03 2003 *************** *** 312,317 **** --- 312,320 ---- CRYPTO_mem_leaks_fp(stderr); + #ifdef OPENSSL_SYS_NETWARE + if (err) printf("ERROR: %d\n", err); + #endif return err; } #endif cvs server: Diffing openssl_097/crypto/sha Index: openssl_097/crypto/sha/sha1test.c diff -c openssl_097/crypto/sha/sha1test.c:1.1.1.1 openssl_097/crypto/sha/sha1test.c:1.1.1.1.2.1 *** openssl_097/crypto/sha/sha1test.c:1.1.1.1 Mon May 5 14:55:15 2003 --- openssl_097/crypto/sha/sha1test.c Tue May 6 14:08:31 2003 *************** *** 157,162 **** --- 157,166 ---- } else printf("test 3 ok\n"); + + #ifdef OPENSSL_SYS_NETWARE + if (err) printf("ERROR: %d\n", err); + #endif EXIT(err); EVP_MD_CTX_cleanup(&c); return(0); Index: openssl_097/crypto/sha/shatest.c diff -c openssl_097/crypto/sha/shatest.c:1.1.1.2 openssl_097/crypto/sha/shatest.c:1.1.1.1.2.3 *** openssl_097/crypto/sha/shatest.c:1.1.1.2 Fri Apr 1 14:49:57 2005 --- openssl_097/crypto/sha/shatest.c Mon Apr 11 11:24:23 2005 *************** *** 157,162 **** --- 157,166 ---- } else printf("test 3 ok\n"); + + #ifdef OPENSSL_SYS_NETWARE + if (err) printf("ERROR: %d\n", err); + #endif EVP_MD_CTX_cleanup(&c); EXIT(err); return(0); cvs server: Diffing openssl_097/crypto/sha/asm cvs server: Diffing openssl_097/crypto/stack cvs server: Diffing openssl_097/crypto/threads Index: openssl_097/crypto/threads/mttest.c diff -c openssl_097/crypto/threads/mttest.c:1.1.1.3 openssl_097/crypto/threads/mttest.c:1.1.1.1.2.2 *** openssl_097/crypto/threads/mttest.c:1.1.1.3 Tue Mar 23 16:50:02 2004 --- openssl_097/crypto/threads/mttest.c Wed Mar 24 16:08:38 2004 *************** *** 77,82 **** --- 77,88 ---- #ifdef PTHREADS #include #endif + #ifdef OPENSSL_SYS_NETWARE + #if !defined __int64 + #define __int64 long long + #endif + #include + #endif #include #include #include *************** *** 86,93 **** --- 92,109 ---- #include #include + #ifdef OPENSSL_NO_FP_API + #define APPS_WIN16 + #include "../buffer/bss_file.c" + #endif + + #ifdef OPENSSL_SYS_NETWARE + #define TEST_SERVER_CERT "/openssl/apps/server.pem" + #define TEST_CLIENT_CERT "/openssl/apps/client.pem" + #else #define TEST_SERVER_CERT "../../apps/server.pem" #define TEST_CLIENT_CERT "../../apps/client.pem" + #endif #define MAX_THREAD_NUMBER 100 *************** *** 100,109 **** --- 116,133 ---- void solaris_locking_callback(int mode,int type,char *file,int line); void win32_locking_callback(int mode,int type,char *file,int line); void pthreads_locking_callback(int mode,int type,char *file,int line); + void netware_locking_callback(int mode,int type,char *file,int line); unsigned long irix_thread_id(void ); unsigned long solaris_thread_id(void ); unsigned long pthreads_thread_id(void ); + unsigned long netware_thread_id(void ); + + #if defined(OPENSSL_SYS_NETWARE) + static MPKMutex *lock_cs; + static MPKSema ThreadSem; + static long *lock_count; + #endif BIO *bio_err=NULL; BIO *bio_stdout=NULL; *************** *** 384,389 **** --- 408,416 ---- SSL_free((SSL *)ctx[2]); SSL_free((SSL *)ctx[3]); } + #ifdef OPENSSL_SYS_NETWARE + MPKSemaphoreSignal(ThreadSem); + #endif return(0); } *************** *** 627,632 **** --- 654,662 ---- } if ((done & S_DONE) && (done & C_DONE)) break; + #if defined(OPENSSL_SYS_NETWARE) + ThreadSwitchWithDelay(); + #endif } SSL_set_shutdown(c_ssl,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN); *************** *** 1094,1096 **** --- 1124,1211 ---- + #ifdef OPENSSL_SYS_NETWARE + + void thread_setup(void) + { + int i; + + lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(MPKMutex)); + lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); + for (i=0; ireferences,c_ctx->references); + } + + unsigned long netware_thread_id(void) + { + unsigned long ret; + + ret=(unsigned long)GetThreadID(); + return(ret); + } + #endif /* NETWARE */ Index: openssl_097/crypto/threads/netware.bat diff -c /dev/null openssl_097/crypto/threads/netware.bat:1.1.2.1 *** /dev/null Tue Apr 12 11:41:45 2005 --- openssl_097/crypto/threads/netware.bat Tue May 6 14:08:34 2003 *************** *** 0 **** --- 1,79 ---- + @echo off + rem batch file to build multi-thread test ( mttest.nlm ) + + rem command line arguments: + rem debug => build using debug settings + + rem + rem After building, copy mttest.nlm to the server and run it, you'll probably + rem want to redirect stdout and stderr. An example command line would be + rem "mttest.nlm -thread 20 -loops 10 -CAfile \openssl\apps\server.pem >mttest.out 2>mttest.err" + rem + + del mttest.nlm + + set BLD_DEBUG= + set CFLAGS= + set LFLAGS= + set LIBS= + + if "%1" == "DEBUG" set BLD_DEBUG=YES + if "%1" == "debug" set BLD_DEBUG=YES + + if "%MWCIncludes%" == "" goto inc_error + if "%PRELUDE%" == "" goto prelude_error + if "%IMPORTS%" == "" goto imports_error + + set CFLAGS=-c -I..\..\outinc_nw -nosyspath -DOPENSSL_SYS_NETWARE -opt off -g -sym internal -maxerrors 20 + + if "%BLD_DEBUG%" == "YES" set LIBS=..\..\out_nw.dbg\ssl.lib ..\..\out_nw.dbg\crypto.lib + if "%BLD_DEBUG%" == "" set LIBS=..\..\out_nw\ssl.lib ..\..\out_nw\crypto.lib + + set LFLAGS=-msgstyle gcc -zerobss -stacksize 32768 -nostdlib -sym internal + + rem generate command file for metrowerks + echo. + echo Generating Metrowerks command file: mttest.def + echo # dynamically generated command file for metrowerks build > mttest.def + echo IMPORT @%IMPORTS%\clib.imp >> mttest.def + echo IMPORT @%IMPORTS%\threads.imp >> mttest.def + echo IMPORT @%IMPORTS%\ws2nlm.imp >> mttest.def + echo IMPORT GetProcessSwitchCount >> mttest.def + echo MODULE clib >> mttest.def + + rem compile + echo. + echo Compiling mttest.c + mwccnlm.exe mttest.c %CFLAGS% + if errorlevel 1 goto end + + rem link + echo. + echo Linking mttest.nlm + mwldnlm.exe %LFLAGS% -screenname mttest -commandfile mttest.def mttest.o "%PRELUDE%" %LIBS% -o mttest.nlm + if errorlevel 1 goto end + + goto end + + :inc_error + echo. + echo Environment variable MWCIncludes is not set - see install.nw + goto end + + :prelude_error + echo. + echo Environment variable PRELUDE is not set - see install.nw + goto end + + :imports_error + echo. + echo Environment variable IMPORTS is not set - see install.nw + goto end + + + :end + set BLD_DEBUG= + set CFLAGS= + set LFLAGS= + set LIBS= + cvs server: Diffing openssl_097/crypto/txt_db cvs server: Diffing openssl_097/crypto/ui Index: openssl_097/crypto/ui/ui_openssl.c diff -c openssl_097/crypto/ui/ui_openssl.c:1.1.1.2 openssl_097/crypto/ui/ui_openssl.c:1.1.1.1.2.2 *** openssl_097/crypto/ui/ui_openssl.c:1.1.1.2 Mon May 5 15:01:33 2003 --- openssl_097/crypto/ui/ui_openssl.c Mon May 19 12:05:58 2003 *************** *** 199,204 **** --- 199,210 ---- #undef SGTTY #endif + #if defined(OPENSSL_SYS_NETWARE) + #undef TERMIOS + #undef TERMIO + #undef SGTTY + #endif + #ifdef TERMIOS # include # define TTY_STRUCT struct termios *************** *** 247,253 **** typedef int sig_atomic_t; #endif ! #if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(MAC_OS_GUSI_SOURCE) /* * This one needs work. As a matter of fact the code is unoperational * and this is only a trick to get it compiled. --- 253,259 ---- typedef int sig_atomic_t; #endif ! #if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(MAC_OS_GUSI_SOURCE) || defined(OPENSSL_SYS_NETWARE) /* * This one needs work. As a matter of fact the code is unoperational * and this is only a trick to get it compiled. *************** *** 460,466 **** CRYPTO_w_lock(CRYPTO_LOCK_UI); is_a_tty = 1; ! #if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_VXWORKS) tty_in=stdin; tty_out=stderr; #else --- 466,472 ---- CRYPTO_w_lock(CRYPTO_LOCK_UI); is_a_tty = 1; ! #if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) tty_in=stdin; tty_out=stderr; #else cvs server: Diffing openssl_097/crypto/x509 cvs server: Diffing openssl_097/crypto/x509v3 cvs server: Diffing openssl_097/demos cvs server: Diffing openssl_097/demos/asn1 cvs server: Diffing openssl_097/demos/bench cvs server: Diffing openssl_097/demos/bench/client cvs server: Diffing openssl_097/demos/bench/common cvs server: Diffing openssl_097/demos/bench/server cvs server: Diffing openssl_097/demos/bio cvs server: Diffing openssl_097/demos/easy_tls cvs server: Diffing openssl_097/demos/eay cvs server: Diffing openssl_097/demos/engines cvs server: Diffing openssl_097/demos/engines/cluster_labs cvs server: Diffing openssl_097/demos/engines/ibmca cvs server: Diffing openssl_097/demos/engines/rsaref cvs server: Diffing openssl_097/demos/engines/zencod cvs server: Diffing openssl_097/demos/maurice cvs server: Diffing openssl_097/demos/pkcs12 cvs server: Diffing openssl_097/demos/prime cvs server: Diffing openssl_097/demos/sign cvs server: Diffing openssl_097/demos/ssl cvs server: Diffing openssl_097/demos/state_machine cvs server: Diffing openssl_097/demos/tunala cvs server: Diffing openssl_097/demos/x509 cvs server: Diffing openssl_097/doc cvs server: Diffing openssl_097/doc/HOWTO cvs server: Diffing openssl_097/doc/apps cvs server: Diffing openssl_097/doc/crypto cvs server: Diffing openssl_097/doc/novell cvs server: Diffing openssl_097/doc/novell/design cvs server: Diffing openssl_097/doc/novell/legal cvs server: Diffing openssl_097/doc/novell/presentations cvs server: Diffing openssl_097/doc/novell/specifications cvs server: Diffing openssl_097/doc/novell/testing cvs server: Diffing openssl_097/doc/ssl cvs server: Diffing openssl_097/external cvs server: Diffing openssl_097/external/encrypt cvs server: Diffing openssl_097/external/encrypt/AIX cvs server: Diffing openssl_097/external/encrypt/AIX/debug cvs server: Diffing openssl_097/external/encrypt/AIX/openssl cvs server: Diffing openssl_097/external/encrypt/HPUX cvs server: Diffing openssl_097/external/encrypt/HPUX/debug cvs server: Diffing openssl_097/external/encrypt/HPUX/openssl cvs server: Diffing openssl_097/external/encrypt/Linux cvs server: Diffing openssl_097/external/encrypt/Linux/gcc2 cvs server: Diffing openssl_097/external/encrypt/Linux/gcc2/debug cvs server: Diffing openssl_097/external/encrypt/Linux/gcc3 cvs server: Diffing openssl_097/external/encrypt/Linux/gcc3/debug cvs server: Diffing openssl_097/external/encrypt/Linux/openssl cvs server: Diffing openssl_097/external/encrypt/NW cvs server: Diffing openssl_097/external/encrypt/Solaris cvs server: Diffing openssl_097/external/encrypt/Solaris/debug cvs server: Diffing openssl_097/external/encrypt/Solaris/openssl cvs server: Diffing openssl_097/external/encrypt/debug cvs server: Diffing openssl_097/external/encrypt/debug/AIX cvs server: Diffing openssl_097/external/encrypt/debug/HPUX cvs server: Diffing openssl_097/external/encrypt/debug/Linux cvs server: Diffing openssl_097/external/encrypt/debug/Linux/gcc2 cvs server: Diffing openssl_097/external/encrypt/debug/Linux/gcc3 cvs server: Diffing openssl_097/external/encrypt/debug/NW cvs server: Diffing openssl_097/external/encrypt/debug/Solaris cvs server: Diffing openssl_097/external/encrypt/debug/netware cvs server: Diffing openssl_097/external/encrypt/debug/win32 cvs server: Diffing openssl_097/external/encrypt/include cvs server: Diffing openssl_097/external/encrypt/include/openssl cvs server: Diffing openssl_097/external/encrypt/netware cvs server: Diffing openssl_097/external/encrypt/netware/debug cvs server: Diffing openssl_097/external/encrypt/netware/openssl cvs server: Diffing openssl_097/external/encrypt/win32 cvs server: Diffing openssl_097/external/encrypt/win32/debug cvs server: Diffing openssl_097/external/encrypt/win32/openssl cvs server: Diffing openssl_097/external/nici cvs server: Diffing openssl_097/external/nici/AIX cvs server: Diffing openssl_097/external/nici/HPUX cvs server: Diffing openssl_097/external/nici/Linux cvs server: Diffing openssl_097/external/nici/S390 cvs server: Diffing openssl_097/external/nici/Solaris cvs server: Diffing openssl_097/external/nici/include cvs server: Diffing openssl_097/external/nici/lib cvs server: Diffing openssl_097/external/nici/lib/AIX cvs server: Diffing openssl_097/external/nici/lib/HP-UX cvs server: Diffing openssl_097/external/nici/lib/Solaris cvs server: Diffing openssl_097/external/nici/lib/linux cvs server: Diffing openssl_097/external/nici/lib/nlm cvs server: Diffing openssl_097/external/nici/lib/s390 cvs server: Diffing openssl_097/external/nici/lib/win9x cvs server: Diffing openssl_097/external/nici/lib/win9x/debug cvs server: Diffing openssl_097/external/nici/lib/wnt cvs server: Diffing openssl_097/external/nici/netware cvs server: Diffing openssl_097/external/nici/win32 cvs server: Diffing openssl_097/external/novell cvs server: Diffing openssl_097/external/novell/include cvs server: Diffing openssl_097/external/nwsdk cvs server: Diffing openssl_097/external/nwsdk/coreos cvs server: Diffing openssl_097/external/nwsdk/coreos/inc cvs server: Diffing openssl_097/external/nwsdk/libc cvs server: Diffing openssl_097/external/nwsdk/libc/imports cvs server: Diffing openssl_097/external/nwsdk/libc/include cvs server: Diffing openssl_097/external/nwsdk/libc/include/arpa cvs server: Diffing openssl_097/external/nwsdk/libc/include/netinet cvs server: Diffing openssl_097/external/nwsdk/libc/include/nks cvs server: Diffing openssl_097/external/nwsdk/libc/include/sys cvs server: Diffing openssl_097/external/nwsdk/libc/include/winsock cvs server: Diffing openssl_097/external/pki cvs server: Diffing openssl_097/external/pki/include cvs server: Diffing openssl_097/external/unittest cvs server: Diffing openssl_097/external/unittest/bin cvs server: Diffing openssl_097/external/unittest/bin/java cvs server: Diffing openssl_097/external/unittest/config cvs server: Diffing openssl_097/external/unittest/include cvs server: Diffing openssl_097/external/unittest/include/public cvs server: Diffing openssl_097/external/unittest/scripts cvs server: Diffing openssl_097/external/unittest/scripts/bash cvs server: Diffing openssl_097/external/unittest/scripts/bat cvs server: Diffing openssl_097/external/unittest/src cvs server: Diffing openssl_097/external/unittest/src/common cvs server: Diffing openssl_097/fips cvs server: Diffing openssl_097/fips/aes cvs server: Diffing openssl_097/fips/des cvs server: Diffing openssl_097/fips/des/asm cvs server: Diffing openssl_097/fips/dh cvs server: Diffing openssl_097/fips/dsa cvs server: Diffing openssl_097/fips/rand cvs server: Diffing openssl_097/fips/rsa cvs server: Diffing openssl_097/fips/sha1 cvs server: Diffing openssl_097/fips/sha1/asm cvs server: Diffing openssl_097/ms cvs server: Diffing openssl_097/openssl_generic_reports cvs server: Diffing openssl_097/os2 cvs server: Diffing openssl_097/shlib cvs server: Diffing openssl_097/ssl Index: openssl_097/ssl/ssltest.c diff -c openssl_097/ssl/ssltest.c:1.1.1.8 openssl_097/ssl/ssltest.c:1.1.1.1.2.8 *** openssl_097/ssl/ssltest.c:1.1.1.8 Mon Apr 11 13:53:32 2005 --- openssl_097/ssl/ssltest.c Tue Apr 12 10:42:09 2005 *************** *** 155,160 **** --- 155,163 ---- #elif defined(OPENSSL_SYS_WINCE) # define TEST_SERVER_CERT "\\OpenSSL\\server.pem" # define TEST_CLIENT_CERT "\\OpenSSL\\client.pem" + #elif defined(OPENSSL_SYS_NETWARE) + # define TEST_SERVER_CERT "\\openssl\\apps\\server.pem" + # define TEST_CLIENT_CERT "\\openssl\\apps\\client.pem" #else # define TEST_SERVER_CERT "../apps/server.pem" # define TEST_CLIENT_CERT "../apps/client.pem" cvs server: Diffing openssl_097/sync_cfg_generic cvs server: Diffing openssl_097/sync_log cvs server: Diffing openssl_097/test cvs server: Diffing openssl_097/times cvs server: Diffing openssl_097/times/090 cvs server: Diffing openssl_097/times/091 cvs server: Diffing openssl_097/times/x86 cvs server: Diffing openssl_097/tools cvs server: Diffing openssl_097/unix cvs server: Diffing openssl_097/util Index: openssl_097/util/libeay.num diff -c openssl_097/util/libeay.num:1.1.1.6 openssl_097/util/libeay.num:1.1.1.1.2.7 *** openssl_097/util/libeay.num:1.1.1.6 Mon Apr 11 13:53:35 2005 --- openssl_097/util/libeay.num Tue Apr 12 10:42:12 2005 *************** *** 2867,2869 **** --- 2867,2870 ---- PROXY_CERT_INFO_EXTENSION_it 3307 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION: PROXY_POLICY_free 3308 EXIST::FUNCTION: PROXY_POLICY_new 3309 EXIST::FUNCTION: + ERR_free_state_table 4507 EXIST::FUNCTION: Index: openssl_097/util/mk1mf.pl diff -c openssl_097/util/mk1mf.pl:1.1.1.5 openssl_097/util/mk1mf.pl:1.1.1.1.2.5 *** openssl_097/util/mk1mf.pl:1.1.1.5 Fri Oct 29 09:36:32 2004 --- openssl_097/util/mk1mf.pl Sat Oct 30 10:31:21 2004 *************** *** 39,44 **** --- 39,46 ---- "ultrix-mips","DEC mips ultrix", "FreeBSD","FreeBSD distribution", "OS2-EMX", "EMX GCC OS/2", + "netware-clib", "CodeWarrior for NetWare - CLib", + "netware-libc", "CodeWarrior for NetWare - LibC", "default","cc under unix", ); *************** *** 67,72 **** --- 69,76 ---- no-engine - No engine no-hw - No hw nasm - Use NASM for x86 asm + nw-nasm - Use NASM x86 asm for NetWare + nw-mwasm - Use Metrowerks x86 asm for NetWare gaswin - Use GNU as with Mingw32 no-socks - No socket code no-err - No error strings *************** *** 196,201 **** --- 200,210 ---- $wc=1; require 'OS2-EMX.pl'; } + elsif (($platform eq "netware-clib") || ($platform eq "netware-libc")) + { + $LIBC=1 if $platform eq "netware-libc"; + require 'netware.pl'; + } else { require "unix.pl"; *************** *** 912,917 **** --- 921,928 ---- elsif (/^no-aes$/) { $no_aes=1; } elsif (/^no-asm$/) { $no_asm=1; } elsif (/^nasm$/) { $nasm=1; } + elsif (/^nw-nasm$/) { $nw_nasm=1; } + elsif (/^nw-mwasm$/) { $nw_mwasm=1; } elsif (/^gaswin$/) { $gaswin=1; } elsif (/^no-ssl2$/) { $no_ssl2=1; } elsif (/^no-ssl3$/) { $no_ssl3=1; } cvs server: Diffing openssl_097/util/pl Index: openssl_097/util/pl/netware.pl diff -c /dev/null openssl_097/util/pl/netware.pl:1.1.2.3 *** /dev/null Tue Apr 12 11:42:49 2005 --- openssl_097/util/pl/netware.pl Sat Oct 30 13:48:16 2004 *************** *** 0 **** --- 1,328 ---- + # Metrowerks Codewarrior for NetWare + # + + # The import files and other misc imports needed to link + if ($LIBC) + { + @import_files = ("libc.imp", "ws2nlm.imp"); + @module_files = ("libc"); + } + else + { + # clib build + @import_files = ("clib.imp", "ws2nlm.imp"); + @module_files = ("clib"); + } + @misc_imports = ("GetProcessSwitchCount", "RunningProcess", + "GetSuperHighResolutionTimer" ); + + # The "IMPORTS" environment variable must be set and point to the location + # where import files (*.imp) can be found. + # Example: set IMPORTS=c:\ndk\nwsdk\imports + $import_path = $ENV{"IMPORTS"} || die ("IMPORTS environment variable not set\n"); + + + # The "PRELUDE" environment variable must be set and point to the location + # and name of the prelude source to link with ( nwpre.obj is recommended ). + # Example: set PRELUDE=c:\codewar\novell support\metrowerks support\libraries\runtime\nwpre.obj + $prelude = $ENV{"PRELUDE"} || die ("PRELUDE environment variable not set\n"); + + #$ssl= "ssleay32"; + #$crypto="libeay32"; + + $o='\\\\'; + $cp='copy >nul:'; + $rm='del'; + + # C compiler + $cc="mwccnlm"; + + # Linker + $link="mwldnlm"; + + # librarian + $mklib="mwldnlm"; + + # assembler + if ($nw_nasm) + { + $asm="nasmw -s -f coff"; + $afile="-o "; + $asm.=" -g" if $debug; + } + elsif ($nw_mwasm) + { + $asm="mwasmnlm -maxerrors 20"; + $afile="-o "; + $asm.=" -g" if $debug; + } + elsif ($nw_masm) + { + # masm assembly settings - it should be possible to use masm but haven't + # got it working. + # $asm='ml /Cp /coff /c /Cx'; + # $asm.=" /Zi" if $debug; + # $afile='/Fo'; + die("Support for masm assembler not yet functional\n"); + } + else + { + $asm=""; + $afile=""; + } + + + + # compile flags + # + # NOTES: Several c files in the crypto subdirectory include headers from + # their local directories. Metrowerks wouldn't find these h files + # without adding individual include directives as compile flags + # or modifying the c files. Instead of adding individual include + # paths for each subdirectory a recursive include directive + # is used ( -ir crypto ). + # The same issue now exists in the fips subdirectory so do the same. + # + # Turned off the "possible" warnings ( -w nopossible ). Metrowerks + # complained a lot about various stuff. May want to turn back + # on for further development. + $cflags="-ir crypto -ir fips -msgstyle gcc -align 4 -processor pentium \\ + -char unsigned -w on -w nolargeargs -w nopossible -w nounusedarg \\ + -w noimplicitconv -relax_pointers -nosyspath -DL_ENDIAN \\ + -DOPENSSL_SYSNAME_NETWARE -U_WIN32 -maxerrors 20 "; + + # link flags + $lflags="-msgstyle gcc -zerobss -stacksize 32768 -nostdlib -sym internal "; + + + # additional flags based upon debug | non-debug + if ($debug) + { + $cflags.=" -opt off -g -sym internal -DDEBUG"; + } + else + { + # CodeWarrior compiler has a problem with optimizations for floating + # points - no optimizations until further investigation + # $cflags.=" -opt all"; + } + + # If LibC build add in NKS_LIBC define and set the entry/exit + # routines - The default entry/exit routines are for CLib and don't exist + # in LibC + if ($LIBC) + { + $cflags.=" -DNETWARE_LIBC"; + $lflags.=" -entry _LibCPrelude -exit _LibCPostlude -flags pseudopreemption"; + } + else + { + $cflags.=" -DNETWARE_CLIB"; + $lflags.=" -entry _Prelude -exit _Stop"; + } + + + # linking stuff + # for the output directories use the mk1mf.pl values with "_nw" appended + if ($shlib) + { + if ($LIBC) + { + $out_def.="_nw_libc_nlm"; + $tmp_def.="_nw_libc_nlm"; + $inc_def.="_nw_libc_nlm"; + } + else # NETWARE_CLIB + { + $out_def.="_nw_clib_nlm"; + $tmp_def.="_nw_clib_nlm"; + $inc_def.="_nw_clib_nlm"; + } + } + else + { + $libp=".lib"; + $shlibp=".lib"; + $lib_flags="-nodefaults -type library"; + if ($LIBC) + { + $out_def.="_nw_libc"; + $tmp_def.="_nw_libc"; + $inc_def.="_nw_libc"; + } + else # NETWARE_CLIB + { + $out_def.="_nw_clib"; + $tmp_def.="_nw_clib"; + $inc_def.="_nw_clib"; + } + } + + # used by mk1mf.pl + $obj='.obj'; + $ofile='-o '; + $efile=''; + $exep='.nlm'; + $ex_libs=''; + + if (!$no_asm) + { + $bn_asm_obj="crypto${o}bn${o}asm${o}bn-nw.obj"; + $bn_asm_src="crypto${o}bn${o}asm${o}bn-nw.asm"; + $des_enc_obj="crypto${o}des${o}asm${o}d-nw.obj crypto${o}des${o}asm${o}y-nw.obj"; + $des_enc_src="crypto${o}des${o}asm${o}d-nw.asm crypto${o}des${o}asm${o}y-nw.asm"; + $bf_enc_obj="crypto${o}bf${o}asm${o}b-nw.obj"; + $bf_enc_src="crypto${o}bf${o}asm${o}b-nw.asm"; + $cast_enc_obj="crypto${o}cast${o}asm${o}c-nw.obj"; + $cast_enc_src="crypto${o}cast${o}asm${o}c-nw.asm"; + $rc4_enc_obj="crypto${o}rc4${o}asm${o}r4-nw.obj"; + $rc4_enc_src="crypto${o}rc4${o}asm${o}r4-nw.asm"; + $rc5_enc_obj="crypto${o}rc5${o}asm${o}r5-nw.obj"; + $rc5_enc_src="crypto${o}rc5${o}asm${o}r5-nw.asm"; + $md5_asm_obj="crypto${o}md5${o}asm${o}m5-nw.obj"; + $md5_asm_src="crypto${o}md5${o}asm${o}m5-nw.asm"; + $sha1_asm_obj="crypto${o}sha${o}asm${o}s1-nw.obj"; + $sha1_asm_src="crypto${o}sha${o}asm${o}s1-nw.asm"; + $rmd160_asm_obj="crypto${o}ripemd${o}asm${o}rm-nw.obj"; + $rmd160_asm_src="crypto${o}ripemd${o}asm${o}rm-nw.asm"; + $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM"; + } + else + { + $bn_asm_obj=''; + $bn_asm_src=''; + $des_enc_obj=''; + $des_enc_src=''; + $bf_enc_obj=''; + $bf_enc_src=''; + $cast_enc_obj=''; + $cast_enc_src=''; + $rc4_enc_obj=''; + $rc4_enc_src=''; + $rc5_enc_obj=''; + $rc5_enc_src=''; + $md5_asm_obj=''; + $md5_asm_src=''; + $sha1_asm_obj=''; + $sha1_asm_src=''; + $rmd160_asm_obj=''; + $rmd160_asm_src=''; + } + + # create the *.def linker command files in \openssl\netware\ directory + sub do_def_file + { + # strip off the leading path + my($target) = bname(@_); + my($def_file); + my($mod_file); + my($i); + + if ($target =~ /(.*).nlm/) + { + $target = $1; + } + + # special case for openssl - the mk1mf.pl defines E_EXE = openssl + if ($target =~ /E_EXE/) + { + $target = "openssl"; + } + + # Note: originally tried to use full path ( \openssl\netware\$target.def ) + # Metrowerks linker choked on this with an assertion failure. bug??? + # + $def_file = "netware\\$target.def"; + + open(DEF_OUT, ">$def_file") || die("unable to open file $def_file\n"); + + print( DEF_OUT "# command file generated by netware.pl for Metrowerks build\n" ); + print( DEF_OUT "#\n"); + print( DEF_OUT "DESCRIPTION \"$target\"\n"); + + foreach $i (@misc_imports) + { + print( DEF_OUT "IMPORT $i\n"); + } + + foreach $i (@import_files) + { + print( DEF_OUT "IMPORT \@$import_path\\$i\n"); + } + + foreach $i (@module_files) + { + print( DEF_OUT "MODULE $i\n"); + } + + close(DEF_OUT); + return($def_file); + } + + sub do_lib_rule + { + my($objs,$target,$name,$shlib)=@_; + my($ret); + + $ret.="$target: $objs\n"; + if (!$shlib) + { + $ret.="\t\@echo Building Lib: $name\n"; + $ret.="\t\$(MKLIB) $lib_flags -o $target $objs\n"; + $ret.="\t\@echo .\n" + } + else + { + die( "Building as NLM not currently supported!" ); + } + + $ret.="\n"; + return($ret); + } + + sub do_link_rule + { + my($target,$files,$dep_libs,$libs)=@_; + my($ret); + my($def_file); + + $def_file = do_def_file($target); + + # special case for openssl - the mk1mf.pl defines E_EXE = openssl + + # NOTE: When building the test nlms no screen name is given + # which causes the console screen to be used. By using the console + # screen there is no "" message which + # requires user interaction. The test script ( tests.pl ) needs to be + # able to run the tests without requiring user interaction. + # + # However, the sample program "openssl.nlm" is used by the tests and is + # a interactive sample so a screen is desired when not be run by the + # tests. To solve the problem, two versions of the program are built: + # openssl2 - no screen used by tests + # openssl - default screen - use for normal interactive modes + # + if ($target =~ /E_EXE/) + { + my($target2) = $target; + + $target2 =~ s/\(E_EXE\)/\(E_EXE\)2/; + + $ret.="$target: $files $dep_libs\n"; + + # openssl + $ret.="\t\$(LINK) \$(LFLAGS) -screenname openssl -commandfile $def_file $files \"$prelude\" $libs -o $target\n"; + # openssl2 + $ret.="\t\$(LINK) \$(LFLAGS) -commandfile $def_file $files \"$prelude\" $libs -o $target2\n"; + } + else + { + $ret.="$target: $files $dep_libs\n"; + $ret.="\t\$(LINK) \$(LFLAGS) -commandfile $def_file $files \"$prelude\" $libs -o $target\n"; + } + + $ret.="\n"; + return($ret); + } + + 1;