Commit Graph

535 Commits

Author SHA1 Message Date
Mahavir Jain
bb1376ff5d
fix(api-docs): include in the ECDSA APIs for doxygen build 2023-11-20 16:17:11 +05:30
Mahavir Jain
2cd1635b86
fix(ecdsa): remove unused k_mode from the ECDSA HAL/LL API
For ESP32-H2 case, the hardware k mode is always enforced through
efuse settings (done in startup code).

For ESP32-P4 case, the software k mode is not supported in the peripheral
itself and code was redundant.
2023-11-20 16:05:15 +05:30
Harshit Malpani
37836b3c62
feat: ECDSA peripheral while performing http connection with mutual auth 2023-11-17 16:24:10 +05:30
Jiang Guang Ming
336bb85806 feat(mbedtls): add new option CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL for mbedtls pytest 2023-10-26 20:26:08 +08:00
Jiang Guang Ming
92b9474a71 feat(mbedtls): support C2 mbedtls can use crypto algorithm in ROM 2023-10-26 20:25:53 +08:00
Mahavir Jain
82d2cdcf5a fix(mbedtls): remove deprecated MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
This config has been removed in the upstream mbedTLS starting 3.0
release. Please see mbedTLS changelog for more details.
2023-10-17 10:03:39 +00:00
Mahavir Jain
bf59005fe1 fix(mbedtls): dynamic buffer feature issue with mbedtls 3.5.0
Set max TLS version in the SSL context during setup phase. Dynamic
buffer feature overrides the `mbedtls_ssl_setup` API and hence
this change is required per upstream 3.5.0 codebase change.
2023-10-17 10:03:39 +00:00
Mahavir Jain
e813bbc680 feat(mbedtls): update to 3.5.0 release
Changelog:
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.5.0
2023-10-17 10:03:39 +00:00
harshal.patil
f6b589e275
feat(esp_hw_support): Added locking mechanism for the ECDSA and ECC peripheral 2023-09-25 14:33:04 +05:30
Kapil Gupta
4756c22ffa change(esp_wifi): Port fast_pbkdf2 implementation for mbedlts
Add changes to use fast_pbkdf2 as default for PMK calculations.
fast_pbkdf2 is significantly faster than current implementations
for esp chips.

Also removes unnecessary code for pbkdf-sha256 and pbkdf-sha512.
2023-09-13 16:33:19 +08:00
Mahavir Jain
5605189398
fix(aes): correct the linking of the DMA descriptors
For certain data lengths, the last input descriptor was not getting appended
correctly and hence the EOF flag in the DMA descriptor link list was
set at incorrect location. This was resulting in the peripheral being
stalled expecting more data and eventually the code used to timeout
waiting for the AES completion interrupt.

Required configs for this issue:

CONFIG_MBEDTLS_HARDWARE_AES
CONFIG_SOC_AES_SUPPORT_DMA

This observation is similar to the issue reported in:
https://github.com/espressif/esp-idf/issues/10647

To recreate this issue, start the AES-GCM DMA operation with data length
12280 bytes and this should stall the operation forever.

In this fix, we are tracing the entire descriptor list and then appending the
extra bytes descriptor at correct position (as the last node).
2023-09-06 08:28:43 +05:30
Mahavir Jain
2fbe919e4c
fix(aes-gcm): correct the DMA completion wait condition for hardware GCM case
DMA operation completion must wait until the last DMA descriptor
ownership has been changed to hardware, that is hardware is completed
the write operation for entire data. Earlier for the hardware GCM case,
the first DMA descriptor was checked and it could have resulted in some
race condition for non interrupt (MBEDTLS_AES_USE_INTERRUPT disabled) case.
2023-09-06 08:28:43 +05:30
Mahavir Jain
10e100f584 Merge branch 'feature/update_mbedtls_v5.1' into 'release/v5.1'
feat(mbedtls): Update to release/v3.4.1 (v5.1)

See merge request espressif/esp-idf!25394
2023-08-23 18:17:20 +08:00
Mahavir Jain
75692c96e2 Merge branch 'feature/support_mbedtls_ecp_fixed_point_configurable_v5.1' into 'release/v5.1'
feat(mbedtls): support ecp fixed-point multiplication configurable (backport v5.1)

