Commit Graph

559 Commits

Author SHA1 Message Date
Jouni Malinen
bb16734aa9 EAP-TLS: Update Session-Id derivation with TLS v1.3
Move to the version used in draft-ietf-emu-eap-tls13-03.txt, i.e.,
include the 0x0D prefix and use a different TLS-Exporter() label string.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-03-20 09:33:52 +05:30
Jouni Malinen
ed8452d53f EAP-TLS: Derive Session-Id using TLS-Exporter when TLS v1.3 is used
This updates Session-Id derivation with TLS v1.3 per
draft-ietf-emu-eap-tls13-00.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-03-20 09:33:51 +05:30
Jouni Malinen
a2336b74f9 EAP-TLS: Update key derivation label per draft-ietf-emu-eap-tls13-00
The label strings used for deriving Key_Material with TLS v1.3 were
changed, so update the implementation to match the new values.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-03-20 09:33:51 +05:30
Jouni Malinen
e9f6949d7e EAP-TLS peer: MSK/EMSK derivation with TLS v1.3
Use new MSK/EMSK derivation mechanism if TLS v1.3 or newer is used per
draft-mattsson-eap-tls13-02.txt.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-03-20 09:33:51 +05:30
Jouni Malinen
34a8628d4e EAP-TLS peer: Allow NewSessionTicket after Client Finished with TLS v1.3
The EAP session cannot be marked fully completed on sending Client
Finished with TLS v1.3 since the server may still send NewSessionTicket
before EAP-Success.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-03-20 09:33:51 +05:30
Jouni Malinen
6a83540ae0 EAP-TLS peer: Support fragmentation of last message
With TLS v1.3, the Finished message from the client can require
fragmentation. Postpone key derivation and marking of the EAP session
fully completed until all the fragments of that last message are sent to
avoid losing all the subsequent fragments.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-03-20 09:33:51 +05:30
Jouni Malinen
77d87edbb2 EAP-TLS peer: Determine whether TLS v1.3 or newer is used
This is needed to be able to handle different key derivation and message
handshakes in EAP implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-03-20 09:33:48 +05:30
Ilan Peer
a539c63d68 EAP-TTLS: Fix possible memory leak in eap_ttls_phase2_request_mschap()
The msg buffer needs to be freed on these two error paths.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
2024-03-20 09:32:32 +05:30
Jouni Malinen
5c0fb10902 EAP peer: External server certificate chain validation
This adds support for optional functionality to validate server
certificate chain in TLS-based EAP methods in an external program.
wpa_supplicant control interface is used to indicate when such
validation is needed and what the result of the external validation is.

This external validation can extend or replace the internal validation.
When ca_cert or ca_path parameter is set, the internal validation is
used. If these parameters are omitted, only the external validation is
used. It needs to be understood that leaving those parameters out will
disable most of the validation steps done with the TLS library and that
configuration is not really recommend.

By default, the external validation is not used. It can be enabled by
addingtls_ext_cert_check=1 into the network profile phase1 parameter.
When enabled, external validation is required through the CTRL-REQ/RSP
mechanism similarly to other EAP authentication parameters through the
control interface.

The request to perform external validation is indicated by the following
event:
CTRL-REQ-EXT_CERT_CHECK-<id>:External server certificate validation needed for SSID <ssid>

Before that event, the server certificate chain is provided with the
CTRL-EVENT-EAP-PEER-CERT events that include the cert=<hexdump>
parameter. depth=# indicates which certificate is in question (0 for the
server certificate, 1 for its issues, and so on).

The result of the external validation is provided with the following
command:
CTRL-RSP-EXT_CERT_CHECK-<id>:<good|bad>

It should be noted that this is currently enabled only for OpenSSL (and
BoringSSL/LibreSSL). Due to the constraints in the library API, the
validation result from external processing cannot be reported cleanly
with TLS alert. In other words, if the external validation reject the
server certificate chain, the pending TLS handshake is terminated
without sending more messages to the server.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-03-20 09:32:32 +05:30
Jiang Jiang Jian
5f969c71be Merge branch 'bugfix/dpp_auth_deinit_crash' into 'master'
Fix issues with DPP stop listen and DPP auth data deinit

Closes WIFIBUG-443, WIFIBUG-442, WIFIBUG-421, and WIFIBUG-423

See merge request espressif/esp-idf!29404
2024-03-19 17:36:28 +08:00
jgujarathi
40ccd1525f fix(wpa_supplicant): Cancel offchannel listen operations before sending dpp fail
- Ensure that offchannel listening operations are cancelled before sending dpp
  fail event
2024-03-18 14:33:57 +05:30
jgujarathi
537cf9bfc0 fix(wpa_supplicant): Ensure dpp auth structure is deinited in dpp task context
- Ensure that the dpp auth data gets deinited only in DPP task context to ensure
  that there are no concurrency issues in usage of DPP auth data.
