Commit Graph

285 Commits

Author SHA1 Message Date
Kapil Gupta
f2a9d457e0 Remove unnecessary code from disconnect handler 2022-10-13 12:14:20 +05:30
Kapil Gupta
722ed6cbc6 wpa_supplicant: Prevent pmk flush for unspecified reasoncode 2022-10-13 12:14:20 +05:30
muhaidong
5b24356ab5 wpa_supplicant: try install gtk before send 2 of 2 2022-09-17 19:02:53 +08:00
Kapil Gupta
4d9c4fd7e1 wpa_supplicant: Fix WPS connection issue after WPS done
esp_wifi_disconnect is needed to clear the wifi state and enable
station to connect to new SSID. Add changes to call it after
WPS is done.
2022-08-23 13:09:32 +05:30
Shreyas Sheth
756b46ca96 esp_wifi: WPA3 SAE H2E support for station
Mandate sta threshold wpa3 for ssid after receiving transition disable
bit from AP
2022-08-18 02:55:51 +05:30
Kapil Gupta
f42fd4236c WiFi: Do not disconnect in WPS disable incase WPS is done/scanning
Closes https://github.com/espressif/esp-idf/issues/9341
2022-07-20 18:17:45 +05:30
Kapil Gupta
522e0a6b06 esp_wifi: clear old keys before going for new connection 2022-07-12 10:43:34 +05:30
Jiang Jiang Jian
4908c4e27d Merge branch 'bugfix/eap_method_selection_release_v4.4' into 'release/v4.4'
esp_wifi: Fix the negotiation of method with eap server.

See merge request espressif/esp-idf!18507
2022-06-15 10:50:03 +08:00
Hrudaynath Dhabe
7543b94b38 esp_wifi: Fix the negotiation of method with eap server. 2022-06-14 15:10:14 +05:30
Kapil Gupta
9fb3ad9946 wpa_supplicant: Unicast key renew in TKIP mic failure
Currently we always request group key renew for during
TKIP mic failure. Add support for unicast/multicast
key renew as per packet.
2022-06-14 14:49:51 +05:30
Kapil Gupta
f05d741c03 esp_wifi: Add APIs to check BTM and RRM support of connected AP 2022-06-14 14:49:51 +05:30
Kapil Gupta
972aa9a9a9 esp_wifi: Changes to not use pmkid caching when SSID is changed 2022-06-14 14:49:51 +05:30
Kapil Gupta
e4df46011c wpa_supplicant: Fix issues reported by coverity 2022-06-14 14:49:51 +05:30
Hrudaynath Dhabe
26ad146077 esp_wifi: Ignore unauthenticated encrypted EAPOL-Key data and fix
handling of key RSC.

Closes https://github.com/espressif/esp-idf/issues/8401
2022-05-30 12:15:44 +05:30
Kapil Gupta
2231a3bcbe wpa_supplicant: Remove scan done event in task 2022-04-20 10:08:45 +00:00
Kapil Gupta
fee9509d5d wpa_supplicant: static analysis fixes 2022-04-20 10:08:45 +00:00
Kapil Gupta
f6da49c3c9 wpa_supplicant: Add BTM security checks 2022-04-20 10:08:45 +00:00
Kapil Gupta
bac4173161 esp_example: Enable MbedTLS for DPP enrollee by default 2022-04-20 10:08:45 +00:00
Kapil Gupta
6e826523b1 wpa_supplicant: Correct task deletion for RRM and DPP tasks
Closes https://github.com/espressif/esp-idf/issues/7409
2022-04-20 10:08:45 +00:00
Nachiket Kukade
659306b243 esp_wifi: Always connect Station in PMF mode if possible
While using esp_wifi_set_config, flag pmf_capable defaults to 0.
Users may not bother to enable it, which prevents connection to a
WPA3 AP. Or the AP may reset into WPA3 mode failing the re-connection.
To ensure better security, deprecate the pmf_capable flag and set it to
true internally.
2022-02-28 17:55:42 +05:30
Jiang Jiang Jian
d483bd9518 Merge branch 'feature/support_eap_fast_release_v4.4' into 'release/v4.4'
Add support for EAP-FAST authentication (backport v4.4)

