Enterprise security support

pull/11104/head
Teja Narahari 2019-07-19 15:23:24 +05:30
parent 46a56fb47b
commit d84b47728a
2 changed files with 7 additions and 2 deletions

View File

@ -113,6 +113,8 @@ static nsapi_security_t whd_tosecurity(whd_security_t sec)
return NSAPI_SECURITY_WPA;
case WHD_SECURITY_WPA2_MIXED_PSK:
return NSAPI_SECURITY_WPA_WPA2;
case WHD_SECURITY_WPA2_MIXED_ENT:
return NSAPI_SECURITY_WPA2_ENT;
case WHD_SECURITY_WPA2_AES_PSK:
case WHD_SECURITY_WPA2_AES_ENT:
case WHD_SECURITY_WPA2_FBT_PSK:
@ -136,6 +138,8 @@ whd_security_t whd_fromsecurity(nsapi_security_t sec)
return WHD_SECURITY_WPA2_AES_PSK;
case NSAPI_SECURITY_WPA_WPA2:
return WHD_SECURITY_WPA2_MIXED_PSK;
case NSAPI_SECURITY_WPA2_ENT:
return WHD_SECURITY_WPA2_MIXED_ENT;
default:
return WHD_SECURITY_UNKNOWN;
}
@ -179,8 +183,8 @@ nsapi_error_t WhdSTAInterface::set_credentials(const char *ssid, const char *pas
{
if ((ssid == NULL) ||
(strlen(ssid) == 0) ||
(pass == NULL && (security != NSAPI_SECURITY_NONE)) ||
(strlen(pass) == 0 && (security != NSAPI_SECURITY_NONE)) ||
(pass == NULL && ( security != NSAPI_SECURITY_NONE && security != NSAPI_SECURITY_WPA2_ENT)) ||
(strlen(pass) == 0 && ( security != NSAPI_SECURITY_NONE && security != NSAPI_SECURITY_WPA2_ENT)) ||
(strlen(pass) > 63 && (security == NSAPI_SECURITY_WPA2 || security == NSAPI_SECURITY_WPA || security == NSAPI_SECURITY_WPA_WPA2))
) {
return NSAPI_ERROR_PARAMETER;

View File

@ -127,6 +127,7 @@ typedef enum nsapi_security {
NSAPI_SECURITY_CHAP = 0x6, /*!< phrase conforms to PPP authentication context */
NSAPI_SECURITY_EAP_TLS = 0x7, /*!< phrase conforms to EAP-TLS */
NSAPI_SECURITY_PEAP = 0x8, /*!< phrase conforms to PEAP */
NSAPI_SECURITY_WPA2_ENT = 0x9, /*!< phrase conforms to WPA2-AES and WPA-TKIP with enterprise security */
NSAPI_SECURITY_UNKNOWN = 0xFF, /*!< unknown/unsupported security in scan results */
} nsapi_security_t;