From 728c299d67fe83e6e2b7c54e5761c26667d9f9e5 Mon Sep 17 00:00:00 2001 From: dkulwin Date: Thu, 29 Oct 2015 15:07:09 -0500 Subject: [PATCH] Fix CNG hash GetProperty bug ssh_digest_start was using a pointer to the algorithm handle instead of the algorithm handle itself in the BCryptGetProperty call. It was also querying for the hash length when it should have been querying for the hash object length. --- contrib/win32/win32compat/cng_digest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/win32/win32compat/cng_digest.c b/contrib/win32/win32compat/cng_digest.c index 0355ecc..e38f3fa 100644 --- a/contrib/win32/win32compat/cng_digest.c +++ b/contrib/win32/win32compat/cng_digest.c @@ -147,7 +147,7 @@ struct ssh_digest_ctx * return NULL; } - if ((hr = BCryptGetProperty(&(ret->cng_alg_handle), BCRYPT_HASH_LENGTH,(PBYTE)&cbHash,sizeof(DWORD),&cbData,0)) != S_OK){ + if ((hr = BCryptGetProperty(ret->cng_alg_handle, BCRYPT_OBJECT_LENGTH, (PBYTE)&cbHash, sizeof(DWORD), &cbData, 0)) != S_OK){ free(ret); return NULL; }