See merge request espressif/esp-idf!16279
2022-02-16 03:28:15 +00:00
Jiang Jiang Jian
11ec6ed917 Merge branch 'bugfix/eap_client_crash_v4.4' into 'release/v4.4'
wpa_supplicant: Fix memory corruption (v4.4)

See merge request espressif/esp-idf!17128
2022-02-16 03:27:47 +00:00
Kapil Gupta
136c5b8204 wpa_supplicant: Fix invalid memory dereference 2022-02-12 10:32:33 +05:30
Hrudaynath Dhabe
e21832cabb esp_wifi: Add support for EAP-FAST authentication method 2022-02-10 15:54:15 +05:30
Kapil Gupta
757445422d wpa_supplicant: Add WPS Fixes
Add following bugfixes

1. Station not able to connect when WPS pin is pressed first on AP.
2. PBC overlap getting detected for selected registrar PIN APs.
3. Station not considering authorised MACs for PIN method.
4. For PIN methodm If no AP is found, station will loop through
   APs in its vicinity and try to do WPS with them one by one till
   WPS timeout occurs. This is for some APs which do not set
   selected registrar correctly.
2022-02-08 17:22:40 +05:30
Laukik Hase
b10d0a533c wpa_supplicant: Saved message-type digest used in handshake for PRF operations 2022-02-02 10:56:48 +05:30
Kapil Gupta
d57b946bbf esp_wifi: Refactor key install code 2021-12-24 11:58:18 +08:00
aditi_lonkar
7cd52401b0 esp_wifi: Fixes memory leak in wpa3. 2021-12-23 19:05:03 +05:30
Jiang Jiang Jian
d037359359 Merge branch 'bugfix/static_analysis_fixes_v4.4' into 'release/v4.4'
ESP_WIFI: Remove static analysis warnings(backport v4.4)

See merge request espressif/esp-idf!16333
2021-12-21 04:11:22 +00:00
Hrudaynath Dhabe
40ae2037bc esp_wifi: Change the verbosity of wpa_supplicant log. 2021-12-14 14:29:09 +05:30
Kapil Gupta
a77ab8c03e ESP_WIFI: Remove static analysis warnings 2021-12-08 18:03:43 +05:30
Zhang Jun Hao
f490adf800 esp_wifi: support station only mode for code size down 2021-12-06 17:34:56 +08:00
Kapil Gupta
1780c7d8da esp_wifi: Remove scan done event for supplicant scans
Closes https://github.com/espressif/esp-idf/issues/7423
2021-11-22 13:37:42 +05:30
Kapil Gupta
57dc6de613 wpa_supplicant: Fix compilation error when debug enabled
Closes https://github.com/espressif/esp-idf/issues/7789
2021-11-22 13:37:42 +05:30
Kapil Gupta
e5091bb7af wpa_supplicant: Optimize BTM request scan 2021-11-22 13:37:42 +05:30
Kapil Gupta
54940f58a4 esp_wifi: Add WPA3 192-bit certification support 2021-10-12 20:48:53 +08:00
Kapil Gupta
797c7144bd esp_wifi: Add support for GCMP and GMAC ciphers 2021-10-12 20:48:51 +08:00
Axel Lin
abb67d0033 wpa_supplicant: Fix wps_free_pins to remove all pins
Current code does not correctly free all pins in wps_free_pins due to the
semicolon at the end of dl_list_for_each_safe(). Fix it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
2021-10-12 04:16:58 +08:00
Kapil Gupta
834afad47e esp_wifi: Add support for MBO certification 2021-10-04 15:56:14 +08:00
Zim Kalinowski
002cd296e1 Merge remote-tracking branch 'origin/master' into feature/github-7022 2021-10-03 12:25:39 +08:00
Kapil Gupta
8bf942c724 wpa_supplicant: Add missing cflag for legacy makefile 2021-09-22 11:30:30 +05:30
Kapil Gupta
393a9d5a94 wpa_supplicant: Update internal tls client with sha384/sha512 support
Add support for validating certificates with SHA384 and SHA512 hashes.
2021-09-13 14:11:55 +05:30
Kapil Gupta
6647f48dda esp_wifi: Fix interoperability issue with windows 2008 2021-09-13 14:11:37 +05:30
Kapil Gupta
d3a42d787d wpa_supplicant: clean tls client state machine 2021-08-27 00:19:32 +08:00
Axel Lin
20d0891e1e wpa_supplicant: Trivial typo fix for setting spp_sup.require
No functional change since both SPP_AMSDU_CAP_ENABLE and SPP_AMSDU_REQ_ENABLE
are defined as 1.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Sagar Bijwe <sagar@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/7366
2021-08-11 13:07:31 +08:00
Axel Lin
cd68b93e3b esp_supplicant: Make esp_rrm_send_neighbor_rep_request return proper error
Current code always return 0 even though wpas_rrm_send_neighbor_rep_request()
fails. Return proper error so the caller can know what's wrong.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Sagar Bijwe <sagar@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/7233
2021-08-11 13:07:31 +08:00
Axel Lin
2a5d5c02b4 wpa_supplicant: Fix clear WLAN_FC_STYPE_ACTION bit in esp_register_action_frame
It should clear WLAN_FC_STYPE_ACTION bit intead of WLAN_FC_STYPE_ACTION.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Sagar Bijwe <sagar@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/7252
2021-08-11 13:07:31 +08:00
Axel Lin
e144a60206 wpa_supplicant: Fix memory leak in esp_issue_scan error paths
Fix memory leak when allocate memory for params->ssid / params->bssid fails.

