Skip to content

SSID wrong lenght validator #4911

Closed
Closed
@mictlan666

Description

@mictlan666

Hello,
In file: https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp
Method: wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase, int32_t channel, const uint8_t* bssid, bool connect)
Line: 107
You have that condition:

  if(!ssid || *ssid == 0x00 || strlen(ssid) > 31) {
        // fail SSID too long or missing!
        return WL_CONNECT_FAILED;
}

This is not agree to IEEE 802.11 standard (https://tools.ietf.org/html/rfc3770#section-4)
SSID could have 32 octets, you checking by strlen so 31 octets with NULL in the end will the longest SSID in your case.
I sure about this because of my local wifi network is md5 hash so has 32 octets.
Dont work when i rewrite to 32 const array: char ssid[32];
You should change condition to strlen(ssid) > 32 OR rewrite first 32 octets (or to NULL) to char ssid[32];

Best regards.

Metadata

Metadata

Assignees

Labels

waiting for feedbackWaiting on additional info. If it's not received, the issue may be closed.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions