rsaenh: Implement duplicate_hash_impl for bcrypt-based hashes.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-07-06 13:44:48 +02:00 committed by Alexandre Julliard
parent 25de5c9255
commit 4c917e9532
2 changed files with 12 additions and 3 deletions

View File

@ -160,9 +160,17 @@ BOOL finalize_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, BYTE *pbHash
BOOL duplicate_hash_impl(ALG_ID aiAlgid, const HASH_CONTEXT *pSrcHashContext,
HASH_CONTEXT *pDestHashContext)
{
*pDestHashContext = *pSrcHashContext;
return TRUE;
switch (aiAlgid)
{
case CALG_MD2:
case CALG_MD4:
case CALG_MD5:
case CALG_SHA:
*pDestHashContext = *pSrcHashContext;
return TRUE;
default:
return !BCryptDuplicateHash(pSrcHashContext->bcrypt_hash, &pDestHashContext->bcrypt_hash, NULL, 0, 0);
}
}
BOOL new_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen)

View File

@ -113,5 +113,6 @@ NTSTATUS WINAPI BCryptHash(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, PUCH
NTSTATUS WINAPI BCryptHashData(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG);
NTSTATUS WINAPI BCryptSetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG);
NTSTATUS WINAPI BCryptDuplicateHash(BCRYPT_HASH_HANDLE, BCRYPT_HASH_HANDLE *, UCHAR *, ULONG, ULONG);
#endif /* __WINE_BCRYPT_H */