diff --git a/dlls/dssenh/Makefile.in b/dlls/dssenh/Makefile.in index 4f05beee518..8015768f99b 100644 --- a/dlls/dssenh/Makefile.in +++ b/dlls/dssenh/Makefile.in @@ -4,3 +4,5 @@ EXTRADLLFLAGS = -mno-cygwin C_SRCS = \ main.c + +RC_SRCS = rsrc.rc diff --git a/dlls/dssenh/dssenh.rgs b/dlls/dssenh/dssenh.rgs new file mode 100644 index 00000000000..0e9bad7c17c --- /dev/null +++ b/dlls/dssenh/dssenh.rgs @@ -0,0 +1,56 @@ +HKLM +{ + NoRemove Software + { + NoRemove Microsoft + { + NoRemove Cryptography + { + NoRemove Defaults + { + NoRemove Provider + { + ForceRemove 'Microsoft Base DSS Cryptographic Provider' + { + val 'Image Path' = s '%MODULE%' + val 'Type' = d 3 + } + ForceRemove 'Microsoft Base DSS and Diffie-Hellman Cryptographic Provider' + { + val 'Image Path' = s '%MODULE%' + val 'Type' = d 13 + } + ForceRemove 'Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider' + { + val 'Image Path' = s '%MODULE%' + val 'Type' = d 13 + } + ForceRemove 'Microsoft DH SChannel Cryptographic Provider' + { + val 'Image Path' = s '%MODULE%' + val 'Type' = d 18 + } + } + NoRemove 'Provider Types' + { + ForceRemove 'Type 003' + { + val 'Name' = s 'Microsoft Base DSS Cryptographic Provider' + val 'TypeName' = s 'DSS Signature' + } + ForceRemove 'Type 013' + { + val 'Name' = s 'Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider' + val 'TypeName' = s 'DSS Signature with Diffie-Hellman Key Exchange' + } + ForceRemove 'Type 018' + { + val 'Name' = s 'Microsoft DH SChannel Cryptographic Provider' + val 'TypeName' = s 'Diffie-Hellman SChannel' + } + } + } + } + } + } +} diff --git a/dlls/dssenh/main.c b/dlls/dssenh/main.c index 80551cf578b..5aa885c8b86 100644 --- a/dlls/dssenh/main.c +++ b/dlls/dssenh/main.c @@ -22,8 +22,13 @@ #include "windef.h" #include "winbase.h" #include "wincrypt.h" +#include "objbase.h" +#include "rpcproxy.h" + #include "wine/debug.h" +static HINSTANCE instance; + WINE_DEFAULT_DEBUG_CHANNEL(dssenh); BOOL WINAPI CPAcquireContext( HCRYPTPROV *ret_prov, LPSTR container, DWORD flags, PVTableProvStruc vtable ) @@ -106,11 +111,12 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) switch (fdwReason) { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hinstDLL); - break; + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + instance = hinstDLL; + DisableThreadLibraryCalls(hinstDLL); + break; } return TRUE; } @@ -120,8 +126,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) */ HRESULT WINAPI DllRegisterServer(void) { - FIXME("Not implemented.\n"); - return E_UNEXPECTED; + return __wine_register_resources( instance ); } /***************************************************** @@ -129,6 +134,5 @@ HRESULT WINAPI DllRegisterServer(void) */ HRESULT WINAPI DllUnregisterServer(void) { - FIXME("Not implemented.\n"); - return E_UNEXPECTED; + return __wine_unregister_resources( instance ); } diff --git a/dlls/dssenh/rsrc.rc b/dlls/dssenh/rsrc.rc new file mode 100644 index 00000000000..ac5ba6258e0 --- /dev/null +++ b/dlls/dssenh/rsrc.rc @@ -0,0 +1,22 @@ +/* + * Resources for dssenh + * + * Copyright 2020 Hans Leidekker for CodeWeavers + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* @makedep: dssenh.rgs */ +1 WINE_REGISTRY dssenh.rgs diff --git a/dlls/dssenh/tests/dssenh.c b/dlls/dssenh/tests/dssenh.c index 7a16acc6790..c88fcd14661 100644 --- a/dlls/dssenh/tests/dssenh.c +++ b/dlls/dssenh/tests/dssenh.c @@ -54,7 +54,6 @@ static void test_acquire_context(void) /* cannot acquire along with PROV_RSA_SIG, not compatible */ SetLastError(0xdeadbeef); result = CryptAcquireContextA(&hProv, NULL, MS_DEF_DSS_PROV_A, PROV_RSA_SIG, 0); - todo_wine ok(!result && GetLastError() == NTE_PROV_TYPE_NO_MATCH, "Expected NTE_PROV_TYPE_NO_MATCH, got %08x\n", GetLastError()); @@ -574,7 +573,7 @@ static void test_data_encryption(const struct encrypt_test *tests, int testLen) SetLastError(0xdeadbeef); result = CryptAcquireContextA( &hProv, NULL, MS_ENH_DSS_DH_PROV_A, PROV_DSS_DH, CRYPT_VERIFYCONTEXT); - if(!result && GetLastError() == NTE_KEYSET_NOT_DEF) + if (!result) { skip("DSSENH is currently not available, skipping encryption tests.\n"); return; @@ -665,7 +664,7 @@ static void test_cipher_modes(const struct ciphermode_test *tests, int testLen) SetLastError(0xdeadbeef); result = CryptAcquireContextA( &hProv, NULL, MS_ENH_DSS_DH_PROV_A, PROV_DSS_DH, CRYPT_VERIFYCONTEXT); - if(!result && GetLastError() == NTE_KEYSET_NOT_DEF) + if (!result) { skip("DSSENH is currently not available, skipping block cipher mode tests.\n"); return;