aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/ssl.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2018-05-28 18:18:19 +0200
committerLuca Deri <deri@ntop.org>2018-05-28 18:18:19 +0200
commit326a2fb7ed8afba6aa42dda65c4c135d0cbae2ff (patch)
tree66a7d6608f902d5d58b1ad7428be593d321bcc92 /src/lib/protocols/ssl.c
parenteef175e57957f89b73a018b0626767b0e06f89ff (diff)
Fix for https://github.com/ntop/nDPI/issues/572
Diffstat (limited to 'src/lib/protocols/ssl.c')
-rw-r--r--src/lib/protocols/ssl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/protocols/ssl.c b/src/lib/protocols/ssl.c
index 7719eded9..5c65b83c1 100644
--- a/src/lib/protocols/ssl.c
+++ b/src/lib/protocols/ssl.c
@@ -42,8 +42,8 @@ static u_int32_t ndpi_ssl_refine_master_protocol(struct ndpi_detection_module_st
{
struct ndpi_packet_struct *packet = &flow->packet;
- if((flow->protos.ssl.client_certificate[0] != '\0')
- || (flow->protos.ssl.server_certificate[0] != '\0')
+ if((flow->protos.stun_ssl.ssl.client_certificate[0] != '\0')
+ || (flow->protos.stun_ssl.ssl.server_certificate[0] != '\0')
|| (flow->host_server_name[0] != '\0'))
protocol = NDPI_PROTOCOL_SSL;
else
@@ -227,8 +227,8 @@ int getSSLcertificate(struct ndpi_detection_module_struct *ndpi_struct,
if(num_dots >= 2) {
if(!ndpi_struct->disable_metadata_export) {
stripCertificateTrailer(buffer, buffer_len);
- snprintf(flow->protos.ssl.server_certificate,
- sizeof(flow->protos.ssl.server_certificate), "%s", buffer);
+ snprintf(flow->protos.stun_ssl.ssl.server_certificate,
+ sizeof(flow->protos.stun_ssl.ssl.server_certificate), "%s", buffer);
}
return(1 /* Server Certificate */);
}
@@ -292,8 +292,8 @@ int getSSLcertificate(struct ndpi_detection_module_struct *ndpi_struct,
stripCertificateTrailer(buffer, buffer_len);
if(!ndpi_struct->disable_metadata_export) {
- snprintf(flow->protos.ssl.client_certificate,
- sizeof(flow->protos.ssl.client_certificate), "%s", buffer);
+ snprintf(flow->protos.stun_ssl.ssl.client_certificate,
+ sizeof(flow->protos.stun_ssl.ssl.client_certificate), "%s", buffer);
}
/* We're happy now */
@@ -326,7 +326,7 @@ int sslTryAndRetrieveServerCertificate(struct ndpi_detection_module_struct *ndpi
packet->ssl_certificate_num_checks++;
if (rc > 0) {
packet->ssl_certificate_detected++;
- if (flow->protos.ssl.server_certificate[0] != '\0')
+ if (flow->protos.stun_ssl.ssl.server_certificate[0] != '\0')
/* 0 means we're done processing extra packets (since we found what we wanted) */
return 0;
}
@@ -379,7 +379,7 @@ int sslDetectProtocolFromCertificate(struct ndpi_detection_module_struct *ndpi_s
/* If we've detected the subprotocol from client certificate but haven't had a chance
* to see the server certificate yet, set up extra packet processing to wait
* a few more packets. */
- if((flow->protos.ssl.client_certificate[0] != '\0') && (flow->protos.ssl.server_certificate[0] == '\0')) {
+ if((flow->protos.stun_ssl.ssl.client_certificate[0] != '\0') && (flow->protos.stun_ssl.ssl.server_certificate[0] == '\0')) {
sslInitExtraPacketProcessing(0, flow);
}
ndpi_set_detected_protocol(ndpi_struct, flow, subproto,
@@ -396,8 +396,8 @@ int sslDetectProtocolFromCertificate(struct ndpi_detection_module_struct *ndpi_s
&& flow->l4.tcp.seen_syn
&& flow->l4.tcp.seen_syn_ack
&& flow->l4.tcp.seen_ack /* We have seen the 3-way handshake */)
- || (flow->protos.ssl.server_certificate[0] != '\0')
- /* || (flow->protos.ssl.client_certificate[0] != '\0') */
+ || (flow->protos.stun_ssl.ssl.server_certificate[0] != '\0')
+ /* || (flow->protos.stun_ssl.ssl.client_certificate[0] != '\0') */
) {
ndpi_int_ssl_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SSL);
}