Skip to content

Commit 517f893

Browse files
committed
Update ticket length constants to support legacy UDS
1 parent 1e552fd commit 517f893

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/UDSClient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def parse_arguments(args: typing.List[str]) -> typing.Tuple[str, str, str, bool]
418418
raise exceptions.MessageException('Not supported protocol') # Just shows "about" dialog
419419

420420
# If ticket length is not valid
421-
if len(ticket) != consts.TICKET_LENGTH:
421+
if len(ticket) not in (consts.TICKET_LENGTH, consts.LEGACY_TICKET_LENGTH):
422422
raise exceptions.MessageException(f'Invalid ticket: {ticket}')
423423

424424
return (

src/uds/consts.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ def _feature_requested(env_var: str) -> bool:
108108
RESPONSE_OK: typing.Final[bytes] = b'OK'
109109

110110
# Ticket length
111-
TICKET_LENGTH: typing.Final[int] = 40 # Ticket length FOR UDS
111+
TICKET_LENGTH: typing.Final[int] = 48 # Ticket length FOR UDS
112+
LEGACY_TICKET_LENGTH: typing.Final[int] = 40 # Ticket length for legacy UDS (pre 3.5.x)
112113

113114
# Constants strings for protocol
114115
HANDSHAKE_V1: typing.Final[bytes] = b'\x5AMGB\xA5\x01\x00'

0 commit comments

Comments
 (0)