[core,license] print a warning on invalid packet
* add stringify function for securityFlags * print a error message on unexpected packet
This commit is contained in:
parent
7041517ed6
commit
358ac53b66
@ -1131,7 +1131,14 @@ state_run_t rdp_client_connect_license(rdpRdp* rdp, wStream* s)
|
||||
}
|
||||
|
||||
if ((securityFlags & SEC_LICENSE_PKT) == 0)
|
||||
{
|
||||
char buffer[512] = { 0 };
|
||||
char lbuffer[32] = { 0 };
|
||||
WLog_ERR(TAG, "[%s] securityFlags=%s, missing required flag %s",
|
||||
rdp_security_flag_string(securityFlags, buffer, sizeof(buffer)),
|
||||
rdp_security_flag_string(SEC_LICENSE_PKT, lbuffer, sizeof(lbuffer)));
|
||||
return STATE_RUN_FAILED;
|
||||
}
|
||||
|
||||
status = license_recv(rdp->license, s);
|
||||
|
||||
|
@ -2437,3 +2437,41 @@ BOOL rdp_reset_rc4_decrypt_keys(rdpRdp* rdp)
|
||||
rdp->decrypt_use_count = 0;
|
||||
return rdp->rc4_decrypt_key != NULL;
|
||||
}
|
||||
|
||||
const char* rdp_security_flag_string(UINT32 securityFlags, char* buffer, size_t size)
|
||||
{
|
||||
if (securityFlags & SEC_EXCHANGE_PKT)
|
||||
winpr_str_append("SEC_EXCHANGE_PKT", buffer, size, "|");
|
||||
if (securityFlags & SEC_TRANSPORT_REQ)
|
||||
winpr_str_append("SEC_TRANSPORT_REQ", buffer, size, "|");
|
||||
if (securityFlags & SEC_TRANSPORT_RSP)
|
||||
winpr_str_append("SEC_TRANSPORT_RSP", buffer, size, "|");
|
||||
if (securityFlags & SEC_ENCRYPT)
|
||||
winpr_str_append("SEC_ENCRYPT", buffer, size, "|");
|
||||
if (securityFlags & SEC_RESET_SEQNO)
|
||||
winpr_str_append("SEC_RESET_SEQNO", buffer, size, "|");
|
||||
if (securityFlags & SEC_IGNORE_SEQNO)
|
||||
winpr_str_append("SEC_IGNORE_SEQNO", buffer, size, "|");
|
||||
if (securityFlags & SEC_INFO_PKT)
|
||||
winpr_str_append("SEC_INFO_PKT", buffer, size, "|");
|
||||
if (securityFlags & SEC_LICENSE_PKT)
|
||||
winpr_str_append("SEC_LICENSE_PKT", buffer, size, "|");
|
||||
if (securityFlags & SEC_LICENSE_ENCRYPT_CS)
|
||||
winpr_str_append("SEC_LICENSE_ENCRYPT_CS", buffer, size, "|");
|
||||
if (securityFlags & SEC_LICENSE_ENCRYPT_SC)
|
||||
winpr_str_append("SEC_LICENSE_ENCRYPT_SC", buffer, size, "|");
|
||||
if (securityFlags & SEC_REDIRECTION_PKT)
|
||||
winpr_str_append("SEC_REDIRECTION_PKT", buffer, size, "|");
|
||||
if (securityFlags & SEC_SECURE_CHECKSUM)
|
||||
winpr_str_append("SEC_SECURE_CHECKSUM", buffer, size, "|");
|
||||
if (securityFlags & SEC_AUTODETECT_REQ)
|
||||
winpr_str_append("SEC_AUTODETECT_REQ", buffer, size, "|");
|
||||
if (securityFlags & SEC_AUTODETECT_RSP)
|
||||
winpr_str_append("SEC_AUTODETECT_RSP", buffer, size, "|");
|
||||
if (securityFlags & SEC_HEARTBEAT)
|
||||
winpr_str_append("SEC_HEARTBEAT", buffer, size, "|");
|
||||
if (securityFlags & SEC_FLAGSHI_VALID)
|
||||
winpr_str_append("SEC_FLAGSHI_VALID", buffer, size, "|");
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
@ -291,4 +291,6 @@ BOOL rdp_reset_rc4_encrypt_keys(rdpRdp* rdp);
|
||||
void rdp_free_rc4_decrypt_keys(rdpRdp* rdp);
|
||||
BOOL rdp_reset_rc4_decrypt_keys(rdpRdp* rdp);
|
||||
|
||||
const char* rdp_security_flag_string(UINT32 securityFlags, char* buffer, size_t size);
|
||||
|
||||
#endif /* FREERDP_LIB_CORE_RDP_H */
|
||||
|
Loading…
Reference in New Issue
Block a user