diff --git a/configure b/configure index f574eef3cb1..9e5f57d3590 100755 --- a/configure +++ b/configure @@ -19116,7 +19116,7 @@ MAKE_LIB_RULES=libs/Makelib.rules MAKE_PROG_RULES=programs/Makeprog.rules - ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/dswave/Makefile dlls/dxguid/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/glut32/Makefile dlls/iccvid/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/iphlpapi/tests/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrt40/Makefile dlls/msvcrtd/Makefile dlls/msvidc32/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/mswsock/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/newdev/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/unicows/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/uuid/Makefile dlls/uxtheme/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/wined3d/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winejack/Makefile dlls/winmm/winenas/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/progman/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winebrowser/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile" + ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/dswave/Makefile dlls/dxguid/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/glut32/Makefile dlls/iccvid/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/iphlpapi/tests/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrt40/Makefile dlls/msvcrtd/Makefile dlls/msvidc32/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/mswsock/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/newdev/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/rsabase/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/unicows/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/uuid/Makefile dlls/uxtheme/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/wined3d/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winejack/Makefile dlls/winmm/winenas/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/progman/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winebrowser/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile" cat >confcache <<\_ACEOF @@ -19751,6 +19751,7 @@ do "dlls/richedit/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/richedit/Makefile" ;; "dlls/rpcrt4/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/rpcrt4/Makefile" ;; "dlls/rpcrt4/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/rpcrt4/tests/Makefile" ;; + "dlls/rsabase/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/rsabase/Makefile" ;; "dlls/serialui/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/serialui/Makefile" ;; "dlls/setupapi/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/setupapi/Makefile" ;; "dlls/shdocvw/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/shdocvw/Makefile" ;; diff --git a/configure.ac b/configure.ac index 3aea035672e..e22ba9e0692 100644 --- a/configure.ac +++ b/configure.ac @@ -1564,6 +1564,7 @@ dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile +dlls/rsabase/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile diff --git a/dlls/Makefile.in b/dlls/Makefile.in index 5962d46652f..1a7870d109f 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -93,6 +93,7 @@ BASEDIRS = \ rasapi32 \ richedit \ rpcrt4 \ + rsabase \ serialui \ setupapi \ shdocvw \ @@ -299,6 +300,7 @@ SYMLINKS = \ rasapi32.dll$(DLLEXT) \ riched32.dll$(DLLEXT) \ rpcrt4.dll$(DLLEXT) \ + rsabase.dll$(DLLEXT) \ serialui.dll$(DLLEXT) \ setupapi.dll$(DLLEXT) \ shdocvw.dll$(DLLEXT) \ @@ -662,6 +664,9 @@ riched32.dll$(DLLEXT): richedit/riched32.dll$(DLLEXT) rpcrt4.dll$(DLLEXT): rpcrt4/rpcrt4.dll$(DLLEXT) $(RM) $@ && $(LN_S) rpcrt4/rpcrt4.dll$(DLLEXT) $@ +rsabase.dll$(DLLEXT): rsabase/rsabase.dll$(DLLEXT) + $(RM) $@ && $(LN_S) rsabase/rsabase.dll$(DLLEXT) $@ + serialui.dll$(DLLEXT): serialui/serialui.dll$(DLLEXT) $(RM) $@ && $(LN_S) serialui/serialui.dll$(DLLEXT) $@ @@ -905,6 +910,7 @@ IMPORT_LIBS = \ librasapi32 \ libriched32 \ librpcrt4 \ + librsabase \ libserialui \ libsetupapi \ libshdocvw \ @@ -1338,6 +1344,11 @@ librpcrt4.def: rpcrt4/rpcrt4.spec.def librpcrt4.a: rpcrt4/rpcrt4.spec.def $(DLLTOOL) -k -l $@ -d rpcrt4/rpcrt4.spec.def +librsabase.def: rsabase/rsabase.spec.def + $(RM) $@ && $(LN_S) rsabase/rsabase.spec.def $@ +librsabase.a: rsabase/rsabase.spec.def + $(DLLTOOL) -k -l $@ -d rsabase/rsabase.spec.def + libserialui.def: serialui/serialui.spec.def $(RM) $@ && $(LN_S) serialui/serialui.spec.def $@ libserialui.a: serialui/serialui.spec.def @@ -1577,6 +1588,7 @@ quartz/quartz.spec.def: $(WINEBUILD) rasapi32/rasapi32.spec.def: $(WINEBUILD) richedit/riched32.spec.def: $(WINEBUILD) rpcrt4/rpcrt4.spec.def: $(WINEBUILD) +rsabase/rsabase.spec.def: $(WINEBUILD) serialui/serialui.spec.def: $(WINEBUILD) setupapi/setupapi.spec.def: $(WINEBUILD) shdocvw/shdocvw.spec.def: $(WINEBUILD) @@ -1706,6 +1718,7 @@ quartz/quartz.dll$(DLLEXT): quartz rasapi32/rasapi32.dll$(DLLEXT): rasapi32 richedit/riched32.dll$(DLLEXT): richedit rpcrt4/rpcrt4.dll$(DLLEXT): rpcrt4 +rsabase/rsabase.dll$(DLLEXT): rsabase serialui/serialui.dll$(DLLEXT): serialui setupapi/setupapi.dll$(DLLEXT): setupapi shdocvw/shdocvw.dll$(DLLEXT): shdocvw diff --git a/dlls/rsabase/.cvsignore b/dlls/rsabase/.cvsignore new file mode 100644 index 00000000000..5414795e042 --- /dev/null +++ b/dlls/rsabase/.cvsignore @@ -0,0 +1,4 @@ +Makefile +rsabase.dll.dbg.c +rsabase.spec.c +rsabase.spec.def diff --git a/dlls/rsabase/Makefile.in b/dlls/rsabase/Makefile.in new file mode 100644 index 00000000000..75763d6d385 --- /dev/null +++ b/dlls/rsabase/Makefile.in @@ -0,0 +1,14 @@ +EXTRADEFS = -DCOM_NO_WINDOWS_H +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = rsabase.dll +IMPORTS = kernel32 + +C_SRCS = \ + main.c + +@MAKE_DLL_RULES@ + +### Dependencies: diff --git a/dlls/rsabase/main.c b/dlls/rsabase/main.c new file mode 100644 index 00000000000..2f0b313fab4 --- /dev/null +++ b/dlls/rsabase/main.c @@ -0,0 +1,310 @@ +/* + * RSABASE - RSA encryption for Wine + * + * Copyright 2004 Mike McCormack for Codeweavers + * Copyright 2002 Transgaming Technologies + * + * David Hammerton + * + * (based upon code from dlls/wininet/netconnection.c) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + */ + + +#include "config.h" +#include "wine/port.h" + +#include + +#include "windef.h" +#include "winbase.h" +#include "wincrypt.h" + +#ifdef HAVE_OPENSSL_SSL_H +#define DSA __ssl_DSA /* avoid conflict with commctrl.h */ +#undef FAR +# include +#undef FAR +#define FAR do_not_use_this_in_wine +#undef DSA +#endif + +#include "wine/library.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(crypt); + +#define RSABASE_MAGIC 0x52534100 + +#ifdef HAVE_OPENSSL_SSL_H + +#ifndef SONAME_LIBCRYPTO +#define SONAME_LIBCRYPTO "libcrypto.so" +#endif + +static void *libcrypto; + +#define MAKE_FUNCPTR(f) static typeof(f) * p##f + +/* OpenSSL funtions that we use */ +MAKE_FUNCPTR(RAND_bytes); + +static BOOL load_libcrypto( void ) +{ + libcrypto = wine_dlopen(SONAME_LIBCRYPTO, RTLD_NOW, NULL, 0); + if (!libcrypto) + { + MESSAGE("Couldn't load %s, RSA encryption not available.\n", SONAME_LIBCRYPTO); + MESSAGE("Install the openssl package if you're have problems.\n"); + return FALSE; + } + + #define GETFUNC(x) \ + p##x = wine_dlsym(libcrypto, #x, NULL, 0); \ + if (!p##x) \ + { \ + ERR("failed to load symbol %s\n", #x); \ + return FALSE; \ + } + + GETFUNC(RAND_bytes); + + return TRUE; +} + +#endif + +typedef struct _RSA_CryptProv +{ + DWORD dwMagic; +} RSA_CryptProv; + +BOOL WINAPI RSA_CPAcquireContext(HCRYPTPROV *phProv, LPSTR pszContainer, + DWORD dwFlags, PVTableProvStruc pVTable) +{ + BOOL ret = FALSE; + RSA_CryptProv *cp; + + TRACE("%p %s %08lx %p\n", phProv, debugstr_a(pszContainer), + dwFlags, pVTable); + +#ifdef HAVE_OPENSSL_SSL_H + + if( !load_libcrypto() ) + return FALSE; + + cp = HeapAlloc( GetProcessHeap(), 0, sizeof (RSA_CryptProv) ); + if( !cp ) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + cp->dwMagic = RSABASE_MAGIC; + + *phProv = (HCRYPTPROV) cp; + ret = TRUE; + +#endif + + return ret; +} + +BOOL WINAPI RSA_CPCreateHash(HCRYPTPROV hProv, ALG_ID Algid, HCRYPTKEY hKey, DWORD dwFlags, HCRYPTHASH *phHash) +{ + FIXME("%08lx %d %08lx %08lx %p\n", hProv, Algid, hKey, dwFlags, phHash); + return FALSE; +} + +BOOL WINAPI RSA_CPDecrypt(HCRYPTPROV hProv, HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final, DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPDeriveKey(HCRYPTPROV hProv, ALG_ID Algid, HCRYPTHASH hBaseData, DWORD dwFlags, HCRYPTKEY *phKey) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPDestroyHash(HCRYPTPROV hProv, HCRYPTHASH hHash) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPDestroyKey(HCRYPTPROV hProv, HCRYPTKEY hKey) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPDuplicateHash(HCRYPTPROV hUID, HCRYPTHASH hHash, DWORD *pdwReserved, DWORD dwFlags, HCRYPTHASH *phHash) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPDuplicateKey(HCRYPTPROV hUID, HCRYPTKEY hKey, DWORD *pdwReserved, DWORD dwFlags, HCRYPTKEY *phKey) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPEncrypt(HCRYPTPROV hProv, HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final, DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen, DWORD dwBufLen) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPExportKey(HCRYPTPROV hProv, HCRYPTKEY hKey, HCRYPTKEY hPubKey, DWORD dwBlobType, DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPGenKey(HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYPTKEY *phKey) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPGenRandom(HCRYPTPROV hProv, DWORD dwLen, BYTE *pbBuffer) +{ + BOOL ret = FALSE; + RSA_CryptProv *cp = (RSA_CryptProv*) hProv; + + TRACE("%08lx %ld %p\n", hProv, dwLen, pbBuffer); + + if( cp && ( cp->dwMagic != RSABASE_MAGIC ) ) + return FALSE; + +#ifdef HAVE_OPENSSL_SSL_H + + if( !pRAND_bytes) + return FALSE; + ret = pRAND_bytes( pbBuffer, dwLen ); + +#endif + + return ret; +} + +BOOL WINAPI RSA_CPGetHashParam(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPGetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPGetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPGetUserKey(HCRYPTPROV hProv, DWORD dwKeySpec, HCRYPTKEY *phUserKey) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPHashData(HCRYPTPROV hProv, HCRYPTHASH hHash, CONST BYTE *pbData, DWORD dwDataLen, DWORD dwFlags) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPHashSessionKey(HCRYPTPROV hProv, HCRYPTHASH hHash, HCRYPTKEY hKey, DWORD dwFlags) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPImportKey(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDataLen, HCRYPTKEY hPubKey, DWORD dwFlags, HCRYPTKEY *phKey) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPReleaseContext(HCRYPTPROV hProv, DWORD dwFlags) +{ + RSA_CryptProv *cp = (RSA_CryptProv*) hProv; + + TRACE("%08lx %08lx\n", hProv, dwFlags); + + if( cp && ( cp->dwMagic != RSABASE_MAGIC ) ) + return FALSE; + + HeapFree( GetProcessHeap(), 0, cp ); + + return TRUE; +} + +BOOL WINAPI RSA_CPSetHashParam(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData, DWORD dwFlags) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPSetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam, BYTE *pbData, DWORD dwFlags) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPSetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, DWORD dwFlags) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPSignHash(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwKeySpec, LPCWSTR sDescription, DWORD dwFlags, BYTE *pbSignature, DWORD *pdwSigLen) +{ + FIXME("(stub)\n"); + return FALSE; +} + +BOOL WINAPI RSA_CPVerifySignature(HCRYPTPROV hProv, HCRYPTHASH hHash, CONST BYTE *pbSignature, DWORD dwSigLen, HCRYPTKEY hPubKey, LPCWSTR sDescription, DWORD dwFlags) +{ + FIXME("(stub)\n"); + return FALSE; +} + +/*********************************************************************** + * DllRegisterServer (RSABASE.@) + */ +HRESULT WINAPI RSABASE_DllRegisterServer() +{ + FIXME("\n"); + return S_OK; +} + +/*********************************************************************** + * DllUnregisterServer (RSABASE.@) + */ +HRESULT WINAPI RSABASE_DllUnregisterServer() +{ + FIXME("\n"); + return S_OK; +} diff --git a/dlls/rsabase/rsabase.spec b/dlls/rsabase/rsabase.spec new file mode 100644 index 00000000000..a0e504e5db4 --- /dev/null +++ b/dlls/rsabase/rsabase.spec @@ -0,0 +1,27 @@ +@ stdcall CPAcquireContext(ptr str long ptr) RSA_CPAcquireContext +@ stdcall CPCreateHash(long long ptr long ptr) RSA_CPCreateHash +@ stdcall CPDecrypt(long long long long long ptr ptr) RSA_CPDecrypt +@ stdcall CPDeriveKey(long long long long ptr) RSA_CPDeriveKey +@ stdcall CPDestroyHash(long long) RSA_CPDestroyHash +@ stdcall CPDestroyKey(long long) RSA_CPDestroyKey +@ stdcall CPDuplicateHash(long long ptr long ptr) RSA_CPDuplicateHash +@ stdcall CPDuplicateKey(long long ptr long ptr) RSA_CPDuplicateKey +@ stdcall CPEncrypt(long long long long long ptr ptr long) RSA_CPEncrypt +@ stdcall CPExportKey(long long long long long ptr ptr) RSA_CPExportKey +@ stdcall CPGenKey(long long long ptr) RSA_CPGenKey +@ stdcall CPGenRandom(long long ptr) RSA_CPGenRandom +@ stdcall CPGetHashParam(long long long ptr ptr long) RSA_CPGetHashParam +@ stdcall CPGetKeyParam(long long long ptr ptr long) RSA_CPGetKeyParam +@ stdcall CPGetProvParam(long long ptr ptr long) RSA_CPGetProvParam +@ stdcall CPGetUserKey(long long ptr) RSA_CPGetUserKey +@ stdcall CPHashData(long long ptr long long) RSA_CPHashData +@ stdcall CPHashSessionKey(long long long long) RSA_CPHashSessionKey +@ stdcall CPImportKey(long ptr long long long ptr) RSA_CPImportKey +@ stdcall CPReleaseContext(long long) RSA_CPReleaseContext +@ stdcall CPSetHashParam(long long long ptr long) RSA_CPSetHashParam +@ stdcall CPSetKeyParam(long long long ptr long) RSA_CPSetKeyParam +@ stdcall CPSetProvParam(long long ptr long) RSA_CPSetProvParam +@ stdcall CPSignHash(long long long wstr long ptr ptr) RSA_CPSignHash +@ stdcall CPVerifySignature(long long ptr long long wstr long) RSA_CPVerifySignature +@ stdcall -private DllRegisterServer() RSABASE_DllRegisterServer +@ stdcall -private DllUnregisterServer() RSABASE_DllUnregisterServer diff --git a/winedefault.reg b/winedefault.reg index ea64359442a..39d6ae3db6c 100644 --- a/winedefault.reg +++ b/winedefault.reg @@ -4633,3 +4633,10 @@ [HKEY_CLASSES_ROOT\CLSID\{E436EBB3-524F-11CE-9F53-0020AF0BA770}\InprocServer32] @="quartz.dll" "ThreadingModel"="Both" + +# +# crypto config +# +[HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Defaults\Provider\Microsoft Base Cryptographic Provider v1.0] +"Image Path"="rsabase.dll" +"Type"=dword:00000001