Commit graph

88 commits

Author SHA1 Message Date
Marius Vikhammer c63684cf6c hw crypto: activated hardware acceleration for esp32s2beta
Activated AES, RSA and SHA hardware acceleration for esp32s2 and enabled related unit tests.

Updated with changes made for ESP32 from 0a04034, 961f59f and caea288.

Added performance targets for esp32s2beta

Closes IDF-757
2019-12-12 12:37:29 +08:00
Ivan Grokhotkov 4872dcea2e wpa_supplicant: remove header file MD5 unit test 2019-11-27 23:00:11 +08:00
Nachiket Kukade 5618cf5100 wpa_supplicant: Fix MD5 mismatch in esp_wifi_driver.h
Make cosmetic changes in esp_wifi_driver.h in both IDF
and wifi library to match the md5sum.
2019-11-27 12:43:04 +00:00
Nachiket Kukade f2e37c4ca8 wpa_supplicant: Support WPA3 4-way handshake, add config option
1. Add changes in 4-way handshake path to allow SAE key mgmt.
2. Support for configuring WAP3 at init time, added Kconfig option.
3. Handle and propagate error conditions properly.
4. Link changes from WiFi library.
2019-11-26 10:59:55 +05:30
Nachiket Kukade da07b2b4a7 wpa_supplicant: Add SAE handshake support for WPA3-PSK
Under WPA3-Personal, SAE authentication is used to derive PMK
which is more secure and immune to offline dictionary attacks.
1. Add modules to generate SAE commit/confirm for the handshake
2. Add modules that build and parse SAE data in Auth frames
3. Add WPA3 association and key mgmt definitions
4. Invert y-bit while solving for ECC co-ordinate -
     Once an X co-ordinate is obtained, solving for Y co-ordinate
     using an elliptical curve equation results in 2 possible values,
     Y and (P - Y), where p is the prime number. The co-ordinates are
     used for deriving keys in SAE handshake. As par the 802.11 spec
     if LSB of X is same as LSB of Y then Y is chosen, (P - Y) otherwise.
     This is not what is implemented, so fix this behavior to obtain the
     correct Y co-ordinate.
2019-11-26 04:24:57 +00:00
Sagar Bijwe aceb141d2b wpa_supplicant: Adding SAE modules with testcase
This change ports SAE(Simultaneous Authentication of Equals)
feature from wpa_supplicant and makes it work with mbedtls
crypto APIs. Currently only group 19 is supported. A sample
SAE handshake is included in the testcase. Other minor
changes for DH groups are also included.
2019-11-26 04:24:57 +00:00
Nachiket Kukade 75ea0df916 Add encryption/decryption support for PMF
1. Add CCMP, AES crypto modules for unicast protected Mgmt frames
2. Add support for computing SHA256 MIC on Bcast Mgmt frames
3. Add support for storing iGTK during 4-way handshake.
4. Provide APIs to MLME for utilizing the SW crypto modules
5. Link PMF changes from WiFi library submodule
2019-11-25 04:11:09 +00:00
Nachiket Kukade 773e095a65 Add support for PMF configuration and negotiation
1. Add APIs for configuring PMF through set config.
2. Map Supplicant and Wifi Cipher types.
3. Add support for PMF negotiation while generating RSN IE.
2019-11-25 04:11:09 +00:00
Hrudaynath Dhabe e543dbfe79 wpa_supplicant: Set assoc_ie_len based on generated RSN/WPA IE 2019-11-11 23:22:14 +08:00
Jiang Jiang Jian cb6e2fc858 Merge branch 'feature/wifi_pmk_caching' into 'master'
wifi: Add PMK caching feature for station WPA2-enterprise

Closes IDF-969

