Incorrect lengths in wifi_ap_config_t for SSID and WFA-PSK
Posted: Fri Aug 02, 2019 3:16 am
- typedef struct {
- uint8_t ssid[32]; /**< SSID of target AP. Null terminated string. */
- uint8_t password[64]; /**< Password of target AP. Null terminated string.*/
- wifi_scan_method_t scan_method; /**< do all channel scan or fast scan */
- bool bssid_set; /**< whether set MAC address of target AP or not. Generally, station_config.bssid_set needs to be 0; and it needs to be 1 only when users need to check the MAC address of the AP.*/
- uint8_t bssid[6]; /**< MAC address of target AP*/
- uint8_t channel; /**< channel of target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. If the channel of AP is unknown, set it to 0.*/
- uint16_t listen_interval; /**< Listen interval for ESP32 station to receive beacon when WIFI_PS_MAX_MODEM is set. Units: AP beacon intervals. Defaults to 3 if set to 0. */
- wifi_sort_method_t sort_method; /**< sort the connect AP in the list by rssi or security mode */
- wifi_scan_threshold_t threshold; /**< When scan_method is set, only APs which have an auth mode that is more secure than the selected auth mode and a signal stronger than the minimum RSSI will be used. */
- } wifi_sta_config_t;
The same issue is with password that should be 65 bytes long assuming it is null-terminated string.
Not major issue in the most cases but especially in machine generated passwords, one could easily get bitten by this.