Skip to content
Permalink
Browse files

Store client_random in server mode

We need the client_random in server mode when the client does RDP security and
tries to reconnect using the cookie.
  • Loading branch information
hardening committed Mar 21, 2017
1 parent b33371f commit b0b3a78a20b7cd3127bd14c9b3a7f7867a0af51d
Showing with 8 additions and 2 deletions.
  1. +8 −2 libfreerdp/core/connection.c
@@ -583,7 +583,14 @@ BOOL rdp_server_establish_keys(rdpRdp* rdp, wStream* s)

mod = rdp->settings->RdpServerRsaKey->Modulus;
priv_exp = rdp->settings->RdpServerRsaKey->PrivateExponent;
crypto_rsa_private_decrypt(crypt_client_random, rand_len - 8, key_len, mod, priv_exp, client_random);
if (crypto_rsa_private_decrypt(crypt_client_random, rand_len - 8, key_len, mod, priv_exp, client_random) <= 0)
{
free(client_random);
goto end;
}

rdp->settings->ClientRandom = client_random;
rdp->settings->ClientRandomLength = 32;

/* now calculate encrypt / decrypt and update keys */
if (!security_establish_keys(client_random, rdp))
@@ -625,7 +632,6 @@ BOOL rdp_server_establish_keys(rdpRdp* rdp, wStream* s)
ret = TRUE;
end:
free(crypt_client_random);
free(client_random);

if (!ret)
{

0 comments on commit b0b3a78

Please sign in to comment.
You can’t perform that action at this time.