Commit da8853f0 authored by Michael Müller's avatar Michael Müller Committed by Alexandre Julliard

bcrypt: Implement BCryptDuplicateHash.

parent 1ffe9826
......@@ -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)
......
......@@ -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;
......
......@@ -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
......
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