mirror of https://github.com/openssl/openssl.git
				
				
				
			NetWare fixes provided by Verdon Walker for OpenSSL 0.9.8-dev.
The changes have been mailed to <crypt@bis.doc.gov> as well. PR: 903
This commit is contained in:
		
							parent
							
								
									7d3932e8cf
								
							
						
					
					
						commit
						47c1735acd
					
				| 
						 | 
				
			
			@ -529,6 +529,7 @@ my %table=(
 | 
			
		|||
"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:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										47
									
								
								INSTALL.NW
								
								
								
								
							
							
						
						
									
										47
									
								
								INSTALL.NW
								
								
								
								
							| 
						 | 
				
			
			@ -99,9 +99,9 @@ following tools may be required:
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
      NLM and NetWare libraries for C (including CLIB and XPlat):
 | 
			
		||||
			If you are going to build a CLIB version of OpenSSL, you will
 | 
			
		||||
			need the CLIB headers and imports.  The March, 2001 NDK release or 
 | 
			
		||||
			later is recommended.
 | 
			
		||||
         If you are going to build a CLIB version of OpenSSL, you will
 | 
			
		||||
         need the CLIB headers and imports.  The March, 2001 NDK release or 
 | 
			
		||||
         later is recommended.
 | 
			
		||||
 | 
			
		||||
         Earlier versions should work but haven't been tested.  In recent
 | 
			
		||||
         versions the import files have been consolidated and function
 | 
			
		||||
| 
						 | 
				
			
			@ -115,9 +115,9 @@ following tools may be required:
 | 
			
		|||
   LIBC - BUILDS:
 | 
			
		||||
   
 | 
			
		||||
      Libraries for C (LibC) - LibC headers and import files
 | 
			
		||||
			If you are going to build a LibC version of OpenSSL, you will
 | 
			
		||||
			need the LibC headers and imports.  The March 14, 2002 NDK release or
 | 
			
		||||
			later is required.  
 | 
			
		||||
         If you are going to build a LibC version of OpenSSL, you will
 | 
			
		||||
         need the LibC headers and imports.  The March 14, 2002 NDK release or
 | 
			
		||||
         later is required.  
 | 
			
		||||
         
 | 
			
		||||
         NOTE: The LibC SDK includes the necessary WinSock2 support.  It
 | 
			
		||||
         It is not necessary to download the WinSock2 Developer when building
 | 
			
		||||
| 
						 | 
				
			
			@ -133,7 +133,7 @@ The set_env.bat file is a template you can use to set up the path
 | 
			
		|||
and environment variables you will need to build.  Modify the
 | 
			
		||||
various lines to point to YOUR tools and run set_env.bat.
 | 
			
		||||
 | 
			
		||||
	netware\set_env.bat [target]
 | 
			
		||||
   netware\set_env.bat [target]
 | 
			
		||||
 | 
			
		||||
      target        - "netware-clib" - CLib NetWare build
 | 
			
		||||
                    - "netware-libc" - LibC NetWare build
 | 
			
		||||
| 
						 | 
				
			
			@ -145,23 +145,21 @@ environment variables:
 | 
			
		|||
 | 
			
		||||
   MWCIncludes - The location of the NDK include files.
 | 
			
		||||
         
 | 
			
		||||
			CLIB ex: set MWCIncludes=c:\ndk\nwsdk\include\nlm
 | 
			
		||||
			LibC ex: set MWCIncludes=c:\ndk\libc\include
 | 
			
		||||
            CLIB ex: set MWCIncludes=c:\ndk\nwsdk\include\nlm
 | 
			
		||||
            LibC ex: set MWCIncludes=c:\ndk\libc\include
 | 
			
		||||
 | 
			
		||||
   PRELUDE - The absolute path of the prelude object to link with.  For
 | 
			
		||||
			a CLIB build it is recommended you use the "nwpre.obj" file shipped
 | 
			
		||||
			with the Metrowerks PDK for NetWare.  For a LibC build you should 
 | 
			
		||||
			use the "libcpre.o" file delivered with the LibC NDK components.
 | 
			
		||||
            a CLIB build it is recommended you use the "clibpre.o" files shipped
 | 
			
		||||
            with the Metrowerks PDK for NetWare.  For a LibC build you should 
 | 
			
		||||
            use the "libcpre.o" file delivered with the LibC NDK components.
 | 
			
		||||
 | 
			
		||||
			CLIB ex: set PRELUDE=c:\codewar\novell support\metrowerks support\
 | 
			
		||||
                               libraries\runtime\nwpre.obj
 | 
			
		||||
										 
 | 
			
		||||
			LibC ex: set PRELUDE=c:\ndk\libc\imports\libcpre.o
 | 
			
		||||
            CLIB ex: set PRELUDE=c:\ndk\nwsdk\imports\clibpre.o
 | 
			
		||||
            LibC ex: set PRELUDE=c:\ndk\libc\imports\libcpre.o
 | 
			
		||||
 | 
			
		||||
   IMPORTS - The locaton of the NDK import files.
 | 
			
		||||
 | 
			
		||||
			CLIB ex: set IMPORTS=c:\ndk\nwsdk\imports
 | 
			
		||||
			LibC ex: set IMPORTS=c:\ndk\libc\imports
 | 
			
		||||
            CLIB ex: set IMPORTS=c:\ndk\nwsdk\imports
 | 
			
		||||
            LibC ex: set IMPORTS=c:\ndk\libc\imports
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
In order to build, you need to run the Perl scripts to configure the build
 | 
			
		||||
| 
						 | 
				
			
			@ -184,15 +182,15 @@ the assembly code.  Always run build.bat from the "openssl" directory.
 | 
			
		|||
                      "no-asm"   - don't use assembly
 | 
			
		||||
 | 
			
		||||
      configure opts- all unrecognized arguments are passed to the
 | 
			
		||||
                       perl configure script
 | 
			
		||||
                      perl configure script
 | 
			
		||||
 | 
			
		||||
   examples:
 | 
			
		||||
 | 
			
		||||
		CLIB build, debug, without assembly:
 | 
			
		||||
			netware\build.bat netware-clib debug no-asm
 | 
			
		||||
      CLIB build, debug, without assembly:
 | 
			
		||||
         netware\build.bat netware-clib debug no-asm
 | 
			
		||||
 | 
			
		||||
		LibC build, non-debug, using NASM assembly:
 | 
			
		||||
			netware\build.bat netware-libc nw-nasm
 | 
			
		||||
      LibC build, non-debug, using NASM assembly:
 | 
			
		||||
         netware\build.bat netware-libc nw-nasm
 | 
			
		||||
 | 
			
		||||
Running build.bat generates a make file to be processed by your make 
 | 
			
		||||
tool (gmake or nmake):
 | 
			
		||||
| 
						 | 
				
			
			@ -207,7 +205,7 @@ subdirectory (in the order listed below):
 | 
			
		|||
 | 
			
		||||
   perl configure no-asm [other config opts] [netware-clib|netware-libc]
 | 
			
		||||
      configures no assembly build for specified netware environment
 | 
			
		||||
		(CLIB or LibC).
 | 
			
		||||
      (CLIB or LibC).
 | 
			
		||||
 | 
			
		||||
   perl util\mkfiles.pl >MINFO
 | 
			
		||||
      generates a listing of source files (used by mk1mf)
 | 
			
		||||
| 
						 | 
				
			
			@ -435,3 +433,4 @@ 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".
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -60,10 +60,10 @@ if "%LIBC_BUILD%" == "Y" set IMPORTS=%TOOLS%\ndk\libc\imports
 | 
			
		|||
if "%CLIB_BUILD%" == "Y" set IMPORTS=%TOOLS%\ndk\nwsdk\imports
 | 
			
		||||
 | 
			
		||||
rem   Set PRELUDE to the absolute path of the prelude object to link with in
 | 
			
		||||
rem   the Metrowerks NetWare PDK - NOTE: for Clib builds "nwpre.obj" is 
 | 
			
		||||
rem   the Metrowerks NetWare PDK - NOTE: for Clib builds "clibpre.o" is 
 | 
			
		||||
rem   recommended, for LibC NKS builds libcpre.o must be used
 | 
			
		||||
if "%LIBC_BUILD%" == "Y" set PRELUDE=%TOOLS%\ndk\libc\imports\libcpre.o
 | 
			
		||||
if "%CLIB_BUILD%" == "Y" set PRELUDE=%TOOLS%\codewar\pdk_21\novell support\metrowerks support\libraries\runtime\nwpre.obj
 | 
			
		||||
if "%LIBC_BUILD%" == "Y" set PRELUDE=%IMPORTS%\libcpre.o
 | 
			
		||||
if "%CLIB_BUILD%" == "Y" set PRELUDE=%IMPORTS%\clibpre.o
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if "%LIBC_BUILD%" == "Y" echo Enviroment configured for LibC build
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -690,6 +690,16 @@ re_start:
 | 
			
		|||
				} 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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
