* limitations under the License.
*/
-#include "connection.h"
-#include "info.h"
#include "per.h"
+#include "info.h"
+#include "input.h"
+
+#include "connection.h"
/**
* Connection Sequence
if (!rdp_send_confirm_active(rdp))
return false;
+ input_register_client_callbacks(rdp->input);
+
/**
* The server may request a different desktop size during Deactivation-Reactivation sequence.
* In this case, the UI should be informed and do actual window resizing at this point.
return false;
if (!rdp_send_client_control_pdu(rdp, CTRLACTION_REQUEST_CONTROL))
return false;
+
+ rdp->input->SynchronizeEvent(rdp->input, 0);
+
if (!rdp_send_client_persistent_key_list_pdu(rdp))
return false;
if (!rdp_send_client_font_list_pdu(rdp, FONTLIST_FIRST | FONTLIST_LAST))
void rdp_write_share_control_header(STREAM* s, uint16 length, uint16 type, uint16 channel_id)
{
- length -= RDP_PACKET_HEADER_LENGTH;
+ length -= (s->p - s->data);
/* Share Control Header */
stream_write_uint16(s, length); /* totalLength */
uint32 pad = 0;
sec_flags = rdp->sec_flags;
+
if (sec_flags != 0)
{
rdp_write_security_header(s, sec_flags);
+
if (sec_flags & SEC_ENCRYPT)
{
if (rdp->settings->encryption_method == ENCRYPTION_METHOD_FIPS)
length = length - (data - s->data);
stream_write_uint16(s, 0x10); /* length */
stream_write_uint8(s, 0x1); /* TSFIPS_VERSION 1*/
+
/* handle padding */
pad = 8 - (length % 8);
+
if (pad == 8)
pad = 0;
if (pad)
memset(data+length, 0, pad);
+
stream_write_uint8(s, pad);
security_hmac_signature(data, length, s->p, rdp);
security_encrypt(s->p, length, rdp);
}
}
+
rdp->sec_flags = 0;
}
+
return pad;
}
if (rdp->sec_flags & SEC_ENCRYPT)
{
sec_bytes = 12;
+
if (rdp->settings->encryption_method == ENCRYPTION_METHOD_FIPS)
sec_bytes += 4;
}
else if (rdp->sec_flags != 0)
+ {
sec_bytes = 4;
+ }
else
+ {
sec_bytes = 0;
+ }
+
return sec_bytes;
}