diff options
author | gal <gal@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-01-13 14:10:02 +0000 |
---|---|---|
committer | gal <gal@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-01-13 14:10:02 +0000 |
commit | 47ef80a9f482f6209be23a2cdd0b25a0cd7501b4 (patch) | |
tree | ad23aaecad308571377122d5f5712eac6b172ae7 /epan/dissectors/packet-ssl-utils.c | |
parent | 68da026afb28d25b266e17b033e659d6828b06ef (diff) |
Support for keylists for protocols that use start_tls - where SSL is negotiated at some point during a conversation and cannot be assumed on the basis of the port number alone.
Also dissection of Distinguished Names.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24075 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-ssl-utils.c')
-rw-r--r-- | epan/dissectors/packet-ssl-utils.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c index d25a694d98..3bf475a7ef 100644 --- a/epan/dissectors/packet-ssl-utils.c +++ b/epan/dissectors/packet-ssl-utils.c @@ -2371,10 +2371,12 @@ ssl_association_add(GTree* associations, dissector_handle_t handle, guint port, if(!assoc->handle){ fprintf(stderr, "association_add() could not find handle for protocol:%s\n",protocol); } else { - if(tcp) - dissector_add("tcp.port", port, handle); - else - dissector_add("udp.port", port, handle); + if(port) { + if(tcp) + dissector_add("tcp.port", port, handle); + else + dissector_add("udp.port", port, handle); + } g_tree_insert(associations, assoc, assoc); } } @@ -2638,8 +2640,12 @@ ssl_parse_key_list(const gchar * keys_list, GHashTable *key_hash, GTree* associa } else { sscanf(addr, "%hhu.%hhu.%hhu.%hhu", &ip[0], &ip[1], &ip[2], &ip[3]); } - - service->port = atoi(port); + + if(!strcmp("start_tls", port)) { + service->port = 0; + } else { + service->port = atoi(port); + } ssl_debug_printf("ssl_init addr '%hhu.%hhu.%hhu.%hhu' port '%d' filename '%s' password(only for p12 file) '%s'\n", ip[0], ip[1], ip[2], ip[3], service->port, filename, cert_passwd); @@ -2676,7 +2682,7 @@ ssl_parse_key_list(const gchar * keys_list, GHashTable *key_hash, GTree* associa } g_hash_table_insert(key_hash, service, private_key); - ssl_association_add(associations, handle, atoi(port), protocol, tcp, TRUE); + ssl_association_add(associations, handle, service->port, protocol, tcp, TRUE); } while (end != NULL); free(tmp); |