/* crypto/rand/rand_win.c */
 | 
			
		||||
/* crypto/rand/rand_nw.c */
 | 
			
		||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
| 
						 | 
				
			
			@ -116,7 +116,7 @@
 | 
			
		|||
#if defined (OPENSSL_SYS_NETWARE)
 | 
			
		||||
 | 
			
		||||
#if defined(NETWARE_LIBC)
 | 
			
		||||
#include <nks\thread.h>
 | 
			
		||||
#include <nks/thread.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
extern long RunningProcess;
 | 
			
		||||
| 
						 | 
				
			
			@ -147,18 +147,23 @@ int RAND_poll(void)
 | 
			
		|||
 | 
			
		||||
   for( i=2; i<ENTROPY_NEEDED; i++)
 | 
			
		||||
   {
 | 
			
		||||
#ifdef __MWERKS__
 | 
			
		||||
      asm 
 | 
			
		||||
      {
 | 
			
		||||
         rdtsc
 | 
			
		||||
         mov tsc, eax        
 | 
			
		||||
      }
 | 
			
		||||
#else
 | 
			
		||||
      asm volatile("rdtsc":"=A" (tsc));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
      RAND_add(&tsc, sizeof(tsc), 1);
 | 
			
		||||
 | 
			
		||||
      l = GetSuperHighResolutionTimer();
 | 
			
		||||
      RAND_add(&l, sizeof(l), 0);
 | 
			
		||||
 | 
			
		||||
# if defined(NETWARE_LIBC)
 | 
			
		||||
         NXThreadYield();
 | 
			
		||||
      NXThreadYield();
 | 
			
		||||
# else /* NETWARE_CLIB */
 | 
			
		||||
      ThreadSwitchWithDelay();
 | 
			
		||||
# endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -161,6 +161,7 @@ int main(int argc, char *argv[])
 | 
			
		|||
#ifdef OPENSSL_SYS_NETWARE
 | 
			
		||||
    if (err) printf("ERROR: %d\n", err);
 | 
			
		||||
#endif
 | 
			
		||||
	EVP_MD_CTX_cleanup(&c);
 | 
			
		||||
	EXIT(err);
 | 
			
		||||
	return(0);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										5
									
								
								e_os.h
								
								
								
								
							
							
						
						
									
										5
									
								
								e_os.h
								
								
								
								
							| 
						 | 
				
			
			@ -181,6 +181,11 @@ extern "C" {
 | 
			
		|||
#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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue