@@ -4177,6 +4177,11 @@ static int esp_wifi_auth_trans(uint32_t wifi_auth)
4177
4177
auth_mode = IW_AUTH_WPA_VERSION_WPA2 ;
4178
4178
break ;
4179
4179
4180
+ case WIFI_AUTH_WPA3_PSK :
4181
+ case WIFI_AUTH_WPA2_WPA3_PSK :
4182
+ auth_mode = IW_AUTH_WPA_VERSION_WPA3 ;
4183
+ break ;
4184
+
4180
4185
default :
4181
4186
wlerr ("Failed to transfer wireless authmode: %d" , wifi_auth );
4182
4187
break ;
@@ -5576,6 +5581,10 @@ int esp_wifi_sta_auth(struct iwreq *iwr, bool set)
5576
5581
wifi_cfg .sta .threshold .authmode = WIFI_AUTH_WPA2_PSK ;
5577
5582
break ;
5578
5583
5584
+ case IW_AUTH_WPA_VERSION_WPA3 :
5585
+ wifi_cfg .sta .threshold .authmode = WIFI_AUTH_WPA3_PSK ;
5586
+ break ;
5587
+
5579
5588
default :
5580
5589
wlerr ("Invalid wpa version %" PRId32 "\n" ,
5581
5590
iwr -> u .param .value );
@@ -5599,12 +5608,8 @@ int esp_wifi_sta_auth(struct iwreq *iwr, bool set)
5599
5608
break ;
5600
5609
5601
5610
case IW_AUTH_CIPHER_TKIP :
5602
- wifi_cfg .sta .threshold .authmode = WIFI_AUTH_WPA_PSK ;
5603
- break ;
5604
-
5605
5611
case IW_AUTH_CIPHER_CCMP :
5606
5612
case IW_AUTH_CIPHER_AES_CMAC :
5607
- wifi_cfg .sta .threshold .authmode = WIFI_AUTH_WPA2_PSK ;
5608
5613
break ;
5609
5614
5610
5615
default :
@@ -6362,40 +6367,12 @@ int esp_wifi_softap_password(struct iwreq *iwr, bool set)
6362
6367
/* Clear the password field and copy the user password to it */
6363
6368
6364
6369
memset (wifi_cfg .ap .password , 0x0 , PWD_MAX_LEN );
6365
- if (len )
6370
+ if (ext -> alg != IW_ENCODE_ALG_NONE )
6366
6371
{
6367
- memcpy (wifi_cfg .ap .password , pdata , len );
6368
- switch (ext -> alg )
6369
- {
6370
- case IW_ENCODE_ALG_NONE :
6371
- wifi_cfg .ap .authmode = WIFI_AUTH_OPEN ;
6372
- break ;
6373
-
6374
- case IW_ENCODE_ALG_WEP :
6375
- wifi_cfg .ap .authmode = WIFI_AUTH_WEP ;
6376
- break ;
6377
-
6378
- case IW_ENCODE_ALG_TKIP :
6379
- wifi_cfg .ap .authmode = WIFI_AUTH_WPA_PSK ;
6380
- break ;
6381
-
6382
- case IW_ENCODE_ALG_CCMP :
6383
- wifi_cfg .ap .authmode = WIFI_AUTH_WPA2_PSK ;
6384
- break ;
6385
-
6386
- case IW_ENCODE_ALG_PMK :
6387
- case IW_ENCODE_ALG_AES_CMAC :
6388
- wifi_cfg .ap .authmode = WIFI_AUTH_WPA_WPA2_PSK ;
6389
- break ;
6390
-
6391
- default :
6392
- wlerr ("Failed to transfer wireless authmode: %d" ,
6393
- ext -> alg );
6394
- return - EINVAL ;
6395
- }
6372
+ memcpy (wifi_cfg .sta .password , pdata , len );
6396
6373
}
6397
6374
6398
- if (g_softap_started )
6375
+ if (g_softap_started )
6399
6376
{
6400
6377
ret = esp_wifi_set_config (WIFI_IF_AP , & wifi_cfg );
6401
6378
if (ret )
@@ -6674,12 +6651,8 @@ int esp_wifi_softap_auth(struct iwreq *iwr, bool set)
6674
6651
break ;
6675
6652
6676
6653
case IW_AUTH_CIPHER_TKIP :
6677
- wifi_cfg .ap .authmode = WIFI_AUTH_WPA_PSK ;
6678
- break ;
6679
-
6680
6654
case IW_AUTH_CIPHER_CCMP :
6681
6655
case IW_AUTH_CIPHER_AES_CMAC :
6682
- wifi_cfg .ap .authmode = WIFI_AUTH_WPA2_PSK ;
6683
6656
break ;
6684
6657
6685
6658
default :
0 commit comments