2024-03-18 14:33:57 +05:30
Sarvesh Bodakhe
fe35466cdd fix(wpa_supplicant): Improve execution flow for WPS registrar public APIs
Make sure that WPS registrar public APIs do not modify supplicant
data in application task context. Execute API functionlity in eloop
context to prevent protential race conditions.
2024-03-18 12:43:39 +05:30
Sarvesh Bodakhe
aad6f44c25 fix(wifi): Avoid dereferencing a dangling function pointer in WPS supplicant
Avoid dereferencing a dangling function pointer in 'eap_server_sm_deinit()'.
This issue arises when hostap unregisteres EAP methods before it removes
the server state machine for station.
2024-03-18 12:43:38 +05:30
Jiang Jiang Jian
b05b19abc7 Merge branch 'feature/sae_pk_transition_disable' into 'master'
Add support for SAE-PK, WPA3-Enterprise and OWE transition disable indication

Closes WIFIBUG-287

See merge request espressif/esp-idf!27783
2024-03-18 11:38:50 +08:00
Kapil Gupta
59a62f2af6 fix(wpa_supplicant): (PEAP client) Update Phase 2 auth requirements
The previous PEAP client behavior allowed the server to skip Phase 2
authentication with the expectation that the server was authenticated
during Phase 1 through TLS server certificate validation. Various PEAP
specifications are not exactly clear on what the behavior on this front
is supposed to be and as such, this ended up being more flexible than
the TTLS/FAST/TEAP cases. However, this is not really ideal when
unfortunately common misconfiguration of PEAP is used in deployed
devices where the server trust root (ca_cert) is not configured or the
user has an easy option for allowing this validation step to be skipped.

Change the default PEAP client behavior to be to require Phase 2
authentication to be successfully completed for cases where TLS session
resumption is not used and the client certificate has not been
configured. Those two exceptions are the main cases where a deployed
authentication server might skip Phase 2 and as such, where a more
strict default behavior could result in undesired interoperability
issues. Requiring Phase 2 authentication will end up disabling TLS
session resumption automatically to avoid interoperability issues.

Allow Phase 2 authentication behavior to be configured with a new phase1
configuration parameter option:
'phase2_auth' option can be used to control Phase 2 (i.e., within TLS
tunnel) behavior for PEAP:
 * 0 = do not require Phase 2 authentication
 * 1 = require Phase 2 authentication when client certificate
   (private_key/client_cert) is no used and TLS session resumption was
   not used (default)
 * 2 = require Phase 2 authentication in all cases
2024-03-15 16:57:26 +08:00
Shyamal Khachane
fd556dc785 feat(wifi): Add support to handle OWE transition disable indication from AP 2024-03-15 13:56:00 +05:30
Sarvesh Bodakhe
34725cdbfd feat(wifi): Add support SAE-PK and WPA3-Enterprise transition disable 2024-03-15 13:55:31 +05:30
Shreyas Sheth
9127a8fb25 fix(wifi): Fix wpa3 crash for station added without sta lock 2024-03-14 15:36:32 +05:30
Nachiket Kukade
ed704a22a8 fix(wpa_supplicant): Suppress RSN IE print to Verbose level 2024-03-13 20:10:20 +08:00
aditi_lonkar
90cc61588e feat(esp_wifi): Add support of Network Introduction Protocol in DPP 2024-02-21 12:47:32 +05:30
Kapil Gupta
3a2e0dcbfb Merge branch 'bugfix/mbo_api_flag' into 'master'
fix(wpa_supplicant):Add CONFIG_MBO flag for mbo apis.

Closes WIFIBUG-390

See merge request espressif/esp-idf!28560
2024-02-21 10:54:46 +08:00
Jiang Jiang Jian
b4fe434d2e Merge branch 'bugfix/fix_esp_wifi_scan_start_memory_leakage_issue' into 'master'
fix(wifi): fix esp_wifi_scan_start memory leakage issue

Closes IDFGH-9313

See merge request espressif/esp-idf!28869
2024-02-05 19:23:33 +08:00
muhaidong
d278ffc501 fix(wifi): fix esp_wifi_scan_start memory leakage issue
Closes https://github.com/espressif/esp-idf/issues/10693
2024-02-03 16:32:09 +08:00
David Cermak
344cb342b8 fix(esp_wifi): Support for esp_wifi_remote 2024-02-01 12:17:43 +01:00
David Cermak
9088655030 fix(esp_wifi): Separate public and native wifi interface types 2024-02-01 12:17:37 +01:00
Kapil Gupta
d033c3ebff fix(wifi): add low memory options for eap enterprise 2024-01-30 22:54:22 +08:00
aditi_lonkar
6006568c77 fix(wpa_supplicant):Add MBO config flag for mbo apis 2024-01-18 15:11:30 +05:30
Kapil Gupta
685fcf4278 Merge branch 'feature/supplicant_bss_extmem' into 'master'
WiFi: Add support to move supplicant BSS to external memory