Fixes: 27101f9454 ("wpa_supplicant: Add initial roaming support")
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Sagar Bijwe <sagar@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/7240
2021-08-11 13:07:31 +08:00
Ato Araki
aea865b360 Fix length typo
Closes https://github.com/espressif/esp-idf/pull/7037
2021-07-29 14:44:43 +08:00
Kapil Gupta
e667d1af2e wpa_supplicant: bypass sonar checks for upstream code 2021-07-22 14:12:22 +08:00
Marius Vikhammer
fe921291d2 build system: fix cxx init_priority not working on S3 2021-07-14 10:56:24 +08:00
Marius Vikhammer
80acc1a002 CI: add S3 default_2 unit test config 2021-07-08 18:39:57 +08:00
Kapil Gupta
16b64e8524 wpa_supplicant: Fix some issues in 11kv
Fix following issues:

1. RRM capability addition for open AP
2. Crash during scan flush
3. Station not able to connect if disassoc timer is present in BTM request
4. Memory leaks during wifi init/deinit.
2021-07-02 09:41:23 +05:30
Kapil Gupta
a7713676b8 wpa_supplicant: Fix crypto related bugs
1. Fix aes_unwrap functionality when hardware acceleration is disabled
2. Fix compilation errors when mbedTLS is disabled.
3. Disable WPA3 when mbedTLS is disabled.
2021-06-28 19:50:01 +08:00
Jiang Jiang Jian
d5845abe62 Merge branch 'bugfix/wps_wfa_cert_fixes' into 'master'
wpa_supplicant: Add WPS strict in config option

Closes WIFI-3624 and WIFI-3842

See merge request espressif/esp-idf!13545
2021-06-28 10:13:23 +00:00
Jiang Jiang Jian
08bd291459 Merge branch 'bugfix/debug_prints_caused_build_failure' into 'master'
wpa_supplicant: Fix supplicant debug logs errors.

See merge request espressif/esp-idf!13745
2021-06-25 05:45:55 +00:00
Kapil Gupta
d3d977617b wpa_supplicant: Add WPS strict in config option
WPS strict disables workarounds with different APs and may cause
IOT issues. Remove this as default and introduce as a config option.

