mirror of
https://github.com/curl/curl.git
synced 2026-05-16 16:36:20 +03:00
curl_ntlm_core: propagate DES CryptEncrypt() error
Spotted by GitHub Code Quality Closes #21569
This commit is contained in:
parent
8f71d0fde5
commit
2538dc04e3
1 changed files with 3 additions and 2 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue