{"action":"closed","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/1861","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/1861/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/1861/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/1861/events","html_url":"https://github.com/esp8266/Arduino/issues/1861","id":145918814,"number":1861,"title":"Commit 293e55c breaks old behaviour of AUTH_OPEN on empty passphrase string","user":{"login":"sauttefk","id":776799,"avatar_url":"https://avatars.githubusercontent.com/u/776799?v=3","gravatar_id":"","url":"https://api.github.com/users/sauttefk","html_url":"https://github.com/sauttefk","followers_url":"https://api.github.com/users/sauttefk/followers","following_url":"https://api.github.com/users/sauttefk/following{/other_user}","gists_url":"https://api.github.com/users/sauttefk/gists{/gist_id}","starred_url":"https://api.github.com/users/sauttefk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sauttefk/subscriptions","organizations_url":"https://api.github.com/users/sauttefk/orgs","repos_url":"https://api.github.com/users/sauttefk/repos","events_url":"https://api.github.com/users/sauttefk/events{/privacy}","received_events_url":"https://api.github.com/users/sauttefk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-05T07:50:27Z","updated_at":"2016-04-13T11:17:14Z","closed_at":"2016-04-13T11:17:14Z","body":"With commit 293e55c softAP setup with passphrases shorter than 8 characters are rejected `strlen(passphrase) < 8`.\r\nThe old behaviour was to allow an empty passphrase to configure AUTH_OPEN mode.\r\nIn a lot of code examples floating around in the internet those empty strings are used so this commit breaks them. \r\n\r\nhttps://github.com/esp8266/Arduino/blob/293e55c6903f5f9de3e5c3d69016c86af3b41398/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp#L96\r\n```\r\n    if(passphrase && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) {\r\n        // fail passphrase to long or short!\r\n        return false;\r\n    }\r\n\r\n[stuff deleted]\r\n\r\n    if(!passphrase || strlen(passphrase) == 0) {\r\n        conf.authmode = AUTH_OPEN;\r\n        *conf.password = 0;\r\n    } else {\r\n        conf.authmode = AUTH_WPA2_PSK;\r\n        strcpy(reinterpret_cast<char*>(conf.password), passphrase);\r\n    }\r\n```\r\n\r\nI suggest to change line 96, to keep the old behaviour:\r\n\r\n```\r\n    if(*passphrase != 0 && passphrase && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) {\r\n```\r\nOtherwise, if the new behaviour is desired `strlen(passphrase) == 0` on line 109 could be removed.\r\n\r\n"}}