Also declare esp device as single band mobile device otherwise
WFA sniffer was not able to identify it in the certification setup.
2021-06-24 16:15:15 +08:00
Aditya Patwardhan
e44bd93cc9 i) wpa_supplicant: Force enable the necessary options for mbedtls in the wpa_supplicant to fix illegal combinations in mbedtls
ii) Fix dependancy for one option in mbedtls menuconfig
2021-06-20 08:39:51 +05:30
David Cermak
02ac1baee4 wpa_supplicant: Temporarily disable write-string warning
Since some assignment of a string literal to `char *` variables were
added and not caught by the CI.
2021-06-10 22:22:48 +08:00
Hrudaynath Dhabe
a260a1bafa wpa_supplicant: Fix supplicant debug logs errors. 2021-05-27 13:02:38 +05:30
Andrey Starodubtsev
6e343c1f8b Fix typo
s/\bUnknow\b/Unknown/g
2021-05-14 18:26:22 +03:00
Jiang Jiang Jian
9afd57057d Merge branch 'bugfix/add_sniffer_fcs_filter' into 'master'
example: Add sniffer FCSFAIL filter

Closes IDFGH-4661

See merge request espressif/esp-idf!12249
2021-05-08 07:31:51 +00:00
kapil.gupta
ad7cb5f5c1 wpa_supplicant: Write Crypto API based on mbedtls
This commit add following crypto changes

1. Update current crypto code with upstream supplicant code
2. Add a proper porting layer to use mbedtls APIs for all the crypto
   operations used by supplicant.

Internal crypto will be used when USE_MBEDLTS flag is disabled
in supplicant's menuconfig.

This commit also removes the clutter in crypto files due to partial
porting of some APIs to mbedtls, all the code from those files have
been removed and rewritten in a generic way, this is inspired from
current upstream code.

This also reduces the lib size significantly, supplicant's lib
size reduces around ~567kb after this change(NB: lib size doesn't
indicate reduction in final bin size).
2021-05-04 10:54:57 +00:00
xiehang
adb15e4a5d esp_wifi: Modify ESP_IF_WIFI_STA to WIFI_IF_STA 2021-04-27 20:06:42 +08:00
Kapil Gupta
20bb0c3b02 wpa_supplicant: Group key reinstallation fixes
This commit reverts previous commit for GTK reinstallation fix
and corrects original fix.
2021-04-23 13:44:02 +05:30
Kapil Gupta
035909872b wpa_supplicant: Prevent reinstallation of an already in-use group key 2021-04-19 04:17:20 +00:00
Angus Gratton
d6f4d99d93 core system: Fix warnings in compilation when assertions are disabled
Adds a CI config for hello world that sets this, to catch future regressions
2021-03-03 10:26:57 +11:00
Marius Vikhammer
04df1f3a42 CI: enable example builds for C3
Enables building C3 examples in CI.

Fixes related warnings/errors and disables examples that cannot run.
2021-02-09 12:04:02 +08:00
Nachiket Kukade
f9ff3da5d4 wpa_supplicant: Fix error handling in DPP Action Rx
1. Fix error handling while receiving DPP Action frames
2. Update wifi lib to avoid forwarding Public action frames
   with NULL bss
2021-02-07 23:23:34 +08:00
Nachiket Kukade
76b2cb28d2 Add DPP Enrollee example
1. Add Example for DPP Enrollee
2. Use DPP Supplicant API's to setup connection
3. Add support for multiple channels in Bootstrapping
4. Add Unity testcase for testing Offchannel operations

Closes https://github.com/espressif/esp-idf/issues/5654
2021-01-25 13:26:33 +05:30
Nachiket Kukade
87205dc2f4 Add DPP Enrollee Support
1. Modify DPP Protocol modules for our purpose
2. Add DPP supplicant task and modules to handle DPP frames
3. Add DPP Public API's and definitions for DPP
2021-01-25 13:24:21 +05:30
Nachiket Kukade
1ca80b4221 Add support for Remain-on-Channel and Action Tx
1. Add API's and structures for Remain-onChannel & Action Tx
2. Handling of events and callbacks for the operations
3. Update WiFi lib with related API support
2021-01-25 13:24:21 +05:30
Jiang Jiang Jian
1614cefd4f Merge branch 'bugfix/wpa_supplicant_coverity_issue_fixes' into 'master'
Fix some issues raised by Coverity static Analyzer.

