Signed-off-by: Sven Baars sbaars@codeweavers.com --- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index f53663f17d0..6207ce00ccb 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -235,11 +235,15 @@ static void testsign_cleanup(struct testsign_context *ctx)
ret = CertDeleteCertificateFromStore(ctx->root_cert); ok(ret, "Failed to remove certificate, error %u\n", GetLastError()); + ret = CertFreeCertificateContext(ctx->root_cert); + ok(ret, "Failed to free certificate context, error %u\n", GetLastError()); ret = CertCloseStore(ctx->root_store, CERT_CLOSE_STORE_CHECK_FLAG); ok(ret, "Failed to close store, error %u\n", GetLastError());
ret = CertDeleteCertificateFromStore(ctx->publisher_cert); ok(ret, "Failed to remove certificate, error %u\n", GetLastError()); + ret = CertFreeCertificateContext(ctx->publisher_cert); + ok(ret, "Failed to free certificate context, error %u\n", GetLastError()); ret = CertCloseStore(ctx->publisher_store, CERT_CLOSE_STORE_CHECK_FLAG); ok(ret, "Failed to close store, error %u\n", GetLastError());
@@ -1360,6 +1364,8 @@ static void add_file_to_catalog(HANDLE catalog, const WCHAR *file) sizeof(L"2:6.0"), (BYTE *)L"2:6.0"); ok(ret, "Failed to write attr, error %u\n", GetLastError()); } + + free(indirect_data); }
static const GUID bus_class = {0xdeadbeef, 0x29ef, 0x4538, {0xa5, 0xfd, 0xb6, 0x95, 0x73, 0xa3, 0x62, 0xc1}}; @@ -1816,6 +1822,8 @@ static void test_pnp_driver(struct testsign_context *ctx) ok(ret, "failed to remove device, error %#x\n", GetLastError()); }
+ SetupDiDestroyDeviceInfoList(set); + /* Windows stops the service but does not delete it. */ manager = OpenSCManagerA(NULL, NULL, SC_MANAGER_CONNECT); ok(!!manager, "failed to open service manager, error %u\n", GetLastError());
Signed-off-by: Sven Baars sbaars@codeweavers.com --- Maybe a better way to do this would be to get rid of the HASH_CONTEXT union, and initialize that handle to NULL in CPCreateHash(). This seems possible now that everything goes through bcrypt, but maybe there are reasons to keep the union and the generic impl glue around.
dlls/rsaenh/implglue.c | 5 +++++ dlls/rsaenh/rsaenh.c | 39 ++++++++++++++++++++------------------- 2 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/dlls/rsaenh/implglue.c b/dlls/rsaenh/implglue.c index 9d90ad70f53..0104774777d 100644 --- a/dlls/rsaenh/implglue.c +++ b/dlls/rsaenh/implglue.c @@ -38,6 +38,8 @@ BOOL init_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext) BCRYPT_ALG_HANDLE provider; NTSTATUS status;
+ pHashContext->bcrypt_hash = NULL; + switch (aiAlgid) { case CALG_MD2: @@ -87,6 +89,9 @@ BOOL update_hash_impl(HASH_CONTEXT *pHashContext, const BYTE *pbData, DWORD dwDa
BOOL finalize_hash_impl(HASH_CONTEXT *pHashContext, BYTE *pbHashValue) { + if (!pHashContext->bcrypt_hash) + return TRUE; + BCryptFinishHash(pHashContext->bcrypt_hash, pbHashValue, RSAENH_MAX_HASH_SIZE, 0); BCryptDestroyHash(pHashContext->bcrypt_hash); return TRUE; diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c index a4deb80b0e1..9cac3606a02 100644 --- a/dlls/rsaenh/rsaenh.c +++ b/dlls/rsaenh/rsaenh.c @@ -588,25 +588,6 @@ static BOOL copy_hmac_info(PHMAC_INFO *dst, const HMAC_INFO *src) { return TRUE; }
-/****************************************************************************** - * destroy_hash [Internal] - * - * Destructor for hash objects - * - * PARAMS - * pCryptHash [I] Pointer to the hash object to be destroyed. - * Will be invalid after function returns! - */ -static void destroy_hash(OBJECTHDR *pObject) -{ - CRYPTHASH *pCryptHash = (CRYPTHASH*)pObject; - - free_hmac_info(pCryptHash->pHMACInfo); - free_data_blob(&pCryptHash->tpPRFParams.blobLabel); - free_data_blob(&pCryptHash->tpPRFParams.blobSeed); - HeapFree(GetProcessHeap(), 0, pCryptHash); -} - /****************************************************************************** * init_hash [Internal] * @@ -722,6 +703,26 @@ static inline void finalize_hash(CRYPTHASH *pCryptHash) { } }
+/****************************************************************************** + * destroy_hash [Internal] + * + * Destructor for hash objects + * + * PARAMS + * pCryptHash [I] Pointer to the hash object to be destroyed. + * Will be invalid after function returns! + */ +static void destroy_hash(OBJECTHDR *pObject) +{ + CRYPTHASH *pCryptHash = (CRYPTHASH*)pObject; + + finalize_hash(pCryptHash); + free_hmac_info(pCryptHash->pHMACInfo); + free_data_blob(&pCryptHash->tpPRFParams.blobLabel); + free_data_blob(&pCryptHash->tpPRFParams.blobSeed); + HeapFree(GetProcessHeap(), 0, pCryptHash); +} + /****************************************************************************** * destroy_key [Internal] *
On Sun, 2022-02-13 at 20:43 +0100, Sven Baars wrote:
Signed-off-by: Sven Baars sbaars@codeweavers.com
Maybe a better way to do this would be to get rid of the HASH_CONTEXT union, and initialize that handle to NULL in CPCreateHash(). This seems possible now that everything goes through bcrypt, but maybe there are reasons to keep the union and the generic impl glue around
I think that would be better. We want to get rid of the glue eventually.