Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ supported, widely used by MUD servers to reduce bandwidth::
# connect to a MUD that offers MCCP compression
telnetlib3-client dunemud.net 6789

# or with TLS (compression auto-disabled over TLS, CRIME/BREACH mitigation)
telnetlib3-client --ssl dunemud.net 6788

# actively request compression from a server
telnetlib3-client --compression dunemud.net 6789

Expand All @@ -154,11 +151,9 @@ supported, widely used by MUD servers to reduce bandwidth::
# host a MUD server that advertises MCCP2/MCCP3
telnetlib3-server --compression --shell=my_mud.shell

By default (without ``--compression`` or ``--no-compression``), the client
passively accepts compression when offered by the server, and the server does
not advertise compression. Compression is automatically disabled over TLS
connections to avoid CRIME/BREACH attacks.

By default (without ``--compression`` or ``--no-compression``), the telnetlib3-client passively
accepts compression when offered by the server, and the telnetlib3-server does not advertise
compression. Compression is automatically disabled over TLS connections.

Asyncio Protocol
----------------
Expand Down
4 changes: 0 additions & 4 deletions bin/server_mud.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,6 @@ async def dispatch(self, text: str) -> bool:
return True
return await method(argument)

# -- commands -------------------------------------------------------

async def do_help(self, argument: str) -> bool:
"""Show available commands."""
if argument:
Expand Down Expand Up @@ -679,8 +677,6 @@ async def do_quit(self, *_args: str) -> bool:
broadcast_room(self.writer, self.player.room, f"{self.player.name} has left.")
return False

# -- helpers --------------------------------------------------------

async def _move(self, direction: str) -> bool:
"""Move player in *direction*."""
w, p = self.writer, self.player
Expand Down
8 changes: 4 additions & 4 deletions docs/guidebook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ TLS / SSL

Telnet over TLS (TELNETS, IANA port 992) secures the connection using
standard TLS encryption. The TLS handshake is handled at the transport
layer the telnet protocol sees plaintext exactly as it would over plain
layer, the telnet protocol sees plaintext exactly as it would over plain
TCP. This is *not* STARTTLS (upgrade-in-place); the connection is
encrypted from the start.

Expand Down Expand Up @@ -426,10 +426,10 @@ Or programmatically with full control::
import ssl
import telnetlib3

# CA-signed server just pass ssl=True
# CA-signed server, just pass ssl=True
reader, writer = await telnetlib3.open_connection("dunemud.net", 6788, ssl=True)

# Self-signed load the server's cert explicitly
# Self-signed, load the server's cert explicitly
ctx = ssl.create_default_context(cafile="cert.pem")
reader, writer = await telnetlib3.open_connection("localhost", 6023, ssl=ctx)

Expand All @@ -447,7 +447,7 @@ certificates)::
.. warning::

``--ssl-no-verify`` is **insecure**. The connection is encrypted, but the
server's identity is not verified a man-in-the-middle could intercept
server's identity is not verified, a man-in-the-middle could intercept
traffic. Only use this for testing or when you trust the network path.

server_tls.py
Expand Down
23 changes: 17 additions & 6 deletions docs/history.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
History
=======
4.0.3
* bugfix: long-running servers leaked memory through :class:`~telnetlib3.server.Server`
``_protocols`` list and ``_new_client`` asyncio.Queue. Both are now bounded
and regularly pruned.
* enhancement: ``telnetlib3.telnet`` now overlays std library module space, ``import telnetlib``
:ghissue:`139`.
* enhancement: ``telnetlib3-fingerprint-server`` and ``telnetlib3-fingerprint`` client now also
detect "telnet loops" and "wrong direction" errors in opposing IAC parser.
* removed: ``telnetlib3-fingerprint-server`` no longer integrates with the (never released)
``tv-detect`` package for terminal vulnerability probing.

4.0.2
* bugfix: MCCP2 decompression failed on MUD servers using raw deflate or gzip-wrapped compression,
producing garbled banners. The client now auto-detects zlib/gzip format and falls back to raw
Expand Down Expand Up @@ -84,7 +95,7 @@ History
server and client protocol code.
* new: ``_atomic_json_write()`` and ``_BytesSafeEncoder`` helpers in
``_paths`` module for fingerprinting subsystem.
* enhancement: Microsoft Telnet (``telnet.exe``) compatibility refined server
* enhancement: Microsoft Telnet (``telnet.exe``) compatibility refined, server
now sends ``DO NEW_ENVIRON`` but excludes ``USER`` variable instead of
skipping the option entirely, :ghissue:`24`.
* enhancement: comprehensive pylint and mypy cleanup across the codebase.
Expand All @@ -108,7 +119,7 @@ History
MSSP, MSP, MXP, ZMP, AARDWOLF, ATCP) by default. Use ``--always-do`` or
``--always-will`` to opt in.
* bugfix: log output "staircase text" in raw terminal mode.
* bugfix: graceful EOF handling connection close no longer prints a traceback.
* bugfix: graceful EOF handling, connection close no longer prints a traceback.

2.5.0
* change: ``telnetlib3-client`` now defaults to raw terminal mode (no line
Expand Down Expand Up @@ -159,7 +170,7 @@ History
art) as surrogates instead of replacing them with U+FFFD.

