mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-15 00:02:49 +03:00
check for WiFi pass < 8 (not allowed for WPA2)
simplify STA config and allow setting of second DNS server for fallback code style
This commit is contained in:
@ -54,14 +54,18 @@ static bool softap_config_equal(const softap_config& lhs, const softap_config& r
|
||||
* @return equal
|
||||
*/
|
||||
static bool softap_config_equal(const softap_config& lhs, const softap_config& rhs) {
|
||||
if(strcmp(reinterpret_cast<const char*>(lhs.ssid), reinterpret_cast<const char*>(rhs.ssid)) != 0)
|
||||
if(strcmp(reinterpret_cast<const char*>(lhs.ssid), reinterpret_cast<const char*>(rhs.ssid)) != 0) {
|
||||
return false;
|
||||
if(strcmp(reinterpret_cast<const char*>(lhs.password), reinterpret_cast<const char*>(rhs.password)) != 0)
|
||||
}
|
||||
if(strcmp(reinterpret_cast<const char*>(lhs.password), reinterpret_cast<const char*>(rhs.password)) != 0) {
|
||||
return false;
|
||||
if(lhs.channel != rhs.channel)
|
||||
}
|
||||
if(lhs.channel != rhs.channel) {
|
||||
return false;
|
||||
if(lhs.ssid_hidden != rhs.ssid_hidden)
|
||||
}
|
||||
if(lhs.ssid_hidden != rhs.ssid_hidden) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -89,8 +93,8 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch
|
||||
return false;
|
||||
}
|
||||
|
||||
if(passphrase && strlen(passphrase) > 63) {
|
||||
// fail passphrase to long!
|
||||
if(passphrase && (strlen(passphrase) > 63 || strlen(passphrase) < 8)) {
|
||||
// fail passphrase to long or short!
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user