See merge request espressif/esp-idf!6156
2019-11-01 15:11:20 +08:00
Hrudaynath Dhabe 4d3356be52 wifi: Add PMK caching feature for station WPA2-enterprise
4. Pmksa cache expiry after dot11RSNAConfigPMKLifetime timeout.
2019-10-31 10:51:30 +00:00
Sagar Bijwe bd5d086475 wifi: Add PMK caching feature for station WPA2-enterprise
1) Added PMK caching module from wpa_supplicant.
2) Modified wpa_sm to
    a) Add entry to PMK cache when first time associated to an AP.
    b) Maintain entry across the associations.
    c) Clear current PMKSA when deauth happens.
    d) Search for an entry when re-associating to the same AP and
       set it as current PMKSA
    e) Wait for msg 1/4 from AP instead of starting EAP authentication.
    f) Check PMKID in msg 1 with current PMKSA/cache.
    g) Use the cached PMK to complete 4-way handshake.
3) Remove config_bss callback as it was redundant and used to cause
   problems for PMK caching flow.

Closes IDF-969
2019-10-31 10:51:30 +00:00
liu zhifu b09624e89a esp_wifi: fix WiFi deinit memory leak 2019-10-30 10:12:15 +08:00
Angus Gratton 496ede9bcd Merge branch 'master' into feature/esp32s2beta_merge 2019-10-15 14:59:27 +11:00
Hrudaynath Dhabe ac0b4c184d wpa_supplicant: Make hexdump logs more compact
When running with wpa debug prints enabled data/key hexdumps are
printed to the log in a really verbose format (one byte per line).

Make these printouts more compact. 16 bytes per line.
2019-10-14 23:37:51 +08:00
Angus Gratton adfc06a530 Merge branch 'master' into feature/esp32s2beta_merge 2019-09-20 10:28:37 +10:00
Ivan Grokhotkov bf68285689 Merge branch 'feature/compile_option_O0' into 'master'
build_system: add new compiler optimization levels

See merge request espressif/esp-idf!5686
2019-09-17 16:54:55 +08:00
Angus Gratton 438d513a95 Merge branch 'master' into feature/esp32s2beta_merge 2019-09-16 16:18:48 +10:00
Andrew 4fdaeb6b6e cmake: Add new compiler optimization levels definitions
Rename and add multiple kconfig compiler options. New compiler options
COMPILER_OPTIMIZATION_PERF and COMPILER_OPTIMIZATION_NONE have been added.
Optimize "Debug" and "Release" options to "Default" and "Size" respectively.
This commit also does the following:

- The COMPILER_OPTIMIZATION_PERF option introduced multiple bug.
This commit fixes those bugs.
- build.yml also updated to test for the new optimization options.
2019-09-06 17:37:19 +08:00
Nachiket Kukade 5df2e6b19c wpa_supplicant: Fix EAP Re-authentication issue
EAP reauth frames are dropped at various stages due to current
implementation of WPA2 ENT states and EAP SM init/deinit logic.
Route EAPOL frames based on EAP pkt type and maintain EAP SM
to facilitate EAP re-authentication process.

The full fix for the change includes a fix from wifi library
(commit - 36f99df849214fbf9b0d15e58554632a568e05aa).
2019-09-06 14:59:05 +05:30
Michael (XIAO Xufeng) 76a3a5fb48 ci: disable unavailable tests for esp32s2beta 2019-09-04 10:53:25 +10:00
Jiang Jiang Jian 8db44f67d7 Merge branch 'bugfix/wps_workaround_for_Telstra_AP' into 'master'
wps: Relax the check on older config methods in case of WPS2.0

See merge request espressif/esp-idf!5781
2019-08-23 17:32:46 +08:00
Nachiket Kukade 19a1af88a5 wps: Relax the check on older config methods in case of WPS2.0
Some APs incorrectly advertize newer WPS2.0 config method bits
without setting bits for the corresponding older methods. This
results in failures during 8-way handshake. Add a workaround to
relax this check so that WPS handshake can proceed.
2019-08-20 09:58:41 +00:00
liu zhifu 003a9872b7 esp_wifi: wifi support new event mechanism
1. WiFi support new event mechanism
2. Update examples to use new event mechanism
2019-08-20 09:39:51 +00:00
Angus Gratton 0a0bb09585 Merge 'master' into feature/esp32s2beta_update 2019-08-20 13:55:23 +10:00
Angus Gratton 6990a7cd54 Merge branch 'master' into feature/esp32s2beta_update 2019-08-19 15:03:43 +10:00
Nachiket Kukade 9ec363a25d wpa_supplicant: Make internally used crypto headers private
A lot of internally used crypto headers are publicly includeable
in user projects. This leads to bug reports when these headers
are incorrectly used or the API's are not used as intended.

Move all crypto headers into private crypto src folder, also move
crypto_ops into Supplicant to remove dependecy on crypto headers.

Closes IDF-476
2019-08-17 11:48:37 +00:00
Angus Gratton 8f74271d5d esp_rom: Fail immediately if the wrong SoC's header file is included 2019-08-12 16:57:40 +10:00
Angus Gratton 04ae56806c Merge branch 'master' into feature/esp32s2beta_update 2019-08-08 15:26:58 +10:00
Angus Gratton 24d26fccde Merge branch 'master' into feature/esp32s2beta_update 2019-08-08 13:44:24 +10:00
Sagar Bijwe 80a5bd8e54 wpa_supplicant: Port more crypto functions to use mbedtls
Use mbedtls PBKDF2 and SHA1 for faster calculations during four-way
handshake.

Closes WIFI-1590
2019-08-07 07:23:28 +00:00
Anton Maklakov 75c0066f93 Fix remaining -Wstrict-prototypes warnings 2019-08-01 16:28:56 +07:00
Anton Maklakov afbaf74007 tools: Mass fixing of empty prototypes (for -Wstrict-prototypes) 2019-08-01 16:28:56 +07:00
liu zhifu f3f08fa713 esp_wifi/supplicant: fix some supplicant bugs
Closes IDFGH-1455
Closes IDF-774
2019-07-18 17:36:19 +08:00
xiehang 6c865a84ff 1, Fix wps memory leak.
2, Add a queue to save wps rx eapol frame.
  3, Add data lock protect wpa2_sig_cnt.
  4, Add a queue to save wpa2 rx rapol frame.
2019-07-11 08:57:31 +00:00
Nachiket Kukade 900df44546 wpa_supplicant: Cleanup fast_xxx modules that use duplicate code
wpa_supplicant is using MbedTLS API's for crypto algorithms. For
calling them a duplicate set of modules is maintained prepended
with 'fast_'. Remove these and use flag USE_MBEDTLS_CRYPTO
instead to separate modules calling MbedTLS API's from native
implementation.
2019-07-10 14:53:20 +05:30
Sagar Bijwe ae46f04997 wpa_supplicant: Fix sprintf security bugs.
Revert back to using os_snprintf instead of sprintf.

Closes WIFI-624
2019-07-06 04:22:53 +00:00
Nachiket Kukade 773ddcf0ff wpa_supplicant: Remove tags file which was added by mistake
Merge request idf/esp-idf!5219 added a ctags 'tags' file to
the repository by mistake. Remove it.
2019-07-05 14:23:21 +05:30
Deng Xin c139683024 supplicant/esp_wifi: move supplicant to idf
Move supplicant to idf and do following refactoring:
1. Make the folder structure consitent with supplicant upstream
2. Remove duplicated header files and minimize the public header files
3. Refactor for WiFi/supplicant interfaces
2019-06-29 22:46:52 +08:00
Renz Christian Bagaporo 9b350f9ecc cmake: some formatting fixes
Do not include bootloader in flash target when secure boot is enabled.
Emit signing warning on all cases where signed apps are enabled (secure
boot and signed images)
Follow convention of capital letters for SECURE_BOOT_SIGNING_KEY
variable, since it is
relevant to other components, not just bootloader.
Pass signing key and verification key via config, not requiring
bootloader to know parent app dir.
Misc. variables name corrections
2019-06-21 19:53:29 +08:00
Renz Christian Bagaporo 9eccd7c082 components: use new component registration api 2019-06-21 19:53:29 +08:00
suda-morris 84b2f9f14d build and link hello-world for esp32s2beta 2019-06-11 13:07:37 +08:00
xiehang 2503af2464 wps: add overlap event
modify some header files to be consistent with vnc
2019-06-06 13:16:20 +08:00
Renz Christian Bagaporo ffec9d4947 components: update with build system changes 2019-05-13 19:59:17 +08:00
Michael (XIAO Xufeng) 562af8f65e global: move the soc component out of the common list
This MR removes the common dependency from every IDF components to the SOC component.

