Skip to content

Commit 476ce09

Browse files
authored
Merge pull request #11104 from tejanarahari/pr/enterprise-security-feature-support-pr2
Enterprise security support
2 parents ff4dac9 + d84b477 commit 476ce09

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

features/netsocket/emac-drivers/TARGET_WHD/interface/WhdSTAInterface.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ static nsapi_security_t whd_tosecurity(whd_security_t sec)
113113
return NSAPI_SECURITY_WPA;
114114
case WHD_SECURITY_WPA2_MIXED_PSK:
115115
return NSAPI_SECURITY_WPA_WPA2;
116+
case WHD_SECURITY_WPA2_MIXED_ENT:
117+
return NSAPI_SECURITY_WPA2_ENT;
116118
case WHD_SECURITY_WPA2_AES_PSK:
117119
case WHD_SECURITY_WPA2_AES_ENT:
118120
case WHD_SECURITY_WPA2_FBT_PSK:
@@ -136,6 +138,8 @@ whd_security_t whd_fromsecurity(nsapi_security_t sec)
136138
return WHD_SECURITY_WPA2_AES_PSK;
137139
case NSAPI_SECURITY_WPA_WPA2:
138140
return WHD_SECURITY_WPA2_MIXED_PSK;
141+
case NSAPI_SECURITY_WPA2_ENT:
142+
return WHD_SECURITY_WPA2_MIXED_ENT;
139143
default:
140144
return WHD_SECURITY_UNKNOWN;
141145
}
@@ -179,8 +183,8 @@ nsapi_error_t WhdSTAInterface::set_credentials(const char *ssid, const char *pas
179183
{
180184
if ((ssid == NULL) ||
181185
(strlen(ssid) == 0) ||
182-
(pass == NULL && (security != NSAPI_SECURITY_NONE)) ||
183-
(strlen(pass) == 0 && (security != NSAPI_SECURITY_NONE)) ||
186+
(pass == NULL && ( security != NSAPI_SECURITY_NONE && security != NSAPI_SECURITY_WPA2_ENT)) ||
187+
(strlen(pass) == 0 && ( security != NSAPI_SECURITY_NONE && security != NSAPI_SECURITY_WPA2_ENT)) ||
184188
(strlen(pass) > 63 && (security == NSAPI_SECURITY_WPA2 || security == NSAPI_SECURITY_WPA || security == NSAPI_SECURITY_WPA_WPA2))
185189
) {
186190
return NSAPI_ERROR_PARAMETER;

features/netsocket/nsapi_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ typedef enum nsapi_security {
127127
NSAPI_SECURITY_CHAP = 0x6, /*!< phrase conforms to PPP authentication context */
128128
NSAPI_SECURITY_EAP_TLS = 0x7, /*!< phrase conforms to EAP-TLS */
129129
NSAPI_SECURITY_PEAP = 0x8, /*!< phrase conforms to PEAP */
130+
NSAPI_SECURITY_WPA2_ENT = 0x9, /*!< phrase conforms to WPA2-AES and WPA-TKIP with enterprise security */
130131
NSAPI_SECURITY_UNKNOWN = 0xFF, /*!< unknown/unsupported security in scan results */
131132
} nsapi_security_t;
132133

0 commit comments

Comments
 (0)