Skip to content

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

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
sauttefk opened this issue Apr 5, 2016 · 0 comments
Closed

Comments

@sauttefk
Copy link
Contributor

sauttefk commented Apr 5, 2016

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.

@sauttefk sauttefk changed the title Commit 293e55c breaks old behaviour of AUTH_OPEN on empty string Commit 293e55c breaks old behaviour of AUTH_OPEN on empty passphrase string Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant