Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add PSK support for WiFiMulti #3914

Copy link
Copy link
Closed
Closed
Copy link
@xchgrbprsp

Description

@xchgrbprsp
Issue body actions

I need to use a PSK instead of a passphrase to connect to WiFi networks using the WiFiMulti library. However, I noticed in the code that there's a length limit of 63 for the argument passphrase.

WiFiMulti.cpp:

bool WiFiMulti::addAP(const char* ssid, const char *passphrase)
{
    WifiAPlist_t newAP;

    if(!ssid || *ssid == 0x00 || strlen(ssid) > 31) {
        // fail SSID too long or missing!
        log_e("[WIFI][APlistAdd] no ssid or ssid too long");
        return false;
    }

    if(passphrase && strlen(passphrase) > 63) {
        // fail passphrase too long!
        log_e("[WIFI][APlistAdd] passphrase too long");
        return false;
    }

and unsurprisingly I got the following error when I call addAP with a PSK which is 64 bytes long:
[E][WiFiMulti.cpp:61] addAP(): [WIFI][APlistAdd] passphrase too long

The thing is WiFi.begin takes PSK as the passphrase argument just fine and I was able to successfully connect when I changed the passphrase length limit to 64 instead.

[I][WiFiMulti.cpp:84] addAP(): [WIFI][APlistAdd] add SSID: XXXXXX
[I][WiFiMulti.cpp:119] run(): [WIFI] 14 networks found
[I][WiFiMulti.cpp:160] run(): [WIFI] Connecting BSSID: A8:E5:44:XX:XX:XX SSID: XXXXXX Channal: 7 (-46)
[I][WiFiMulti.cpp:174] run(): [WIFI] Connecting done.

I would like to know if this is a bug where the passphrase argument length limit was not revised when PSK support was added or if there are other concerns for allowing PSK here. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)Issue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.