Commit Graph

6 Commits

Author SHA1 Message Date
Tomi Fontanilles d4394c2f9b mbedtls config: fix too early check_config.h includes
check_config.h was included manually by custom configuration files.
This caused compilation errors when updating MbedTLS to 3.6.0
because check_config.h was processed too early, before the whole
configuration is defined, effectively causing configuration check errors.

MbedTLS already takes care of including check_config.h at the right time.
Remove those erroneous manual check_config.h includes.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-04-25 11:05:54 +02:00
Marcin Niestroj 65e1314058 zephyr: remove MBEDTLS_ECP_MAX_BITS from mbedTLS configs
According to mbedTLS' Changelog "Mbed TLS 3.0.0 branch released
2021-07-07" -> "Removals":

   MBEDTLS_ECP_MAX_BITS is no longer a configuration option because it
   is now determined automatically based on supported curves.

Hence remove MBEDTLS_ECP_MAX_BITS from configuration files to fix build
issues with Zephyr when there is unfortunate order of include
statements, like:

  /__w/zephyr/zephyr/modules/mbedtls/zephyr_init.c
  In file included from /__w/zephyr/modules/crypto/mbedtls/include/mbedtls/ssl.h:30,
                   from /__w/zephyr/modules/crypto/mbedtls/include/mbedtls/debug.h:27,
                   from /__w/zephyr/zephyr/modules/mbedtls/zephyr_init.c:16:
  /__w/zephyr/modules/crypto/mbedtls/include/mbedtls/ecp.h:314: error: "MBEDTLS_ECP_MAX_BITS" redefined [-Werror]
    314 | #define MBEDTLS_ECP_MAX_BITS 1
        |
  In file included from /__w/zephyr/bootloader/mcuboot/boot/zephyr/include/mcuboot-mbedtls-cfg.h:25,
                   from /__w/zephyr/modules/crypto/mbedtls/include/mbedtls/build_info.h:59,
                   from /__w/zephyr/modules/crypto/mbedtls/include/mbedtls/debug.h:25,
                   from /__w/zephyr/zephyr/modules/mbedtls/zephyr_init.c:16:
  /__w/zephyr/bootloader/mcuboot/boot/zephyr/include/config-rsa.h:72: note: this is the location of the previous definition
     72 | #define MBEDTLS_ECP_MAX_BITS             2048
        |
  cc1: all warnings being treated as errors

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-06-15 14:37:24 -06:00
Sebastian Bøe c8ba937ee3 zephyr: Use a smaller sha256 implementation
Reduce the size of the sha256 implementation by 1300 bytes by using a
slower implementation.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2022-01-20 16:09:37 +01:00
Sherry Zhang 17adf8dd96 zephyr: upgrade mbedtls library to mbedtls-3.0.0
Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
Change-Id: I306a9adc2e2a9c7933f637224f87c21dbd1bc5a4
2021-07-16 09:42:57 +02:00
Blaž Hrastnik 8097d86b2f Compile with MBEDTLS_CIPHER_MODE_CTR set.
Signed-off-by: Blaž Hrastnik <blaz@mxxn.io>
2020-09-28 09:08:44 -06:00
Fabio Utzig 1171df91b9 Add Zephyr infrastructure for ed25519
Signed-off-by: Fabio Utzig <utzig@apache.org>
2019-06-13 19:21:05 -03:00