Commit Graph

337 Commits

Author SHA1 Message Date
Christoph Baechler
0002b59fc6
esp_ds: ignore releasing mutex if not called from same task 2023-06-20 09:02:48 +05:30
Mahavir Jain
18dbdbb643
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 09:22:10 +05:30
harshal.patil
9e4055ef44 mbedtls: Update to release v2.28.3
- Release Notes: https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.3
2023-04-11 09:26:32 +00:00
harshal.patil
f138411fd7 mbedtls/port: added stream_block parameter sanity check 2023-01-25 15:40:45 +05:30
harshal.patil
119ac05b5e mbedtls: fix esp_aes_crypt_ctr writing to null stream block 2023-01-25 15:40:45 +05:30
harshal.patil
342671a943 mbedtls: added SOC_AES_SUPPORT_AES_192 check in esp_aes_gcm_setkey() 2023-01-25 15:40:45 +05:30
Aditya Patwardhan
861c3f5025 esp_rsa_sign_alt: Fix esp_init_ds_data_ctx API to not modify user defined data when it is given directory from flash 2022-08-23 13:32:12 +05:30
Laukik Hase
7008e36ccb
mbedtls: Update to release v2.28.1
- Changelog: https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.1
2022-07-14 10:08:45 +05:30
Mahavir Jain
d8ffa6df04 esp_crt_bundle: Fix build problems if MBEDTLS_CERTIFICATE_BUNDLE is disabled
Exclude source and include file from build list if certificate bundle feature
is disabled.

Closes https://github.com/espressif/esp-idf/issues/8714
Closes IDFGH-7106
2022-06-13 11:24:00 +05:30
Jiang Jiang Jian
c65f973e64 Merge branch 'bugfix/mbedtls_dynamic_buffer_crash_on_ssl_server_v4.3' into 'release/v4.3'
fix(mbedtls): fix ssl server memory leak when enable mbedtls dynamic buffer (backport v4.3)

See merge request espressif/esp-idf!17876
2022-06-09 17:26:16 +08:00
Li Jingyi
24feccbd80 mbedtls: fix ssl server crash when enable mbedtls dynamic buffer
Not free keycert until MBEDTLS_SSL_CLIENT_KEY_EXCHANGE for rsa key exchange methods, because keycert will be used to parse client key exchange.
2022-06-09 04:37:35 +00:00
Espressif BOT
d2c1c97755 Update esp_crt_bundle certificates 2022-06-06 11:22:07 +05:30
Aditya Patwardhan
ac05c493b9 esp_crt_bundle: Add bounds checking for the "esp_crt_bundle_set" API.
Closes https://github.com/espressif/esp-idf/issues/8397
2022-06-06 11:22:02 +05:30
Mahavir Jain
a6fd8b0972 mbedtls: move locally managed root certificates to separate file
Purpose:
This will allow for easily automating periodic updates to
"cacrt_all.pem" file.

Note:
For now newly created "cacrt_local.pem" contains single "DST Root CA X3"
which we are keeping to manage compatibility with endpoints like
"howsmyssl.com". Please note this Root CA is expired and is not part of
Mozilla’s NSS root certificate store.
2022-06-02 11:07:37 +05:30
Laukik Hase
bc7cb7c947 esp_crt_bundle: Fix build error
- When `esp_crt_bundle.h` is included before any config,
  a build error (`esp_err_t` not defined) is observed

Closes https://github.com/espressif/esp-idf/issues/8606
2022-06-02 11:06:55 +05:30
Li Jingyi
ffef57c580 fix(mbedtls): fix ssl server memory leak when enable mbedtls dynamic buffer function 2022-05-19 16:28:53 +08:00
Laukik Hase
bdd329ff02 ci: Fix issues for build stage
- Fixed logs expecting different format specifier
- Updated ignore list for check_public_header test
- Updated functions ported from mbedTLS
- Fix for make-system build errors
2022-02-02 15:07:50 +05:30
Laukik Hase
df9f101792 mbedtls: Added option MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
- Removed code regarding MBEDTLS_DYNAMIC_FREE_PEER_CERT
  (config was kept for backward compatibility)
- Combined mbedTLS v2.28.x related options under a separate Kconfig menu
2022-02-02 11:00:32 +05:30
Laukik Hase
92c0c09514 mbedtls: Moved mbedtls_mpi_mul_int to port layer 2022-02-02 11:00:32 +05:30
Laukik Hase
29b6d229c1 mbedtls: Added config options for v2.28.0 upgrade 2022-02-02 11:00:32 +05:30
Laukik Hase
021627754c mbedtls: Upgrade to v2.28.0 2022-02-02 11:00:27 +05:30
Marius Vikhammer
6e9d90d6e1 soc: Added support for specify the maximum descriptor length when setting up the DMA descriptor link 2022-01-06 08:11:57 +08:00
Marius Vikhammer
2a28ec3522 crypto: also apply cache writeback/invalidate for SPIRAM_USE_MEMMAP
Closes https://github.com/espressif/esp-idf/issues/7944
2022-01-06 08:11:57 +08:00
Marius Vikhammer
b957692888 crypto: allocate all DMA descriptors to DMA capable memory.
These were previously placed on the stack, but the stack could be placed in
RTC RAM which is not DMA capable.
2022-01-06 08:11:57 +08:00
Li Jingyi
e3b39381fd fix(mbedtls): fix compiling error when open MBEDTLS_SSL_PROTO_DTLS and disable MBEDTLS_DYNAMIC_BUFFER feature when MBEDTLS_SSL_PROTO_DTLS is selected 2021-12-23 15:34:18 +08:00
Jiang Jiang Jian
0fed811a46 Merge branch 'feature/mbedtls-2.16.12-integration_v4.3' into 'release/v4.3'
mbedtls: upgrade to release v2.16.12 (v4.3)