Closes WIFI-3251

See merge request espressif/esp-idf!11918
2021-01-25 15:52:21 +08:00
Jiang Jiang Jian
76bb9565af Merge branch 'bugfix/fix_wifi_interface_use' into 'master'
esp_wifi: Modify ESP_IF_WIFI_STA to WIFI_IF_STA

See merge request espressif/esp-idf!12050
2021-01-25 12:18:27 +08:00
aditi_lonkar
562a5dd215 wpa_supplicant: Fix some memory leak issues by coverity static analyzer. 2021-01-25 03:37:47 +00:00
Alex
67d0460c2d Feature/wifi wapi release 2021-01-23 18:15:07 +08:00
kapil.gupta
7bc74089f4 esp_wifi: Add pairwise cipher support in softAP config
Closes https://github.com/espressif/esp-idf/issues/5963
2021-01-20 22:40:40 +05:30
xiehang
b8a8fe3f54 esp_wifi: Modify ESP_IF_WIFI_STA to WIFI_IF_STA 2021-01-19 11:55:44 +08:00
ronghulin
adfa43a3a4 feature: support tx amsdu 2021-01-15 20:10:18 +08:00
zhangyanjiao
1da9d9c356 esp_wifi: add esptouch v2
Closes https://github.com/espressif/esp-idf/issues/1311
2021-01-15 14:32:46 +08:00
Jiang Jiang Jian
56625eea1e Merge branch 'bugfix/11kv_bugfixes' into 'master'
wpa_supplicant: Remove lock during processing of BTM/RRM packets

Closes WIFI-3182 and WIFI-3175

See merge request espressif/esp-idf!11717
2020-12-25 19:09:27 +08:00
kapil.gupta
f14da2ecc0 wpa_supplicant: Remove lock during processing of btm/rrm packets
Lock is not required during btm/rrm action frames processing and
taking it may cause inconsistant behavior since wifi task
posts the events to this task.
2020-12-22 16:56:41 +05:30
kapil.gupta
903198ad7f 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.
2020-12-21 14:27:10 +05:30
zhangyanjiao
c0f4fdfd4d wpa_supplicant: Use WPA3 flag to reduce code size
Flag ESP32_WIFI_ENABLE_WPA3_SAE from Menuconfig is used to
control the stack size required by WPA3. Use the same flag
to compile out the WPA3 code and control the code size.
With this flag disabled code footprint reduces by about 7.7kB
in libwpa_supplicant.a
Update WiFi libs with added checks to cleanly handle disabling
of WPA3 callbacks.

Closes https://github.com/espressif/esp-idf/issues/5971
2020-11-23 14:28:12 +08:00
kapil.gupta
27101f9454 wpa_supplicant: Add initial roaming support
This commit adds different features from 802.11k and 802.11v
specifications to make the device ready for network assisted
roaming. It also adds initial framework for device to detect
whether it needs to move to a better AP.

Followings are added as part of this.

1. Support for sending neighbor report request and provide
   the report back to the APP.
2. Support for beacon measurement report.
3. Support for link measurement report.
4. Support for sending bss transition management query frame
   (triggered by the APP).
5. Support for bss transition management request and move
   to the candidate based on that.
6. Sending the bss transition management response.
2020-11-17 17:15:26 +05:30
Angus Gratton
420aef1ffe Updates for riscv support
* Target components pull in xtensa component directly
* Use CPU HAL where applicable
* Remove unnecessary xtensa headers
* Compilation changes necessary to support non-xtensa gcc types (ie int32_t/uint32_t is no
  longer signed/unsigned int).

