#endif
#include <winpr/crt.h>
+#include <winpr/crypto.h>
#include <winpr/print.h>
#include <winpr/windows.h>
#include <openssl/ssl.h>
-#include <openssl/md5.h>
-#include <openssl/rc4.h>
-#include <openssl/sha.h>
#include <openssl/evp.h>
#include <openssl/aes.h>
-#include <openssl/rand.h>
#include <openssl/engine.h>
#include <freerdp/log.h>
* Example: WB^6HsrIaFmEpi
*/
- RAND_bytes((BYTE*) nums, sizeof(nums));
+ winpr_RAND((BYTE*) nums, sizeof(nums));
passStub[0] = set1[nums[0] % sizeof(set1)]; /* character 0 */
passStub[1] = set2[nums[1] % sizeof(set2)]; /* character 1 */
BYTE* freerdp_assistance_encrypt_pass_stub(const char* password, const char* passStub, int* pEncryptedSize)
{
int status;
- MD5_CTX md5Ctx;
+ WINPR_MD5_CTX md5Ctx;
int cbPasswordW;
int cbPassStubW;
int EncryptedSize;
cbPasswordW = (status - 1) * 2;
- MD5_Init(&md5Ctx);
- MD5_Update(&md5Ctx, PasswordW, cbPasswordW);
- MD5_Final((void*) PasswordHash, &md5Ctx);
+ if (!winpr_MD5_Init(&md5Ctx))
+ {
+ free (PasswordW);
+ return NULL;
+ }
+ if (!winpr_MD5_Update(&md5Ctx, (BYTE*)PasswordW, cbPasswordW))
+ {
+ free (PasswordW);
+ return NULL;
+ }
+ if (!winpr_MD5_Final(&md5Ctx, (BYTE*) PasswordHash))
+ {
+ free (PasswordW);
+ return NULL;
+ }
status = ConvertToUnicode(CP_UTF8, 0, passStub, -1, &PassStubW, 0);
if (status <= 0)
+ {
+ free (PasswordW);
return NULL;
+ }
cbPassStubW = (status - 1) * 2;
#include "config.h"
#endif
+#include <winpr/crypto.h>
+
#include "autodetect.h"
#define RDP_RTT_REQUEST_TYPE_CONTINUOUS 0x0001
return FALSE;
}
- RAND_bytes(buffer, payloadLength);
+ winpr_RAND(buffer, payloadLength);
Stream_Write(s, buffer, payloadLength);
bResult = rdp_send_message_channel_pdu(context->rdp, s, SEC_AUTODETECT_REQ);
return FALSE;
}
- RAND_bytes(buffer, payloadLength);
+ winpr_RAND(buffer, payloadLength);
Stream_Write(s, buffer, payloadLength);
}
}
#include <winpr/dsparse.h>
#include <winpr/winhttp.h>
-#include <openssl/rand.h>
-
#define TAG FREERDP_TAG("core.gateway.ntlm")
wStream* rpc_ntlm_http_request(rdpRpc* rpc, HttpContext* http, const char* method, int contentLength, SecBuffer* ntlmToken)
#include <winpr/dsparse.h>
#include <freerdp/log.h>
-#include <openssl/rand.h>
#include "http.h"
#include <freerdp/log.h>
-#include <openssl/rand.h>
#include <openssl/bio.h>
#ifdef HAVE_VALGRIND_MEMCHECK_H
#endif
#include <winpr/crt.h>
+#include <winpr/crypto.h>
#include <winpr/winhttp.h>
#include <freerdp/log.h>
void rts_generate_cookie(BYTE* cookie)
{
- RAND_pseudo_bytes(cookie, 16);
+ winpr_RAND(cookie, 16);
}
/* CONN/A Sequence */
#endif
#include <winpr/crt.h>
+#include <winpr/crypto.h>
#include <freerdp/log.h>
#include <freerdp/crypto/crypto.h>
void crypto_nonce(BYTE* nonce, int size)
{
- RAND_bytes((void*) nonce, size);
+ winpr_RAND((void*) nonce, size);
}
char* crypto_cert_fingerprint(X509* xcert)