wpa2 enterprise: update wpa2 enterprise APIs
This commit is contained in:
parent
1ca82de638
commit
f7fb8b264f
|
@ -8,19 +8,29 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/**
|
||||
* @brief Set wpa2 enterprise authentication.
|
||||
* @brief Enable wpa2 enterprise authentication.
|
||||
*
|
||||
* @attention wpa2 enterprise authentication can only be used when ESP8266 station is enabled.
|
||||
* wpa2 enterprise authentication can only support PEAP-MSCHAPv2 and TTLS-MSCHAPv2 method.
|
||||
* @attention wpa2 enterprise authentication can only be used when ESP32 station is enabled.
|
||||
* wpa2 enterprise authentication can only support TLS, PEAP-MSCHAPv2 and TTLS-MSCHAPv2 method.
|
||||
*
|
||||
* @param enable
|
||||
* - 1: enable wpa2 enterprise authentication;
|
||||
* - 0: disable wpa2 enterprise authentication
|
||||
* @param null
|
||||
*
|
||||
* @return 0: succeed
|
||||
-1: fail
|
||||
* @return ESP_ERR_WIFI_OK: succeed.
|
||||
* ESP_ERR_WIFI_NO_MEM: fail(internal memory malloc fail)
|
||||
*/
|
||||
esp_err_t esp_wifi_sta_set_wpa2_enterprise_auth(int enable);
|
||||
esp_err_t esp_wifi_sta_wpa2_enterprise_enable(void);
|
||||
|
||||
/**
|
||||
* @brief Disable wpa2 enterprise authentication.
|
||||
*
|
||||
* @attention wpa2 enterprise authentication can only be used when ESP32 station is enabled.
|
||||
* wpa2 enterprise authentication can only support TLS, PEAP-MSCHAPv2 and TTLS-MSCHAPv2 method.
|
||||
*
|
||||
* @param null
|
||||
*
|
||||
* @return ESP_ERR_WIFI_OK: succeed.
|
||||
*/
|
||||
esp_err_t esp_wifi_sta_wpa2_enterprise_disable(void);
|
||||
|
||||
/**
|
||||
* @brief Set username for PEAP/TTLS method.
|
||||
|
@ -28,34 +38,12 @@ esp_err_t esp_wifi_sta_set_wpa2_enterprise_auth(int enable);
|
|||
* @param username: point to address where stores the username;
|
||||
* len: length of username, limited to 1~127
|
||||
*
|
||||
* @return 0: succeed
|
||||
* -1: fail(len <= 0 or len >= 128)
|
||||
* -2: fail(internal memory malloc fail)
|
||||
* @return ESP_ERR_WIFI_OK: succeed
|
||||
* ESP_ERR_WIFI_ARG: fail(len <= 0 or len >= 128)
|
||||
* ESP_ERR_WIFI_NO_MEM: fail(internal memory malloc fail)
|
||||
*/
|
||||
esp_err_t esp_wifi_sta_set_enterprise_username(unsigned char *username, int len);
|
||||
|
||||
/**
|
||||
* @brief Set password for PEAP/TTLS method..
|
||||
*
|
||||
* @param password: point to address where stores the password;
|
||||
* len: length of password
|
||||
*
|
||||
* @return 0: succeed
|
||||
* -1: fail(len <= 0)
|
||||
* -2: fail(internal memory malloc fail)
|
||||
*/
|
||||
esp_err_t esp_wifi_sta_set_enterprise_password(unsigned char *password, int len);
|
||||
|
||||
/**
|
||||
* @brief Set CA certificate for PEAP/TTLS method.
|
||||
*
|
||||
* @param ca_cert: point to address where stores the CA certificate;
|
||||
* len: length of ca_cert
|
||||
*
|
||||
* @return 0: succeed
|
||||
*/
|
||||
esp_err_t esp_wifi_sta_set_enterprise_ca_cert(unsigned char *ca_cert, int len);
|
||||
|
||||
/**
|
||||
* @brief Clear username for PEAP/TTLS method.
|
||||
*
|
||||
|
@ -65,6 +53,19 @@ esp_err_t esp_wifi_sta_set_enterprise_ca_cert(unsigned char *ca_cert, int len);
|
|||
*/
|
||||
void esp_wifi_sta_clear_enterprise_username(void);
|
||||
|
||||
/**
|
||||
* @brief Set password for PEAP/TTLS method..
|
||||
*
|
||||
* @param password: point to address where stores the password;
|
||||
* len: length of password
|
||||
*
|
||||
* @return ESP_ERR_WIFI_OK: succeed
|
||||
* ESP_ERR_WIFI_ARG: fail(len <= 0)
|
||||
* ESP_ERR_WIFI_NO_MEM: fail(internal memory malloc fail)
|
||||
*/
|
||||
|
||||
esp_err_t esp_wifi_sta_set_enterprise_password(unsigned char *password, int len);
|
||||
|
||||
/**
|
||||
* @brief Clear password for PEAP/TTLS method..
|
||||
*
|
||||
|
@ -74,6 +75,38 @@ void esp_wifi_sta_clear_enterprise_username(void);
|
|||
*/
|
||||
void esp_wifi_sta_clear_enterprise_password(void);
|
||||
|
||||
/**
|
||||
* @brief Set new password for PEAP/TTLS method..
|
||||
*
|
||||
* @param password: point to address where stores the password;
|
||||
* len: length of password
|
||||
*
|
||||
* @return ESP_ERR_WIFI_OK: succeed
|
||||
* ESP_ERR_WIFI_ARG: fail(len <= 0)
|
||||
* ESP_ERR_WIFI_NO_MEM: fail(internal memory malloc fail)
|
||||
*/
|
||||
|
||||
esp_err_t esp_wifi_sta_set_enterprise_new_password(unsigned char *password, int len);
|
||||
|
||||
/**
|
||||
* @brief Clear new password for PEAP/TTLS method..
|
||||
*
|
||||
* @param null
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
void esp_wifi_sta_clear_enterprise_new_password(void);
|
||||
|
||||
/**
|
||||
* @brief Set CA certificate for PEAP/TTLS method.
|
||||
*
|
||||
* @param ca_cert: point to address where stores the CA certificate;
|
||||
* len: length of ca_cert
|
||||
*
|
||||
* @return ESP_ERR_WIFI_OK: succeed
|
||||
*/
|
||||
esp_err_t esp_wifi_sta_set_enterprise_ca_cert(unsigned char *ca_cert, int len);
|
||||
|
||||
/**
|
||||
* @brief Clear CA certificate for PEAP/TTLS method.
|
||||
*
|
||||
|
@ -93,7 +126,7 @@ void esp_wifi_sta_clear_enterprise_ca_cert(void);
|
|||
* private_key_password: point to address where stores the private key password;
|
||||
* private_key_password_len: length of private key password;
|
||||
*
|
||||
* @return 0: succeed
|
||||
* @return ESP_ERR_WIFI_OK: succeed
|
||||
*/
|
||||
esp_err_t esp_wifi_sta_set_enterprise_cert_key(unsigned char *client_cert, int client_cert_len, unsigned char *private_key, int private_key_len, unsigned char *private_key_passwd, int private_key_passwd_len);
|
||||
|
||||
|
@ -106,6 +139,25 @@ esp_err_t esp_wifi_sta_set_enterprise_cert_key(unsigned char *client_cert, int c
|
|||
*/
|
||||
void esp_wifi_sta_clear_enterprise_cert_key(void);
|
||||
|
||||
/**
|
||||
* @brief Set wpa2 enterprise certs time check(disable or not).
|
||||
*
|
||||
* @param true: disable wpa2 enterprise certs time check
|
||||
* false: enable wpa2 enterprise certs time check
|
||||
*
|
||||
* @return ESP_ERR_WIFI_OK: succeed
|
||||
*/
|
||||
esp_err_t esp_wifi_sta_set_enterprise_disable_time_check(bool disable);
|
||||
|
||||
/**
|
||||
* @brief Get wpa2 enterprise certs time check(disable or not).
|
||||
*
|
||||
* @param disable: store disable value
|
||||
*
|
||||
* @return ESP_ERR_WIFI_OK: succeed
|
||||
*/
|
||||
esp_err_t esp_wifi_sta_get_enterprise_disable_time_check(bool *disable);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue