mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 03:07:21 +02:00
Merge branch 'bugfix/wps_phassphrase_v5.0' into 'release/v5.0'
wpa_supplicant: Get WPS credential in passphrase format(v5.0) See merge request espressif/esp-idf!23076
This commit is contained in:
@ -400,4 +400,15 @@ menu "Wi-Fi"
|
|||||||
When using ESP mesh, this value should be set to a maximum of 6.
|
When using ESP mesh, this value should be set to a maximum of 6.
|
||||||
|
|
||||||
|
|
||||||
endmenu # Wi-Fi
|
config ESP_WIFI_WPS_PASSPHRASE
|
||||||
|
bool "Get WPA2 passphrase in WPS config"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Select this option to get passphrase during WPS configuration.
|
||||||
|
This option fakes the virtual display capabilites to get the
|
||||||
|
configuration in passphrase mode.
|
||||||
|
Not recommanded to be used since WPS credentials should not
|
||||||
|
be shared to other devices, making it in readable format increases
|
||||||
|
that risk, also passphrase requires pbkdf2 to convert in psk.
|
||||||
|
|
||||||
|
endmenu # Wi-Fi
|
||||||
|
@ -805,11 +805,12 @@ int wps_finish(void)
|
|||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
esp_wifi_get_config(WIFI_IF_STA, config);
|
||||||
os_memcpy(config->sta.ssid, sm->ssid[0], sm->ssid_len[0]);
|
os_memcpy(config->sta.ssid, sm->ssid[0], sm->ssid_len[0]);
|
||||||
os_memcpy(config->sta.password, sm->key[0], sm->key_len[0]);
|
os_memcpy(config->sta.password, sm->key[0], sm->key_len[0]);
|
||||||
os_memcpy(config->sta.bssid, sm->bssid, ETH_ALEN);
|
os_memcpy(config->sta.bssid, sm->bssid, ETH_ALEN);
|
||||||
config->sta.bssid_set = 0;
|
config->sta.bssid_set = 0;
|
||||||
esp_wifi_set_config(0, config);
|
esp_wifi_set_config(WIFI_IF_STA, config);
|
||||||
|
|
||||||
os_free(config);
|
os_free(config);
|
||||||
}
|
}
|
||||||
@ -1151,7 +1152,10 @@ int wps_dev_init(void)
|
|||||||
ret = ESP_FAIL;
|
ret = ESP_FAIL;
|
||||||
goto _out;
|
goto _out;
|
||||||
}
|
}
|
||||||
dev->config_methods = WPS_CONFIG_VIRT_PUSHBUTTON | WPS_CONFIG_PHY_DISPLAY;
|
dev->config_methods = WPS_CONFIG_VIRT_PUSHBUTTON;
|
||||||
|
#ifdef CONFIG_ESP_WIFI_WPS_PASSPHRASE
|
||||||
|
dev->config_methods |= WPS_CONFIG_DISPLAY | WPS_CONFIG_VIRT_DISPLAY;
|
||||||
|
#endif
|
||||||
dev->rf_bands = WPS_RF_24GHZ;
|
dev->rf_bands = WPS_RF_24GHZ;
|
||||||
|
|
||||||
WPA_PUT_BE16(dev->pri_dev_type, WPS_DEV_PHONE);
|
WPA_PUT_BE16(dev->pri_dev_type, WPS_DEV_PHONE);
|
||||||
@ -1433,6 +1437,7 @@ static int wifi_station_wps_init(const esp_wps_config_t *config)
|
|||||||
}
|
}
|
||||||
|
|
||||||
os_memcpy(cfg.wps->uuid, sm->uuid, WPS_UUID_LEN);
|
os_memcpy(cfg.wps->uuid, sm->uuid, WPS_UUID_LEN);
|
||||||
|
cfg.wps->config_methods = sm->wps_ctx->dev.config_methods;
|
||||||
if ((sm->wps = wps_init(&cfg)) == NULL) { /* alloc wps_data */
|
if ((sm->wps = wps_init(&cfg)) == NULL) { /* alloc wps_data */
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user