Currently, in the ``idf_functions.cmake`` script, we include the header path of SOC component by default for all components.
But for better code organization (or maybe also benifits to the compiling speed), we may remove the dependency to SOC components for most components except the driver and kernel related components.

In CMAKE, we have two kinds of header visibilities (set by include path visibility):

(Assume component A --(depends on)--> B, B is the current component)

1. public (``COMPONENT_ADD_INCLUDEDIRS``): means this path is visible to other depending components (A) (visible to A and B)
2. private (``COMPONENT_PRIV_INCLUDEDIRS``): means this path is only visible to source files inside the component (visible to B only)

and we have two kinds of depending ways:

(Assume component A --(depends on)--> B --(depends on)--> C, B is the current component)

1. public (```COMPONENT_REQUIRES```): means B can access to public include path of C. All other components rely on you (A) will also be available for the public headers. (visible to A, B)
2. private (``COMPONENT_PRIV_REQUIRES``): means B can access to public include path of C, but don't propagate this relation to other components (A). (visible to B)

1. remove the common requirement in ``idf_functions.cmake``, this makes the SOC components invisible to all other components by default.
2. if a component (for example, DRIVER) really needs the dependency to SOC, add a private dependency to SOC for it.
3. some other components that don't really depends on the SOC may still meet some errors saying "can't find header soc/...", this is because it's depended component (DRIVER) incorrectly include the header of SOC in its public headers. Moving all this kind of #include into source files, or private headers
4. Fix the include requirements for some file which miss sufficient #include directives. (Previously they include some headers by the long long long header include link)

This is a breaking change. Previous code may depends on the long include chain.
You may need to include the following headers for some files after this commit:

- soc/soc.h
- soc/soc_memory_layout.h
- driver/gpio.h
- esp_sleep.h

The major broken include chain includes:

1. esp_system.h no longer includes esp_sleep.h. The latter includes driver/gpio.h and driver/touch_pad.h.
2. ets_sys.h no longer includes soc/soc.h
3. freertos/portmacro.h no longer includes soc/soc_memory_layout.h

some peripheral headers no longer includes their hw related headers, e.g. rom/gpio.h no longer includes soc/gpio_pins.h and soc/gpio_reg.h

BREAKING CHANGE
2019-04-16 13:21:15 +08:00
Ivan Grokhotkov d15e18aa5d newlib: fixes for compatibility with newlib 3.0 2019-04-10 13:48:57 +08:00
morris c159984264 separate rom from esp32 component to esp_rom
1. separate rom include files and linkscript to esp_rom
2. modefiy "include rom/xxx.h" to "include esp32/rom/xxx.h"
3. Forward compatible
4. update mqtt
2019-03-21 18:51:45 +08:00
Balazs Racz efcd10ea31 Fix missing declaration of __bswap64 in endian.h
Merges https://github.com/espressif/esp-idf/pull/2983
2019-03-21 15:08:11 +08:00
Ivan Grokhotkov 1d0bffb20a lwip, wpa_supplicant: use endianness macros from libc if possible 2019-03-19 22:15:32 +08:00
Renz Bagaporo cc774111bf cmake: Add support for test build 2018-10-20 12:07:24 +08:00