WPA2 Enterprise additions
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include <WiFiServer.h>
|
||||
#include <WiFiSSLClient.h>
|
||||
#include <WiFiUdp.h>
|
||||
#include "esp_wpa2.h"
|
||||
|
||||
#include "CommandHandler.h"
|
||||
|
||||
@@ -976,6 +977,74 @@ int setAnalogWrite(const uint8_t command[], uint8_t response[])
|
||||
return 6;
|
||||
}
|
||||
|
||||
int wpa2EntSetIdentity(const uint8_t command[], uint8_t response[]) {
|
||||
char identity[32 + 1];
|
||||
|
||||
memset(identity, 0x00, sizeof(identity));
|
||||
memcpy(identity, &command[4], command[3]);
|
||||
|
||||
esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)identity, strlen(identity));
|
||||
|
||||
response[2] = 1; // number of parameters
|
||||
response[3] = 1; // parameter 1 length
|
||||
response[4] = 1;
|
||||
|
||||
return 6;
|
||||
}
|
||||
|
||||
int wpa2EntSetUsername(const uint8_t command[], uint8_t response[]) {
|
||||
char username[32 + 1];
|
||||
|
||||
memset(username, 0x00, sizeof(username));
|
||||
memcpy(username, &command[4], command[3]);
|
||||
|
||||
esp_wifi_sta_wpa2_ent_set_username((uint8_t *)username, strlen(username));
|
||||
|
||||
response[2] = 1; // number of parameters
|
||||
response[3] = 1; // parameter 1 length
|
||||
response[4] = 1;
|
||||
|
||||
return 6;
|
||||
}
|
||||
|
||||
int wpa2EntSetPassword(const uint8_t command[], uint8_t response[]) {
|
||||
char password[32 + 1];
|
||||
|
||||
memset(password, 0x00, sizeof(password));
|
||||
memcpy(password, &command[4], command[3]);
|
||||
|
||||
esp_wifi_sta_wpa2_ent_set_password((uint8_t *)password, strlen(password));
|
||||
|
||||
response[2] = 1; // number of parameters
|
||||
response[3] = 1; // parameter 1 length
|
||||
response[4] = 1;
|
||||
|
||||
return 6;
|
||||
}
|
||||
|
||||
int wpa2EntSetCACert(const uint8_t command[], uint8_t response[]) {
|
||||
// not yet implemented (need to decide if writing in the filesystem is better than loading every time)
|
||||
// keep in mind size limit for messages
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wpa2EntSetCertKey(const uint8_t command[], uint8_t response[]) {
|
||||
// not yet implemented (need to decide if writing in the filesystem is better than loading every time)
|
||||
// keep in mind size limit for messages
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wpa2EntEnable(const uint8_t command[], uint8_t response[]) {
|
||||
|
||||
esp_wpa2_config_t config = WPA2_CONFIG_INIT_DEFAULT();
|
||||
esp_wifi_sta_wpa2_ent_enable(&config);
|
||||
|
||||
response[2] = 1; // number of parameters
|
||||
response[3] = 1; // parameter 1 length
|
||||
response[4] = 1;
|
||||
|
||||
return 6;
|
||||
}
|
||||
|
||||
typedef int (*CommandHandlerType)(const uint8_t command[], uint8_t response[]);
|
||||
|
||||
@@ -993,7 +1062,7 @@ const CommandHandlerType commandHandlers[] = {
|
||||
disconnect, NULL, getIdxRSSI, getIdxEnct, reqHostByName, getHostByName, startScanNetworks, getFwVersion, NULL, sendUDPdata, getRemoteData, getTime, getIdxBSSID, getIdxChannel, ping, getSocket,
|
||||
|
||||
// 0x40 -> 0x4f
|
||||
NULL, NULL, NULL, NULL, sendDataTcp, getDataBufTcp, insertDataBuf, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, sendDataTcp, getDataBufTcp, insertDataBuf, NULL, NULL, NULL, wpa2EntSetIdentity, wpa2EntSetUsername, wpa2EntSetPassword, wpa2EntSetCACert, wpa2EntSetCertKey, wpa2EntEnable,
|
||||
|
||||
// 0x50 -> 0x5f
|
||||
setPinMode, setDigitalWrite, setAnalogWrite,
|
||||
|
||||
16
sdkconfig
16
sdkconfig
@@ -171,6 +171,9 @@ CONFIG_SCAN_DUPLICATE_TYPE=0
|
||||
CONFIG_DUPLICATE_SCAN_CACHE_SIZE=200
|
||||
CONFIG_BLE_MESH_SCAN_DUPLICATE_EN=
|
||||
CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=
|
||||
CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=y
|
||||
CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM=100
|
||||
CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD=20
|
||||
CONFIG_BT_RESERVE_DRAM=0xdb5c
|
||||
|
||||
#
|
||||
@@ -191,6 +194,16 @@ CONFIG_SPI_MASTER_ISR_IN_IRAM=y
|
||||
CONFIG_SPI_SLAVE_IN_IRAM=
|
||||
CONFIG_SPI_SLAVE_ISR_IN_IRAM=y
|
||||
|
||||
#
|
||||
# eFuse Bit Manager
|
||||
#
|
||||
CONFIG_EFUSE_CUSTOM_TABLE=
|
||||
CONFIG_EFUSE_VIRTUAL=
|
||||
CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE=
|
||||
CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y
|
||||
CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT=
|
||||
CONFIG_EFUSE_MAX_BLK_LEN=192
|
||||
|
||||
#
|
||||
# ESP32-specific
|
||||
#
|
||||
@@ -288,6 +301,7 @@ CONFIG_ESP32_WIFI_NVS_ENABLED=y
|
||||
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
|
||||
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1=
|
||||
CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752
|
||||
CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32
|
||||
CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE=y
|
||||
CONFIG_ESP32_WIFI_DEBUG_LOG_DEBUG=
|
||||
CONFIG_ESP32_WIFI_DEBUG_LOG_VERBOSE=y
|
||||
@@ -296,6 +310,7 @@ CONFIG_ESP32_WIFI_DEBUG_LOG_MODULE_WIFI=y
|
||||
CONFIG_ESP32_WIFI_DEBUG_LOG_MODULE_COEX=
|
||||
CONFIG_ESP32_WIFI_DEBUG_LOG_MODULE_MESH=
|
||||
CONFIG_ESP32_WIFI_DEBUG_LOG_SUBMODULE=
|
||||
CONFIG_ESP32_WIFI_IRAM_OPT=y
|
||||
|
||||
#
|
||||
# PHY
|
||||
@@ -437,6 +452,7 @@ CONFIG_FREERTOS_USE_TRACE_FACILITY=
|
||||
CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=
|
||||
CONFIG_FREERTOS_DEBUG_INTERNALS=
|
||||
CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y
|
||||
CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y
|
||||
|
||||
#
|
||||
# Heap memory debugging
|
||||
|
||||
Reference in New Issue
Block a user