27
27
#
28
28
29
29
# Set the mbed TLS release to import (this can/should be edited before import)
30
- MBED_TLS_RELEASE ?= mbedtls-2.20.0d1
30
+ MBED_TLS_RELEASE ?= mbedtls-2.22.0
31
31
MBED_TLS_REPO_URL ?=
[email protected] :ARMmbed/mbedtls.git
32
32
33
33
# Translate between mbed TLS namespace and mbed namespace
@@ -36,9 +36,20 @@ TARGET_SRC:=$(TARGET_PREFIX)src
36
36
TARGET_INC: =$(TARGET_PREFIX ) inc
37
37
TARGET_TESTS: =$(TARGET_PREFIX ) TESTS
38
38
39
+ # A folder structure is introduced here for targets that have both a Secure
40
+ # Processing Environment (SPE) targets and Non-secure Processing Environment
41
+ # (NSPE). Documentation for each folder as follows:
42
+ # COMPONENT_PSA_SRV_IMPL - Include secure service implementation code. For
43
+ # example PSA Crypto or PSA Secure Time implementations
44
+ TARGET_SRV_IMPL: =$(TARGET_PREFIX ) /platform/COMPONENT_PSA_SRV_IMPL
45
+ # COMPONENT_NSPE - Include code that compiles ONLY to the NSPE image and never
46
+ # compiles to the SPE image
47
+ TARGET_NSPE: =$(TARGET_SRV_IMPL ) /COMPONENT_NSPE
48
+
39
49
# mbed TLS source directory - hidden from mbed via TARGET_IGNORE
40
50
MBED_TLS_DIR: =TARGET_IGNORE/mbedtls
41
51
MBED_TLS_API: =$(MBED_TLS_DIR ) /include/mbedtls
52
+ CRYPTO_API: =$(MBED_TLS_DIR ) /include/psa
42
53
MBED_TLS_GIT_CFG =$(MBED_TLS_DIR ) /.git/config
43
54
44
55
.PHONY : all deploy deploy-tests rsync mbedtls clean update
@@ -57,10 +68,24 @@ rsync:
57
68
rm -rf $(TARGET_INC )
58
69
mkdir -p $(TARGET_INC )
59
70
rsync -a --delete $(MBED_TLS_API ) $(TARGET_INC )
71
+ rsync -a --delete --exclude=' crypto_struct.h' $(CRYPTO_API ) $(TARGET_INC ) /
60
72
#
61
73
# Copying licenses
62
74
cp $(MBED_TLS_DIR ) /LICENSE $(TARGET_PREFIX )
63
75
#
76
+ # Copying Mbed Crypto into Mbed OS...
77
+ rm -rf $(TARGET_SRV_IMPL )
78
+
79
+ mkdir -p $(TARGET_SRV_IMPL)
80
+ mkdir -p $(TARGET_NSPE)
81
+
82
+ rsync -a --delete $(CRYPTO_API)/crypto_struct.h $(TARGET_NSPE)/
83
+ rsync -a --delete $(MBED_TLS_DIR)/library/psa_*.c $(TARGET_SRV_IMPL)/
84
+ rsync -a --delete $(MBED_TLS_DIR)/library/psa_*.h $(TARGET_SRV_IMPL)/
85
+ #
86
+ # Remove PSA-specific C & H files (they go into $(TARGET_SRV_IMPL))
87
+ rm -rf $(TARGET_SRC)/psa_*.c
88
+ rm -rf $(TARGET_SRC)/psa_*.h
64
89
65
90
deploy : rsync
66
91
#
@@ -110,3 +135,4 @@ clean:
110
135
rm -rf $(TARGET_SRC )
111
136
rm -rf $(TARGET_INC )
112
137
rm -rf $(MBED_TLS_DIR )
138
+ rm -rf $(TARGET_SRV_IMPL )
0 commit comments