diff options
author | Hannes Mezger <hannes.mezger@ascolab.com> | 2018-12-12 12:00:39 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-12-12 20:22:06 +0000 |
commit | 49c6f8e432fbd60240c9b3ce1b9391cadb5ecfd7 (patch) | |
tree | 40e8ee359b1593b425085d479ef6ca2572b94ce8 /plugins/epan | |
parent | 9711abc9f5cc13c82c5f04b11b8a711829f8825c (diff) |
opcua: add support for new reverse hello message
The reverse hello message type was added in OPC UA specification 1.04.
Change-Id: I00095e35049b8f38ab183ded1b96af51d788d986
Reviewed-on: https://code.wireshark.org/review/31018
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'plugins/epan')
-rw-r--r-- | plugins/epan/opcua/opcua.c | 7 | ||||
-rw-r--r-- | plugins/epan/opcua/opcua_transport_layer.c | 12 | ||||
-rw-r--r-- | plugins/epan/opcua/opcua_transport_layer.h | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/plugins/epan/opcua/opcua.c b/plugins/epan/opcua/opcua.c index 4ca68a9e83..cd71f72eb8 100644 --- a/plugins/epan/opcua/opcua.c +++ b/plugins/epan/opcua/opcua.c @@ -95,6 +95,7 @@ enum MessageType MSG_HELLO = 0, MSG_ACKNOWLEDGE, MSG_ERROR, + MSG_REVERSEHELLO, MSG_MESSAGE, MSG_OPENSECURECHANNEL, MSG_CLOSESECURECHANNEL, @@ -107,6 +108,7 @@ static const char* g_szMessageTypes[] = "Hello message", "Acknowledge message", "Error message", + "Reverse Hello message", "UA Secure Conversation Message", "OpenSecureChannel message", "CloseSecureChannel message", @@ -165,6 +167,11 @@ static int dissect_opcua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree * msgtype = MSG_ERROR; pfctParse = parseError; } + else if (tvb_memeql(tvb, 0, "RHE", 3) == 0) + { + msgtype = MSG_REVERSEHELLO; + pfctParse = parseReverseHello; + } else if (tvb_memeql(tvb, 0, "MSG", 3) == 0) { msgtype = MSG_MESSAGE; diff --git a/plugins/epan/opcua/opcua_transport_layer.c b/plugins/epan/opcua/opcua_transport_layer.c index 0d1cd98dd5..a352782de7 100644 --- a/plugins/epan/opcua/opcua_transport_layer.c +++ b/plugins/epan/opcua/opcua_transport_layer.c @@ -33,6 +33,7 @@ static int hf_opcua_transport_sbs = -1; static int hf_opcua_transport_mms = -1; static int hf_opcua_transport_mcc = -1; static int hf_opcua_transport_endpoint = -1; +static int hf_opcua_transport_suri = -1; static int hf_opcua_transport_error = -1; static int hf_opcua_transport_reason = -1; static int hf_opcua_transport_spu = -1; @@ -61,6 +62,7 @@ void registerTransportLayerTypes(int proto) {&hf_opcua_transport_mms, {"MaxMessageSize", "opcua.transport.mms", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, {&hf_opcua_transport_mcc, {"MaxChunkCount", "opcua.transport.mcc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}}, {&hf_opcua_transport_endpoint, {"EndPointUrl", "opcua.transport.endpoint", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}}, + {&hf_opcua_transport_suri, {"ServerUri", "opcua.transport.suri", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_opcua_transport_error, {"Error", "opcua.transport.error", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}}, {&hf_opcua_transport_reason, {"Reason", "opcua.transport.reason", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}}, {&hf_opcua_transport_spu, {"SecurityPolicyUri", "opcua.security.spu", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}}, @@ -111,6 +113,16 @@ int parseError(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffse return -1; } +int parseReverseHello(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset) +{ + proto_tree_add_item(tree, hf_opcua_transport_type, tvb, *pOffset, 3, ENC_ASCII|ENC_NA); *pOffset+=3; + proto_tree_add_item(tree, hf_opcua_transport_chunk, tvb, *pOffset, 1, ENC_ASCII|ENC_NA); *pOffset+=1; + proto_tree_add_item(tree, hf_opcua_transport_size, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4; + parseString(tree, tvb, pinfo, pOffset, hf_opcua_transport_suri); + parseString(tree, tvb, pinfo, pOffset, hf_opcua_transport_endpoint); + return -1; +} + int parseMessage(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset) { proto_tree_add_item(tree, hf_opcua_transport_type, tvb, *pOffset, 3, ENC_ASCII|ENC_NA); *pOffset+=3; diff --git a/plugins/epan/opcua/opcua_transport_layer.h b/plugins/epan/opcua/opcua_transport_layer.h index 757f87f013..4e63aa5a0f 100644 --- a/plugins/epan/opcua/opcua_transport_layer.h +++ b/plugins/epan/opcua/opcua_transport_layer.h @@ -18,6 +18,7 @@ int parseHello(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset); int parseAcknowledge(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset); int parseError(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset); +int parseReverseHello(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset); int parseMessage(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset); int parseAbort(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset); int parseService(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset); |