hcrypto WinCNG backend: don't leak handles on digest reinit
Similar fix to 9518f296
, but for the WinCNG EVP backend.
This commit is contained in:
@@ -570,6 +570,11 @@ wincng_md_hash_init(BCRYPT_ALG_HANDLE hAlgorithm,
|
|||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
ULONG cbData;
|
ULONG cbData;
|
||||||
|
|
||||||
|
if (cng->hHash) {
|
||||||
|
BCryptDestroyHash(cng->hHash); /* allow reinitialization */
|
||||||
|
cng->hHash = (BCRYPT_HASH_HANDLE)0;
|
||||||
|
}
|
||||||
|
|
||||||
status = BCryptGetProperty(hAlgorithm,
|
status = BCryptGetProperty(hAlgorithm,
|
||||||
BCRYPT_OBJECT_LENGTH,
|
BCRYPT_OBJECT_LENGTH,
|
||||||
(PUCHAR)&cng->cbHashObject,
|
(PUCHAR)&cng->cbHashObject,
|
||||||
|
Reference in New Issue
Block a user