@@ -32,9 +32,11 @@ if in_mbedtls_repo; then
32
32
crypto_core_dir=' library'
33
33
builtin_drivers_dir=' library'
34
34
fi
35
+ MBEDTLS_FRAMEWORK_DIR=" $PWD /framework"
35
36
elif in_tf_psa_crypto_repo; then
36
37
crypto_core_dir=' core'
37
38
builtin_drivers_dir=' drivers/builtin/src/'
39
+ MBEDTLS_FRAMEWORK_DIR=" $PWD /../framework"
38
40
else
39
41
echo " Must be run from Mbed TLS root or TF-PSA-Crypto root" >&2
40
42
exit 1
@@ -138,34 +140,36 @@ check()
138
140
139
141
# The first case is temporary for the hybrid situation with a tf-psa-crypto
140
142
# directory in Mbed TLS that is not just a TF-PSA-Crypto submodule.
141
- if [ -d tf-psa-crypto ] ; then
142
- cd tf-psa-crypto
143
+ check_tf_psa_crypto ()
144
+ {
143
145
check scripts/generate_psa_constants.py ./programs/psa/psa_constant_names_generated.c
144
- check ../framework/scripts/generate_bignum_tests.py $( ../framework/scripts/generate_bignum_tests.py --list)
145
- check ../framework/scripts/generate_config_tests.py tests/suites/test_suite_config.psa_boolean.data
146
- check ../framework/scripts/generate_ecp_tests.py $( ../framework/scripts/generate_ecp_tests.py --list)
147
- check ../framework/scripts/generate_psa_tests.py $( ../framework/scripts/generate_psa_tests.py --list)
148
- cd ..
149
- check tf-psa-crypto/scripts/generate_driver_wrappers.py ${crypto_core_dir} /psa_crypto_driver_wrappers.h \
150
- ${crypto_core_dir} /psa_crypto_driver_wrappers_no_static.c
151
- check framework/scripts/generate_config_tests.py tests/suites/test_suite_config.mbedtls_boolean.data
152
- else
146
+ check ${MBEDTLS_FRAMEWORK_DIR} /scripts/generate_bignum_tests.py $( ${MBEDTLS_FRAMEWORK_DIR} /scripts/generate_bignum_tests.py --list)
147
+ check ${MBEDTLS_FRAMEWORK_DIR} /scripts/generate_config_tests.py tests/suites/test_suite_config.psa_boolean.data
148
+ check ${MBEDTLS_FRAMEWORK_DIR} /scripts/generate_ecp_tests.py $( ${MBEDTLS_FRAMEWORK_DIR} /scripts/generate_ecp_tests.py --list)
149
+ check ${MBEDTLS_FRAMEWORK_DIR} /scripts/generate_psa_tests.py $( ${MBEDTLS_FRAMEWORK_DIR} /scripts/generate_psa_tests.py --list)
150
+ check scripts/generate_driver_wrappers.py ${crypto_core_dir} /psa_crypto_driver_wrappers.h \
151
+ ${crypto_core_dir} /psa_crypto_driver_wrappers_no_static.c
152
+ check ${MBEDTLS_FRAMEWORK_DIR} /scripts/generate_config_tests.py tests/suites/test_suite_config.mbedtls_boolean.data
153
+ # Generated files that are present in the repository even in the development
154
+ # branch. (This is intended to be temporary, until the generator scripts are
155
+ # fully reviewed and the build scripts support a generated header file.)
156
+ check ${MBEDTLS_FRAMEWORK_DIR} /scripts/generate_psa_wrappers.py tests/include/test/psa_test_wrappers.h tests/src/psa_test_wrappers.c
157
+ }
158
+
159
+ check_mbedtls ()
160
+ {
161
+ # TF-PSA-Crypto does not exist run additional checks.
162
+ if [ ! -d tf-psa-crypto ]; then
153
163
check framework/scripts/generate_bignum_tests.py $( framework/scripts/generate_bignum_tests.py --list)
154
- if in_tf_psa_crypto_repo; then
155
- check framework/scripts/generate_config_tests.py tests/suites/test_suite_config.psa_boolean.data
156
- else
157
- check framework/scripts/generate_config_tests.py tests/suites/test_suite_config.mbedtls_boolean.data
158
- fi
164
+ check framework/scripts/generate_config_tests.py tests/suites/test_suite_config.mbedtls_boolean.data
159
165
check framework/scripts/generate_ecp_tests.py $( framework/scripts/generate_ecp_tests.py --list)
160
166
check framework/scripts/generate_psa_tests.py $( framework/scripts/generate_psa_tests.py --list)
161
167
check scripts/generate_driver_wrappers.py ${crypto_core_dir} /psa_crypto_driver_wrappers.h \
162
168
${crypto_core_dir} /psa_crypto_driver_wrappers_no_static.c
163
- fi
164
-
165
- check framework/scripts/generate_test_keys.py framework/tests/src/test_keys.h
169
+ fi
166
170
167
- # Additional checks for Mbed TLS only
168
- if in_mbedtls_repo ; then
171
+ check framework/scripts/generate_test_keys.py framework/tests/src/test_keys.h
172
+ # Additional checks for Mbed TLS only
169
173
check scripts/generate_errors.pl library/error.c
170
174
check scripts/generate_query_config.pl programs/test/query_config.c
171
175
check scripts/generate_features.pl library/version_features.c
@@ -176,9 +180,10 @@ if in_mbedtls_repo; then
176
180
# care about their content, but the files must exist. So it must run after
177
181
# the step that creates or updates these files.
178
182
check scripts/generate_visualc_files.pl visualc/VS2017
179
- fi
183
+ }
180
184
181
- # Generated files that are present in the repository even in the development
182
- # branch. (This is intended to be temporary, until the generator scripts are
183
- # fully reviewed and the build scripts support a generated header file.)
184
- check framework/scripts/generate_psa_wrappers.py tf-psa-crypto/tests/include/test/psa_test_wrappers.h tf-psa-crypto/tests/src/psa_test_wrappers.c
185
+ if in_mbedtls_repo; then
186
+ check_mbedtls
187
+ else
188
+ check_tf_psa_crypto
189
+ fi
0 commit comments