Skip to content

Commit 96caa94

Browse files
authored
Merge pull request #6 from dspace-group/fix/tlssecret
Fix for incorrectly labelled disclosure packets
2 parents f3673f4 + f212c4e commit 96caa94

9 files changed

Lines changed: 339 additions & 191 deletions

File tree

Installer/InstallerScript.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// DO NOT CHANGE VERSION HERE! Run update_version.bat
2-
#define AppVer "1.2.0"
2+
#define AppVer "1.3.0"
33
#define AppId "dsV2Gshark"
44

55
[Setup]

OSSAcknowledgements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ cbExiGen
141141

142142
The license text of the 'Apache License Version 2.0' can be found in APPENDIX A.
143143

144-
Wireshark 4.2.3
144+
Wireshark 4.2.4
145145
Copyright:
146146
Copyright 1998-2024 Gerald Combs <gerald@wireshark.org> and contributors
147147
Repository: https://gitlab.com/wireshark/wireshark

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The plugin processes a TLS master secret disclosure packet after handshake to de
3232
The disclosure message is a UDP packet within the source port range 49152-65535 (see Wireshark protocol settings) containing the ASCII string `CLIENT_RANDOM <32-byte client random> <48-byte master secret>` as payload data. This disclosure message has to be sent from one of the communication partners in a testing environment.
3333
For TLS 1.3 decryption you have to provide different secrets: `CLIENT_HANDSHAKE_TRAFFIC_SECRET`, `SERVER_HANDSHAKE_TRAFFIC_SECRET`, `EXPORTER_SECRET`, `CLIENT_TRAFFIC_SECRET_<number>`, `SERVER_TRAFFIC_SECRET_<number>`. You can send one UDP packet for each secret or combine the secrets in one UDP packet (separated by line breaks).
3434

35+
3536
### Wireshark I/O Graph
3637
This optional feature updates the Wireshark I/O Graph preferences to display a V2G session. The graph can be accessed via 'Statistics' -> 'I/O Graphs' (shortcut: Alt + S + I).
3738
The graph displays the data in 1 second intervals. This can be changed using the drop down menu at the bottom.
@@ -57,10 +58,11 @@ Click on a packet in the graph to inspect it in the Wireshark main window. Press
5758

5859
## Limitations
5960
- ISO 15118-20 is not fully supported yet
60-
- some BPT messages are not fully decoded
61+
- please let us know if you encounter incorrectly decoded packets
6162
- Linux
6263
- no installer
6364
- filter buttons and color filters must be added manually
65+
- I/O graph must be configured manually
6466

