Skip to content

Commit 3242743

Browse files
committed
Work around a bug user auth banner message generated by cryptlib
This commit works around the inclusion of an extra NUL byte in user auth banner messages generated by the cryptlib library. Thanks go to GitHub user mmayomoar for reporting this issue and suggesting a fix.
1 parent f2020ed commit 3242743

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

asyncssh/connection.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2501,6 +2501,13 @@ def _process_userauth_banner(self, _pkttype: int, _pktid: int,
25012501

25022502
msg_bytes = packet.get_string()
25032503
lang_bytes = packet.get_string()
2504+
2505+
# Work around an extra NUL byte appearing in the user
2506+
# auth banner message in some versions of cryptlib
2507+
if b'cryptlib' in self._server_version and \
2508+
packet.get_remaining_payload() == b'\0': # pragma: no cover
2509+
packet.get_byte()
2510+
25042511
packet.check_end()
25052512

25062513
try:

0 commit comments

Comments
 (0)