Loading lib/curl_ntlm_core.c +23 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ #include "curl_hmac.h" #include "warnless.h" #include "curl_endian.h" #include "curl_des.h" #define _MPRINTF_REPLACE /* use our functions only */ #include <curl/mprintf.h> Loading Loading @@ -147,7 +148,11 @@ static void setup_des_key(const unsigned char *key_56, extend_key_56_to_64(key_56, (char *) key); /* Set the key parity to odd */ #if defined(HAVE_BORINGSSL) Curl_des_set_odd_parity((unsigned char *) &key, sizeof(key)); #else DES_set_odd_parity(&key); #endif /* Set the key */ DES_set_key(&key, ks); Loading @@ -163,6 +168,9 @@ static void setup_des_key(const unsigned char *key_56, /* Expand the 56-bit key to 64-bits */ extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ Curl_des_set_odd_parity((unsigned char *) key, sizeof(key)); /* Set the key */ des_set_key(des, (const uint8_t *) key); } Loading @@ -180,6 +188,9 @@ static void setup_des_key(const unsigned char *key_56, /* Expand the 56-bit key to 64-bits */ extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ Curl_des_set_odd_parity((unsigned char *) key, sizeof(key)); /* Set the key */ gcry_cipher_setkey(*des, key, sizeof(key)); } Loading Loading @@ -212,6 +223,9 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, /* Expand the 56-bit key to 64-bits */ extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ Curl_des_set_odd_parity((unsigned char *) key, sizeof(key)); /* Import the key */ key_item.data = (unsigned char *)key; key_item.len = sizeof(key); Loading Loading @@ -258,6 +272,9 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, /* Expand the 56-bit key to 64-bits */ extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ Curl_des_set_odd_parity((unsigned char *) key, sizeof(key)); /* Perform the encryption */ err = CCCrypt(kCCEncrypt, kCCAlgorithmDES, kCCOptionECBMode, key, kCCKeySizeDES, NULL, in, 8 /* inbuflen */, out, Loading @@ -281,6 +298,9 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, /* Expand the 56-bit key to 64-bits */ extend_key_56_to_64(key_56, ctl.Crypto_Key); /* Set the key parity to odd */ Curl_des_set_odd_parity((unsigned char *) ctl.Crypto_Key, ctl.Data_Len); /* Perform the encryption */ _CIPHER((_SPCPTR *) &out, &ctl, (_SPCPTR *) &in); Loading Loading @@ -316,6 +336,9 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, /* Expand the 56-bit key to 64-bits */ extend_key_56_to_64(key_56, blob.key); /* Set the key parity to odd */ Curl_des_set_odd_parity((unsigned char *) blob.key, sizeof(blob.key)); /* Import the key */ if(!CryptImportKey(hprov, (BYTE *) &blob, sizeof(blob), 0, 0, &hkey)) { CryptReleaseContext(hprov, 0); Loading Loading
lib/curl_ntlm_core.c +23 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ #include "curl_hmac.h" #include "warnless.h" #include "curl_endian.h" #include "curl_des.h" #define _MPRINTF_REPLACE /* use our functions only */ #include <curl/mprintf.h> Loading Loading @@ -147,7 +148,11 @@ static void setup_des_key(const unsigned char *key_56, extend_key_56_to_64(key_56, (char *) key); /* Set the key parity to odd */ #if defined(HAVE_BORINGSSL) Curl_des_set_odd_parity((unsigned char *) &key, sizeof(key)); #else DES_set_odd_parity(&key); #endif /* Set the key */ DES_set_key(&key, ks); Loading @@ -163,6 +168,9 @@ static void setup_des_key(const unsigned char *key_56, /* Expand the 56-bit key to 64-bits */ extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ Curl_des_set_odd_parity((unsigned char *) key, sizeof(key)); /* Set the key */ des_set_key(des, (const uint8_t *) key); } Loading @@ -180,6 +188,9 @@ static void setup_des_key(const unsigned char *key_56, /* Expand the 56-bit key to 64-bits */ extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ Curl_des_set_odd_parity((unsigned char *) key, sizeof(key)); /* Set the key */ gcry_cipher_setkey(*des, key, sizeof(key)); } Loading Loading @@ -212,6 +223,9 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, /* Expand the 56-bit key to 64-bits */ extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ Curl_des_set_odd_parity((unsigned char *) key, sizeof(key)); /* Import the key */ key_item.data = (unsigned char *)key; key_item.len = sizeof(key); Loading Loading @@ -258,6 +272,9 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, /* Expand the 56-bit key to 64-bits */ extend_key_56_to_64(key_56, key); /* Set the key parity to odd */ Curl_des_set_odd_parity((unsigned char *) key, sizeof(key)); /* Perform the encryption */ err = CCCrypt(kCCEncrypt, kCCAlgorithmDES, kCCOptionECBMode, key, kCCKeySizeDES, NULL, in, 8 /* inbuflen */, out, Loading @@ -281,6 +298,9 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, /* Expand the 56-bit key to 64-bits */ extend_key_56_to_64(key_56, ctl.Crypto_Key); /* Set the key parity to odd */ Curl_des_set_odd_parity((unsigned char *) ctl.Crypto_Key, ctl.Data_Len); /* Perform the encryption */ _CIPHER((_SPCPTR *) &out, &ctl, (_SPCPTR *) &in); Loading Loading @@ -316,6 +336,9 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, /* Expand the 56-bit key to 64-bits */ extend_key_56_to_64(key_56, blob.key); /* Set the key parity to odd */ Curl_des_set_odd_parity((unsigned char *) blob.key, sizeof(blob.key)); /* Import the key */ if(!CryptImportKey(hprov, (BYTE *) &blob, sizeof(blob), 0, 0, &hkey)) { CryptReleaseContext(hprov, 0); Loading