Skip to content

Commit

Permalink
Fix 64 character WPA2 PSK password.
Browse files Browse the repository at this point in the history
  • Loading branch information
BotoX authored Jun 6, 2017
1 parent fd7a20d commit 01c6dad
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sming/SmingCore/Platform/Station.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ bool StationClass::config(String ssid, String password, bool autoConnectOnStartu
station_config config = {0};

if (ssid.length() >= sizeof(config.ssid)) return false;
if (password.length() >= sizeof(config.password)) return false;
if (password.length() > sizeof(config.password)) return false;

bool enabled = isEnabled();
bool dhcp = isEnabledDHCP();
Expand All @@ -70,7 +70,10 @@ bool StationClass::config(String ssid, String password, bool autoConnectOnStartu
memset(config.password, 0, sizeof(config.password));
config.bssid_set = false;
strcpy((char*)config.ssid, ssid.c_str());
strcpy((char*)config.password, password.c_str());
if (password.length() == 64)
memcpy((char*)config.password, password.c_str(), 64);
else
strcpy((char*)config.password, password.c_str());

noInterrupts();

Expand Down

0 comments on commit 01c6dad

Please sign in to comment.