From 2538dc04e3a57d718de8676bd7dc86f643fd06b0 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 12 May 2026 15:56:11 +0200 Subject: [PATCH] curl_ntlm_core: propagate DES `CryptEncrypt()` error Spotted by GitHub Code Quality Closes #21569 --- lib/curl_ntlm_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index e6aab7e39e..9f8db0328f 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -251,6 +251,7 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, char key[8]; } blob; DWORD len = 8; + BOOL res; /* Acquire the crypto provider */ if(!CryptAcquireContext(&hprov, NULL, NULL, PROV_RSA_FULL, @@ -280,12 +281,12 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, memcpy(out, in, 8); /* Perform the encryption */ - CryptEncrypt(hkey, 0, FALSE, 0, out, &len, len); + res = CryptEncrypt(hkey, 0, FALSE, 0, out, &len, len); CryptDestroyKey(hkey); CryptReleaseContext(hprov, 0); - return TRUE; + return res; } #endif /* crypto backends */