bcrypt: Implement BCryptDuplicateHash.

Signed-off-by: Michael Müller <michael@fds-team.de>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Müller 2017-03-10 15:35:14 +01:00 committed by Alexandre Julliard
parent 1ffe98264c
commit da8853f062
3 changed files with 23 additions and 2 deletions

View File

@ -11,7 +11,7 @@
@ stdcall BCryptDestroyHash(ptr)
@ stub BCryptDestroyKey
@ stub BCryptDestroySecret
@ stub BCryptDuplicateHash
@ stdcall BCryptDuplicateHash(ptr ptr ptr long long)
@ stub BCryptDuplicateKey
@ stub BCryptEncrypt
@ stdcall BCryptEnumAlgorithms(long ptr ptr long)

View File

@ -536,6 +536,27 @@ end:
return STATUS_SUCCESS;
}
NTSTATUS WINAPI BCryptDuplicateHash( BCRYPT_HASH_HANDLE handle, BCRYPT_HASH_HANDLE *handle_copy,
UCHAR *object, ULONG objectlen, ULONG flags )
{
struct hash *hash_orig = handle;
struct hash *hash_copy;
TRACE( "%p, %p, %p, %u, %u\n", handle, handle_copy, object, objectlen, flags );
if (!hash_orig || hash_orig->hdr.magic != MAGIC_HASH) return STATUS_INVALID_HANDLE;
if (!handle_copy) return STATUS_INVALID_PARAMETER;
if (object) FIXME( "ignoring object buffer\n" );
if (!(hash_copy = HeapAlloc( GetProcessHeap(), 0, sizeof(*hash_copy) )))
return STATUS_NO_MEMORY;
memcpy( hash_copy, hash_orig, sizeof(*hash_orig) );
*handle_copy = hash_copy;
return STATUS_SUCCESS;
}
NTSTATUS WINAPI BCryptDestroyHash( BCRYPT_HASH_HANDLE handle )
{
struct hash *hash = handle;

View File

@ -13,7 +13,7 @@
@ stdcall BCryptDestroyHash(ptr) bcrypt.BCryptDestroyHash
@ stub BCryptDestroyKey
@ stub BCryptDestroySecret
@ stub BCryptDuplicateHash
@ stdcall BCryptDuplicateHash(ptr ptr ptr long long) bcrypt.BCryptDuplicateHash
@ stub BCryptDuplicateKey
@ stub BCryptEncrypt
@ stdcall BCryptEnumAlgorithms(long ptr ptr long) bcrypt.BCryptEnumAlgorithms