meshcoredecoder 0.2.2__py3-none-any.whl → 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cli.py +2 -2
- index.py +1 -1
- meshcoredecoder/__init__.py +1 -1
- meshcoredecoder/crypto/channel_crypto.py +52 -81
- meshcoredecoder/decoder/packet_decoder.py +16 -8
- meshcoredecoder/decoder/payload_decoders/__init__.py +3 -1
- meshcoredecoder/decoder/payload_decoders/ack.py +1 -1
- meshcoredecoder/decoder/payload_decoders/advert.py +1 -1
- meshcoredecoder/decoder/payload_decoders/anon_request.py +1 -1
- meshcoredecoder/decoder/payload_decoders/control.py +206 -0
- meshcoredecoder/decoder/payload_decoders/path.py +2 -1
- meshcoredecoder/decoder/payload_decoders/request.py +7 -1
- meshcoredecoder/decoder/payload_decoders/response.py +94 -24
- meshcoredecoder/decoder/payload_decoders/text_message.py +5 -1
- meshcoredecoder/types/enums.py +26 -18
- meshcoredecoder/types/payloads.py +32 -3
- meshcoredecoder/utils/enum_names.py +2 -0
- {meshcoredecoder-0.2.2.dist-info → meshcoredecoder-0.3.0.dist-info}/METADATA +78 -10
- meshcoredecoder-0.3.0.dist-info/RECORD +36 -0
- {meshcoredecoder-0.2.2.dist-info → meshcoredecoder-0.3.0.dist-info}/WHEEL +1 -1
- meshcoredecoder-0.2.2.dist-info/RECORD +0 -35
- {meshcoredecoder-0.2.2.dist-info → meshcoredecoder-0.3.0.dist-info}/entry_points.txt +0 -0
- {meshcoredecoder-0.2.2.dist-info → meshcoredecoder-0.3.0.dist-info}/licenses/LICENSE +0 -0
- {meshcoredecoder-0.2.2.dist-info → meshcoredecoder-0.3.0.dist-info}/top_level.txt +0 -0
cli.py
CHANGED
|
@@ -11,7 +11,7 @@ import sys
|
|
|
11
11
|
import json
|
|
12
12
|
import asyncio
|
|
13
13
|
from typing import List, Optional
|
|
14
|
-
from meshcoredecoder import MeshCoreDecoder
|
|
14
|
+
from meshcoredecoder import MeshCoreDecoder, __version__
|
|
15
15
|
from meshcoredecoder.crypto import MeshCoreKeyStore
|
|
16
16
|
from meshcoredecoder.types.crypto import DecryptionOptions
|
|
17
17
|
from meshcoredecoder.utils.enum_names import get_route_type_name, get_payload_type_name, get_device_role_name
|
|
@@ -877,7 +877,7 @@ def main():
|
|
|
877
877
|
formatter_class=argparse.RawDescriptionHelpFormatter
|
|
878
878
|
)
|
|
879
879
|
|
|
880
|
-
parser.add_argument('--version', action='version', version='
|
|
880
|
+
parser.add_argument('--version', action='version', version=f'%(prog)s {__version__}')
|
|
881
881
|
|
|
882
882
|
subparsers = parser.add_subparsers(dest='command', help='Commands')
|
|
883
883
|
|
index.py
CHANGED
meshcoredecoder/__init__.py
CHANGED
|
@@ -1014,7 +1014,7 @@ class ChannelCrypto:
|
|
|
1014
1014
|
(decrypted_bytes[3] << 24)
|
|
1015
1015
|
)
|
|
1016
1016
|
|
|
1017
|
-
#
|
|
1017
|
+
# For anonrequest payloads, default to repeater/sensor login
|
|
1018
1018
|
# Room server: timestamp(4) + sync_timestamp(4) + password
|
|
1019
1019
|
# Repeater/Sensor: timestamp(4) + password
|
|
1020
1020
|
# Regular request: timestamp(4) + req_type(1) + req_data
|
|
@@ -1023,89 +1023,31 @@ class ChannelCrypto:
|
|
|
1023
1023
|
}
|
|
1024
1024
|
|
|
1025
1025
|
if len(decrypted_bytes) >= 8:
|
|
1026
|
-
#
|
|
1027
|
-
|
|
1028
|
-
decrypted_bytes[4] |
|
|
1029
|
-
(decrypted_bytes[5] << 8) |
|
|
1030
|
-
(decrypted_bytes[6] << 16) |
|
|
1031
|
-
(decrypted_bytes[7] << 24)
|
|
1032
|
-
)
|
|
1033
|
-
|
|
1034
|
-
# Check if bytes 4-7 look like a valid timestamp (reasonable Unix timestamp)
|
|
1035
|
-
# If sync_timestamp is 0 or very small, it might actually be the start of a password
|
|
1036
|
-
# Room server sync_timestamp should be a reasonable timestamp (e.g., > 1000000000)
|
|
1037
|
-
is_likely_sync_timestamp = (sync_timestamp > 1000000000)
|
|
1038
|
-
|
|
1039
|
-
if is_likely_sync_timestamp:
|
|
1040
|
-
# Room server login: timestamp(4) + sync_timestamp(4) + password
|
|
1041
|
-
result_data['sync_timestamp'] = sync_timestamp
|
|
1042
|
-
# Try to decode password (null-terminated string)
|
|
1043
|
-
password_bytes = decrypted_bytes[8:]
|
|
1044
|
-
try:
|
|
1045
|
-
password = password_bytes.decode('utf-8')
|
|
1046
|
-
null_index = password.find('\0')
|
|
1047
|
-
if null_index >= 0:
|
|
1048
|
-
password = password[:null_index]
|
|
1049
|
-
result_data['password'] = password
|
|
1050
|
-
result_data['type'] = 'room_server_login'
|
|
1051
|
-
except UnicodeDecodeError:
|
|
1052
|
-
# Might be regular request format
|
|
1053
|
-
if len(decrypted_bytes) >= 5:
|
|
1054
|
-
request_type = decrypted_bytes[4]
|
|
1055
|
-
request_data = decrypted_bytes[5:]
|
|
1056
|
-
result_data['request_type'] = request_type
|
|
1057
|
-
result_data['request_data'] = request_data
|
|
1058
|
-
result_data['type'] = 'request'
|
|
1059
|
-
else:
|
|
1060
|
-
# sync_timestamp is 0 or very small - could be repeater/sensor login OR regular request
|
|
1061
|
-
# Check if byte 4 is a valid request type first (0x01-0x06)
|
|
1062
|
-
if len(decrypted_bytes) >= 5:
|
|
1063
|
-
request_type_byte = decrypted_bytes[4]
|
|
1064
|
-
is_valid_request_type = (0x01 <= request_type_byte <= 0x06)
|
|
1065
|
-
|
|
1066
|
-
if is_valid_request_type:
|
|
1067
|
-
# Regular request: timestamp(4) + req_type(1) + req_data
|
|
1068
|
-
request_type = request_type_byte
|
|
1069
|
-
request_data = decrypted_bytes[5:]
|
|
1070
|
-
result_data['request_type'] = request_type
|
|
1071
|
-
result_data['request_data'] = request_data
|
|
1072
|
-
result_data['type'] = 'request'
|
|
1073
|
-
else:
|
|
1074
|
-
# Not a valid request type - likely repeater/sensor login
|
|
1075
|
-
# Repeater/Sensor login: timestamp(4) + password(null-terminated string)
|
|
1076
|
-
# Password starts at byte 4
|
|
1077
|
-
password_bytes = decrypted_bytes[4:]
|
|
1078
|
-
try:
|
|
1079
|
-
password = password_bytes.decode('utf-8')
|
|
1080
|
-
null_index = password.find('\0')
|
|
1081
|
-
if null_index >= 0:
|
|
1082
|
-
password = password[:null_index]
|
|
1083
|
-
result_data['password'] = password
|
|
1084
|
-
result_data['type'] = 'repeater_sensor_login'
|
|
1085
|
-
except UnicodeDecodeError:
|
|
1086
|
-
# If it's not valid UTF-8, treat as unknown
|
|
1087
|
-
result_data['raw'] = bytes_to_hex(decrypted_bytes[4:])
|
|
1088
|
-
result_data['type'] = 'unknown'
|
|
1089
|
-
else:
|
|
1090
|
-
# Too short - can't determine
|
|
1091
|
-
result_data['raw'] = bytes_to_hex(decrypted_bytes)
|
|
1092
|
-
result_data['type'] = 'unknown'
|
|
1093
|
-
elif len(decrypted_bytes) >= 5:
|
|
1094
|
-
# Could be regular request format or repeater/sensor login
|
|
1095
|
-
# Check if byte 4 is a valid request type (0x01-0x06)
|
|
1026
|
+
# Check if byte 4 is a valid request type first (0x01-0x06)
|
|
1027
|
+
# This takes priority over checking for sync_timestamp
|
|
1096
1028
|
request_type_byte = decrypted_bytes[4]
|
|
1097
1029
|
is_valid_request_type = (0x01 <= request_type_byte <= 0x06)
|
|
1098
1030
|
|
|
1099
1031
|
if is_valid_request_type:
|
|
1100
|
-
# Regular request
|
|
1032
|
+
# Regular request: timestamp(4) + req_type(1) + req_data
|
|
1101
1033
|
request_type = request_type_byte
|
|
1102
1034
|
request_data = decrypted_bytes[5:]
|
|
1103
1035
|
result_data['request_type'] = request_type
|
|
1104
1036
|
result_data['request_data'] = request_data
|
|
1105
1037
|
result_data['type'] = 'request'
|
|
1106
1038
|
else:
|
|
1039
|
+
# Not a valid request type - check if it could be room server or repeater/sensor login
|
|
1040
|
+
sync_timestamp = (
|
|
1041
|
+
decrypted_bytes[4] |
|
|
1042
|
+
(decrypted_bytes[5] << 8) |
|
|
1043
|
+
(decrypted_bytes[6] << 16) |
|
|
1044
|
+
(decrypted_bytes[7] << 24)
|
|
1045
|
+
)
|
|
1046
|
+
|
|
1047
|
+
# For anonrequest payloads, default to repeater/sensor login
|
|
1048
|
+
# AnonRequest logins are always repeater/sensor logins, not room server logins
|
|
1107
1049
|
# Repeater/Sensor login: timestamp(4) + password(null-terminated string)
|
|
1108
|
-
#
|
|
1050
|
+
# Password starts at byte 4
|
|
1109
1051
|
password_bytes = decrypted_bytes[4:]
|
|
1110
1052
|
try:
|
|
1111
1053
|
password = password_bytes.decode('utf-8')
|
|
@@ -1115,15 +1057,44 @@ class ChannelCrypto:
|
|
|
1115
1057
|
result_data['password'] = password
|
|
1116
1058
|
result_data['type'] = 'repeater_sensor_login'
|
|
1117
1059
|
except UnicodeDecodeError:
|
|
1118
|
-
# If it's not valid UTF-8,
|
|
1119
|
-
|
|
1120
|
-
result_data['
|
|
1121
|
-
result_data['request_data'] = decrypted_bytes[5:]
|
|
1122
|
-
result_data['type'] = 'request'
|
|
1060
|
+
# If it's not valid UTF-8, treat as unknown
|
|
1061
|
+
result_data['raw'] = bytes_to_hex(decrypted_bytes[4:])
|
|
1062
|
+
result_data['type'] = 'unknown'
|
|
1123
1063
|
else:
|
|
1124
|
-
#
|
|
1125
|
-
|
|
1126
|
-
|
|
1064
|
+
# Less than 8 bytes - check if byte 4 is a valid request type
|
|
1065
|
+
if len(decrypted_bytes) >= 5:
|
|
1066
|
+
request_type_byte = decrypted_bytes[4]
|
|
1067
|
+
is_valid_request_type = (0x01 <= request_type_byte <= 0x06)
|
|
1068
|
+
|
|
1069
|
+
if is_valid_request_type:
|
|
1070
|
+
# Regular request: timestamp(4) + req_type(1) + req_data
|
|
1071
|
+
request_type = request_type_byte
|
|
1072
|
+
request_data = decrypted_bytes[5:]
|
|
1073
|
+
result_data['request_type'] = request_type
|
|
1074
|
+
result_data['request_data'] = request_data
|
|
1075
|
+
result_data['type'] = 'request'
|
|
1076
|
+
else:
|
|
1077
|
+
# Not a valid request type - likely repeater/sensor login
|
|
1078
|
+
# Repeater/Sensor login: timestamp(4) + password(null-terminated string)
|
|
1079
|
+
# Byte 4 is the start of the password string
|
|
1080
|
+
password_bytes = decrypted_bytes[4:]
|
|
1081
|
+
try:
|
|
1082
|
+
password = password_bytes.decode('utf-8')
|
|
1083
|
+
null_index = password.find('\0')
|
|
1084
|
+
if null_index >= 0:
|
|
1085
|
+
password = password[:null_index]
|
|
1086
|
+
result_data['password'] = password
|
|
1087
|
+
result_data['type'] = 'repeater_sensor_login'
|
|
1088
|
+
except UnicodeDecodeError:
|
|
1089
|
+
# If it's not valid UTF-8, might still be a request with invalid type
|
|
1090
|
+
# or corrupted data - try as request anyway
|
|
1091
|
+
result_data['request_type'] = request_type_byte
|
|
1092
|
+
result_data['request_data'] = decrypted_bytes[5:] if len(decrypted_bytes) > 5 else b''
|
|
1093
|
+
result_data['type'] = 'request'
|
|
1094
|
+
else:
|
|
1095
|
+
# Too short - can't determine
|
|
1096
|
+
result_data['raw'] = bytes_to_hex(decrypted_bytes)
|
|
1097
|
+
result_data['type'] = 'unknown'
|
|
1127
1098
|
|
|
1128
1099
|
return DecryptionResult(
|
|
1129
1100
|
success=True,
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Copyright (c) 2025 Michael Hart: https://github.com/michaelhart/meshcore-decoder
|
|
3
3
|
MIT License
|
|
4
4
|
|
|
5
|
-
Main packet decoder - orchestrates all payload decoders
|
|
5
|
+
Main packet decoder - orchestrates all payload decoders.
|
|
6
|
+
Packet layout: docs/packet_format.md. Payload formats: docs/payloads.md.
|
|
6
7
|
"""
|
|
7
8
|
|
|
8
9
|
from typing import Optional, Dict, Any, List, Tuple
|
|
@@ -23,6 +24,7 @@ from .payload_decoders.request import RequestPayloadDecoder
|
|
|
23
24
|
from .payload_decoders.response import ResponsePayloadDecoder
|
|
24
25
|
from .payload_decoders.anon_request import AnonRequestPayloadDecoder
|
|
25
26
|
from .payload_decoders.text_message import TextMessagePayloadDecoder
|
|
27
|
+
from .payload_decoders.control import ControlPayloadDecoder
|
|
26
28
|
|
|
27
29
|
|
|
28
30
|
class MeshCorePacketDecoder:
|
|
@@ -139,16 +141,14 @@ class MeshCorePacketDecoder:
|
|
|
139
141
|
transport_codes = (code1, code2)
|
|
140
142
|
|
|
141
143
|
if include_structure:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
(bytes_data[offset + 2] << 16) |
|
|
145
|
-
(bytes_data[offset + 3] << 24))
|
|
144
|
+
transport_code_1 = bytes_data[offset] | (bytes_data[offset + 1] << 8)
|
|
145
|
+
transport_code_2 = bytes_data[offset + 2] | (bytes_data[offset + 3] << 8)
|
|
146
146
|
segments.append(PacketSegment(
|
|
147
|
-
name='Transport
|
|
148
|
-
description='
|
|
147
|
+
name='Transport Codes',
|
|
148
|
+
description='2× uint16: transport_code_1 (region scope), transport_code_2 (reserved). See packet_format.md.',
|
|
149
149
|
start_byte=offset,
|
|
150
150
|
end_byte=offset + 3,
|
|
151
|
-
value=f'0x{
|
|
151
|
+
value=f'0x{transport_code_1:04x} 0x{transport_code_2:04x}'
|
|
152
152
|
))
|
|
153
153
|
offset += 4
|
|
154
154
|
|
|
@@ -296,6 +296,14 @@ class MeshCorePacketDecoder:
|
|
|
296
296
|
decoder_options['include_segments'] = include_structure
|
|
297
297
|
decoder_options['segment_offset'] = 0
|
|
298
298
|
decoded_payload = TextMessagePayloadDecoder.decode(payload_bytes, options if options else decoder_options)
|
|
299
|
+
elif payload_type == PayloadType.Control:
|
|
300
|
+
result = ControlPayloadDecoder.decode(payload_bytes, {'include_segments': include_structure, 'segment_offset': 0})
|
|
301
|
+
decoded_payload = result
|
|
302
|
+
if result and hasattr(result, 'segments') and result.segments:
|
|
303
|
+
payload_segments.extend(result.segments)
|
|
304
|
+
elif payload_type in (PayloadType.Reserved0C, PayloadType.Reserved0D, PayloadType.Reserved0E):
|
|
305
|
+
# Reserved payload types: show raw only
|
|
306
|
+
decoded_payload = None
|
|
299
307
|
|
|
300
308
|
# If no segments were generated and we need structure, show basic payload info
|
|
301
309
|
if include_structure and len(payload_segments) == 0 and len(bytes_data) > offset:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Payload decoder modules"""
|
|
1
|
+
"""Payload decoder modules. See docs/payloads.md for formats."""
|
|
2
2
|
from .ack import AckPayloadDecoder
|
|
3
3
|
from .trace import TracePayloadDecoder
|
|
4
4
|
from .path import PathPayloadDecoder
|
|
@@ -9,6 +9,7 @@ from .request import RequestPayloadDecoder
|
|
|
9
9
|
from .response import ResponsePayloadDecoder
|
|
10
10
|
from .anon_request import AnonRequestPayloadDecoder
|
|
11
11
|
from .text_message import TextMessagePayloadDecoder
|
|
12
|
+
from .control import ControlPayloadDecoder
|
|
12
13
|
|
|
13
14
|
__all__ = [
|
|
14
15
|
'AckPayloadDecoder',
|
|
@@ -21,4 +22,5 @@ __all__ = [
|
|
|
21
22
|
'ResponsePayloadDecoder',
|
|
22
23
|
'AnonRequestPayloadDecoder',
|
|
23
24
|
'TextMessagePayloadDecoder',
|
|
25
|
+
'ControlPayloadDecoder',
|
|
24
26
|
]
|
|
@@ -23,7 +23,7 @@ class AckPayloadDecoder:
|
|
|
23
23
|
options = {}
|
|
24
24
|
|
|
25
25
|
try:
|
|
26
|
-
#
|
|
26
|
+
# docs/payloads.md: Ack = checksum(4), CRC of message timestamp, text, and sender pubkey.
|
|
27
27
|
# - checksum (4 bytes) - CRC checksum of message timestamp, text, and sender pubkey
|
|
28
28
|
|
|
29
29
|
if len(payload) < 4:
|
|
@@ -53,7 +53,7 @@ class AdvertPayloadDecoder:
|
|
|
53
53
|
segment_offset = options.get('segment_offset', 0)
|
|
54
54
|
current_offset = 0
|
|
55
55
|
|
|
56
|
-
#
|
|
56
|
+
# docs/payloads.md: Advert = public_key(32) + timestamp(4) + signature(64) + appdata (flags + optional lat/long, feature1/2, name).
|
|
57
57
|
public_key = bytes_to_hex(payload[current_offset:current_offset + 32])
|
|
58
58
|
if options.get('include_segments'):
|
|
59
59
|
segments.append(PayloadSegment(
|
|
@@ -38,7 +38,7 @@ class AnonRequestPayloadDecoder:
|
|
|
38
38
|
)
|
|
39
39
|
|
|
40
40
|
try:
|
|
41
|
-
#
|
|
41
|
+
# docs/payloads.md: AnonRequest = dest_hash(1) + public_key(32) + cipher MAC(2) + ciphertext.
|
|
42
42
|
# - destination_hash (1 byte)
|
|
43
43
|
# - sender_public_key (32 bytes)
|
|
44
44
|
# - cipher_mac (2 bytes)
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Copyright (c) 2025 Michael Hart: https://github.com/michaelhart/meshcore-decoder
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Control payload decoder.
|
|
6
|
+
Structure per docs/payloads.md: flags (1, upper 4 bits = sub_type), data (rest).
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Optional, Dict, Any, List
|
|
10
|
+
from ...types.payloads import ControlPayload
|
|
11
|
+
from ...types.packet import PayloadSegment
|
|
12
|
+
from ...types.enums import PayloadType, PayloadVersion
|
|
13
|
+
from ...utils.hex import bytes_to_hex
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# Sub-types from payloads.md (upper 4 bits of flags)
|
|
17
|
+
CONTROL_SUB_TYPE_DISCOVER_REQ = 0x8
|
|
18
|
+
CONTROL_SUB_TYPE_DISCOVER_RESP = 0x9
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ControlPayloadDecoder:
|
|
22
|
+
@staticmethod
|
|
23
|
+
def decode(
|
|
24
|
+
payload: bytes,
|
|
25
|
+
options: Optional[Dict[str, Any]] = None
|
|
26
|
+
) -> Optional[ControlPayload]:
|
|
27
|
+
"""Decode a Control payload. See docs/payloads.md Control data."""
|
|
28
|
+
if options is None:
|
|
29
|
+
options = {}
|
|
30
|
+
|
|
31
|
+
try:
|
|
32
|
+
if len(payload) < 1:
|
|
33
|
+
result = ControlPayload(
|
|
34
|
+
payload_type=PayloadType.Control,
|
|
35
|
+
version=PayloadVersion.Version1,
|
|
36
|
+
is_valid=False,
|
|
37
|
+
errors=['Control payload too short (minimum 1 byte for flags)'],
|
|
38
|
+
flags=0,
|
|
39
|
+
sub_type=0,
|
|
40
|
+
data_hex=''
|
|
41
|
+
)
|
|
42
|
+
if options.get('include_segments'):
|
|
43
|
+
result.segments = [PayloadSegment(
|
|
44
|
+
name='Invalid Control Data',
|
|
45
|
+
description='Control payload too short',
|
|
46
|
+
start_byte=options.get('segment_offset', 0),
|
|
47
|
+
end_byte=options.get('segment_offset', 0) + max(0, len(payload) - 1),
|
|
48
|
+
value=bytes_to_hex(payload)
|
|
49
|
+
)]
|
|
50
|
+
return result
|
|
51
|
+
|
|
52
|
+
segments: List[PayloadSegment] = []
|
|
53
|
+
segment_offset = options.get('segment_offset', 0)
|
|
54
|
+
offset = 0
|
|
55
|
+
|
|
56
|
+
flags = payload[offset]
|
|
57
|
+
sub_type = (flags >> 4) & 0x0F
|
|
58
|
+
lower_bits = flags & 0x0F
|
|
59
|
+
|
|
60
|
+
if options.get('include_segments'):
|
|
61
|
+
segments.append(PayloadSegment(
|
|
62
|
+
name='Flags',
|
|
63
|
+
description=f'Upper 4 bits = sub_type (0x{sub_type:x}), lower 4 bits = type-specific',
|
|
64
|
+
start_byte=segment_offset + offset,
|
|
65
|
+
end_byte=segment_offset + offset,
|
|
66
|
+
value=f'{flags:02x}'
|
|
67
|
+
))
|
|
68
|
+
offset += 1
|
|
69
|
+
|
|
70
|
+
data_bytes = payload[offset:]
|
|
71
|
+
data_hex = bytes_to_hex(data_bytes)
|
|
72
|
+
parsed: Dict[str, Any] = {}
|
|
73
|
+
|
|
74
|
+
if sub_type == CONTROL_SUB_TYPE_DISCOVER_REQ and len(data_bytes) >= 5:
|
|
75
|
+
# DISCOVER_REQ: type_filter(1), tag(4), since(4 optional)
|
|
76
|
+
type_filter = data_bytes[0]
|
|
77
|
+
parsed['sub_type_name'] = 'DISCOVER_REQ'
|
|
78
|
+
parsed['prefix_only'] = bool(lower_bits & 0x01)
|
|
79
|
+
parsed['type_filter'] = type_filter
|
|
80
|
+
parsed['type_filter_hex'] = f'0x{type_filter:02x}'
|
|
81
|
+
if len(data_bytes) >= 9:
|
|
82
|
+
tag = (
|
|
83
|
+
data_bytes[1] |
|
|
84
|
+
(data_bytes[2] << 8) |
|
|
85
|
+
(data_bytes[3] << 16) |
|
|
86
|
+
(data_bytes[4] << 24)
|
|
87
|
+
)
|
|
88
|
+
parsed['tag'] = tag
|
|
89
|
+
parsed['tag_hex'] = f'0x{tag:08x}'
|
|
90
|
+
if len(data_bytes) >= 13:
|
|
91
|
+
since = (
|
|
92
|
+
data_bytes[5] |
|
|
93
|
+
(data_bytes[6] << 8) |
|
|
94
|
+
(data_bytes[7] << 16) |
|
|
95
|
+
(data_bytes[8] << 24)
|
|
96
|
+
)
|
|
97
|
+
parsed['since'] = since
|
|
98
|
+
parsed['since_hex'] = f'0x{since:08x}'
|
|
99
|
+
|
|
100
|
+
if options.get('include_segments'):
|
|
101
|
+
segments.append(PayloadSegment(
|
|
102
|
+
name='Type Filter',
|
|
103
|
+
description=f'Bit mask for ADV_TYPE_*: 0x{type_filter:02x}',
|
|
104
|
+
start_byte=segment_offset + offset,
|
|
105
|
+
end_byte=segment_offset + offset,
|
|
106
|
+
value=f'{type_filter:02x}'
|
|
107
|
+
))
|
|
108
|
+
if len(data_bytes) >= 9:
|
|
109
|
+
segments.append(PayloadSegment(
|
|
110
|
+
name='Tag',
|
|
111
|
+
description=f'Random tag from sender: 0x{parsed["tag"]:08x}',
|
|
112
|
+
start_byte=segment_offset + offset + 1,
|
|
113
|
+
end_byte=segment_offset + offset + 4,
|
|
114
|
+
value=bytes_to_hex(data_bytes[1:5])
|
|
115
|
+
))
|
|
116
|
+
if len(data_bytes) >= 13:
|
|
117
|
+
segments.append(PayloadSegment(
|
|
118
|
+
name='Since',
|
|
119
|
+
description=f'Epoch timestamp (optional): {parsed["since"]}',
|
|
120
|
+
start_byte=segment_offset + offset + 5,
|
|
121
|
+
end_byte=segment_offset + offset + 8,
|
|
122
|
+
value=bytes_to_hex(data_bytes[5:9])
|
|
123
|
+
))
|
|
124
|
+
|
|
125
|
+
elif sub_type == CONTROL_SUB_TYPE_DISCOVER_RESP and len(data_bytes) >= 6:
|
|
126
|
+
# DISCOVER_RESP: snr(1, signed, SNR*4), tag(4), pubkey(8 or 32)
|
|
127
|
+
snr_raw = data_bytes[0]
|
|
128
|
+
snr_signed = snr_raw - 256 if snr_raw > 127 else snr_raw
|
|
129
|
+
snr_db = snr_signed / 4.0
|
|
130
|
+
tag = (
|
|
131
|
+
data_bytes[1] |
|
|
132
|
+
(data_bytes[2] << 8) |
|
|
133
|
+
(data_bytes[3] << 16) |
|
|
134
|
+
(data_bytes[4] << 24)
|
|
135
|
+
)
|
|
136
|
+
parsed['sub_type_name'] = 'DISCOVER_RESP'
|
|
137
|
+
parsed['node_type'] = lower_bits
|
|
138
|
+
parsed['snr_raw'] = snr_raw
|
|
139
|
+
parsed['snr_db'] = round(snr_db, 2)
|
|
140
|
+
parsed['tag'] = tag
|
|
141
|
+
parsed['tag_hex'] = f'0x{tag:08x}'
|
|
142
|
+
if len(data_bytes) >= 6 + 8:
|
|
143
|
+
pubkey_len = 32 if len(data_bytes) >= 6 + 32 else 8
|
|
144
|
+
pubkey_hex = bytes_to_hex(data_bytes[5:5 + pubkey_len])
|
|
145
|
+
parsed['pubkey_len'] = pubkey_len
|
|
146
|
+
parsed['pubkey'] = pubkey_hex
|
|
147
|
+
|
|
148
|
+
if options.get('include_segments'):
|
|
149
|
+
segments.append(PayloadSegment(
|
|
150
|
+
name='SNR',
|
|
151
|
+
description=f'SNR*4 (signed): {snr_db:.2f} dB',
|
|
152
|
+
start_byte=segment_offset + offset,
|
|
153
|
+
end_byte=segment_offset + offset,
|
|
154
|
+
value=f'{snr_raw:02x}'
|
|
155
|
+
))
|
|
156
|
+
segments.append(PayloadSegment(
|
|
157
|
+
name='Tag',
|
|
158
|
+
description=f'Reflected from DISCOVER_REQ: 0x{tag:08x}',
|
|
159
|
+
start_byte=segment_offset + offset + 1,
|
|
160
|
+
end_byte=segment_offset + offset + 4,
|
|
161
|
+
value=bytes_to_hex(data_bytes[1:5])
|
|
162
|
+
))
|
|
163
|
+
if len(data_bytes) >= 6 + 8:
|
|
164
|
+
pubkey_len = 32 if len(data_bytes) >= 6 + 32 else 8
|
|
165
|
+
segments.append(PayloadSegment(
|
|
166
|
+
name='Pubkey',
|
|
167
|
+
description=f'Node ID or prefix ({pubkey_len} bytes)',
|
|
168
|
+
start_byte=segment_offset + offset + 5,
|
|
169
|
+
end_byte=segment_offset + offset + 4 + pubkey_len,
|
|
170
|
+
value=bytes_to_hex(data_bytes[5:5 + pubkey_len])
|
|
171
|
+
))
|
|
172
|
+
|
|
173
|
+
else:
|
|
174
|
+
parsed['raw'] = data_hex
|
|
175
|
+
if options.get('include_segments') and len(data_bytes) > 0:
|
|
176
|
+
segments.append(PayloadSegment(
|
|
177
|
+
name='Data',
|
|
178
|
+
description=f'Control data ({len(data_bytes)} bytes)',
|
|
179
|
+
start_byte=segment_offset + offset,
|
|
180
|
+
end_byte=segment_offset + len(payload) - 1,
|
|
181
|
+
value=data_hex
|
|
182
|
+
))
|
|
183
|
+
|
|
184
|
+
result = ControlPayload(
|
|
185
|
+
payload_type=PayloadType.Control,
|
|
186
|
+
version=PayloadVersion.Version1,
|
|
187
|
+
is_valid=True,
|
|
188
|
+
flags=flags,
|
|
189
|
+
sub_type=sub_type,
|
|
190
|
+
data_hex=data_hex,
|
|
191
|
+
parsed=parsed
|
|
192
|
+
)
|
|
193
|
+
if options.get('include_segments'):
|
|
194
|
+
result.segments = segments
|
|
195
|
+
return result
|
|
196
|
+
|
|
197
|
+
except Exception as error:
|
|
198
|
+
return ControlPayload(
|
|
199
|
+
payload_type=PayloadType.Control,
|
|
200
|
+
version=PayloadVersion.Version1,
|
|
201
|
+
is_valid=False,
|
|
202
|
+
errors=[str(error)],
|
|
203
|
+
flags=0,
|
|
204
|
+
sub_type=0,
|
|
205
|
+
data_hex=''
|
|
206
|
+
)
|
|
@@ -38,7 +38,8 @@ class PathPayloadDecoder:
|
|
|
38
38
|
)
|
|
39
39
|
|
|
40
40
|
try:
|
|
41
|
-
#
|
|
41
|
+
# docs/payloads.md: Path = dest_hash(1) + source_hash(1) + cipher MAC(2) + ciphertext.
|
|
42
|
+
# Ciphertext plaintext: path_length(1), path(bytes), extra_type(1), extra(rest).
|
|
42
43
|
# Encrypted format:
|
|
43
44
|
# - destination_hash (1 byte)
|
|
44
45
|
# - source_hash (1 byte)
|
|
@@ -38,7 +38,8 @@ class RequestPayloadDecoder:
|
|
|
38
38
|
)
|
|
39
39
|
|
|
40
40
|
try:
|
|
41
|
-
#
|
|
41
|
+
# docs/payloads.md: Request payload = dest_hash(1) + source_hash(1) + cipher MAC(2) + ciphertext.
|
|
42
|
+
# Ciphertext plaintext: timestamp(4), request_type(1), request_data(rest).
|
|
42
43
|
# - destination hash (1 byte)
|
|
43
44
|
# - source hash (1 byte)
|
|
44
45
|
# - cipher MAC (2 bytes)
|
|
@@ -345,6 +346,11 @@ class RequestPayloadDecoder:
|
|
|
345
346
|
else:
|
|
346
347
|
parsed['error'] = f'Request data too short (expected at least 10 bytes, got {len(request_data)})'
|
|
347
348
|
|
|
349
|
+
elif request_type == RequestType.GetOwnerInfo:
|
|
350
|
+
# 0x07 - Get Owner Info (repeater firmware-ver/name/owner info)
|
|
351
|
+
parsed['description'] = 'Get owner info (repeater firmware version, name, owner)'
|
|
352
|
+
parsed['raw'] = bytes_to_hex(request_data) if len(request_data) > 0 else ''
|
|
353
|
+
|
|
348
354
|
else:
|
|
349
355
|
# Unknown or Keepalive (deprecated)
|
|
350
356
|
parsed['raw'] = bytes_to_hex(request_data)
|
|
@@ -163,7 +163,8 @@ class ResponsePayloadDecoder:
|
|
|
163
163
|
)
|
|
164
164
|
|
|
165
165
|
try:
|
|
166
|
-
#
|
|
166
|
+
# docs/payloads.md: Response = dest_hash(1) + source_hash(1) + cipher MAC(2) + ciphertext.
|
|
167
|
+
# Ciphertext plaintext: tag(4), content(rest).
|
|
167
168
|
# - destination_hash (1 byte)
|
|
168
169
|
# - source_hash (1 byte)
|
|
169
170
|
# - cipher_mac (2 bytes)
|
|
@@ -251,15 +252,18 @@ class ResponsePayloadDecoder:
|
|
|
251
252
|
neighbors: List[NeighborEntry] = []
|
|
252
253
|
|
|
253
254
|
# Check if we should attempt decryption
|
|
254
|
-
if
|
|
255
|
+
# Use decryption_options if available, otherwise check if options is a DecryptionOptions object
|
|
256
|
+
effective_options = decryption_options if decryption_options else (options if isinstance(options, DecryptionOptions) else None)
|
|
257
|
+
|
|
258
|
+
if not effective_options:
|
|
255
259
|
decrypted_data = {'error': 'No decryption options provided. Use --node-key PUBKEY:PRIVKEY to provide decryption keys.'}
|
|
256
|
-
elif not
|
|
260
|
+
elif not effective_options.attempt_decryption:
|
|
257
261
|
decrypted_data = {'error': 'Decryption disabled in options'}
|
|
258
|
-
elif not
|
|
262
|
+
elif not effective_options.key_store:
|
|
259
263
|
decrypted_data = {'error': 'No key store provided. Use --node-key PUBKEY:PRIVKEY to provide decryption keys.'}
|
|
260
264
|
elif len(ciphertext_bytes) == 0:
|
|
261
265
|
decrypted_data = {'error': 'No ciphertext to decrypt'}
|
|
262
|
-
elif
|
|
266
|
+
elif effective_options.attempt_decryption and effective_options.key_store and len(ciphertext_bytes) > 0:
|
|
263
267
|
# Try to find a node key that matches the source hash
|
|
264
268
|
# For Response payloads: source_hash is the node that sent the response (the responder)
|
|
265
269
|
# The response is encrypted with the responder's private key, so we need the private key
|
|
@@ -286,7 +290,7 @@ class ResponsePayloadDecoder:
|
|
|
286
290
|
our_pubkey = None # Our public key (might match destination_hash)
|
|
287
291
|
|
|
288
292
|
# First, find the sender's public key (matches source_hash) and our private key
|
|
289
|
-
for stored_pubkey, stored_privkey in
|
|
293
|
+
for stored_pubkey, stored_privkey in effective_options.key_store.node_keys.items():
|
|
290
294
|
pubkey_bytes = bytes.fromhex(stored_pubkey)
|
|
291
295
|
if len(pubkey_bytes) > 0:
|
|
292
296
|
pubkey_first_byte = byte_to_hex(pubkey_bytes[0])
|
|
@@ -350,14 +354,23 @@ class ResponsePayloadDecoder:
|
|
|
350
354
|
(decrypted_bytes[3] << 24)
|
|
351
355
|
)
|
|
352
356
|
|
|
353
|
-
#
|
|
357
|
+
# Extract content (bytes 4+)
|
|
358
|
+
content_bytes = decrypted_bytes[4:] if len(decrypted_bytes) > 4 else b''
|
|
359
|
+
|
|
360
|
+
# Parse response content to determine type
|
|
361
|
+
parsed_content = ResponsePayloadDecoder._parse_response_content(tag, content_bytes)
|
|
362
|
+
|
|
363
|
+
# Try to parse neighbor table (for GetNeighbours responses)
|
|
354
364
|
neighbors, total_count = ResponsePayloadDecoder._parse_neighbors(decrypted_bytes, 0)
|
|
355
365
|
|
|
366
|
+
# Build decrypted_data with parsed content
|
|
356
367
|
decrypted_data = {
|
|
357
368
|
'tag': tag,
|
|
358
369
|
'raw': bytes_to_hex(decrypted_bytes),
|
|
359
|
-
'
|
|
370
|
+
'content': parsed_content
|
|
360
371
|
}
|
|
372
|
+
if len(neighbors) > 0:
|
|
373
|
+
decrypted_data['neighborCount'] = len(neighbors)
|
|
361
374
|
if total_count is not None:
|
|
362
375
|
decrypted_data['totalNeighborCount'] = total_count
|
|
363
376
|
else:
|
|
@@ -372,7 +385,7 @@ class ResponsePayloadDecoder:
|
|
|
372
385
|
|
|
373
386
|
# Try all keys as fallback - maybe the key mapping is different
|
|
374
387
|
if not decryption_success:
|
|
375
|
-
for stored_pubkey, stored_privkey in
|
|
388
|
+
for stored_pubkey, stored_privkey in effective_options.key_store.node_keys.items():
|
|
376
389
|
# Skip if we already tried this combination
|
|
377
390
|
if sender_pubkey and stored_pubkey == sender_pubkey:
|
|
378
391
|
continue
|
|
@@ -401,6 +414,27 @@ class ResponsePayloadDecoder:
|
|
|
401
414
|
if decryption_result.success and decryption_result.data:
|
|
402
415
|
decrypted_bytes = decryption_result.data
|
|
403
416
|
decryption_success = True
|
|
417
|
+
# Parse the decrypted content
|
|
418
|
+
if len(decrypted_bytes) >= 4:
|
|
419
|
+
tag = (
|
|
420
|
+
decrypted_bytes[0] |
|
|
421
|
+
(decrypted_bytes[1] << 8) |
|
|
422
|
+
(decrypted_bytes[2] << 16) |
|
|
423
|
+
(decrypted_bytes[3] << 24)
|
|
424
|
+
)
|
|
425
|
+
content_bytes = decrypted_bytes[4:] if len(decrypted_bytes) > 4 else b''
|
|
426
|
+
parsed_content = ResponsePayloadDecoder._parse_response_content(tag, content_bytes)
|
|
427
|
+
neighbors, total_count = ResponsePayloadDecoder._parse_neighbors(decrypted_bytes, 0)
|
|
428
|
+
|
|
429
|
+
decrypted_data = {
|
|
430
|
+
'tag': tag,
|
|
431
|
+
'raw': bytes_to_hex(decrypted_bytes),
|
|
432
|
+
'content': parsed_content
|
|
433
|
+
}
|
|
434
|
+
if len(neighbors) > 0:
|
|
435
|
+
decrypted_data['neighborCount'] = len(neighbors)
|
|
436
|
+
if total_count is not None:
|
|
437
|
+
decrypted_data['totalNeighborCount'] = total_count
|
|
404
438
|
break
|
|
405
439
|
else:
|
|
406
440
|
if decryption_result.error and "succeeded but MAC" not in decryption_result.error:
|
|
@@ -409,13 +443,13 @@ class ResponsePayloadDecoder:
|
|
|
409
443
|
|
|
410
444
|
# Fallback: try old method if key exchange didn't work
|
|
411
445
|
if not decryption_success:
|
|
412
|
-
for node_pubkey, node_privkey in
|
|
446
|
+
for node_pubkey, node_privkey in effective_options.key_store.node_keys.items():
|
|
413
447
|
pubkey_bytes = bytes.fromhex(node_pubkey)
|
|
414
448
|
if len(pubkey_bytes) > 0:
|
|
415
449
|
pubkey_first_byte = byte_to_hex(pubkey_bytes[0])
|
|
416
450
|
should_try = (pubkey_first_byte == source_hash or
|
|
417
451
|
pubkey_first_byte == destination_hash or
|
|
418
|
-
len(
|
|
452
|
+
len(effective_options.key_store.node_keys) == 1)
|
|
419
453
|
|
|
420
454
|
if should_try and not any(m['pubkey'] == node_pubkey[:16] + '...' for m in matching_keys_tried):
|
|
421
455
|
# Try old fallback methods
|
|
@@ -450,14 +484,22 @@ class ResponsePayloadDecoder:
|
|
|
450
484
|
(decrypted_bytes[3] << 24)
|
|
451
485
|
)
|
|
452
486
|
|
|
453
|
-
#
|
|
487
|
+
# Extract content (bytes 4+)
|
|
488
|
+
content_bytes = decrypted_bytes[4:] if len(decrypted_bytes) > 4 else b''
|
|
489
|
+
|
|
490
|
+
# Parse response content to determine type
|
|
491
|
+
parsed_content = ResponsePayloadDecoder._parse_response_content(tag, content_bytes)
|
|
492
|
+
|
|
493
|
+
# Try to parse neighbor table
|
|
454
494
|
neighbors, total_count = ResponsePayloadDecoder._parse_neighbors(decrypted_bytes, 0)
|
|
455
495
|
|
|
456
496
|
decrypted_data = {
|
|
457
497
|
'tag': tag,
|
|
458
498
|
'raw': bytes_to_hex(decrypted_bytes),
|
|
459
|
-
'
|
|
499
|
+
'content': parsed_content
|
|
460
500
|
}
|
|
501
|
+
if len(neighbors) > 0:
|
|
502
|
+
decrypted_data['neighborCount'] = len(neighbors)
|
|
461
503
|
if total_count is not None:
|
|
462
504
|
decrypted_data['totalNeighborCount'] = total_count
|
|
463
505
|
|
|
@@ -471,7 +513,7 @@ class ResponsePayloadDecoder:
|
|
|
471
513
|
# (in case of hash collisions or key format issues)
|
|
472
514
|
if not decryption_success and len(matching_keys_tried) > 0:
|
|
473
515
|
# We already tried matching keys, now try all remaining keys
|
|
474
|
-
for node_pubkey, node_privkey in
|
|
516
|
+
for node_pubkey, node_privkey in effective_options.key_store.node_keys.items():
|
|
475
517
|
pubkey_bytes = bytes.fromhex(node_pubkey)
|
|
476
518
|
if len(pubkey_bytes) > 0:
|
|
477
519
|
pubkey_first_byte = byte_to_hex(pubkey_bytes[0])
|
|
@@ -496,15 +538,23 @@ class ResponsePayloadDecoder:
|
|
|
496
538
|
(decrypted_bytes[3] << 24)
|
|
497
539
|
)
|
|
498
540
|
|
|
541
|
+
# Extract content (bytes 4+)
|
|
542
|
+
content_bytes = decrypted_bytes[4:] if len(decrypted_bytes) > 4 else b''
|
|
543
|
+
|
|
544
|
+
# Parse response content to determine type
|
|
545
|
+
parsed_content = ResponsePayloadDecoder._parse_response_content(tag, content_bytes)
|
|
546
|
+
|
|
499
547
|
# Try to parse neighbor table
|
|
500
548
|
neighbors, total_count = ResponsePayloadDecoder._parse_neighbors(decrypted_bytes, 0)
|
|
501
549
|
|
|
502
550
|
decrypted_data = {
|
|
503
551
|
'tag': tag,
|
|
504
552
|
'raw': bytes_to_hex(decrypted_bytes),
|
|
505
|
-
'
|
|
553
|
+
'content': parsed_content,
|
|
506
554
|
'note': f'Decrypted with key hash {pubkey_first_byte} (did not match source/dest hash)'
|
|
507
555
|
}
|
|
556
|
+
if len(neighbors) > 0:
|
|
557
|
+
decrypted_data['neighborCount'] = len(neighbors)
|
|
508
558
|
if total_count is not None:
|
|
509
559
|
decrypted_data['totalNeighborCount'] = total_count
|
|
510
560
|
|
|
@@ -515,10 +565,10 @@ class ResponsePayloadDecoder:
|
|
|
515
565
|
error_msg = 'Decryption failed'
|
|
516
566
|
if len(matching_keys_tried) == 0:
|
|
517
567
|
error_msg += f': No node key found matching source hash ({source_hash}) or destination hash ({destination_hash})'
|
|
518
|
-
error_msg += f'. Available keys: {len(
|
|
519
|
-
if len(
|
|
568
|
+
error_msg += f'. Available keys: {len(effective_options.key_store.node_keys)} key(s) provided'
|
|
569
|
+
if len(effective_options.key_store.node_keys) > 0:
|
|
520
570
|
available_hashes = []
|
|
521
|
-
for pk in
|
|
571
|
+
for pk in effective_options.key_store.node_keys.keys():
|
|
522
572
|
try:
|
|
523
573
|
pk_bytes = bytes.fromhex(pk)
|
|
524
574
|
if len(pk_bytes) > 0:
|
|
@@ -541,6 +591,11 @@ class ResponsePayloadDecoder:
|
|
|
541
591
|
if decrypted_data is None:
|
|
542
592
|
decrypted_data = {'error': 'Decryption was attempted but no result was set. This is a bug.'}
|
|
543
593
|
|
|
594
|
+
# Extract tag from decrypted_data if available
|
|
595
|
+
result_tag = tag
|
|
596
|
+
if decrypted_data and 'tag' in decrypted_data:
|
|
597
|
+
result_tag = decrypted_data['tag']
|
|
598
|
+
|
|
544
599
|
result = ResponsePayload(
|
|
545
600
|
payload_type=PayloadType.Response,
|
|
546
601
|
version=PayloadVersion.Version1,
|
|
@@ -551,12 +606,20 @@ class ResponsePayloadDecoder:
|
|
|
551
606
|
ciphertext=ciphertext,
|
|
552
607
|
ciphertext_length=len(payload) - 4,
|
|
553
608
|
decrypted=decrypted_data,
|
|
554
|
-
tag=
|
|
609
|
+
tag=result_tag,
|
|
555
610
|
neighbors=neighbors
|
|
556
611
|
)
|
|
557
612
|
|
|
558
|
-
# Attempt decryption if key store is provided
|
|
559
|
-
if
|
|
613
|
+
# Attempt decryption if key store is provided (second path - try if first path failed or didn't run)
|
|
614
|
+
# Check if first path succeeded by looking for valid content (not error and not unknown type)
|
|
615
|
+
first_path_succeeded = (
|
|
616
|
+
result.decrypted and
|
|
617
|
+
'content' in result.decrypted and
|
|
618
|
+
result.decrypted.get('content', {}).get('type') != 'unknown' and
|
|
619
|
+
'error' not in result.decrypted
|
|
620
|
+
)
|
|
621
|
+
|
|
622
|
+
if not first_path_succeeded and decryption_options and decryption_options.key_store and decryption_options.attempt_decryption:
|
|
560
623
|
key_store = decryption_options.key_store
|
|
561
624
|
|
|
562
625
|
# Try to decrypt using shared secrets or calculate from node keys
|
|
@@ -582,10 +645,13 @@ class ResponsePayloadDecoder:
|
|
|
582
645
|
'tag': decryption_result.data['tag'],
|
|
583
646
|
'content': parsed_content
|
|
584
647
|
}
|
|
648
|
+
result.tag = decryption_result.data['tag']
|
|
585
649
|
break # Stop trying once we find a working key
|
|
586
650
|
|
|
587
651
|
# If shared secrets didn't work, try calculating from node keys
|
|
588
|
-
if not result.decrypted
|
|
652
|
+
if (not result.decrypted or
|
|
653
|
+
(result.decrypted.get('content', {}).get('type') == 'unknown') or
|
|
654
|
+
'error' in result.decrypted) and node_keys:
|
|
589
655
|
destination_hash_byte = hex_to_bytes(destination_hash)[0]
|
|
590
656
|
|
|
591
657
|
# Find our node key that matches destination hash
|
|
@@ -629,7 +695,10 @@ class ResponsePayloadDecoder:
|
|
|
629
695
|
break
|
|
630
696
|
|
|
631
697
|
# If no peer keys matched by hash, try all peer keys anyway
|
|
632
|
-
if not result.decrypted
|
|
698
|
+
if ((not result.decrypted or
|
|
699
|
+
(result.decrypted.get('content', {}).get('type') == 'unknown') or
|
|
700
|
+
'error' in result.decrypted) and
|
|
701
|
+
hasattr(key_store, 'peer_public_keys') and key_store.peer_public_keys):
|
|
633
702
|
for peer_pub_key_hex in key_store.peer_public_keys:
|
|
634
703
|
shared_secret = ChannelCrypto.calculate_shared_secret(
|
|
635
704
|
peer_pub_key_hex,
|
|
@@ -650,8 +719,9 @@ class ResponsePayloadDecoder:
|
|
|
650
719
|
'tag': decryption_result.data['tag'],
|
|
651
720
|
'content': parsed_content
|
|
652
721
|
}
|
|
722
|
+
result.tag = decryption_result.data['tag']
|
|
653
723
|
break
|
|
654
|
-
if result.decrypted:
|
|
724
|
+
if result.decrypted and result.decrypted.get('content', {}).get('type') != 'unknown':
|
|
655
725
|
break
|
|
656
726
|
|
|
657
727
|
if options.get('include_segments'):
|
|
@@ -38,7 +38,8 @@ class TextMessagePayloadDecoder:
|
|
|
38
38
|
)
|
|
39
39
|
|
|
40
40
|
try:
|
|
41
|
-
#
|
|
41
|
+
# docs/payloads.md: TextMessage = dest_hash(1) + source_hash(1) + cipher MAC(2) + ciphertext.
|
|
42
|
+
# Ciphertext plaintext: timestamp(4), txt_type+attempt(1), message(rest). txt_type: 0=plain, 1=CLI, 2=signed.
|
|
42
43
|
# - destination_hash (1 byte)
|
|
43
44
|
# - source_hash (1 byte)
|
|
44
45
|
# - cipher_mac (2 bytes)
|
|
@@ -119,6 +120,9 @@ class TextMessagePayloadDecoder:
|
|
|
119
120
|
value=ciphertext
|
|
120
121
|
))
|
|
121
122
|
|
|
123
|
+
# Initialize decrypted_data before using it
|
|
124
|
+
decrypted_data: Optional[Dict[str, Any]] = None
|
|
125
|
+
|
|
122
126
|
result = TextMessagePayload(
|
|
123
127
|
payload_type=PayloadType.TextMessage,
|
|
124
128
|
version=PayloadVersion.Version1,
|
meshcoredecoder/types/enums.py
CHANGED
|
@@ -2,33 +2,39 @@
|
|
|
2
2
|
Copyright (c) 2025 Michael Hart: https://github.com/michaelhart/meshcore-decoder
|
|
3
3
|
MIT License
|
|
4
4
|
|
|
5
|
-
MeshCore packet type definitions
|
|
6
|
-
Reference:
|
|
5
|
+
MeshCore packet type definitions.
|
|
6
|
+
Reference: docs/packet_format.md and docs/payloads.md
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
from enum import Enum
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class RouteType(Enum):
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
"""Route types from packet header bits 0-1 (mask 0x03). See packet_format.md."""
|
|
14
|
+
TransportFlood = 0x00 # ROUTE_TYPE_TRANSPORT_FLOOD
|
|
15
|
+
Flood = 0x01 # ROUTE_TYPE_FLOOD
|
|
16
|
+
Direct = 0x02 # ROUTE_TYPE_DIRECT
|
|
17
|
+
TransportDirect = 0x03 # ROUTE_TYPE_TRANSPORT_DIRECT
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
class PayloadType(Enum):
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
"""Payload types from packet header bits 2-5 (mask 0x3C). See packet_format.md."""
|
|
22
|
+
Request = 0x00 # PAYLOAD_TYPE_REQ
|
|
23
|
+
Response = 0x01 # PAYLOAD_TYPE_RESPONSE
|
|
24
|
+
TextMessage = 0x02 # PAYLOAD_TYPE_TXT_MSG
|
|
25
|
+
Ack = 0x03 # PAYLOAD_TYPE_ACK
|
|
26
|
+
Advert = 0x04 # PAYLOAD_TYPE_ADVERT
|
|
27
|
+
GroupText = 0x05 # PAYLOAD_TYPE_GRP_TXT
|
|
28
|
+
GroupData = 0x06 # PAYLOAD_TYPE_GRP_DATA
|
|
29
|
+
AnonRequest = 0x07 # PAYLOAD_TYPE_ANON_REQ
|
|
30
|
+
Path = 0x08 # PAYLOAD_TYPE_PATH
|
|
31
|
+
Trace = 0x09 # PAYLOAD_TYPE_TRACE
|
|
32
|
+
Multipart = 0x0A # PAYLOAD_TYPE_MULTIPART
|
|
33
|
+
Control = 0x0B # PAYLOAD_TYPE_CONTROL
|
|
34
|
+
Reserved0C = 0x0C # reserved
|
|
35
|
+
Reserved0D = 0x0D # reserved
|
|
36
|
+
Reserved0E = 0x0E # reserved
|
|
37
|
+
RawCustom = 0x0F # PAYLOAD_TYPE_RAW_CUSTOM
|
|
32
38
|
|
|
33
39
|
|
|
34
40
|
class PayloadVersion(Enum):
|
|
@@ -53,9 +59,11 @@ class AdvertFlags(Enum):
|
|
|
53
59
|
|
|
54
60
|
|
|
55
61
|
class RequestType(Enum):
|
|
62
|
+
"""Request types in REQ payload ciphertext. See payloads.md Request type table."""
|
|
56
63
|
GetStats = 0x01
|
|
57
64
|
Keepalive = 0x02 # deprecated
|
|
58
65
|
GetTelemetryData = 0x03
|
|
59
66
|
GetMinMaxAvgData = 0x04
|
|
60
67
|
GetAccessList = 0x05
|
|
61
68
|
GetNeighbours = 0x06
|
|
69
|
+
GetOwnerInfo = 0x07
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Payload type definitions
|
|
3
|
-
Reference:
|
|
2
|
+
Payload type definitions.
|
|
3
|
+
Reference: docs/payloads.md
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
from typing import Dict, Optional, List, Any
|
|
@@ -326,6 +326,34 @@ class NeighborEntry:
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
|
|
329
|
+
class ControlPayload(BasePayload):
|
|
330
|
+
"""Control packet payload (unencrypted). See payloads.md Control data."""
|
|
331
|
+
def __init__(
|
|
332
|
+
self,
|
|
333
|
+
flags: int,
|
|
334
|
+
sub_type: int,
|
|
335
|
+
data_hex: str,
|
|
336
|
+
parsed: Optional[Dict[str, Any]] = None,
|
|
337
|
+
**kwargs
|
|
338
|
+
):
|
|
339
|
+
super().__init__(**kwargs)
|
|
340
|
+
self.flags = flags
|
|
341
|
+
self.sub_type = sub_type
|
|
342
|
+
self.data_hex = data_hex
|
|
343
|
+
self.parsed = parsed or {}
|
|
344
|
+
|
|
345
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
346
|
+
result = super().to_dict()
|
|
347
|
+
result.update({
|
|
348
|
+
'flags': self.flags,
|
|
349
|
+
'subType': self.sub_type,
|
|
350
|
+
'dataHex': self.data_hex,
|
|
351
|
+
})
|
|
352
|
+
if self.parsed:
|
|
353
|
+
result['parsed'] = self.parsed
|
|
354
|
+
return result
|
|
355
|
+
|
|
356
|
+
|
|
329
357
|
class ResponsePayload(BasePayload):
|
|
330
358
|
"""Response payload"""
|
|
331
359
|
def __init__(
|
|
@@ -377,5 +405,6 @@ class ResponsePayload(BasePayload):
|
|
|
377
405
|
# Union type for all payload types
|
|
378
406
|
PayloadData = (
|
|
379
407
|
AdvertPayload | TracePayload | GroupTextPayload | GroupDataPayload | RequestPayload |
|
|
380
|
-
TextMessagePayload | AnonRequestPayload | AckPayload | PathPayload | ResponsePayload
|
|
408
|
+
TextMessagePayload | AnonRequestPayload | AckPayload | PathPayload | ResponsePayload |
|
|
409
|
+
ControlPayload
|
|
381
410
|
)
|
|
@@ -54,5 +54,7 @@ def get_request_type_name(request_type: RequestType) -> str:
|
|
|
54
54
|
RequestType.GetTelemetryData: 'Get Telemetry Data',
|
|
55
55
|
RequestType.GetMinMaxAvgData: 'Get Min/Max/Avg Data',
|
|
56
56
|
RequestType.GetAccessList: 'Get Access List',
|
|
57
|
+
RequestType.GetNeighbours: 'Get Neighbors',
|
|
58
|
+
RequestType.GetOwnerInfo: 'Get Owner Info',
|
|
57
59
|
}
|
|
58
60
|
return mapping.get(request_type, f"Unknown ({request_type})")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meshcoredecoder
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Complete Python implementation of the MeshCore Packet Decoder
|
|
5
5
|
Home-page: https://github.com/chrisdavis2110/meshcore-decoder-py
|
|
6
6
|
Author: Chris Davis
|
|
@@ -46,9 +46,18 @@ A Python library for decoding MeshCore mesh networking packets with full cryptog
|
|
|
46
46
|
## Features
|
|
47
47
|
|
|
48
48
|
- **Packet Decoding**: Decode MeshCore packets
|
|
49
|
-
- **Built-in Decryption**: Decrypt GroupText, TextMessage, and
|
|
49
|
+
- **Built-in Decryption**: Decrypt GroupText, TextMessage, Request, Response, Path, and AnonRequest payloads
|
|
50
50
|
- **Developer Friendly**: Python-first with full type hints and data classes
|
|
51
51
|
|
|
52
|
+
## Protocol reference
|
|
53
|
+
|
|
54
|
+
Packet and payload layouts follow the MeshCore protocol as described in the local docs:
|
|
55
|
+
|
|
56
|
+
- **[docs/packet_format.md](docs/packet_format.md)** – Packet layout (header, transport codes, path, payload), route types, payload types, payload versions
|
|
57
|
+
- **[docs/payloads.md](docs/payloads.md)** – Payload formats (Advert, Ack, Request/Response, TextMessage, Path, Control, Group text/datagram, etc.)
|
|
58
|
+
|
|
59
|
+
Supported payload types include: Request, Response, TextMessage, Ack, Advert, GroupText, GroupData, AnonRequest, Path, Trace, Multipart, Control (DISCOVER_REQ / DISCOVER_RESP), reserved (0x0C–0x0E), and RawCustom. Request types include GetStats, Keepalive, GetTelemetryData, GetMinMaxAvgData, GetAccessList, GetNeighbours, and GetOwnerInfo.
|
|
60
|
+
|
|
52
61
|
## Installation
|
|
53
62
|
|
|
54
63
|
### Install to a single project
|
|
@@ -231,9 +240,9 @@ if packet.payload_type == PayloadType.Trace and packet.payload.get('decoded'):
|
|
|
231
240
|
|
|
232
241
|
SNR (Signal-to-Noise Ratio) data is available from multiple packet types:
|
|
233
242
|
|
|
234
|
-
1. **TRACE Packets**
|
|
235
|
-
2. **GetStats Response Packets**
|
|
236
|
-
3. **DISCOVER_RESP Control Packets**
|
|
243
|
+
1. **TRACE Packets** – SNR values for each hop in the path
|
|
244
|
+
2. **GetStats / GetNeighbours Response Packets** – Full neighbor table with SNR values (requires decryption)
|
|
245
|
+
3. **DISCOVER_RESP Control Packets** – SNR in discovery responses (unencrypted; decode with `PayloadType.Control`)
|
|
237
246
|
|
|
238
247
|
### How GetStats Works
|
|
239
248
|
|
|
@@ -247,8 +256,8 @@ GetStats is a request/response protocol used to query a repeater node for its ne
|
|
|
247
256
|
- **Cipher MAC** (2 bytes): MAC for encrypted data
|
|
248
257
|
- **Ciphertext**: Encrypted data containing:
|
|
249
258
|
- Timestamp (4 bytes, Unix timestamp)
|
|
250
|
-
- Request type (1 byte
|
|
251
|
-
- Request data (optional,
|
|
259
|
+
- Request type (1 byte): e.g. 0x01 GetStats, 0x06 GetNeighbours, 0x07 GetOwnerInfo (see [docs/payloads.md](docs/payloads.md))
|
|
260
|
+
- Request data (optional, depends on request type)
|
|
252
261
|
|
|
253
262
|
**2. Receiving a Neighbor List Response:**
|
|
254
263
|
- The target repeater responds with a Response packet
|
|
@@ -378,9 +387,9 @@ Byte 8+: Array of neighbor entries, each entry:
|
|
|
378
387
|
|--------|---------|-----------------|---------------------|
|
|
379
388
|
| **TRACE Packets** | ✅ Path SNR per hop | Path hashes, trace tag | ❌ No |
|
|
380
389
|
| **Response Packets** | ✅ Neighbor SNR | Full neighbor table (pubkey prefixes, timestamps) | ✅ Yes (node key) |
|
|
381
|
-
| **DISCOVER_RESP** | ✅ SNR | Node info, tag
|
|
390
|
+
| **DISCOVER_RESP (Control)** | ✅ SNR | Node info, tag, pubkey (8 or 32 bytes) | ❌ No |
|
|
382
391
|
|
|
383
|
-
**Note:** Response packets are the only source that provides the complete neighbor table with pubkey prefixes, timestamps, and SNR values. TRACE packets provide SNR for the specific path taken
|
|
392
|
+
**Note:** Response packets are the only source that provides the complete neighbor table with pubkey prefixes, timestamps, and SNR values. TRACE packets provide SNR for the specific path taken. Control packets with sub_type DISCOVER_RESP provide SNR and node pubkey (or prefix) without decryption.
|
|
384
393
|
|
|
385
394
|
**NeighborEntry Object:**
|
|
386
395
|
|
|
@@ -432,6 +441,10 @@ The CLI will automatically:
|
|
|
432
441
|
- Display total neighbors available and neighbors in the packet
|
|
433
442
|
- Show each neighbor's pubkey prefix, SNR, and timestamps
|
|
434
443
|
|
|
444
|
+
## Packet format (summary)
|
|
445
|
+
|
|
446
|
+
Each packet is: **header** (1 byte) → optional **transport_codes** (4 bytes for Transport Flood/Direct) → **path_length** (1 byte) → **path** (0–64 bytes) → **payload** (0–184 bytes). The header encodes route type (bits 0–1), payload type (bits 2–5), and payload version (bits 6–7). Path length is variable (e.g. 0, 1, or 2 bytes of path data are all valid). Full field descriptions and tables are in [docs/packet_format.md](docs/packet_format.md).
|
|
447
|
+
|
|
435
448
|
## Packet Structure Analysis
|
|
436
449
|
|
|
437
450
|
For detailed packet analysis and debugging, use `analyze_structure()` to get byte-level breakdowns:
|
|
@@ -671,7 +684,7 @@ packet = MeshCoreDecoder.decode(packet_hex)
|
|
|
671
684
|
|
|
672
685
|
if packet.payload_type == PayloadType.Ack:
|
|
673
686
|
ack = packet.payload['decoded']
|
|
674
|
-
print(f"Checksum:
|
|
687
|
+
print(f"Checksum: {ack.checksum}") # 4-byte CRC (hex)
|
|
675
688
|
```
|
|
676
689
|
|
|
677
690
|
#### Trace
|
|
@@ -689,6 +702,25 @@ if packet.payload_type == PayloadType.Trace:
|
|
|
689
702
|
print(f" Hop {i}: {snr:.1f} dB")
|
|
690
703
|
```
|
|
691
704
|
|
|
705
|
+
#### Control (DISCOVER_REQ / DISCOVER_RESP)
|
|
706
|
+
```python
|
|
707
|
+
# Control payloads are unencrypted. Sub-types include DISCOVER_REQ (0x8) and DISCOVER_RESP (0x9).
|
|
708
|
+
packet_hex = "2D00..." # Flood + Control + path_len=0 + payload (flags + data)
|
|
709
|
+
packet = MeshCoreDecoder.decode(packet_hex)
|
|
710
|
+
|
|
711
|
+
if packet.payload_type == PayloadType.Control and packet.payload.get('decoded'):
|
|
712
|
+
ctrl = packet.payload['decoded']
|
|
713
|
+
print(f"Sub-type: 0x{ctrl.sub_type:x}")
|
|
714
|
+
if ctrl.parsed.get('sub_type_name') == 'DISCOVER_REQ':
|
|
715
|
+
print(f" prefix_only: {ctrl.parsed.get('prefix_only')}")
|
|
716
|
+
print(f" type_filter: {ctrl.parsed.get('type_filter_hex')}")
|
|
717
|
+
print(f" tag: {ctrl.parsed.get('tag_hex')}")
|
|
718
|
+
elif ctrl.parsed.get('sub_type_name') == 'DISCOVER_RESP':
|
|
719
|
+
print(f" SNR: {ctrl.parsed.get('snr_db')} dB")
|
|
720
|
+
print(f" tag: {ctrl.parsed.get('tag_hex')}")
|
|
721
|
+
print(f" pubkey: {ctrl.parsed.get('pubkey', '')[:16]}...")
|
|
722
|
+
```
|
|
723
|
+
|
|
692
724
|
### Encrypted Packets (Require Keys)
|
|
693
725
|
|
|
694
726
|
#### GroupText
|
|
@@ -800,6 +832,42 @@ for name, hex_data, opts in packets:
|
|
|
800
832
|
|
|
801
833
|
|
|
802
834
|
|
|
835
|
+
## Publishing to PyPI
|
|
836
|
+
|
|
837
|
+
To release a new version and upload to PyPI:
|
|
838
|
+
|
|
839
|
+
1. **Bump the version** in these files (keep them in sync):
|
|
840
|
+
- `pyproject.toml` → `version = "X.Y.Z"`
|
|
841
|
+
- `meshcoredecoder/__init__.py` → `__version__ = "X.Y.Z"`
|
|
842
|
+
- `setup.py` → `version="X.Y.Z"`
|
|
843
|
+
- `index.py` → `__version__ = "X.Y.Z"`
|
|
844
|
+
|
|
845
|
+
2. **Install build tools** (if needed):
|
|
846
|
+
```bash
|
|
847
|
+
pip install build twine
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
3. **Build the package**:
|
|
851
|
+
```bash
|
|
852
|
+
python -m build
|
|
853
|
+
```
|
|
854
|
+
This creates `dist/meshcoredecoder-X.Y.Z.tar.gz` and `dist/meshcoredecoder_X.Y.Z-*.whl`.
|
|
855
|
+
|
|
856
|
+
4. **Upload to PyPI** (requires a [PyPI account](https://pypi.org/account/register/) and API token):
|
|
857
|
+
```bash
|
|
858
|
+
twine upload dist/*
|
|
859
|
+
```
|
|
860
|
+
Use your PyPI username and an [API token](https://pypi.org/manage/account/token/) as the password. For Test PyPI first:
|
|
861
|
+
```bash
|
|
862
|
+
twine upload --repository testpypi dist/*
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
5. **Tag the release** (optional):
|
|
866
|
+
```bash
|
|
867
|
+
git tag vX.Y.Z
|
|
868
|
+
git push origin vX.Y.Z
|
|
869
|
+
```
|
|
870
|
+
|
|
803
871
|
## License
|
|
804
872
|
|
|
805
873
|
MIT License
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
cli.py,sha256=oMW7wy8UoVFiS6fcp5jZ8ZojbVm7ZrbLJcX0_CmVljo,51434
|
|
2
|
+
index.py,sha256=dPlGhLOsOIhFtz5pCKOMJzBDD1lAEjI8NkZH5j-GeRw,2448
|
|
3
|
+
meshcoredecoder/__init__.py,sha256=OqlWqWYHDEvulEe-sCfkgQB7Vyi3eT4niUFIbly74Zo,275
|
|
4
|
+
meshcoredecoder/crypto/__init__.py,sha256=00r884_WImNp5YOYfSKYtUaIj6gZdyJV0--xC_Y71Ok,236
|
|
5
|
+
meshcoredecoder/crypto/channel_crypto.py,sha256=YKcFcD14ToqDhGfNUZwHEEW-kXKB8UP0VRuQWW75h7M,55512
|
|
6
|
+
meshcoredecoder/crypto/ed25519_verifier.py,sha256=9DAx0gqnf9I7fPxfKU4G1y0GbJK1stCtTKpCX4foL5k,5057
|
|
7
|
+
meshcoredecoder/crypto/key_manager.py,sha256=FXABZBd1B0kQwpyg7EX-pZDqxh5KVKnlB7A1FE3NQeU,5034
|
|
8
|
+
meshcoredecoder/decoder/__init__.py,sha256=P_E5CQS1eXoVy59A1mAV9TD5XCS6FpQpc4RizhOZVrw,654
|
|
9
|
+
meshcoredecoder/decoder/packet_decoder.py,sha256=qQA0wPI63fIjT8z95rrjkMBYfM6GmIuiAZaMRmvfGfM,25055
|
|
10
|
+
meshcoredecoder/decoder/payload_decoders/__init__.py,sha256=Q3khEbL1w84VhfczwcMm8KVT9HCjBPb8RzmcoU-NtB8,885
|
|
11
|
+
meshcoredecoder/decoder/payload_decoders/ack.py,sha256=Ao9M4b5e-aoNoq6pVAHkmcx1wJFrzsHLnSSjK84jcM8,3332
|
|
12
|
+
meshcoredecoder/decoder/payload_decoders/advert.py,sha256=iWJLyiU1mZ_wbfLaS51KFPdDeLJ0iTwM3Nn-LrIpu8Q,12710
|
|
13
|
+
meshcoredecoder/decoder/payload_decoders/anon_request.py,sha256=MwCaHNcNZAMmc4C9jXccQbEY61b3OIQzeIb-XS02tbw,7868
|
|
14
|
+
meshcoredecoder/decoder/payload_decoders/control.py,sha256=wWWOGLzuyTMpIbBtpI3k4lL88Us-3Ca7byK76d1ifw8,8836
|
|
15
|
+
meshcoredecoder/decoder/payload_decoders/group_data.py,sha256=llDm6lXDYqM_3udSz7lOtKCfHR39hUa5zivyfs21B_U,5435
|
|
16
|
+
meshcoredecoder/decoder/payload_decoders/group_text.py,sha256=BhdF1ZYrMS_UH7-xRxeNHU1WvgNf2Buk9SxpDN0YYcQ,5526
|
|
17
|
+
meshcoredecoder/decoder/payload_decoders/path.py,sha256=nsY4XzSPYBtMhMWDqLf2aDx0n3mg19qH8fo_sb04Nc4,13899
|
|
18
|
+
meshcoredecoder/decoder/payload_decoders/request.py,sha256=M4YMuVPNvSyyZjvIIpy1KaO5lFO9JyviKMRU9-52oag,19055
|
|
19
|
+
meshcoredecoder/decoder/payload_decoders/response.py,sha256=jab9mYYNYJH4xSCn2Fo9eOECvnMiplUxgW7MKvcC8_M,61439
|
|
20
|
+
meshcoredecoder/decoder/payload_decoders/text_message.py,sha256=JBwizJ58xRWB_JehPwLcatAP-K3WGag25zBaVrdZLu0,10622
|
|
21
|
+
meshcoredecoder/decoder/payload_decoders/trace.py,sha256=eN3E_5oidZzGdNsr--PhxtwYAwLW0lMJDGHz09lDqzA,6110
|
|
22
|
+
meshcoredecoder/types/__init__.py,sha256=XReL92twDsQQf8GUxYbPEdZGlV8XweQCPT-43jn8IfA,640
|
|
23
|
+
meshcoredecoder/types/crypto.py,sha256=o7C7IsiwMtJjzIUYRw548-AJmm898ucLDy1xYVukreE,1842
|
|
24
|
+
meshcoredecoder/types/enums.py,sha256=nBnpiQ1iFxeMaQBpQKrz2UrJqgH3Pw_LXrzK-aUlPc0,2019
|
|
25
|
+
meshcoredecoder/types/packet.py,sha256=LAMTHsFX3pWxP5M4gVsMRHEct2C2p36gpij_BuJofMw,3874
|
|
26
|
+
meshcoredecoder/types/payloads.py,sha256=Vbhx0ayfZ8Xg3UaCv29Ysb6zHSEP6_rWn8oDCUKe1Ks,12778
|
|
27
|
+
meshcoredecoder/utils/__init__.py,sha256=0_EpRPd97R2Cead_BTG9SDS6vVZV268u3XBkA-syOHk,739
|
|
28
|
+
meshcoredecoder/utils/auth_token.py,sha256=gVVgHH_Am1k-cZxPbrTHCafvqdWSqlg9Dw-RRYaRI8Y,6973
|
|
29
|
+
meshcoredecoder/utils/enum_names.py,sha256=Rb64MIF0ygzCkLMWCsMbSV3wAbExMVpoCWS3jdYR8Ms,2040
|
|
30
|
+
meshcoredecoder/utils/hex.py,sha256=IjDuoeIAr7swv9Fa1NKstZTotTwmtufdi_psCjqVU5k,1136
|
|
31
|
+
meshcoredecoder-0.3.0.dist-info/licenses/LICENSE,sha256=W4bNA8wxOTF7Wmcmi5UwjrrKnjT_Qua52Z5wQLPLfKM,1130
|
|
32
|
+
meshcoredecoder-0.3.0.dist-info/METADATA,sha256=RSx1Bwxi2wxPwu7zYPgP-GGCec2WMrASxZKzRB6G6P8,34093
|
|
33
|
+
meshcoredecoder-0.3.0.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
|
|
34
|
+
meshcoredecoder-0.3.0.dist-info/entry_points.txt,sha256=P8cgSHWETiDCc2jRCB95PuVyJDDeSq0gH-ufYVlqWDY,45
|
|
35
|
+
meshcoredecoder-0.3.0.dist-info/top_level.txt,sha256=Rj9ZjVG2I6CEgpgF8I_QqUDp-vTQEdYm2KD93mIGkJM,26
|
|
36
|
+
meshcoredecoder-0.3.0.dist-info/RECORD,,
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
cli.py,sha256=bJXnvtgbn_en1KqD6mPtSvGEvpgwVVllISo9952pVmc,51403
|
|
2
|
-
index.py,sha256=RSXENgfhiZLdH8dJqOVvn8KZR_7Rk4kWTlMBbukf97E,2448
|
|
3
|
-
meshcoredecoder/__init__.py,sha256=TRQyFtXhpq_KRy8Zh4IZj55vYypmL1KbmeBUH1rldaU,275
|
|
4
|
-
meshcoredecoder/crypto/__init__.py,sha256=00r884_WImNp5YOYfSKYtUaIj6gZdyJV0--xC_Y71Ok,236
|
|
5
|
-
meshcoredecoder/crypto/channel_crypto.py,sha256=sNQq-CRr6zVGFOFO0Q7z5kVm7lYHY9fJsBjlSdssjTY,57242
|
|
6
|
-
meshcoredecoder/crypto/ed25519_verifier.py,sha256=9DAx0gqnf9I7fPxfKU4G1y0GbJK1stCtTKpCX4foL5k,5057
|
|
7
|
-
meshcoredecoder/crypto/key_manager.py,sha256=FXABZBd1B0kQwpyg7EX-pZDqxh5KVKnlB7A1FE3NQeU,5034
|
|
8
|
-
meshcoredecoder/decoder/__init__.py,sha256=P_E5CQS1eXoVy59A1mAV9TD5XCS6FpQpc4RizhOZVrw,654
|
|
9
|
-
meshcoredecoder/decoder/packet_decoder.py,sha256=eNiOQdfUWU1Sb0mbo94Ox2CFMxz01XLwCm1mjtBdNwY,24351
|
|
10
|
-
meshcoredecoder/decoder/payload_decoders/__init__.py,sha256=DGuu2SfDuAEg8hu9V6iWcxyXOUoen816SqcdZgVzHmU,778
|
|
11
|
-
meshcoredecoder/decoder/payload_decoders/ack.py,sha256=W6JgF6ylf-Y5IWW33P-_EHTz5GEYY_-ng_aUxvDdHac,3299
|
|
12
|
-
meshcoredecoder/decoder/payload_decoders/advert.py,sha256=OiOvjD2Db6d5GPA0Og2j7BQReGWLhiv6OcoyOtzZWOg,12627
|
|
13
|
-
meshcoredecoder/decoder/payload_decoders/anon_request.py,sha256=IhoQLnC7_7MDbdZLtFjcBBbAbQ-EC9k6JFfirhct3wg,7839
|
|
14
|
-
meshcoredecoder/decoder/payload_decoders/group_data.py,sha256=llDm6lXDYqM_3udSz7lOtKCfHR39hUa5zivyfs21B_U,5435
|
|
15
|
-
meshcoredecoder/decoder/payload_decoders/group_text.py,sha256=BhdF1ZYrMS_UH7-xRxeNHU1WvgNf2Buk9SxpDN0YYcQ,5526
|
|
16
|
-
meshcoredecoder/decoder/payload_decoders/path.py,sha256=MTptEthcN9R9r9KJf6Y40AWoZI54_vVlqBvXyAywrXk,13791
|
|
17
|
-
meshcoredecoder/decoder/payload_decoders/request.py,sha256=eYA_rxrEKZa1gS7pMGWMb6I_0F89vRoMW23b_3-nx_0,18601
|
|
18
|
-
meshcoredecoder/decoder/payload_decoders/response.py,sha256=RUAPC5jx-0R2W0l1b7BNwCqPiYqIyHljdI_72gmSDCQ,56765
|
|
19
|
-
meshcoredecoder/decoder/payload_decoders/text_message.py,sha256=sU4BH3bzbBDmxDYjX4N-1YWlOqx0kNOpwkSfsnYF26g,10368
|
|
20
|
-
meshcoredecoder/decoder/payload_decoders/trace.py,sha256=eN3E_5oidZzGdNsr--PhxtwYAwLW0lMJDGHz09lDqzA,6110
|
|
21
|
-
meshcoredecoder/types/__init__.py,sha256=XReL92twDsQQf8GUxYbPEdZGlV8XweQCPT-43jn8IfA,640
|
|
22
|
-
meshcoredecoder/types/crypto.py,sha256=o7C7IsiwMtJjzIUYRw548-AJmm898ucLDy1xYVukreE,1842
|
|
23
|
-
meshcoredecoder/types/enums.py,sha256=Cjl4VuEdW30KS8cY-atZY2-no523VPR46YFF-57dtOs,1139
|
|
24
|
-
meshcoredecoder/types/packet.py,sha256=LAMTHsFX3pWxP5M4gVsMRHEct2C2p36gpij_BuJofMw,3874
|
|
25
|
-
meshcoredecoder/types/payloads.py,sha256=cSKJYM5j2MZwEjbQrCS1ljX1LQvdPjY5GVNorQ3Q91A,12048
|
|
26
|
-
meshcoredecoder/utils/__init__.py,sha256=0_EpRPd97R2Cead_BTG9SDS6vVZV268u3XBkA-syOHk,739
|
|
27
|
-
meshcoredecoder/utils/auth_token.py,sha256=gVVgHH_Am1k-cZxPbrTHCafvqdWSqlg9Dw-RRYaRI8Y,6973
|
|
28
|
-
meshcoredecoder/utils/enum_names.py,sha256=6cSkbxexW8PT4MkwvWUA-oHQCvELUN2o3alIbp8bkP0,1936
|
|
29
|
-
meshcoredecoder/utils/hex.py,sha256=IjDuoeIAr7swv9Fa1NKstZTotTwmtufdi_psCjqVU5k,1136
|
|
30
|
-
meshcoredecoder-0.2.2.dist-info/licenses/LICENSE,sha256=W4bNA8wxOTF7Wmcmi5UwjrrKnjT_Qua52Z5wQLPLfKM,1130
|
|
31
|
-
meshcoredecoder-0.2.2.dist-info/METADATA,sha256=DxrnPrLbXVm4Gly-j5cJjMuQkPgTeA_E-xjcK8y_p3I,30671
|
|
32
|
-
meshcoredecoder-0.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
33
|
-
meshcoredecoder-0.2.2.dist-info/entry_points.txt,sha256=P8cgSHWETiDCc2jRCB95PuVyJDDeSq0gH-ufYVlqWDY,45
|
|
34
|
-
meshcoredecoder-0.2.2.dist-info/top_level.txt,sha256=Rj9ZjVG2I6CEgpgF8I_QqUDp-vTQEdYm2KD93mIGkJM,26
|
|
35
|
-
meshcoredecoder-0.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|