See merge request espressif/esp-idf!25286
2023-08-23 18:16:20 +08:00
Harshit Malpani
7eae1e4534
feat(mbedtls): Update to release/v3.4.1 2023-08-17 17:33:22 +05:30
Jiang Guang Ming
e9a1a7add5 feat(mbedtls): support ecp fixed-point multiplication configurable 2023-08-11 16:40:38 +08:00
Mahavir Jain
bef0eaf2c7 ci(test): add SHA DMA mode test for large data in PSRAM
Covers a test scenario described in following issue:
https://github.com/espressif/esp-idf/issues/11915
2023-08-02 04:48:40 +00:00
Mahavir Jain
b966103800 fix(sha): DMA mode iteration calculation issue for certain data lengths
SHA hardware DMA mode calculation had off-by-one error for specific
input lengths. This was causing last chunk of the input data not being
fed to the hardware accelerator and hence resulting in an incorrect
final result.

Closes: https://github.com/espressif/esp-idf/issues/11915
2023-08-02 04:48:40 +00:00
Jiang Guang Ming
de15b6f819 fix(mbedtls): sha test will fail when run twice 2023-07-21 12:06:26 +00:00
Jiang Jiang Jian
b530d768e6 Merge branch 'fix/esp_aes_return_values_v5.1' into 'release/v5.1'
fix(mbedtls): fix return values of esp-aes APIs (v5.1)

See merge request espressif/esp-idf!24804
2023-07-15 12:24:25 +08:00
harshal.patil
34dccf840e refactor(mbedtls): refactored the return values check in some esp-aes APIs 2023-07-14 20:51:47 +05:30
harshal.patil
895d86621b fix(mbedtls): Fixed the transmission of return values of the esp-aes APIs
- Earlier, some intermediate return values were not stored and returned,
thus incorrect return values used to get transmitted to the upper layer of APIs.

- Also, zeroised the output buffer in case of error condition.
2023-07-14 14:20:47 +05:30
harshal.patil
8692da51a0 fix(mbedtls): Fix the port for the mbedtls_internal_shaX_process API
- Also added the fix to update intermediate SHA state in the mbedtls_shaX_update API
2023-07-14 14:20:20 +05:30
Laukik Hase
8e25eb1e08
fix(mbedtls): Fix incorrect assert for H/W MPI operations
- Closes https://github.com/espressif/esp-idf/issues/11850
2023-07-13 16:24:44 +05:30
harshal.patil
bdbb717be9 mbedtls: update submodule to include:
fix: mbedtls_ecdsa_can_do was not being defined when ECDSA_SIGN_ALT is defined but ECDSA_VERIFY_ALT is not defined causing mbedtls_ecdsa_verify_restartable to always fail.
feature: initial version of the sbom.yml file
2023-07-10 14:11:51 +00:00
Aditya Patwardhan
bcef59f33c Merge branch 'bugfix/mbedtls_dyanmic_buffer_with_dhm_build_v5.1' into 'release/v5.1'
fix(mbedtls): Build issue in dynamic buffer feature (v5.1)

See merge request espressif/esp-idf!24537
2023-07-05 12:04:00 +08:00
Mahavir Jain
ec8268d863 fix(mbedtls): Build issue in dynamic buffer feature
Fix build issue in mbedTLS dynamic buffer feature with
`CONFIG_MBEDTLS_DHM_C` enabled case.

Closes https://github.com/espressif/esp-idf/issues/11770
2023-07-03 04:01:19 +00:00
Mahavir Jain
69bcbe97f4 aes: fix DMA descriptor calculation for the alignment case
The number of the DMA descriptors allocated for certain length (e.g.,
8176) were not sufficient (off by 1 error). This used to result in the
dynamic memory corruption as the region was modified beyond the
allocated range.

This change fixes the DMA descriptor calculation part and allocates
sufficient DMA descriptors based on the data length alignment considerations.

Test has also been added to cover the specific scenario in the CI.

