From 903198ad7fec6a2f4241a49da71e90207bcfe227 Mon Sep 17 00:00:00 2001 From: "kapil.gupta" Date: Wed, 16 Dec 2020 15:45:30 +0530 Subject: [PATCH] esp_wifi: Fix some wifi bugs. 1. Send encrypted mgmt frames in pmf connection 2. Remove dependecy of SHA256 AKM on PMF 3. Fix null pointer dereference 4. Set TTLS default phase2 method as MSCHAPV2. --- components/esp_wifi/lib | 2 +- components/wpa_supplicant/src/crypto/tls_mbedtls.c | 4 ++++ components/wpa_supplicant/src/eap_peer/eap.c | 7 +++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index c69597c79f..d530c227d7 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit c69597c79fc5d3b2bffb5cc330bd7ab8f956e460 +Subproject commit d530c227d7cd073ce14658124325e0352fae4e1d diff --git a/components/wpa_supplicant/src/crypto/tls_mbedtls.c b/components/wpa_supplicant/src/crypto/tls_mbedtls.c index 409281ff92..9db60867ad 100644 --- a/components/wpa_supplicant/src/crypto/tls_mbedtls.c +++ b/components/wpa_supplicant/src/crypto/tls_mbedtls.c @@ -502,6 +502,10 @@ struct tls_connection * tls_connection_init(void *tls_ctx) void tls_connection_deinit(void *tls_ctx, struct tls_connection *conn) { + /* case: tls init failed */ + if (!conn) { + return; + } /* Free ssl ctx and data */ tls_mbedtls_conn_delete((tls_context_t *) conn->tls); os_free(conn->tls); diff --git a/components/wpa_supplicant/src/eap_peer/eap.c b/components/wpa_supplicant/src/eap_peer/eap.c index fd78331f47..b71f4c14b3 100644 --- a/components/wpa_supplicant/src/eap_peer/eap.c +++ b/components/wpa_supplicant/src/eap_peer/eap.c @@ -476,8 +476,11 @@ int eap_peer_config_init( sm->config.new_password_len); } - if (g_wpa_ttls_phase2_type) { - sm->config.phase2 = g_wpa_ttls_phase2_type; + if (g_wpa_ttls_phase2_type) { + sm->config.phase2 = g_wpa_ttls_phase2_type; + } else { + /* set default config phase2 mode as MSCHAPV2 */ + sm->config.phase2 = "auth=MSCHAPV2"; } return 0;