See merge request espressif/esp-idf!16484
2021-12-22 13:32:30 +00:00
Mahavir Jain
0fd5c562bf mbedtls: upgrade to release v2.16.12
For release notes, please refer to:
https://github.com/ARMmbed/mbedtls/releases/tag/v2.16.12
2021-12-21 14:04:31 +05:30
Mahavir Jain
9d79b70acf mbedtls: small documentation update 2021-12-21 14:04:12 +05:30
Li Jingyi
32e29580de feat(mbedtls): modify __wrap_mbedtls_ssl_setup to decrease SSL peak heap cost 2021-12-21 15:19:29 +08:00
Mahavir Jain
70936f4c92 mbedtls: remove wrap from component.mk as well
Note: This was not required in original MR, as master branch does
not support GNU Make.
2021-12-02 17:15:42 +05:30
Mahavir Jain
7a8c8f8576 esp_bignum: move check for supported MPI bits at start of API
This can allow hardware MPI API to return as soon as it identifies
that it can handle require bitlength operation.
2021-12-02 15:08:42 +05:30
Mahavir Jain
1cae1fc18e mbedtls: update mbedtls submodule pointer for MPI API change 2021-12-02 15:08:41 +05:30
Mahavir Jain
0befb28237 mbedtls: fix hardware MPI (bignum) related regression
In commit de22f3a4e5, combination of
hardware and software MPI (bignum) related approach was used to
work around chip (e.g. ESP32-C3) limitation of max 3072 bits support.

This was done using linker "--wrap" flag but since the relevant API is
being used in same translation (compilation unit), hardware mode was not
getting used in some cases (e.g., RSA key generation).

This commit modified internal mbedTLS API and makes software+hardware
combination deterministic.
2021-12-02 15:08:37 +05:30
Mahavir Jain
f864e1ddbb mbedtls: update kconfig help to correct on supported MPI bits 2021-12-02 15:07:37 +05:30
Marius Vikhammer
1c9f018891 aes: fix potential unaligned access in aes-gcm 2021-11-04 10:59:53 +08:00
Victor Morales
caafeff63f esp_crt_bundle: remove EC-ACC certificate
Fixes bug #7631
2021-10-07 13:13:52 +05:30
Zim Kalinowski
121910b939 Merge branch 'ci/change_perf_key_v4.3' into 'release/v4.3'
ci: update performance test key to db compatible format (v4.3)

See merge request espressif/esp-idf!14654
2021-09-10 04:23:09 +00:00
Marius Vikhammer
d5d126b73e aes/sha: fixed driver reseting the wrong GDMA channel
Driver was using the channel ID from tx when reseting rx.
But since rx and tx is not necessarily from the same pair this could lead
to the driver reseting the wrong DMA channel.
2021-08-30 17:06:13 +08:00
Fu Hanxi
2231d6b158 ci: update performance test key to db compatible format 2021-08-04 12:22:25 +08:00
Mahavir Jain
ab452839ed Merge branch 'feature/upgrade_mbedtls_to_v4.3' into 'release/v4.3'
mbedtls: upgrade to release v2.16.11 (v4.3)

See merge request espressif/esp-idf!14437
2021-07-21 12:17:00 +00:00
Mahavir Jain
f817971f68 mbedtls: fix crt_bundle test to ensure proper server start event
This fixes occasional test failure that was observed due to
client task getting started before server was up.
2021-07-20 14:15:59 +05:30
Mahavir Jain
4333e618b5 mbedtls: upgrade to release v2.16.11
For detailed release notes please refer to:
https://github.com/ARMmbed/mbedtls/releases/tag/v2.16.11
2021-07-20 14:15:59 +05:30
Mahavir Jain
dd12e9f8cd Merge branch 'cert/skipping_keyelements_validation' into 'master'
MbedTLS: Add config option for key elements and key element extension for SSL connection

See merge request espressif/esp-idf!12898

(cherry picked from commit 76bd33e9a4)

38d67725 mbedtls: Add config option key element and key element ext
2021-07-14 16:43:58 +08:00
kapil.gupta
ae35d70359 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-06-29 14:34:48 +08:00
Mahavir Jain
a213b289be Merge branch 'feature/extmem_alloc_for_s2_v4.3' into 'release/v4.3'
External memory allocation policy support  for ESP32-S2 (GitHub PR) (v4.3)

See merge request espressif/esp-idf!13619
2021-06-16 16:34:13 +00:00
Marcel Kottmann
4c8ae4fd56 mbedtls: Allow external mem alloc for ESP32-S2
Closes https://github.com/espressif/esp-idf/pull/6998
Closes IDFGH-5226
2021-06-16 11:11:55 +08:00
Marius Vikhammer
390bdf2f78 mbedtls: fixed CMake build warning
Building mbedtls with CMake would warn that:

"A private source from a directory other than that of target "mbedcrypto
 has a relative path"

This happened due to some of the CMake variables listing sources could be empty.

Changed to only use target_sources in the code-path where we set the sources,
so we only call target_sources will non-empty variables.

Closes https://github.com/espressif/esp-idf/issues/6767
2021-05-19 11:11:04 +08:00
yuanjm
6d32eec165 mbedtls: Fix mbedtls_ssl_send_alert_message crash due to ssl->out_iv is NULL 2021-04-30 02:01:51 +00:00
liuhan
9bf4d44235 mbedtls: Add CONFIG_MBEDTLS_ROM_MD5 to use ROM MD5 in mbedTLS 2021-04-22 12:34:00 +00:00
Angus Gratton
9c4c377f2d mbedtls tests: Add optional debug log output to AES stream tests 2021-03-25 15:28:45 +11:00