From b9005b1724667036d546e97aa71a5f9bd33e0524 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sat, 2 Jun 2012 14:41:34 +0200 Subject: [PATCH] core/probe.c: Fix TLS probe when handshake version != SSL version GnuTLS sends a handshake with SSL 3.0 (0x0300) in the outer packet, but mentions TLS 1.2 (0x0303) in the Client Hello. There's no real need for uhub to validate these fields, as OpenSSL should do that itself already. Just use the version mentioned in Client Hello for logging output. --- src/core/probe.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/probe.c b/src/core/probe.c index 4ab8858..293cf45 100644 --- a/src/core/probe.c +++ b/src/core/probe.c @@ -76,12 +76,11 @@ static void probe_net_event(struct net_connection* con, int events, void *arg) probe_recvbuf[0] == 22 && probe_recvbuf[1] == 3 && /* protocol major version */ probe_recvbuf[5] == 1 && /* message type */ - probe_recvbuf[9] == probe_recvbuf[1] && - probe_recvbuf[10] == probe_recvbuf[2]) + probe_recvbuf[9] == probe_recvbuf[1]) { if (probe->hub->config->tls_enable) { - LOG_TRACE("Probed TLS %d.%d connection", (int) probe_recvbuf[1], (int) probe_recvbuf[2]); + LOG_TRACE("Probed TLS %d.%d connection", (int) probe_recvbuf[9], (int) probe_recvbuf[10]); if (user_create(probe->hub, probe->connection, &probe->addr)) { probe->connection = 0; @@ -90,7 +89,7 @@ static void probe_net_event(struct net_connection* con, int events, void *arg) } else { - LOG_TRACE("Probed TLS %d.%d connection. TLS disabled in hub.", (int) probe_recvbuf[1], (int) probe_recvbuf[2]); + LOG_TRACE("Probed TLS %d.%d connection. TLS disabled in hub.", (int) probe_recvbuf[9], (int) probe_recvbuf[10]); } } else