2.4.0
* new: ``telnetlib3.color_filter`` module translates 16-color ANSI SGR
* new: ``telnetlib3.color_filter`` module, translates 16-color ANSI SGR
codes to 24-bit RGB from hardware palettes (EGA, CGA, VGA, xterm).
Enabled by default. New client CLI options: ``--colormatch``,
``--color-brightness``, ``--color-contrast``, ``--background-color``,
Expand All @@ -181,11 +192,11 @@ History
* enhancement: ``telnetlib3-fingerprint`` now always probes extended MUD
options (MSP, MXP, ZMP, AARDWOLF, ATCP) during server scans and captures
ZMP, ATCP, Aardwolf, MXP, and COM-PORT data in session output.
* enhancement: ``telnetlib3-fingerprint`` smart prompt detection —
* enhancement: ``telnetlib3-fingerprint`` smart prompt detectionm
auto-answers yes/no, color, UTF-8 menu, ``who``, and ``help`` prompts.
* enhancement: ``--banner-max-bytes`` option for ``telnetlib3-fingerprint``;
default raised from 1024 to 65536.
* new: ATASCII (Atari 8-bit) codec ``--encoding=atascii`` for connecting
* new: ATASCII (Atari 8-bit) codec, ``--encoding=atascii`` for connecting
to Atari BBS systems. Maps all 256 byte values to Unicode including
graphics characters, card suits, and the inverse-video range (0x80--0xFF).
ATASCII EOL (0x9B) maps to newline. Aliases: ``atari8bit``, ``atari_8bit``.
Expand Down Expand Up @@ -233,7 +244,7 @@ History
* enhancement: reversed ``WILL``/``DO`` for directional options (e.g. ``WILL
NAWS`` from server, ``DO TTYPE`` from client) now gracefully refused with
``DONT``/``WONT`` instead of raising :exc:`ValueError`.
* enhancement: ``NEW_ENVIRON SEND`` and response logging improved
* enhancement: ``NEW_ENVIRON SEND`` and response logging improved,
``SEND (all)`` / ``env send: (empty)`` instead of raw byte dumps.
* enhancement: ``telnetlib3-fingerprint`` now probes MSDP and MSSP options
and captures MSSP server status data in session output.
Expand Down
5 changes: 3 additions & 2 deletions docs/rfcs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RFCs Implemented
* :rfc:`859`, "Telnet Status Option", May 1983.
* :rfc:`860`, "Telnet Timing mark Option", May 1983.
* :rfc:`885`, "Telnet End of Record Option", Dec 1983.
* :rfc:`930`, "Telnet Terminal Type Option", Jan 1984.
* :rfc:`1073`, "Telnet Window Size Option", Oct 1988.
* :rfc:`1079`, "Telnet Terminal Speed Option", Dec 1988.
* :rfc:`1091`, "Telnet Terminal-Type Option", Feb 1989.
Expand Down Expand Up @@ -59,8 +60,8 @@ RFCs Not Implemented
* :rfc:`1041`, "Telnet 3270 Regime Option", Jan 1988
* :rfc:`1043`, "Telnet Data Entry Terminal Option", Feb 1988
* :rfc:`1097`, "Telnet Subliminal-Message Option", Apr 1989
* :rfc:`1143`, "The Q Method of Implementing .. Option Negotiation", Feb 1990
Approximately only Rules 1, 2, and 3, but not 4, 5, and 6.
* :rfc:`1143`, "The Q Method of Implementing .. Option Negotiation", Feb 1990, Approximately only
Rules 1, 2, and 3 are implemented, but not 4, 5, and 6.
* :rfc:`1205`, "5250 Telnet Interface", Feb 1991
* :rfc:`1411`, "Telnet Authentication: Kerberos_ Version 4", Jan 1993
* :rfc:`1412`, "Telnet Authentication: SPX"
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ classifiers = [
requires-python = ">=3.9"
dependencies = [
"wcwidth>=0.6.0",
"blessed>=1.33; platform_system == 'Windows'",
"blessed>=1.41; platform_system == 'Windows'",
]

[project.optional-dependencies]
Expand All @@ -55,6 +55,7 @@ docs = [
"sphinx-autodoc-typehints",
]
extras = [
"blessed>=1.41",
"prettytable>=3.17,<4",
"ucs-detect>=2,<3",
]
Expand Down
4 changes: 2 additions & 2 deletions telnetlib3/client_shell_win32.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ async def telnet_client_shell(
"""
Windows telnet client shell using blessed/jinxed Terminal.

Requires ``blessed>=1.20`` (installed automatically on Windows via the
``blessed; platform_system == 'Windows'`` dependency in pyproject.toml).
Requires blessed, installed automatically on Windows via the
``blessed; platform_system == 'Windows'`` directive in pyproject.toml.
"""
with Terminal(telnet_writer=telnet_writer) as tty_shell:
await _telnet_client_shell_impl(telnet_reader, telnet_writer, tty_shell)
2 changes: 1 addition & 1 deletion telnetlib3/encodings/big5bbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def decode(self, input: bytes, final: bool = False) -> str: # type: ignore[over
result.append(bytes([b, b2]).decode("big5", errors="strict"))
i += 2
except UnicodeDecodeError:
# Structurally valid but undefined in Big5 treat
# Structurally valid but undefined in Big5, treat
# the lone lead byte as a CP437 half-width character.
result.append(bytes([b]).decode("cp437"))
i += 1
Expand Down
Loading
Loading