Closes https://github.com/espressif/esp-idf/issues/11310
2023-06-07 04:29:32 +00:00
Christoph Baechler
501c7d1101
esp_ds: ignore releasing mutex if not called from same task 2023-05-19 08:31:34 +05:30
Marius Vikhammer
63153794c9 build-system: replace ADDITIONAL_MAKE_CLEAN_FILES with ADDITIONAL_CLEAN_FILES
ADDITIONAL_MAKE_CLEAN_FILES is deprecated and only worked with make.
Replaced with the new ADDITIONAL_CLEAN_FILES (CMake 3.15) which also works with ninja.
2023-05-10 09:53:55 +08:00
Sachin Parekh
5fac5b0191 mbedtls/ecdsa: Add ECDSA signature generation test 2023-04-30 11:47:35 +05:30
Sachin Parekh
abc099ce9f ecdsa: Support multiple ECDSA keys
Add provision to choose which efuse block should be used as ECDSA
private key
2023-04-30 11:47:35 +05:30
laokaiyao
954a6a2cff esp32h4: removed esp32h4 related codes 2023-04-26 18:53:12 +08:00
laokaiyao
cae47ce37e esp32h4: removed esp32h4 related files 2023-04-26 18:53:12 +08:00
harshal.patil
b8718506cd mbedtls: fix ci failures for update v3.4.0
- While updating to mbedtls release/v3.4.0, building mbedtls/library/psa_crypto.c,
clang produced an unreachable-code warning, so added `-Wno-unreachable-code` compile option for clang.
- In `mbedtls/v3.4.0`, the ECDSA restartable sign and verify functions (`ecdsa.c`) were made public.
- But the `mbedtls_ecdsa_sign_det_restartable` function prototype was declared in the file `ecdsa.h`,
only when `MBEDTLS_ECDSA_SIGN_ALT` was not defined.
- added a patch in mbedtls library to fix it.
2023-04-24 11:56:56 +05:30
harshal.patil
0116dcb578 mbedtls: replace low-level sha apis with md apis in esp_ssl_tls 2023-04-24 11:56:56 +05:30
harshal.patil
3152dea192 mbedtls: Update config options as per release/v3.4.0
- Added a Kconfig option for the newly added mbedtls option MBEDTLS_PKCS7_C
2023-04-24 11:56:56 +05:30
harshal.patil
31e42e77de mbedtls: Update to release/v3.4.0
- Release Notes: https://github.com/Mbed-TLS/mbedtls/releases/tag/v3.4.0
2023-04-24 11:56:56 +05:30
Sachin Parekh
d2940c5ff3 mbedtls: Add port layer for ECDSA peripheral 2023-03-24 10:43:40 +05:30
Aditya Patwardhan
85b1efc729 Merge branch 'update/update_cmn_crt_authorities_csv' into 'master'
Update common cert authorities csv

See merge request espressif/esp-idf!22713
2023-03-16 12:59:48 +08:00
harshal.patil
6b8bc64f31 test: enable mbedtls esp_crt_bundle test for esp32h2 2023-03-13 12:00:01 +05:30
Espressif BOT
e174fc967e Update common cert authorities csv 2023-03-12 11:00:24 +08:00
Mahavir Jain
e364e1c102 Merge branch 'feature/esp32h2_enable_rsa_support' into 'master'
mbedtls: enable RSA support for esp32h2

Closes IDF-6284 and IDF-6415

See merge request espressif/esp-idf!22498
2023-03-02 15:06:24 +08:00
David Čermák
956e62c461 Merge branch 'feature/lwip_ipv6_only' into 'master'
lwip: Support IPv6 only mode

Closes IDF-6023

See merge request espressif/esp-idf!20468
2023-03-01 21:38:10 +08:00
harshal.patil
04cc562180 mbedtls: enable RSA support for esp32h2 2023-03-01 14:18:57 +05:30
Mahavir Jain
4db6cae2d6 Merge branch 'fix/mbedtls_test_app_perf_logs_esp32c2' into 'master'
mbedtls/test_apps: Fix performance logs

See merge request espressif/esp-idf!22340
2023-02-28 19:50:56 +08:00
Jiang Jiang Jian
b9d40b4943 Merge branch 'feature/add_esp_http_client_host_test' into 'master'
fix esp_http_client_example to build for Linux target.

See merge request espressif/esp-idf!22339
2023-02-28 19:48:24 +08:00
Armando
4c0d6b6835 mbedtls: updated to use default gdma psram alignment
When accessing the PSRAM, the GDMA buffer alignment should be larger or
equal to the data cache line size
2023-02-28 10:42:22 +08:00
Harshit Malpani
214627f14b
mbedtls: Keep CONFIG_MBEDTLS_DYNAMIC_BUFFER disabled for Linux target 2023-02-27 15:12:14 +05:30
David Cermak
5f6cb31105 lwip: Support IPv6 only mode 2023-02-27 08:53:34 +01:00