Commit 3ae2dd16 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

dssenh: Register the DSS provider.

parent c690a31a
...@@ -4,3 +4,5 @@ EXTRADLLFLAGS = -mno-cygwin ...@@ -4,3 +4,5 @@ EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ C_SRCS = \
main.c main.c
RC_SRCS = rsrc.rc
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'
}
}
}
}
}
}
}
...@@ -22,8 +22,13 @@ ...@@ -22,8 +22,13 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wincrypt.h" #include "wincrypt.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "wine/debug.h" #include "wine/debug.h"
static HINSTANCE instance;
WINE_DEFAULT_DEBUG_CHANNEL(dssenh); WINE_DEFAULT_DEBUG_CHANNEL(dssenh);
BOOL WINAPI CPAcquireContext( HCRYPTPROV *ret_prov, LPSTR container, DWORD flags, PVTableProvStruc vtable ) 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) ...@@ -106,11 +111,12 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
switch (fdwReason) switch (fdwReason)
{ {
case DLL_WINE_PREATTACH: case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */ return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinstDLL); instance = hinstDLL;
break; DisableThreadLibraryCalls(hinstDLL);
break;
} }
return TRUE; return TRUE;
} }
...@@ -120,8 +126,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) ...@@ -120,8 +126,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
*/ */
HRESULT WINAPI DllRegisterServer(void) HRESULT WINAPI DllRegisterServer(void)
{ {
FIXME("Not implemented.\n"); return __wine_register_resources( instance );
return E_UNEXPECTED;
} }
/***************************************************** /*****************************************************
...@@ -129,6 +134,5 @@ HRESULT WINAPI DllRegisterServer(void) ...@@ -129,6 +134,5 @@ HRESULT WINAPI DllRegisterServer(void)
*/ */
HRESULT WINAPI DllUnregisterServer(void) HRESULT WINAPI DllUnregisterServer(void)
{ {
FIXME("Not implemented.\n"); return __wine_unregister_resources( instance );
return E_UNEXPECTED;
} }
/*
* 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
...@@ -54,7 +54,6 @@ static void test_acquire_context(void) ...@@ -54,7 +54,6 @@ static void test_acquire_context(void)
/* cannot acquire along with PROV_RSA_SIG, not compatible */ /* cannot acquire along with PROV_RSA_SIG, not compatible */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
result = CryptAcquireContextA(&hProv, NULL, MS_DEF_DSS_PROV_A, PROV_RSA_SIG, 0); result = CryptAcquireContextA(&hProv, NULL, MS_DEF_DSS_PROV_A, PROV_RSA_SIG, 0);
todo_wine
ok(!result && GetLastError() == NTE_PROV_TYPE_NO_MATCH, ok(!result && GetLastError() == NTE_PROV_TYPE_NO_MATCH,
"Expected NTE_PROV_TYPE_NO_MATCH, got %08x\n", GetLastError()); "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) ...@@ -574,7 +573,7 @@ static void test_data_encryption(const struct encrypt_test *tests, int testLen)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
result = CryptAcquireContextA( result = CryptAcquireContextA(
&hProv, NULL, MS_ENH_DSS_DH_PROV_A, PROV_DSS_DH, CRYPT_VERIFYCONTEXT); &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"); skip("DSSENH is currently not available, skipping encryption tests.\n");
return; return;
...@@ -665,7 +664,7 @@ static void test_cipher_modes(const struct ciphermode_test *tests, int testLen) ...@@ -665,7 +664,7 @@ static void test_cipher_modes(const struct ciphermode_test *tests, int testLen)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
result = CryptAcquireContextA( result = CryptAcquireContextA(
&hProv, NULL, MS_ENH_DSS_DH_PROV_A, PROV_DSS_DH, CRYPT_VERIFYCONTEXT); &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"); skip("DSSENH is currently not available, skipping block cipher mode tests.\n");
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment