Skip to content

SSID and passphrase/PSK may be truncated or be treated as broken #5367

Closed
@inagaki83

Description

@inagaki83

Hardware:

Board: ESP32 Dev Module
Core Installation version: 1.0.3
IDE name: Arduino IDE
Flash Frequency: 40MHz
PSRAM enabled: no
Upload Speed: 460800
Computer OS: Debian

Description:

  1. SSID is up to 32-octet length according to the standard. But 32-octet SSID is rejected in WiFiSTA.cpp or is truncated to 31 octets in WiFiAP.cpp.
  2. 64-char PSK is truncated to 63 characters (to be broken) in WiFiAP.cpp by strlcpy().
  3. SoftAP with 62-char or shorter passphrases might cause "Password error" in client side (10% of board caused this issue). Filling the wifi_ap_config_t::password[64] using strncpy() resolved the issue. So it's an ESP-IDF bug and affected by some noise bytes after NUL, I guess.
  4. On the HEAD, SSID or passphrase including % will cause unintentional printf formatting and will be broken in WiFiAP.cpp and WiFiSTA.cpp.

SSID and passphrase/PSK should always be copied using strncpy(), I think.

Sketch:

In the official example WiFiAccessPoint.ino, you should use...:

  • 32-octet SSID.
  • 64-character PSK.
  • some % character in SSID and passphrase.

In the official example WiFiClient.ino, you should use...:

  • 32-octet SSID.
  • some % character in SSID and passphrase.

Debug Messages:

No debug messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions