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