dssenh: Implement CPGenRandom.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2020-10-12 16:11:11 +02:00 committed by Alexandre Julliard
parent e32b29a3fd
commit c822cb995e
2 changed files with 13 additions and 1 deletions

View File

@ -9,7 +9,7 @@
@ stub CPEncrypt
@ stdcall CPExportKey(ptr ptr ptr long long ptr ptr)
@ stdcall CPGenKey(ptr long long ptr)
@ stub CPGenRandom
@ stdcall CPGenRandom(ptr long ptr)
@ stdcall CPGetHashParam(ptr ptr long ptr ptr long)
@ stub CPGetKeyParam
@ stdcall CPGetProvParam(ptr long ptr ptr long)

View File

@ -27,6 +27,7 @@
#include "bcrypt.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "ntsecapi.h"
#include "wine/debug.h"
#include "wine/heap.h"
@ -498,6 +499,17 @@ BOOL WINAPI CPDuplicateKey( HCRYPTPROV hprov, HCRYPTKEY hkey, DWORD *reserved, D
return TRUE;
}
BOOL WINAPI CPGenRandom( HCRYPTPROV hprov, DWORD len, BYTE *buffer )
{
struct container *container = (struct container *)hprov;
TRACE( "%p, %u, %p\n", (void *)hprov, len, buffer );
if (container->magic != MAGIC_CONTAINER) return FALSE;
return RtlGenRandom( buffer, len );
}
static struct hash *create_hash( ALG_ID algid )
{
struct hash *ret;