Skip to content

Commit 293e55c breaks old behaviour of AUTH_OPEN on empty passphrase string #1861

@sauttefk

Description

@sauttefk

With commit 293e55c softAP setup with passphrases shorter than 8 characters are rejected strlen(passphrase) < 8.
The old behaviour was to allow an empty passphrase to configure AUTH_OPEN mode.
In a lot of code examples floating around in the internet those empty strings are used so this commit breaks them.

if(passphrase && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) {

    if(passphrase && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) {
        // fail passphrase to long or short!
        return false;
    }

[stuff deleted]

    if(!passphrase || strlen(passphrase) == 0) {
        conf.authmode = AUTH_OPEN;
        *conf.password = 0;
    } else {
        conf.authmode = AUTH_WPA2_PSK;
        strcpy(reinterpret_cast<char*>(conf.password), passphrase);
    }

I suggest to change line 96, to keep the old behaviour:

    if(*passphrase != 0 && passphrase && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) {

Otherwise, if the new behaviour is desired strlen(passphrase) == 0 on line 109 could be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions