diff --git a/include/freerdp/crypto/crypto.h b/include/freerdp/crypto/crypto.h index 89b3eef26..3d112d4e4 100644 --- a/include/freerdp/crypto/crypto.h +++ b/include/freerdp/crypto/crypto.h @@ -92,7 +92,6 @@ FREERDP_API int crypto_rsa_public_decrypt(const BYTE* input, int length, UINT32 FREERDP_API int crypto_rsa_private_encrypt(const BYTE* input, int length, UINT32 key_length, const BYTE* modulus, const BYTE* private_exponent, BYTE* output); FREERDP_API int crypto_rsa_private_decrypt(const BYTE* input, int length, UINT32 key_length, const BYTE* modulus, const BYTE* private_exponent, BYTE* output); FREERDP_API void crypto_reverse(BYTE* data, int length); -FREERDP_API void crypto_nonce(BYTE* nonce, int size); FREERDP_API char* crypto_base64_encode(const BYTE* data, int length); FREERDP_API void crypto_base64_decode(const char* enc_data, int length, BYTE** dec_data, int* res_length); diff --git a/libfreerdp/core/connection.c b/libfreerdp/core/connection.c index 44b6deb5c..111924c7d 100644 --- a/libfreerdp/core/connection.c +++ b/libfreerdp/core/connection.c @@ -437,7 +437,7 @@ static BOOL rdp_client_establish_keys(rdpRdp* rdp) if (!settings->ClientRandom) return FALSE; - crypto_nonce(settings->ClientRandom, settings->ClientRandomLength); + winpr_RAND(settings->ClientRandom, settings->ClientRandomLength); key_len = settings->RdpServerCertificate->cert_info.ModulusLength; mod = settings->RdpServerCertificate->cert_info.Modulus; exp = settings->RdpServerCertificate->cert_info.exponent; diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index 86aff0004..2d63fa777 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -1349,7 +1349,7 @@ BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs) settings->ServerRandomLength = serverRandomLen; settings->ServerRandom = (BYTE*) malloc(serverRandomLen); - crypto_nonce(settings->ServerRandom, serverRandomLen); + winpr_RAND(settings->ServerRandom, serverRandomLen); Stream_Write(s, settings->ServerRandom, serverRandomLen); sigData = Stream_Pointer(s); diff --git a/libfreerdp/core/license.c b/libfreerdp/core/license.c index bfb988192..4852f9bb5 100644 --- a/libfreerdp/core/license.c +++ b/libfreerdp/core/license.c @@ -329,10 +329,10 @@ void license_generate_randoms(rdpLicense* license) ZeroMemory(license->ClientRandom, CLIENT_RANDOM_LENGTH); /* ClientRandom */ ZeroMemory(license->PremasterSecret, PREMASTER_SECRET_LENGTH); /* PremasterSecret */ #ifndef LICENSE_NULL_CLIENT_RANDOM - crypto_nonce(license->ClientRandom, CLIENT_RANDOM_LENGTH); /* ClientRandom */ + winpr_RAND(license->ClientRandom, CLIENT_RANDOM_LENGTH); /* ClientRandom */ #endif #ifndef LICENSE_NULL_PREMASTER_SECRET - crypto_nonce(license->PremasterSecret, PREMASTER_SECRET_LENGTH); /* PremasterSecret */ + winpr_RAND(license->PremasterSecret, PREMASTER_SECRET_LENGTH); /* PremasterSecret */ #endif } diff --git a/libfreerdp/crypto/crypto.c b/libfreerdp/crypto/crypto.c index dfb1dbc8b..00059b75f 100644 --- a/libfreerdp/crypto/crypto.c +++ b/libfreerdp/crypto/crypto.c @@ -240,11 +240,6 @@ void crypto_reverse(BYTE* data, int length) } } -void crypto_nonce(BYTE* nonce, int size) -{ - winpr_RAND((void*) nonce, size); -} - char* crypto_cert_fingerprint(X509* xcert) { int i = 0;