mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-16 08:42:50 +00:00
Merge pull request #9717 from Harry-Ramsey/move-programs-psa-tf-psa-crypto-development
Move programs/psa to tf-psa-crypto
This commit is contained in:
commit
a13d4049ba
7
programs/.gitignore
vendored
7
programs/.gitignore
vendored
@ -33,12 +33,6 @@ pkey/rsa_sign
|
|||||||
pkey/rsa_sign_pss
|
pkey/rsa_sign_pss
|
||||||
pkey/rsa_verify
|
pkey/rsa_verify
|
||||||
pkey/rsa_verify_pss
|
pkey/rsa_verify_pss
|
||||||
psa/aead_demo
|
|
||||||
psa/crypto_examples
|
|
||||||
psa/hmac_demo
|
|
||||||
psa/key_ladder_demo
|
|
||||||
psa/psa_constant_names
|
|
||||||
psa/psa_hash
|
|
||||||
random/gen_entropy
|
random/gen_entropy
|
||||||
random/gen_random_ctr_drbg
|
random/gen_random_ctr_drbg
|
||||||
ssl/dtls_client
|
ssl/dtls_client
|
||||||
@ -75,7 +69,6 @@ x509/req_app
|
|||||||
|
|
||||||
###START_GENERATED_FILES###
|
###START_GENERATED_FILES###
|
||||||
# Generated source files
|
# Generated source files
|
||||||
/psa/psa_constant_names_generated.c
|
|
||||||
/test/query_config.c
|
/test/query_config.c
|
||||||
|
|
||||||
# Generated data files
|
# Generated data files
|
||||||
|
@ -8,7 +8,7 @@ if (NOT WIN32)
|
|||||||
endif()
|
endif()
|
||||||
add_subdirectory(hash)
|
add_subdirectory(hash)
|
||||||
add_subdirectory(pkey)
|
add_subdirectory(pkey)
|
||||||
add_subdirectory(psa)
|
add_subdirectory(../tf-psa-crypto/programs/psa ../tf-psa-crypto/programs/psa)
|
||||||
add_subdirectory(random)
|
add_subdirectory(random)
|
||||||
add_subdirectory(ssl)
|
add_subdirectory(ssl)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
|
@ -29,6 +29,9 @@ endif
|
|||||||
## be declared by appending with `APPS += ...` afterwards.
|
## be declared by appending with `APPS += ...` afterwards.
|
||||||
## See the get_app_list function in scripts/generate_visualc_files.pl and
|
## See the get_app_list function in scripts/generate_visualc_files.pl and
|
||||||
## make sure to check that it still works if you tweak the format here.
|
## make sure to check that it still works if you tweak the format here.
|
||||||
|
##
|
||||||
|
## Note: Variables cannot be used to define an apps path. This cannot be
|
||||||
|
## substituted by the script generate_visualc_files.pl.
|
||||||
APPS = \
|
APPS = \
|
||||||
aes/crypt_and_hash \
|
aes/crypt_and_hash \
|
||||||
cipher/cipher_aead_demo \
|
cipher/cipher_aead_demo \
|
||||||
@ -55,12 +58,12 @@ APPS = \
|
|||||||
pkey/rsa_sign_pss \
|
pkey/rsa_sign_pss \
|
||||||
pkey/rsa_verify \
|
pkey/rsa_verify \
|
||||||
pkey/rsa_verify_pss \
|
pkey/rsa_verify_pss \
|
||||||
psa/aead_demo \
|
../tf-psa-crypto/programs/psa/aead_demo \
|
||||||
psa/crypto_examples \
|
../tf-psa-crypto/programs/psa/crypto_examples \
|
||||||
psa/hmac_demo \
|
../tf-psa-crypto/programs/psa/hmac_demo \
|
||||||
psa/key_ladder_demo \
|
../tf-psa-crypto/programs/psa/key_ladder_demo \
|
||||||
psa/psa_constant_names \
|
../tf-psa-crypto/programs/psa/psa_constant_names \
|
||||||
psa/psa_hash \
|
../tf-psa-crypto/programs/psa/psa_hash \
|
||||||
random/gen_entropy \
|
random/gen_entropy \
|
||||||
random/gen_random_ctr_drbg \
|
random/gen_random_ctr_drbg \
|
||||||
ssl/dtls_client \
|
ssl/dtls_client \
|
||||||
@ -132,13 +135,13 @@ ${MBEDTLS_TEST_OBJS}:
|
|||||||
GENERATED_FILES = psa/psa_constant_names_generated.c test/query_config.c
|
GENERATED_FILES = psa/psa_constant_names_generated.c test/query_config.c
|
||||||
generated_files: $(GENERATED_FILES)
|
generated_files: $(GENERATED_FILES)
|
||||||
|
|
||||||
psa/psa_constant_names_generated.c: $(gen_file_dep) ../scripts/generate_psa_constants.py
|
../tf-psa-crypto/psa/psa_constant_names_generated.c: $(gen_file_dep) ../tf-psa-crypto/scripts/generate_psa_constants.py
|
||||||
psa/psa_constant_names_generated.c: $(gen_file_dep) ../tf-psa-crypto/include/psa/crypto_values.h
|
psa/psa_constant_names_generated.c: $(gen_file_dep) ../tf-psa-crypto/include/psa/crypto_values.h
|
||||||
psa/psa_constant_names_generated.c: $(gen_file_dep) ../tf-psa-crypto/include/psa/crypto_extra.h
|
psa/psa_constant_names_generated.c: $(gen_file_dep) ../tf-psa-crypto/include/psa/crypto_extra.h
|
||||||
psa/psa_constant_names_generated.c: $(gen_file_dep) ../tf-psa-crypto/tests/suites/test_suite_psa_crypto_metadata.data
|
psa/psa_constant_names_generated.c: $(gen_file_dep) ../tf-psa-crypto/tests/suites/test_suite_psa_crypto_metadata.data
|
||||||
psa/psa_constant_names_generated.c:
|
psa/psa_constant_names_generated.c:
|
||||||
echo " Gen $@"
|
echo " Gen $@"
|
||||||
$(PYTHON) ../scripts/generate_psa_constants.py
|
cd ../tf-psa-crypto; $(PYTHON) ./scripts/generate_psa_constants.py
|
||||||
|
|
||||||
test/query_config.c: $(gen_file_dep) ../scripts/generate_query_config.pl
|
test/query_config.c: $(gen_file_dep) ../scripts/generate_query_config.pl
|
||||||
## The generated file only depends on the options that are present in mbedtls_config.h,
|
## The generated file only depends on the options that are present in mbedtls_config.h,
|
||||||
@ -252,29 +255,29 @@ pkey/rsa_encrypt$(EXEXT): pkey/rsa_encrypt.c $(DEP)
|
|||||||
echo " CC pkey/rsa_encrypt.c"
|
echo " CC pkey/rsa_encrypt.c"
|
||||||
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_encrypt.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_encrypt.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
psa/aead_demo$(EXEXT): psa/aead_demo.c $(DEP)
|
../tf-psa-crypto/programs/psa/aead_demo$(EXEXT): ../tf-psa-crypto/programs/psa/aead_demo.c $(DEP)
|
||||||
echo " CC psa/aead_demo.c"
|
echo " CC psa/aead_demo.c"
|
||||||
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/aead_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ../tf-psa-crypto/programs/psa/aead_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
psa/crypto_examples$(EXEXT): psa/crypto_examples.c $(DEP)
|
../tf-psa-crypto/programs/psa/crypto_examples$(EXEXT): ../tf-psa-crypto/programs/psa/crypto_examples.c $(DEP)
|
||||||
echo " CC psa/crypto_examples.c"
|
echo " CC psa/crypto_examples.c"
|
||||||
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/crypto_examples.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ../tf-psa-crypto/programs/psa/crypto_examples.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
psa/hmac_demo$(EXEXT): psa/hmac_demo.c $(DEP)
|
../tf-psa-crypto/programs/psa/hmac_demo$(EXEXT): ../tf-psa-crypto/programs/psa/hmac_demo.c $(DEP)
|
||||||
echo " CC psa/hmac_demo.c"
|
echo " CC psa/hmac_demo.c"
|
||||||
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/hmac_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ../tf-psa-crypto/programs/psa/hmac_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
psa/key_ladder_demo$(EXEXT): psa/key_ladder_demo.c $(DEP)
|
../tf-psa-crypto/programs/psa/key_ladder_demo$(EXEXT): ../tf-psa-crypto/programs/psa/key_ladder_demo.c $(DEP)
|
||||||
echo " CC psa/key_ladder_demo.c"
|
echo " CC psa/key_ladder_demo.c"
|
||||||
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/key_ladder_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ../tf-psa-crypto/programs/psa/key_ladder_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
psa/psa_constant_names$(EXEXT): psa/psa_constant_names.c psa/psa_constant_names_generated.c $(DEP)
|
../tf-psa-crypto/programs/psa/psa_constant_names$(EXEXT): ../tf-psa-crypto/programs/psa/psa_constant_names.c psa/psa_constant_names_generated.c $(DEP)
|
||||||
echo " CC psa/psa_constant_names.c"
|
echo " CC psa/psa_constant_names.c"
|
||||||
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/psa_constant_names.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ../tf-psa-crypto/programs/psa/psa_constant_names.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
psa/psa_hash$(EXEXT): psa/psa_hash.c $(DEP)
|
../tf-psa-crypto/programs/psa/psa_hash$(EXEXT): ../tf-psa-crypto/programs/psa/psa_hash.c $(DEP)
|
||||||
echo " CC psa/psa_hash.c"
|
echo " CC psa/psa_hash.c"
|
||||||
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/psa_hash.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ../tf-psa-crypto/programs/psa/psa_hash.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
random/gen_entropy$(EXEXT): random/gen_entropy.c $(DEP)
|
random/gen_entropy$(EXEXT): random/gen_entropy.c $(DEP)
|
||||||
echo " CC random/gen_entropy.c"
|
echo " CC random/gen_entropy.c"
|
||||||
|
@ -21,7 +21,9 @@ my $vsx_main_file = "$vsx_dir/mbedTLS.$vsx_ext";
|
|||||||
my $vsx_sln_tpl_file = "scripts/data_files/vs2017-sln-template.sln";
|
my $vsx_sln_tpl_file = "scripts/data_files/vs2017-sln-template.sln";
|
||||||
my $vsx_sln_file = "$vsx_dir/mbedTLS.sln";
|
my $vsx_sln_file = "$vsx_dir/mbedTLS.sln";
|
||||||
|
|
||||||
my $programs_dir = 'programs';
|
my $mbedtls_programs_dir = "programs";
|
||||||
|
my $tfpsacrypto_programs_dir = "tf-psa-crypto/programs";
|
||||||
|
|
||||||
my $mbedtls_header_dir = 'include/mbedtls';
|
my $mbedtls_header_dir = 'include/mbedtls';
|
||||||
my $drivers_builtin_header_dir = 'tf-psa-crypto/drivers/builtin/include/mbedtls';
|
my $drivers_builtin_header_dir = 'tf-psa-crypto/drivers/builtin/include/mbedtls';
|
||||||
my $psa_header_dir = 'tf-psa-crypto/include/psa';
|
my $psa_header_dir = 'tf-psa-crypto/include/psa';
|
||||||
@ -122,7 +124,8 @@ sub check_dirs {
|
|||||||
&& -d $test_header_dir
|
&& -d $test_header_dir
|
||||||
&& -d $tls_test_header_dir
|
&& -d $tls_test_header_dir
|
||||||
&& -d $test_drivers_header_dir
|
&& -d $test_drivers_header_dir
|
||||||
&& -d $programs_dir;
|
&& -d $mbedtls_programs_dir
|
||||||
|
&& -d $tfpsacrypto_programs_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub slurp_file {
|
sub slurp_file {
|
||||||
|
@ -19,7 +19,9 @@ python framework\scripts\generate_ssl_debug_helpers.py || exit /b 1
|
|||||||
perl scripts\generate_visualc_files.pl || exit /b 1
|
perl scripts\generate_visualc_files.pl || exit /b 1
|
||||||
|
|
||||||
@rem @@@@ programs\** @@@@
|
@rem @@@@ programs\** @@@@
|
||||||
|
cd tf-psa-crypto
|
||||||
python scripts\generate_psa_constants.py || exit /b 1
|
python scripts\generate_psa_constants.py || exit /b 1
|
||||||
|
cd ..
|
||||||
|
|
||||||
@rem @@@@ tests\** @@@@
|
@rem @@@@ tests\** @@@@
|
||||||
python framework\scripts\generate_bignum_tests.py --directory tf-psa-crypto\tests\suites || exit /b 1
|
python framework\scripts\generate_bignum_tests.py --directory tf-psa-crypto\tests\suites || exit /b 1
|
||||||
|
@ -140,6 +140,7 @@ check()
|
|||||||
# directory in Mbed TLS that is not just a TF-PSA-Crypto submodule.
|
# directory in Mbed TLS that is not just a TF-PSA-Crypto submodule.
|
||||||
if [ -d tf-psa-crypto ]; then
|
if [ -d tf-psa-crypto ]; then
|
||||||
cd tf-psa-crypto
|
cd tf-psa-crypto
|
||||||
|
check scripts/generate_psa_constants.py ./programs/psa/psa_constant_names_generated.c
|
||||||
check ../framework/scripts/generate_bignum_tests.py $(../framework/scripts/generate_bignum_tests.py --list)
|
check ../framework/scripts/generate_bignum_tests.py $(../framework/scripts/generate_bignum_tests.py --list)
|
||||||
check ../framework/scripts/generate_config_tests.py tests/suites/test_suite_config.psa_boolean.data
|
check ../framework/scripts/generate_config_tests.py tests/suites/test_suite_config.psa_boolean.data
|
||||||
check ../framework/scripts/generate_ecp_tests.py $(../framework/scripts/generate_ecp_tests.py --list)
|
check ../framework/scripts/generate_ecp_tests.py $(../framework/scripts/generate_ecp_tests.py --list)
|
||||||
@ -161,7 +162,6 @@ else
|
|||||||
${crypto_core_dir}/psa_crypto_driver_wrappers_no_static.c
|
${crypto_core_dir}/psa_crypto_driver_wrappers_no_static.c
|
||||||
fi
|
fi
|
||||||
|
|
||||||
check scripts/generate_psa_constants.py programs/psa/psa_constant_names_generated.c
|
|
||||||
check framework/scripts/generate_test_keys.py framework/tests/src/test_keys.h
|
check framework/scripts/generate_test_keys.py framework/tests/src/test_keys.h
|
||||||
|
|
||||||
# Additional checks for Mbed TLS only
|
# Additional checks for Mbed TLS only
|
||||||
|
@ -21,7 +21,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
DEFAULT_STATUS_LOG_FILE = 'tests/statuses.log'
|
DEFAULT_STATUS_LOG_FILE = 'tests/statuses.log'
|
||||||
DEFAULT_PSA_CONSTANT_NAMES = 'programs/psa/psa_constant_names'
|
DEFAULT_PSA_CONSTANT_NAMES = 'tf-psa-crypto/programs/psa/psa_constant_names'
|
||||||
|
|
||||||
class Statuses:
|
class Statuses:
|
||||||
"""Information about observed return statues of API functions."""
|
"""Information about observed return statues of API functions."""
|
||||||
|
@ -44,7 +44,9 @@ def run_all_demos(quiet=False):
|
|||||||
|
|
||||||
Return True if all demos passed and False if a demo fails.
|
Return True if all demos passed and False if a demo fails.
|
||||||
"""
|
"""
|
||||||
all_demos = glob.glob('programs/*/*_demo.sh')
|
mbedtls_demos = glob.glob('programs/*/*_demo.sh')
|
||||||
|
tf_psa_crypto_demos = glob.glob('tf-psa-crypto/programs/*/*_demo.sh')
|
||||||
|
all_demos = mbedtls_demos + tf_psa_crypto_demos
|
||||||
if not all_demos:
|
if not all_demos:
|
||||||
# Keep the message on one line. pylint: disable=line-too-long
|
# Keep the message on one line. pylint: disable=line-too-long
|
||||||
raise Exception('No demos found. run_demos needs to operate from the Mbed TLS toplevel directory.')
|
raise Exception('No demos found. run_demos needs to operate from the Mbed TLS toplevel directory.')
|
||||||
|
@ -173,7 +173,7 @@ def main():
|
|||||||
action='store_false', dest='keep_c',
|
action='store_false', dest='keep_c',
|
||||||
help='Don\'t keep the intermediate C file (default)')
|
help='Don\'t keep the intermediate C file (default)')
|
||||||
parser.add_argument('--program',
|
parser.add_argument('--program',
|
||||||
default='programs/psa/psa_constant_names',
|
default='tf-psa-crypto/programs/psa/psa_constant_names',
|
||||||
help='Program to test')
|
help='Program to test')
|
||||||
parser.add_argument('--show',
|
parser.add_argument('--show',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
|
10
tf-psa-crypto/programs/.gitignore
vendored
10
tf-psa-crypto/programs/.gitignore
vendored
@ -0,0 +1,10 @@
|
|||||||
|
psa/aead_demo
|
||||||
|
psa/crypto_examples
|
||||||
|
psa/hmac_demo
|
||||||
|
psa/key_ladder_demo
|
||||||
|
psa/psa_constant_names
|
||||||
|
psa/psa_hash
|
||||||
|
|
||||||
|
###START_GENERATED_FILES###
|
||||||
|
# Generated source files
|
||||||
|
psa/psa_constant_names_generated.c
|
@ -20,8 +20,8 @@ if(GEN_FILES)
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/../..
|
${CMAKE_CURRENT_SOURCE_DIR}/../..
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/generate_psa_constants.py
|
${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/generate_psa_constants.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/include/psa/crypto_values.h
|
${CMAKE_CURRENT_SOURCE_DIR}/../../include/psa/crypto_values.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/include/psa/crypto_extra.h
|
${CMAKE_CURRENT_SOURCE_DIR}/../../include/psa/crypto_extra.h
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
link_to_source(psa_constant_names_generated.c)
|
link_to_source(psa_constant_names_generated.c)
|
@ -3,7 +3,7 @@
|
|||||||
# Copyright The Mbed TLS Contributors
|
# Copyright The Mbed TLS Contributors
|
||||||
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
||||||
|
|
||||||
. "${0%/*}/../demo_common.sh"
|
. "${0%/*}/../../../programs/demo_common.sh"
|
||||||
|
|
||||||
msg <<'EOF'
|
msg <<'EOF'
|
||||||
This script demonstrates the use of the PSA cryptography interface to
|
This script demonstrates the use of the PSA cryptography interface to
|
@ -3,7 +3,7 @@
|
|||||||
# Copyright The Mbed TLS Contributors
|
# Copyright The Mbed TLS Contributors
|
||||||
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
||||||
|
|
||||||
. "${0%/*}/../demo_common.sh"
|
. "${0%/*}/../../../programs/demo_common.sh"
|
||||||
|
|
||||||
msg <<'EOF'
|
msg <<'EOF'
|
||||||
This program demonstrates the use of the PSA cryptography interface to
|
This program demonstrates the use of the PSA cryptography interface to
|
@ -329,6 +329,6 @@ if __name__ == '__main__':
|
|||||||
# Allow to change the directory where psa_constant_names_generated.c is written to.
|
# Allow to change the directory where psa_constant_names_generated.c is written to.
|
||||||
OUTPUT_FILE_DIR = sys.argv[1] if len(sys.argv) == 2 else "programs/psa"
|
OUTPUT_FILE_DIR = sys.argv[1] if len(sys.argv) == 2 else "programs/psa"
|
||||||
|
|
||||||
generate_psa_constants(['tf-psa-crypto/include/psa/crypto_values.h',
|
generate_psa_constants(['include/psa/crypto_values.h',
|
||||||
'tf-psa-crypto/include/psa/crypto_extra.h'],
|
'include/psa/crypto_extra.h'],
|
||||||
OUTPUT_FILE_DIR + '/psa_constant_names_generated.c')
|
OUTPUT_FILE_DIR + '/psa_constant_names_generated.c')
|
Loading…
x
Reference in New Issue
Block a user