See merge request espressif/esp-idf!27891
2024-01-11 15:55:14 +08:00
laokaiyao
11e19f40b9 feat(esp32c5): support to build hello world on esp32c5 beta3 2024-01-09 13:11:11 +08:00
Kapil Gupta
36c38943c8 fix(wifi): Add support to move supplicant BSS to external memory 2023-12-13 16:07:13 +00:00
igor.udot
6e258a879d fix: add count for wpa test 2023-12-06 15:58:05 +08:00
igor.udot
e0a40feb5c refactor: changed logic of unity_tester, replaced threads by generators 2023-12-06 15:58:05 +08:00
Jiang Jiang Jian
9f2578a0bd Merge branch 'bugfix/wps_disable_crash' into 'master'
Fix a crash in esp_wifi_wps_disable

Closes WIFIBUG-252 and WIFIBUG-266

See merge request espressif/esp-idf!27233
2023-12-05 11:21:09 +08:00
jgujarathi
322aa53d9d fix(wpa_supplicant): Add support for a dpp authentication timeout
- Adds support for a 1 second dpp authentication timeout.
2023-12-01 15:08:32 +05:30
jgujarathi
8508363ce5 fix(wpa_supplicant): Restructuring DPP init method to ensure cleanup
- Restructuring DPP init function to ensure cleanup of variables in case of
  init failure
2023-12-01 12:23:03 +05:30
jgujarathi
76da067bce fix(wpa_supplicant): Fix location of clearing up dpp global variables
- Fix location of cleaing up dpp global variables to ensure that there are
  no concurrency issues.
2023-12-01 12:23:03 +05:30
jgujarathi
30c510020f fix(wpa_supplicant): Fix a memory leak in dpp deinit path
- Ensures that the auth information of dpp gets freed when there is
  dpp gets deinited.
2023-12-01 12:23:00 +05:30
Jiang Jiang Jian
e6a490c2ae Merge branch 'bugfix/dpp_listen_bugs' into 'master'
fix(wpa_supplicant): Fix few bugs in dpp

See merge request espressif/esp-idf!26792
2023-12-01 11:07:18 +08:00
aditi_lonkar
bdeec024e8 fix(esp_wifi):Fix WDT when esp_supp_dpp_start_listen called multiple times 2023-11-30 15:37:17 +05:30
Ivan Grokhotkov
88fa79fcc7
feat(unity): upgrade to 2.6.0-RC1 2023-11-28 20:22:02 +01:00
jgujarathi
f73432f651 fix(wpa_supplicant): Move concurrent wps and dpp check to before creating task
- Move the check for checking concurrent wps and dpp check to before creating
  task rather than after.
2023-11-28 15:18:39 +05:30
jgujarathi
bb4b9d0687 fix(wpa_supplicant): Fix a crash in esp_wifi_wps_disable
- Fixes a crash observed in esp_wifi_wps_disable when wps process
  is ongoing, caused due to concurrency issues in cancelling timers.
2023-11-28 11:55:35 +05:30
muhaidong
147463a0ac fix(wifi): allow some special igtk keyindx to workaround faulty APs 2023-11-16 20:20:08 +08:00
Jiang Jiang Jian
b7c2e63bb4 Merge branch 'bugfix/supplicant_disconnect_process' into 'master'
esp_wifi:  Fix bug in esp_wifi_deauthenticate_internal() & wpa_supplicant: Add parameter to configure reason code of deauth frame

Closes WIFIBUG-13

See merge request espressif/esp-idf!23776
2023-11-15 23:52:32 +08:00
Sarvesh Bodakhe
b42e14c9b7 fix(wifi): fix bug in 'esp_wifi_deauthenticate_internal' and other improvements 2023-11-15 08:27:50 +05:30
Jiang Jiang Jian
65b8830d07 Merge branch 'bugfix/disallow_dpp_wps' into 'master'
fix(wifi): Disallow DPP and WPS concurrency

Closes WIFIBUG-205

See merge request espressif/esp-idf!26850
2023-11-15 10:41:59 +08:00
Sarvesh Bodakhe
2d83e3e7f4 fix(wpa_supplicant): Add some bugfixes in wpa_supplicant
1) Add parameter to configure reason code of deauth frame
2) Add logs to indicate MIC failure 4-Way-Handshake
3) Process RSNXE capabilities only if AP advertises them
2023-11-15 08:06:37 +05:30
Sudeep Mohanty
d507a86285 feat(freertos): Exposed Kconfig option for configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES
This commit exposes the FreeRTOS List integrity check option
configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES via menuconfig.
2023-11-09 14:54:13 +01:00
Kapil Gupta
c815fe67fa fix(wpa_supplicant): memzero wifi config before sending config event 2023-11-03 15:44:08 +05:30