jeelabs / esp-link

esp8266 wifi-serial bridge, outbound TCP, and arduino/AVR/LPC/NXP programmer
Other
2.82k stars 720 forks source link

Telnet escaping from uC to TCP #380

Open vdanika opened 6 years ago

vdanika commented 6 years ago

When communicating Telnet with binary data, the IAC (0xFF) bytes received from uart are not escaped. It seems Telnet escaping is implemented only in telnet->uart direction. I'm not sure where, but somewhere in "espbuffsend" should be a check for the conn_mode (conn->conn_mode == cmTelnet) and escaped the received IAC from uC. The use case: I'm using Telnet commands to put STM32 in DFU mode, than I upload the new binary using the DFU protocol. This part works fine, but when I try to verify the image, the Telnet socket breaks on invalid commands (because 0xFF is not escaped, the Telnet client try to parse command).