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:
parent
25de5c9255
commit
4c917e9532
|
@ -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,
|
BOOL duplicate_hash_impl(ALG_ID aiAlgid, const HASH_CONTEXT *pSrcHashContext,
|
||||||
HASH_CONTEXT *pDestHashContext)
|
HASH_CONTEXT *pDestHashContext)
|
||||||
{
|
{
|
||||||
*pDestHashContext = *pSrcHashContext;
|
switch (aiAlgid)
|
||||||
|
{
|
||||||
return TRUE;
|
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)
|
BOOL new_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen)
|
||||||
|
|
|
@ -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 BCryptHashData(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
|
||||||
NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG);
|
NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG);
|
||||||
NTSTATUS WINAPI BCryptSetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, 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 */
|
#endif /* __WINE_BCRYPT_H */
|
||||||
|
|
Loading…
Reference in New Issue