Commit 4e3b2870 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

rsaenh: Pass exact size to BCryptFinishHash().

parent 6705a710
......@@ -70,9 +70,9 @@ BOOL update_hash_impl(BCRYPT_HASH_HANDLE hash_handle, const BYTE *pbData, DWORD
return TRUE;
}
BOOL finalize_hash_impl(BCRYPT_HASH_HANDLE hash_handle, BYTE *pbHashValue)
BOOL finalize_hash_impl(BCRYPT_HASH_HANDLE hash_handle, BYTE *hash_value, DWORD hash_size)
{
BCryptFinishHash(hash_handle, pbHashValue, RSAENH_MAX_HASH_SIZE, 0);
BCryptFinishHash(hash_handle, hash_value, hash_size, 0);
BCryptDestroyHash(hash_handle);
return TRUE;
}
......
......@@ -41,7 +41,7 @@ typedef union tagKEY_CONTEXT {
BOOL init_hash_impl(ALG_ID aiAlgid, BCRYPT_HASH_HANDLE *hash_handle) DECLSPEC_HIDDEN;
BOOL update_hash_impl(BCRYPT_HASH_HANDLE hash_handle, const BYTE *pbData,
DWORD dwDataLen) DECLSPEC_HIDDEN;
BOOL finalize_hash_impl(BCRYPT_HASH_HANDLE hash_handle, BYTE *pbHashValue) DECLSPEC_HIDDEN;
BOOL finalize_hash_impl(BCRYPT_HASH_HANDLE hash_handle, BYTE *hash_value, DWORD hash_size) DECLSPEC_HIDDEN;
BOOL duplicate_hash_impl(BCRYPT_HASH_HANDLE src_hash_handle,
BCRYPT_HASH_HANDLE *dest_hash_handle) DECLSPEC_HIDDEN;
......
......@@ -816,7 +816,7 @@ static inline void finalize_hash(CRYPTHASH *pCryptHash)
if (pCryptHash->pHMACInfo) {
BYTE abHashValue[RSAENH_MAX_HASH_SIZE];
finalize_hash_impl(pCryptHash->hash_handle, pCryptHash->abHashValue);
finalize_hash_impl(pCryptHash->hash_handle, pCryptHash->abHashValue, pCryptHash->dwHashSize);
memcpy(abHashValue, pCryptHash->abHashValue, pCryptHash->dwHashSize);
init_hash_impl(pCryptHash->pHMACInfo->HashAlgid, &pCryptHash->hash_handle);
update_hash_impl(pCryptHash->hash_handle,
......@@ -824,7 +824,7 @@ static inline void finalize_hash(CRYPTHASH *pCryptHash)
pCryptHash->pHMACInfo->cbOuterString);
update_hash_impl(pCryptHash->hash_handle,
abHashValue, pCryptHash->dwHashSize);
finalize_hash_impl(pCryptHash->hash_handle, pCryptHash->abHashValue);
finalize_hash_impl(pCryptHash->hash_handle, pCryptHash->abHashValue, pCryptHash->dwHashSize);
pCryptHash->hash_handle = NULL;
}
break;
......@@ -842,7 +842,7 @@ static inline void finalize_hash(CRYPTHASH *pCryptHash)
break;
default:
finalize_hash_impl(pCryptHash->hash_handle, pCryptHash->abHashValue);
finalize_hash_impl(pCryptHash->hash_handle, pCryptHash->abHashValue, pCryptHash->dwHashSize);
pCryptHash->hash_handle = NULL;
}
}
......
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