Skip to content

Commit 413c229

Browse files
adeaarmvaleriosetti
authored andcommitted
[zep noup] Enable sources when MCUBOOT_USE_PSA_CRYPTO and not MBEDTLS_PSA_CRYPTO_C
Gate relevant files for the thin PSA crypto core on MCUBOOT_USE_PSA_CRYPTO during BL2 build instead of MBEDTLS_PSA_CRYPTO_C which is not defined in such case. A full solution might require a change in config strategy of Mbed TLS with the definition Signed-off-by: Antonio de Angelis <[email protected]> applied using: git am modules/tee/tf-m/trusted-firmware-m/lib/ext/mbedcrypto/\ 0007-Enable-sources-when-MCUBOOT_USE_PSA_CRYPTO-and-not-M.patch Signed-off-by: Tomi Fontanilles <[email protected]>
1 parent ae58d91 commit 413c229

File tree

9 files changed

+5
-59
lines changed

9 files changed

+5
-59
lines changed

CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,6 @@ if(LIB_INSTALL_DIR)
315315
set(CMAKE_INSTALL_LIBDIR "${LIB_INSTALL_DIR}")
316316
endif()
317317

318-
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/framework/CMakeLists.txt")
319-
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
320-
message(FATAL_ERROR "${CMAKE_CURRENT_SOURCE_DIR}CMakeLists.txt not found (and does appear to be a git checkout). Run `git submodule update --init` from the source tree to fetch the submodule contents.")
321-
else ()
322-
message(FATAL_ERROR "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt not found (and does not appear to be a git checkout). Please ensure you have downloaded the right archive from the release page on GitHub.")
323-
endif()
324-
endif()
325-
add_subdirectory(framework)
326-
327318
add_subdirectory(include)
328319

329320
add_subdirectory(3rdparty)

Makefile

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,6 @@ DESTDIR=/usr/local
22
PREFIX=mbedtls_
33
PERL ?= perl
44

5-
ifneq (,$(filter-out lib library/%,$(or $(MAKECMDGOALS),all)))
6-
ifeq (,$(wildcard framework/exported.make))
7-
# Use the define keyword to get a multi-line message.
8-
# GNU make appends ". Stop.", so tweak the ending of our message accordingly.
9-
ifneq (,$(wildcard .git))
10-
define error_message
11-
${MBEDTLS_PATH}/framework/exported.make not found (and does appear to be a git checkout). Run `git submodule update --init` from the source tree to fetch the submodule contents.
12-
This is a fatal error
13-
endef
14-
else
15-
define error_message
16-
${MBEDTLS_PATH}/framework/exported.make not found (and does not appear to be a git checkout). Please ensure you have downloaded the right archive from the release page on GitHub.
17-
endef
18-
endif
19-
$(error $(error_message))
20-
endif
21-
include framework/exported.make
22-
endif
23-
245
.SILENT:
256

267
.PHONY: all no_test programs lib tests install uninstall clean test check lcov apidoc apidoc_clean

include/mbedtls/psa_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* otherwise error codes would be unknown in test_suite_psa_crypto_util.data.*/
2222
#include <mbedtls/asn1write.h>
2323

24-
#if defined(MBEDTLS_PSA_CRYPTO_CLIENT)
24+
#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) || defined(MCUBOOT_USE_PSA_CRYPTO)
2525

2626
/** The random generator function for the PSA subsystem.
2727
*

library/Makefile

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,6 @@ GENERATED_FILES := \
88
psa_crypto_driver_wrappers.h \
99
psa_crypto_driver_wrappers_no_static.c
1010

11-
ifneq ($(GENERATED_FILES),$(wildcard $(GENERATED_FILES)))
12-
ifeq (,$(wildcard $(MBEDTLS_PATH)/framework/exported.make))
13-
# Use the define keyword to get a multi-line message.
14-
# GNU make appends ". Stop.", so tweak the ending of our message accordingly.
15-
define error_message
16-
$(MBEDTLS_PATH)/framework/exported.make not found.
17-
Run `git submodule update --init` to fetch the submodule contents.
18-
This is a fatal error
19-
endef
20-
$(error $(error_message))
21-
endif
22-
include $(MBEDTLS_PATH)/framework/exported.make
23-
endif
24-
2511
# Also see "include/mbedtls/mbedtls_config.h"
2612

2713
CFLAGS ?= -O2

library/psa_crypto_driver_wrappers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "mbedtls/constant_time.h"
2424
/* END-common headers */
2525

26-
#if defined(MBEDTLS_PSA_CRYPTO_C)
26+
#if defined(MBEDTLS_PSA_CRYPTO_C) || defined(MCUBOOT_USE_PSA_CRYPTO)
2727

2828
/* BEGIN-driver headers */
2929
/* Headers for mbedtls_test opaque driver */

library/psa_crypto_ecp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "common.h"
1010

11-
#if defined(MBEDTLS_PSA_CRYPTO_C)
11+
#if defined(MBEDTLS_PSA_CRYPTO_C) || defined(MCUBOOT_USE_PSA_CRYPTO)
1212

1313
#include <psa/crypto.h>
1414
#include "psa_crypto_core.h"

library/psa_crypto_hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "common.h"
1010

11-
#if defined(MBEDTLS_PSA_CRYPTO_C)
11+
#if defined(MBEDTLS_PSA_CRYPTO_C) || defined(MCUBOOT_USE_PSA_CRYPTO)
1212

1313
#include <psa/crypto.h>
1414
#include "psa_crypto_core.h"

library/psa_crypto_rsa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "common.h"
1010

11-
#if defined(MBEDTLS_PSA_CRYPTO_C)
11+
#if defined(MBEDTLS_PSA_CRYPTO_C) || defined(MCUBOOT_USE_PSA_CRYPTO)
1212

1313
#include <psa/crypto.h>
1414
#include "psa/crypto_values.h"

scripts/common.make

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@ ifndef MBEDTLS_PATH
44
MBEDTLS_PATH := ..
55
endif
66

7-
ifeq (,$(wildcard $(MBEDTLS_PATH)/framework/exported.make))
8-
# Use the define keyword to get a multi-line message.
9-
# GNU make appends ". Stop.", so tweak the ending of our message accordingly.
10-
define error_message
11-
$(MBEDTLS_PATH)/framework/exported.make not found.
12-
Run `git submodule update --init` to fetch the submodule contents.
13-
This is a fatal error
14-
endef
15-
$(error $(error_message))
16-
endif
17-
include $(MBEDTLS_PATH)/framework/exported.make
18-
197
CFLAGS ?= -O2
208
WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
219
WARNING_CXXFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral -std=c++11 -pedantic

0 commit comments

Comments
 (0)