Skip to content

Commit 5662733

Browse files
dav1901devyte
authored andcommitted
Set authmode if passphrase is provided (#5317)
1 parent 4726a25 commit 5662733

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
117117

118118
struct station_config conf;
119119
strcpy(reinterpret_cast<char*>(conf.ssid), ssid);
120+
121+
conf.threshold.authmode = AUTH_OPEN;
120122

121123
if(passphrase) {
124+
conf.threshold.authmode = AUTH_WPA_PSK;
122125
if (strlen(passphrase) == 64) // it's not a passphrase, is the PSK, which is copied into conf.password without null term
123126
memcpy(reinterpret_cast<char*>(conf.password), passphrase, 64);
124127
else
@@ -130,9 +133,6 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
130133
conf.threshold.rssi = -127;
131134
conf.open_and_wep_mode_disable = !(_useInsecureWEP || *conf.password == 0);
132135

133-
// TODO(#909): set authmode to AUTH_WPA_PSK if passphrase is provided
134-
conf.threshold.authmode = AUTH_OPEN;
135-
136136
if(bssid) {
137137
conf.bssid_set = 1;
138138
memcpy((void *) &conf.bssid[0], (void *) bssid, 6);

0 commit comments

Comments
 (0)