diff --git a/Makefile.am b/Makefile.am index e0a74c7..1489be3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,8 +75,9 @@ gen-coverage: coverage: init-coverage build-coverage gen-coverage # DSP/VCPROJ generation adapted from libcurl -# only OpenSSL is supported with this build system -include Makefile.OpenSSL.inc +# only OpenSSL and WinCNG are supported with this build system +CRYPTO_CSOURCES = openssl.c wincng.c +CRYPTO_HHEADERS = openssl.h wincng.h # Makefile.inc provides the CSOURCES and HHEADERS defines include Makefile.inc diff --git a/win32/libssh2_config.h b/win32/libssh2_config.h index 4e2ae29..56646da 100644 --- a/win32/libssh2_config.h +++ b/win32/libssh2_config.h @@ -18,6 +18,7 @@ #define HAVE_GETTIMEOFDAY #endif +#define HAVE_LIBCRYPT32 #define HAVE_WINSOCK2_H #define HAVE_IOCTLSOCKET #define HAVE_SELECT diff --git a/win32/msvcproj.head b/win32/msvcproj.head index 6b39740..eb82020 100644 --- a/win32/msvcproj.head +++ b/win32/msvcproj.head @@ -1,12 +1,12 @@ # Microsoft Developer Studio Project File - Name="libssh2" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** -# only OpenSSL is supported with this build system +# only OpenSSL and WinCNG are supported with this build system # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 # TARGTYPE "Win32 (x86) Static Library" 0x0104 -CFG=libssh2 - Win32 Debug +CFG=libssh2 - Win32 OpenSSL Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE @@ -19,10 +19,14 @@ CFG=libssh2 - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "libssh2 - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libssh2 - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libssh2 - Win32 LIB Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libssh2 - Win32 LIB Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "libssh2 - Win32 OpenSSL DLL Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libssh2 - Win32 OpenSSL DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libssh2 - Win32 OpenSSL LIB Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libssh2 - Win32 OpenSSL LIB Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "libssh2 - Win32 WinCNG DLL Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libssh2 - Win32 WinCNG DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libssh2 - Win32 WinCNG LIB Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libssh2 - Win32 WinCNG LIB Debug" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project @@ -33,7 +37,7 @@ CPP=cl.exe MTL=midl.exe RSC=rc.exe -!IF "$(CFG)" == "libssh2 - Win32 DLL Release" +!IF "$(CFG)" == "libssh2 - Win32 OpenSSL DLL Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -60,7 +64,7 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 gdi32.lib advapi32.lib user32.lib kernel32.lib ws2_32.lib libeay32.lib zlib.lib /nologo /dll /map /debug /machine:I386 -!ELSEIF "$(CFG)" == "libssh2 - Win32 DLL Debug" +!ELSEIF "$(CFG)" == "libssh2 - Win32 OpenSSL DLL Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -88,7 +92,7 @@ LINK32=link.exe # ADD LINK32 gdi32.lib advapi32.lib user32.lib kernel32.lib ws2_32.lib libeay32.lib zlib.lib /nologo /dll /incremental:no /map /debug /machine:I386 /pdbtype:sept # SUBTRACT LINK32 /nodefaultlib -!ELSEIF "$(CFG)" == "libssh2 - Win32 LIB Release" +!ELSEIF "$(CFG)" == "libssh2 - Win32 OpenSSL LIB Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -112,7 +116,7 @@ LIB32=link.exe -lib # ADD LIB32 /nologo # ADD LIB32 /nologo /out:"Release_lib\libssh2.lib" -!ELSEIF "$(CFG)" == "libssh2 - Win32 LIB Debug" +!ELSEIF "$(CFG)" == "libssh2 - Win32 OpenSSL LIB Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -135,12 +139,118 @@ LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"Debug_lib\libssh2d.lib" +!ELSEIF "$(CFG)" == "libssh2 - Win32 WinCNG LIB Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_dll" +# PROP BASE Intermediate_Dir "Release_dll" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_dll" +# PROP Intermediate_Dir "Release_dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "LIBSSH2_WIN32" /D "LIBSSH2_WINCNG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\win32" /I "..\include" /D "WIN32" /D "NDEBUG" /D "LIBSSH2_WIN32" /D "LIBSSH2_WINCNG" /D "_MBCS" /D "_LIB" /YX /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 gdi32.lib advapi32.lib user32.lib kernel32.lib ws2_32.lib crypt32.lib bcrypt.lib /nologo /dll /map /debug /machine:I386 + +!ELSEIF "$(CFG)" == "libssh2 - Win32 WinCNG DLL Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_dll" +# PROP BASE Intermediate_Dir "Debug_dll" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_dll" +# PROP Intermediate_Dir "Debug_dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "LIBSSH2_WIN32" /D "LIBSSH2_WINCNG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "..\win32" /I "..\include" /D "WIN32" /D "_DEBUG" /D "LIBSSH2_WIN32" /D "LIBSSH2_WINCNG" /D "_MBCS" /D "_LIB" /D "LIBSSH2DEBUG" /YX /FD /GZ /c +# SUBTRACT CPP /WX /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 gdi32.lib advapi32.lib user32.lib kernel32.lib ws2_32.lib crypt32.lib bcrypt.lib /nologo /dll /incremental:no /map /debug /machine:I386 /pdbtype:sept +# SUBTRACT LINK32 /nodefaultlib + +!ELSEIF "$(CFG)" == "libssh2 - Win32 WinCNG LIB Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release_lib" +# PROP BASE Intermediate_Dir "Release_lib" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_lib" +# PROP Intermediate_Dir "Release_lib" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "LIBSSH2_WIN32" /D "LIBSSH2_WINCNG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\win32" /I "..\include" /D "WIN32" /D "NDEBUG" /D "LIBSSH2_WIN32" /D "LIBSSH2_WINCNG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +# ADD LIB32 /nologo /out:"Release_lib\libssh2.lib" + +!ELSEIF "$(CFG)" == "libssh2 - Win32 WinCNG LIB Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug_lib" +# PROP BASE Intermediate_Dir "Debug_lib" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_lib" +# PROP Intermediate_Dir "Debug_lib" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "LIBSSH2_WIN32" /D "LIBSSH2_WINCNG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "..\win32" /I "..\include" /D "WIN32" /D "_DEBUG" /D "LIBSSH2_WIN32" /D "LIBSSH2_WINCNG" /D "_MBCS" /D "_LIB" /D "LIBSSH2DEBUG" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Debug_lib\libssh2d.lib" + !ENDIF # Begin Target -# Name "libssh2 - Win32 DLL Release" -# Name "libssh2 - Win32 DLL Debug" -# Name "libssh2 - Win32 LIB Release" -# Name "libssh2 - Win32 LIB Debug" +# Name "libssh2 - Win32 OpenSSL DLL Release" +# Name "libssh2 - Win32 OpenSSL DLL Debug" +# Name "libssh2 - Win32 OpenSSL LIB Release" +# Name "libssh2 - Win32 OpenSSL LIB Debug" +# Name "libssh2 - Win32 WinCNG DLL Release" +# Name "libssh2 - Win32 WinCNG DLL Debug" +# Name "libssh2 - Win32 WinCNG LIB Release" +# Name "libssh2 - Win32 WinCNG LIB Debug"