Skip to content

Commit 93c0bfc

Browse files
committed
[NXP][platform][common] add WPA3 support
Signed-off-by: Martin Girardot <[email protected]>
1 parent b9961ac commit 93c0bfc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/platform/nxp/common/ConnectivityManagerImpl.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,15 @@ CHIP_ERROR ConnectivityManagerImpl::ProvisionWiFiNetwork(const char * ssid, uint
641641
if (keyLen > 0)
642642
{
643643
pNetworkData->security.type = WLAN_SECURITY_WILDCARD;
644-
memcpy(pNetworkData->security.psk, key, keyLen);
645-
pNetworkData->security.psk_len = keyLen;
644+
if(keyLen <= sizeof(pNetworkData->security.psk))
645+
{
646+
/* Needed for WEP, WPA and WPA2 support */
647+
memcpy(pNetworkData->security.psk, key, keyLen);
648+
pNetworkData->security.psk_len = keyLen;
649+
}
650+
/* Needed for WPA3 SAE support as the max length of SAE password is larger than max length of WPA-PSK */
651+
memcpy(pNetworkData->security.password, key, keyLen);
652+
pNetworkData->security.password_len = keyLen;
646653
}
647654

648655
ConnectNetworkTimerHandler(NULL, (void *) pNetworkData);

0 commit comments

Comments
 (0)