Skip to content
Snippets Groups Projects
Commit 51173f34 authored by deuce's avatar deuce
Browse files

Update to lates cryptlib.

Make the integrated mingw32 Cryptlib build work on my system.
parent eece89e9
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ $(CRYPT_SRC): | $(3RDPSRCDIR)
$(CRYPT_IDIR): | $(3RDPODIR)
$(QUIET)$(IFNOTEXIST) mkdir $(CRYPT_IDIR)
$(CRYPTLIB_BUILD): $(3RDP_ROOT)$(DIRSEP)dist/cryptlib.zip $(3RDP_ROOT)$(DIRSEP)build/SSL-fix.patch $(3RDP_ROOT)$(DIRSEP)build/random_exit.patch $(3RDP_ROOT)$(DIRSEP)build/Dynamic-linked-static-lib.patch $(3RDP_ROOT)$(DIRSEP)build/terminal-params.patch $(3RDP_ROOT)$(DIRSEP)build/cl-mingw32.patch | $(CRYPT_SRC) $(CRYPT_IDIR)
$(CRYPTLIB_BUILD): $(3RDP_ROOT)$(DIRSEP)dist/cryptlib.zip $(3RDP_ROOT)$(DIRSEP)build/SSL-fix.patch $(3RDP_ROOT)$(DIRSEP)build/random_exit.patch $(3RDP_ROOT)$(DIRSEP)build/Dynamic-linked-static-lib.patch $(3RDP_ROOT)$(DIRSEP)build/terminal-params.patch $(3RDP_ROOT)$(DIRSEP)build/cl-mingw32-static.patch $(3RDP_ROOT)$(DIRSEP)build/cl-ranlib.patch | $(CRYPT_SRC) $(CRYPT_IDIR)
@echo Creating $@ ...
$(QUIET)-rm -rf $(CRYPT_SRC)/*
$(QUIET)unzip -oa $(3RDPDISTDIR)$(DIRSEP)cryptlib.zip -d $(CRYPT_SRC)
......@@ -73,9 +73,12 @@ $(CRYPTLIB_BUILD): $(3RDP_ROOT)$(DIRSEP)dist/cryptlib.zip $(3RDP_ROOT)$(DIRSEP)b
$(QUIET)patch -p0 -d $(CRYPT_SRC) < SSL-fix.patch
$(QUIET)patch -p0 -d $(CRYPT_SRC) < Dynamic-linked-static-lib.patch
$(QUIET)patch -p0 -d $(CRYPT_SRC) < terminal-params.patch
$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-mingw32.patch
$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-mingw32-static.patch
$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-ranlib.patch
ifeq ($(CC),mingw32-gcc)
$(QUIET)cd $(CRYPT_SRC) && env - PATH=$(PATH) CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) make target-mingw
$(QUIET)cd $(CRYPT_SRC) && env - PATH=$(PATH) CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) make directories
$(QUIET)cd $(CRYPT_SRC) && env - PATH=$(PATH) CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) make toolscripts
$(QUIET)cd $(CRYPT_SRC) && env - PATH=$(PATH) CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) make MINGW32_NT-6.1 OSNAME=win32
else
ifdef MINGW32
$(QUIET)cd $(CRYPT_SRC) && env - PATH=$(PATH) CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) make target-mingw
......
--- makefile.orig 2012-12-14 03:31:22.000000000 -0800
+++ makefile 2014-06-25 01:52:11.000000000 -0700
@@ -1892,9 +1892,9 @@
MINGW32_NT-6.1:
@make OSNAME=win32 target-init
- @make $(DEFINES) EXTRAOBJS="$(WIN32ASMOBJS)" \
+ @make OSNAME=win32 $(DEFINES) EXTRAOBJS="$(WIN32ASMOBJS)" \
CFLAGS="$(XCFLAGS) -fomit-frame-pointer -O3 \
- -Wl,--subsystem,windows,--output-def,cl32.def"
+ -Wl,--subsystem,windows,--output-def,cl32.def -DSTATIC_LIB"
# NCR MP-RAS: Use the NCR cc. The "-DNCR_UST" is needed to enable threading
# (User-Space Threads).
diff -ur ../cl.patched/io/tcp.h ./io/tcp.h
--- ../cl.patched/io/tcp.h 2014-06-23 03:18:20.000000000 -0700
+++ ./io/tcp.h 2014-06-24 00:35:54.000000000 -0700
@@ -199,7 +199,7 @@
defined( __ECOS__ ) || defined( __MVS__ ) || \
defined( __PALMOS__ ) || defined( __RTEMS__ ) || \
defined ( __SYMBIAN32__ ) || defined( __TANDEM_NSK__ ) || \
- defined( __TANDEM_OSS__ ) || defined( __UNIX__ )
+ defined( __TANDEM_OSS__ ) || ( defined( __UNIX__ ) && !defined(__MSVCRT__))
/* C_IN is a cryptlib.h value which is also defined in some versions of
netdb.h, so we have to undefine it before we include any network header
@@ -838,8 +838,7 @@
strangely it is present for straight x86 builds), and also for older
WinCE builds, in which case we have to explicitly define it
ourselves */
- #if defined( __WINDOWS__ ) && !defined( IPV6_V6ONLY ) && \
- ( defined( _M_X64 ) || defined( __WINCE__ ) )
+ #if defined( __WINDOWS__ ) && !defined( IPV6_V6ONLY )
#define IPV6_V6ONLY 27 /* Force dual stack to use only IPv6 */
#endif /* Some Windows build environments */
#endif /* IPv6 */
diff -ur ../cl.patched/kernel/sec_mem.c ./kernel/sec_mem.c
--- ../cl.patched/kernel/sec_mem.c 2014-06-23 03:18:15.000000000 -0700
+++ ./kernel/sec_mem.c 2014-06-24 00:52:37.000000000 -0700
@@ -314,7 +314,7 @@
#if defined( __WIN32__ )
#if !defined( NDEBUG ) && !defined( NT_DRIVER ) && !defined( __BORLANDC__ )
- #define USE_HEAP_CHECKING
+// #define USE_HEAP_CHECKING
#endif /* Win32 debug version */
#ifdef USE_HEAP_CHECKING
diff -ur ../cl.patched/makefile ./makefile
--- ../cl.patched/makefile 2014-06-23 03:18:24.000000000 -0700
+++ ./makefile 2014-06-24 00:49:18.000000000 -0700
@@ -2299,9 +2299,8 @@
target-mingw:
@make OSNAME=win32 target-init
- @make asm_elf OBJPATH=$(OBJPATH)
make $(XDEFINES) OSNAME=MinGW CFLAGS="$(XCFLAGS) \
- -DCONFIG_DATA_LITTLEENDIAN -DWIN32 -DUSE_ASM -fomit-frame-pointer -O3"
+ -DCONFIG_DATA_LITTLEENDIAN -DWIN32 -DNO_ASM -DSTATIC_LIB -fomit-frame-pointer -O3"
# MIPS running Linux: Little-endian, 2.x kernel. Note that we use $(CFLAGS)
# rather than $(XCFLAGS) since this is a Unix system, just not the same as
diff -ur ../cl.patched/misc/config.h ./misc/config.h
--- ../cl.patched/misc/config.h 2014-06-23 03:18:16.000000000 -0700
+++ ./misc/config.h 2014-06-24 00:44:01.000000000 -0700
@@ -268,10 +268,10 @@
#if defined( __WIN32__ )
#ifndef __BORLANDC__
- #define USE_PKCS11
+// #define USE_PKCS11
#endif /* Borland C can't handle PKCS #11 headers */
#if !defined( NDEBUG )
- #define USE_HARDWARE
+// #define USE_HARDWARE
#endif /* Windows debug mode only */
#endif /* __WIN32__ */
#ifdef HAS_PKCS11
diff -ur ../cl.patched/misc/os_spec.c ./misc/os_spec.c
--- ../cl.patched/misc/os_spec.c 2014-06-23 03:18:16.000000000 -0700
+++ ./misc/os_spec.c 2014-06-24 00:24:48.000000000 -0700
@@ -1077,6 +1077,7 @@
#pragma comment( linker, "/export:DllRegisterServer=_DllRegisterServer@0,PRIVATE" )
#endif /* Win64 */
+#if 0
STDAPI DllRegisterServer( void )
{
MessageBoxA( NULL, "Why are you trying to register the cryptlib DLL?\n"
@@ -1085,6 +1086,7 @@
MB_ICONQUESTION | MB_OK );
return( E_NOINTERFACE );
}
+#endif
#endif /* !( NT_DRIVER || STATIC_LIB ) */
/* Borland's archaic compilers don't recognise DllMain() but still use the
diff -ur ../cl.patched/misc/os_spec.h ./misc/os_spec.h
--- ../cl.patched/misc/os_spec.h 2014-06-23 03:18:16.000000000 -0700
+++ ./misc/os_spec.h 2014-06-24 00:32:50.000000000 -0700
@@ -39,7 +39,7 @@
different versions of Visual C (it's different for each of VC 2.0, 2.1,
4.0, and 4.1. It actually remains the same after 4.1) */
-#if !defined( __WINDOWS__ ) && ( defined( _Windows ) || defined( _WINDOWS ) )
+#if !defined( __WINDOWS__ ) && ( defined( _Windows ) || defined( _WINDOWS ) || defined( WIN32 ))
#define __WINDOWS__
#endif /* Win16 */
#if !defined( __WIN32__ ) && ( defined( WIN32 ) || defined( _WIN32 ) )
@@ -944,7 +944,8 @@
#define EOL "\n"
#define EOL_LEN 1
#else
- #error "You need to add the OS-specific define to enable end-of-line handling"
+ #define EOL "\n"
+ #define EOL_LEN 1
#endif /* OS-specific EOL markers */
/* If we're compiling on IBM mainframes, enable EBCDIC <-> ASCII string
diff -ur ../cl.patched/random/win32.c ./random/win32.c
--- ../cl.patched/random/win32.c 2014-06-23 03:18:14.000000000 -0700
+++ ./random/win32.c 2014-06-24 00:24:48.000000000 -0700
@@ -1216,7 +1216,7 @@
/* If we're running under Win64 there's no need to include Win95/98
backwards-compatibility features */
-#ifndef __WIN64__
+#if 0
/* Type definitions for function pointers to call Toolhelp32 functions */
@@ -2118,7 +2118,7 @@
krnlExitMutex( MUTEX_RANDOM );
return;
}
-#ifndef __WIN64__
+#if 0
if( getSysVar( SYSVAR_ISWIN95 ) == TRUE )
{
hThread = ( HANDLE ) _beginthreadex( NULL, 0, threadSafeSlowPollWin95,
diff -ur ../cl.patched/tools/buildlib.sh ./tools/buildlib.sh
--- ../cl.patched/tools/buildlib.sh 2014-06-23 03:18:20.000000000 -0700
+++ ./tools/buildlib.sh 2014-06-24 00:24:48.000000000 -0700
@@ -69,7 +69,7 @@
echo "Need to set up ucLinux link command" ;;
*)
- ar rcs $LIBNAME $* || \
- ( ar rc $LIBNAME $* && ranlib $LIBNAME )
+ $AR rcs $LIBNAME $* || \
+ ( $AR rc $LIBNAME $* && $RANLIB $LIBNAME )
esac
--- tools/buildlib.sh.orig 2012-11-06 03:55:52.000000000 -0800
+++ tools/buildlib.sh 2014-06-25 01:59:50.000000000 -0700
@@ -75,7 +75,9 @@
echo "Need to set up ucLinux link command" ;;
*)
- $AR rcs $LIBNAME $* || \
- ( $AR rc $LIBNAME $* && ranlib $LIBNAME )
+ if [ "$RANLIB" = "" ] ; then
+ RANLIB = ranlib
+ fi
+ ( $AR rc $LIBNAME $* && $RANLIB $LIBNAME )
esac
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment