Skip to content

Add PSK support for WiFiMulti #3914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xchgrbprsp opened this issue Apr 19, 2020 · 2 comments
Closed

Add PSK support for WiFiMulti #3914

xchgrbprsp opened this issue Apr 19, 2020 · 2 comments
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@xchgrbprsp
Copy link

xchgrbprsp commented Apr 19, 2020

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.

@stale
Copy link

stale bot commented Jun 18, 2020

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Jun 18, 2020
@stale
Copy link

stale bot commented Jul 2, 2020

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

1 participant