6567
## Support
6668
- If you encounter any problems, feel free to open an issue or contact us at support@dSPACE.de
@@ -69,7 +71,7 @@ Click on a packet in the graph to inspect it in the Wireshark main window. Press
6971
## Further notes
7072
- When sniffing V2G communication, lost packets may occur, which cause corrupted TCP/TLS sessions. In that case, it may help to activate the option to ignore Message Authentication Code (MAC) check failures in the Wireshark TLS protocol settings.
7173
This option can be found under Wireshark Preferences - Protocols - TLS
72-
- This plugin was built and tested with Wireshark 4.2.3
74+
- This plugin was built and tested with Wireshark 4.2.4
7375
- The EXI decoding is based on [cbExiGen](https://github.com/EVerest/cbexigen)
7476

7577

V2G_Libraries/CertificateInfos/main.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include <windows.h>
22

3-
#define VER_FILEVERSION 1,2,0,0
4-
#define VER_FILEVERSION_STR "1.2.0.0\0"
3+
#define VER_FILEVERSION 1,3,0,0
4+
#define VER_FILEVERSION_STR "1.3.0.0\0"
55
#define VER_COMPANYNAME_STR "dSPACE GmbH"
66
#define VER_PRODUCTNAME_STR "V2gCertificateInfos"
7-
#define VER_PRODUCTVERSION 1,2,0,0
8-
#define VER_PRODUCTVERSION_STR "1.2.0.0\0"
7+
#define VER_PRODUCTVERSION 1,3,0,0
8+
#define VER_PRODUCTVERSION_STR "1.3.0.0\0"
99

1010
VS_VERSION_INFO VERSIONINFO
1111
FILEVERSION VER_FILEVERSION

V2G_Libraries/V2GDecoder/main.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include <windows.h>
22

3-
#define VER_FILEVERSION 1,2,0,0
4-
#define VER_FILEVERSION_STR "1.2.0.0\0"
3+
#define VER_FILEVERSION 1,3,0,0
4+
#define VER_FILEVERSION_STR "1.3.0.0\0"
55
#define VER_COMPANYNAME_STR "dSPACE GmbH"
66
#define VER_PRODUCTNAME_STR "V2gDecoder"
7-
#define VER_PRODUCTVERSION 1,2,0,0
8-
#define VER_PRODUCTVERSION_STR "1.2.0.0\0"
7+
#define VER_PRODUCTVERSION 1,3,0,0
8+
#define VER_PRODUCTVERSION_STR "1.3.0.0\0"
99

1010
VS_VERSION_INFO VERSIONINFO
1111
FILEVERSION VER_FILEVERSION

Wireshark/plugins/v2gmsg.lua

Lines changed: 154 additions & 53 deletions
Large diffs are not rendered by default.

Wireshark/plugins/v2gsdp.lua

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,111 +5,109 @@
55
-- See license file (dsV2Gshark_LICENSE.txt)
66
--
77

8-
p_sdpreq = Proto("v2gsdp-req","V2G SECC Discovery Protocol Request")
9-
p_sdpres = Proto("v2gsdp-res","V2G SECC Discovery Protocol Response")
8+
p_sdpreq = Proto("v2gsdp-req", "V2G SECC Discovery Protocol Request")
9+
p_sdpres = Proto("v2gsdp-res", "V2G SECC Discovery Protocol Response")
1010
local p_v2gsdp_info = {
1111
version = DS_V2GSHARK_VERSION,
12-
author = "dSPACE GmbH",
12+
author = "dSPACE GmbH"
1313
}
1414
set_plugin_info(p_v2gsdp_info)
1515

16-
1716
-- V2G SDP Request
18-
local f_req_sec = ProtoField.uint8("v2gsdp-req.security","Security",base.HEX)
19-
local f_req_tp = ProtoField.uint8("v2gsdp-req.transportprotocol","Transport Protocol",base.HEX)
17+
local f_req_sec = ProtoField.uint8("v2gsdp-req.security", "Security", base.HEX)
18+
local f_req_tp = ProtoField.uint8("v2gsdp-req.transportprotocol", "Transport Protocol", base.HEX)
2019
local f_req_emsp_ids = ProtoField.string("v2gsdp-req.emsp", "EMSP IDs")
2120

2221
local WITH_TLS = 0
2322
local NO_TLS = 16
2423

2524
local sec_types = {
26-
[WITH_TLS] = "Secured with TLS", -- 0x00
27-
[NO_TLS] = "No transport layer security", -- 0x10
25+
[WITH_TLS] = "Secured with TLS", -- 0x00
26+
[NO_TLS] = "No transport layer security" -- 0x10
2827
}
2928

30-
p_sdpreq.fields = {f_req_sec,f_req_tp,f_req_emsp_ids}
29+
p_sdpreq.fields = {f_req_sec, f_req_tp, f_req_emsp_ids}
3130

3231
-- SDP Request dissection function
33-
function p_sdpreq.dissector(buf,pinfo,root)
32+
function p_sdpreq.dissector(buf, pinfo, root)
3433
pinfo.cols.protocol = "V2GMSG (SDP)"
3534

3635
-- create subtree
37-
subtree = root:add(p_sdpreq,buf(0))
36+
subtree = root:add(p_sdpreq, buf(0))
3837

3938
-- add protocol fields to subtree
4039

4140
local emsp = pinfo.private["SDP_ESMP"]
4241
if emsp ~= nil and emsp == true then
42+
-- else: emsp list is empty
4343
-- Note: the SDP_RES_EMSP misses the fields 'Security' and 'Transport Protocol',
4444
-- since EMPS is only useful with PnC (TCP + TLS)
4545
if buf:len() > 0 then
46-
subtree:add(f_req_emsp_ids, buf(0))
46+
subtree:add(f_req_emsp_ids, buf(0))
4747
end
48-
-- else: emsp list is empty
4948
else
5049
-- Security
51-
local sec_num = buf(0,1):uint()
52-
local sec = subtree:add(f_req_sec,buf(0,1))
50+
local sec_num = buf(0, 1):uint()
51+
local sec = subtree:add(f_req_sec, buf(0, 1))
5352
if sec_types[sec_num] ~= nil then
54-
sec:append_text(" (" .. sec_types[sec_num] ..")")
53+
sec:append_text(" (" .. sec_types[sec_num] .. ")")
5554
-- Concatenate the info of v2g
5655
pinfo.cols.info = tostring(pinfo.cols.info) .. ", " .. sec_types[sec_num]
5756
end
5857

5958
-- Transport Protocol
60-
local tp = subtree:add(f_req_tp,buf(1,1))
61-
if buf(1,1):uint() == 0 then
59+
local tp = subtree:add(f_req_tp, buf(1, 1))
60+
if buf(1, 1):uint() == 0 then
6261
tp:append_text(" (TCP)")
6362
end
6463
end
6564
end
6665

6766
-- V2G SDP Response
68-
local f_res_ipv6 = ProtoField.ipv6("v2gsdp-res.ipv6","SECC IP Address")
69-
local f_res_port = ProtoField.uint16("v2gsdp-res.port","SECC Port")
70-
local f_res_sec = ProtoField.uint8("v2gsdp-res.security","Security",base.HEX)
71-
local f_res_tp = ProtoField.uint8("v2gsdp-res.transportprotocol","Transport Protocol",base.HEX)
67+
local f_res_ipv6 = ProtoField.ipv6("v2gsdp-res.ipv6", "SECC IP Address")
68+
local f_res_port = ProtoField.uint16("v2gsdp-res.port", "SECC Port")
69+
local f_res_sec = ProtoField.uint8("v2gsdp-res.security", "Security", base.HEX)
70+
local f_res_tp = ProtoField.uint8("v2gsdp-res.transportprotocol", "Transport Protocol", base.HEX)
7271
local f_res_emsp_ids = ProtoField.string("v2gsdp-res.emsp", "EMSP IDs")
7372

74-
p_sdpres.fields = {f_res_ipv6,f_res_port,f_res_sec,f_res_tp,f_res_emsp_ids}
73+
p_sdpres.fields = {f_res_ipv6, f_res_port, f_res_sec, f_res_tp, f_res_emsp_ids}
7574

7675
-- SDP Response dissection function
77-
function p_sdpres.dissector(buf,pinfo,root)
76+
function p_sdpres.dissector(buf, pinfo, root)
7877
pinfo.cols.protocol = "V2GMSG (SDP)"
7978

8079
-- create subtree
81-
local subtree = root:add(p_sdpres,buf(0))
80+
local subtree = root:add(p_sdpres, buf(0))
8281

8382
-- add protocol fields to subtree
8483
-- SECC IPv6
85-
subtree:add(f_res_ipv6,buf(0,16))
84+
subtree:add(f_res_ipv6, buf(0, 16))
8685
-- SECC Port
87-
subtree:add(f_res_port,buf(16,2))
88-
86+
subtree:add(f_res_port, buf(16, 2))
8987

9088
local emsp = pinfo.private["SDP_ESMP"]
9189
if emsp ~= nil and emsp == true and buf:len() > 18 then
9290
-- Note: the SDP_RES_EMSP misses the fields 'Security' and 'Transport Protocol',
9391
-- since EMPS is only useful with PnC (TCP + TLS)
94-
subtree:add(f_req_emsp_ids, buf(18))
92+
subtree:add(f_req_emsp_ids, buf(18))
9593
else
9694
-- Security
97-
local sec_num = buf(18,1):uint()
98-
local sec = subtree:add(f_res_sec,buf(18,1))
95+
local sec_num = buf(18, 1):uint()
96+
local sec = subtree:add(f_res_sec, buf(18, 1))
9997
if sec_types[sec_num] ~= nil then
100-
sec:append_text(" (" .. sec_types[sec_num] ..")")
98+
sec:append_text(" (" .. sec_types[sec_num] .. ")")
10199
-- Concatenate the info of v2g
102100
pinfo.cols.info = tostring(pinfo.cols.info) .. ", " .. sec_types[sec_num]
103101
end
104102

105103
-- Transport Protocol
106-
local tp = subtree:add(f_res_tp,buf(19,1))
107-
if buf(19,1):uint() == 0 then
104+
local tp = subtree:add(f_res_tp, buf(19, 1))
105+
if buf(19, 1):uint() == 0 then
108106
tp:append_text(" (TCP)")
109107
if sec_num == NO_TLS then
110-
DissectorTable.get("tcp.port"):add(buf(16,2):uint(),Dissector.get("v2gtp"))
108+
DissectorTable.get("tcp.port"):add(buf(16, 2):uint(), Dissector.get("v2gtp"))
111109
elseif sec_num == WITH_TLS then
112-
DissectorTable.get("tls.port"):add(buf(16,2):uint(),Dissector.get("v2gtp"))
110+
DissectorTable.get("tls.port"):add(buf(16, 2):uint(), Dissector.get("v2gtp"))
113111
end
114112
end
115113
end

0 commit comments

Comments
 (0)