diff options
author | Idan Freiberg <speidy@gmail.com> | 2017-01-16 07:26:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-16 07:26:51 +0200 |
commit | 19375dda7a12e955f053f32ea6a1d206a773010d (patch) | |
tree | fb7884710abaea8d0cc1463fbac3ec064e9ab376 /libxrdp | |
parent | 5fa636be89b11e038997a4177f411a819f1fc157 (diff) | |
parent | f29a98b2439ac391fc93b7b3aaced4dd2159bae2 (diff) | |
download | xrdp-proprietary-19375dda7a12e955f053f32ea6a1d206a773010d.tar.gz xrdp-proprietary-19375dda7a12e955f053f32ea6a1d206a773010d.zip |
Merge pull request #426 from metalefty/log-tls-version-and-cipher
TLS: log TLS version and cipher
Diffstat (limited to 'libxrdp')
-rw-r--r-- | libxrdp/xrdp_rdp.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c index 914b6277..ca82df70 100644 --- a/libxrdp/xrdp_rdp.c +++ b/libxrdp/xrdp_rdp.c @@ -816,6 +816,9 @@ xrdp_rdp_send_data_update_sync(struct xrdp_rdp *self) int APP_CC xrdp_rdp_incoming(struct xrdp_rdp *self) { + struct xrdp_iso *iso; + iso = self->sec_layer->mcs_layer->iso_layer; + DEBUG(("in xrdp_rdp_incoming")); if (xrdp_sec_incoming(self->sec_layer) != 0) @@ -825,12 +828,32 @@ xrdp_rdp_incoming(struct xrdp_rdp *self) self->mcs_channel = self->sec_layer->mcs_layer->userid + MCS_USERCHANNEL_BASE; DEBUG(("out xrdp_rdp_incoming mcs channel %d", self->mcs_channel)); - g_strncpy(self->client_info.client_addr, - self->sec_layer->mcs_layer->iso_layer->trans->addr, + g_strncpy(self->client_info.client_addr, iso->trans->addr, sizeof(self->client_info.client_addr) - 1); - g_strncpy(self->client_info.client_port, - self->sec_layer->mcs_layer->iso_layer->trans->port, + g_strncpy(self->client_info.client_port, iso->trans->port, sizeof(self->client_info.client_port) - 1); + + /* log TLS version and cipher when TLS is used */ + /* TODO: client_addr, client_port is empty when IPv6 enabled */ + + if (iso->selectedProtocol > PROTOCOL_RDP) + { + log_message(LOG_LEVEL_INFO, + "TLS connection established from %s port %s: %s with cipher %s", + self->client_info.client_addr, + self->client_info.client_port, + iso->trans->ssl_protocol, + iso->trans->cipher_name); + } + else + { + log_message(LOG_LEVEL_INFO, + "Non-TLS connection established from %s port %s: " + "encrypted with standard RDP security", + self->client_info.client_addr, + self->client_info.client_port); + } + return 0; } |