From ee6de6d293bb7a060361140765d34b71774e999f Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 23 Jan 2023 16:19:06 +0100 Subject: [PATCH] [core] fix rdp encrypted autodetect messages --- libfreerdp/core/peer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libfreerdp/core/peer.c b/libfreerdp/core/peer.c index 3d6fce2a2..692d89ac4 100644 --- a/libfreerdp/core/peer.c +++ b/libfreerdp/core/peer.c @@ -446,9 +446,13 @@ static state_run_t peer_recv_tpkt_pdu(freerdp_peer* client, wStream* s) if (rdp_get_state(rdp) <= CONNECTION_STATE_LICENSING) { - if (!rdp_read_security_header(s, &securityFlags, NULL)) + if (!rdp_read_security_header(s, &securityFlags, &length)) return STATE_RUN_FAILED; - + if (securityFlags & SEC_ENCRYPT) + { + if (!rdp_decrypt(rdp, s, &length, securityFlags)) + return STATE_RUN_FAILED; + } return rdp_recv_message_channel_pdu(rdp, s, securityFlags); }