Changes come from internal branch commit a6723fc
2020-11-13 07:49:11 +11:00
Angus Gratton
66fb5a29bb Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)
2020-11-11 07:36:35 +00:00
Nachiket Kukade
89a25e41c8 wpa_supplicant: Increase PMK Lifetime to a very high value
For WPA3 connection nearing PMK lifetime expiry, PMK Cache
needs a re-authentication or the cache will expire. After
current expiry of 12 hours Station ends up sending a deauth
to the AP. An SAE re-authentication also cannot occur without
a disconnection with current implementation. So increase the
PMK lifetime to 100 days for now.
2020-11-10 10:17:48 +00:00
Angus Gratton
6d1d6e736d Merge branch 'bugfix/wpa_supplicant_link_depth' into 'master'
wpa_supplicant: Fix failure to link under some circumstances

Closes IDFGH-3715

See merge request espressif/esp-idf!10822
2020-10-26 12:22:32 +08:00
kapil.gupta
474c38a5f3 esp_wifi: Add WPS Reason code in all failures 2020-10-21 10:56:19 +05:30
Angus Gratton
bc1cca2bf8 wpa_supplicant: Fix failure to link under some circumstances
Depending on CMake internals, the wpa_supplicant library may need to be repeated
multiple times in the linker command line.

Closes https://github.com/espressif/esp-idf/issues/5641
2020-10-13 18:25:29 +11:00
Nachiket Kukade
6ae4b3ef48 esp_wifi: Update wifi lib
1. Add STA checks during STA PMF operations
2. Fix WPA2-Ent issue with Open AP
3. Skip WPA-TKIP profile if PMF is required
4. Skip & clear Supplicant PMK Cache with mismatching AP config
2020-10-10 09:03:55 +00:00
kapil.gupta
ebc0b42c75 esp_wifi: Add support for 802.1x sha256 auth key mode
Closes https://github.com/espressif/esp-idf/issues/5805
2020-09-29 15:23:39 +05:30
Xia Xiaotian
bdbe74693f esp_wifi: refactor wifi code in order to adapter to new chips 2020-09-24 10:15:50 +08:00
Jakob Hasse
20c068ef3b cmock: added cmock as component
* changing dependencies from unity->cmock
* added component.mk and Makefile.projbuild
* ignore test dir in gen_esp_err_to_name.py
* added some brief introduction of CMock in IDF
2020-09-02 16:38:37 +08:00
Nachiket Kukade
3308ede898 espnow/pmf: Implement ESPNOW + PMF Co-existance
H/W decryption of Mgmt frames was disabled for PMF and done through
S/W. If ESPNOW packets go through this path, it affects backward
compatibility since method of decrypting Mgmt packets is different in H/W.

To address PMF + ESPNOW Co-existance, CCMP decryption method is modified
for ESPNOW packets so that they can be decrypted correctly. Since Tx
of ESPNOW packets can still be done in H/W alongside PMF, no change
required in encryption method in S/W.

Co-Authored-By: Nachiket Kukade <nachiket.kukade@espressif.com>
Co-Authored-By: zhangyanjiao <zhangyanjiao@espressif.com>
Co-Authored-By: kapil.gupta <kapil.gupta@espressif.com>
2020-09-02 09:26:39 +05:30
kapil.gupta
06bc7f1d2f wpa_supplicant: Deinit wpa2 states in wifi deinit 2020-08-26 03:51:37 +00:00
Jiang Jiang Jian
c27bd40d54 Merge branch 'feature/support_phase2TTLS_algos' into 'master'
wpa_supplicant: add support for PAP, MS-CHAP and CHAP as Phase 2 algorithms for TTLS alongside MS-CHAPv2

Closes FCS-361

See merge request espressif/esp-idf!8816
2020-08-07 14:06:12 +08:00
kapil.gupta
50b4cf9286 wpa_supplicant: Fix IOT issue with latest freeradius
Fix inter operability issue with freeradius version 3.0.21
and openssl 1.1.1f when internal tls client is used which
requires extension elements in client hello.

closes https://github.com/espressif/esp-idf/issues/5273
closes https://github.com/espressif/esp-idf/issues/5627
2020-08-04 04:50:58 +00:00
morris
2917651478 esp_rom: extract common ets apis into esp_rom_sys.h 2020-07-27 15:27:01 +08:00