From cebae72da44ea475ea725ed9030d9e621534b4e6 Mon Sep 17 00:00:00 2001 From: codemastr Date: Sun, 25 Aug 2002 16:35:17 +0000 Subject: [PATCH] Fixed a win32 password encryption bug in NT service mode --- Changes | 3 ++- src/auth.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 3dd48e9a4..79a9ae80f 100644 --- a/Changes +++ b/Changes @@ -1559,4 +1559,5 @@ seen. gmtime warning still there by Alzirr - Compile fix regarding above fix - Added vhost::swhois requested by FrostByghte (#0000171) - +- Fixed a win32 password encryption bug when in NT service mode reported by simonbell + (#0000285) diff --git a/src/auth.c b/src/auth.c index 3dd52e434..e09b1d532 100644 --- a/src/auth.c +++ b/src/auth.c @@ -200,7 +200,8 @@ int Auth_Check(aClient *cptr, anAuthStruct *as, char *para) HCRYPTHASH hHash; char buf2[512]; DWORD size = 512; - if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0)) + if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, + CRYPT_NEWKEYSET)) return -1; if (!CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash)) return -1; @@ -243,7 +244,8 @@ int Auth_Check(aClient *cptr, anAuthStruct *as, char *para) HCRYPTHASH hHash; char buf2[512]; DWORD size = 512; - if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0)) + if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, + CRYPT_NEWKEYSET)) return -1; if (!CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash)) return -1;