mbedtls/tests/scripts
Jaeden Amero c17f29309f psa: Support RSA signature without MBEDTLS_GENPRIME
On space-constrained platforms, it is a useful configuration to be able
to import/export and perform RSA key pair operations, but to exclude RSA
key generation, potentially saving flash space. It is not possible to
express this with the PSA_WANT_ configuration system at the present
time. However, in previous versions of Mbed TLS (v2.24.0 and earlier) it
was possible to configure a software PSA implementation which was
capable of making RSA signatures but not capable of generating RSA keys.
To do this, one unset MBEDTLS_GENPRIME.

Since the addition of MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR, this
expressivity was lost. Expressing that you wanted to work with RSA key
pairs forced you to include the ability to generate key pairs as well.

Change psa_crypto_rsa.c to only call mbedtls_rsa_gen_key() if
MBEDTLS_GENPRIME is also set. This restores the configuration behavior
present in Mbed TLS v2.24.0 and earlier versions.

It left as a future exercise to add the ability to PSA to be able to
express a desire for a software or accelerator configuration that
includes RSA key pair operations, like signature, but excludes key pair
generation.

Without this change, linker errors will occur when attempts to call,
which doesn't exist when MBEDTLS_GENPRIME is unset.
    psa_crypto_rsa.c.obj: in function `rsa_generate_key':
    psa_crypto_rsa.c:320: undefined reference to `mbedtls_rsa_gen_key'

Fixes #4512

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2021-05-21 10:21:27 +01:00
..
all-in-docker.sh Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
all.sh psa: Support RSA signature without MBEDTLS_GENPRIME 2021-05-21 10:21:27 +01:00
analyze_outcomes.py Document the fields of TestCasesOutcomes 2020-06-26 18:31:26 +02:00
basic-build-test.sh Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
basic-in-docker.sh Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
check-doxy-blocks.pl Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
check-generated-files.sh generate_psa_tests.py: allow generating each file independently 2021-03-10 23:22:35 +01:00
check-names.sh Make check-names.sh accept any grep 2021-04-07 15:01:28 +01:00
check-python-files.sh mypy: require at least version 0.780 2021-01-20 12:03:24 +01:00
check_files.py check_files.py: pass mypy 2020-12-10 21:30:01 +01:00
check_test_cases.py Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
curves.pl Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
depends-hashes.pl Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
depends-pkalgs.pl Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
docker_env.sh Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
doxygen.sh Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
gen_ctr_drbg.pl Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
gen_gcm_decrypt.pl Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
gen_gcm_encrypt.pl Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
gen_pkcs1_v21_sign_verify.pl Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
generate-afl-tests.sh Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
generate_psa_tests.py Cover encodings of algorithms without parameters 2021-03-16 22:29:12 +01:00
generate_test_code.py Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
key-exchanges.pl Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
list-enum-consts.pl Scan library for enums in list-enum-consts.sh 2021-04-07 14:48:14 +01:00
list-identifiers.sh Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
list-macros.sh tests: psa: Add mbedtls/MBEDTLS prefix to test driver symbols 2021-05-05 09:02:13 +02:00
list-symbols.sh Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
mbedtls_test.py mbedtls_test.py: Tell mypy to ignore mbed_host_tests 2020-12-10 21:30:14 +01:00
psa_collect_statuses.py Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
recursion.pl Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
run-test-suites.pl Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
scripts_path.py Allow tests/scripts/foo.py to import from scripts 2020-12-10 23:16:03 +01:00
set_psa_test_dependencies.py Update PSA crypto test dependencies 2021-03-24 09:26:44 +01:00
tcp_client.pl Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
test-ref-configs.pl Remove config-psa-crypto.h 2021-05-05 17:59:15 +02:00
test_config_script.py Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
test_generate_test_code.py test_generate_test_code: remove Python 2 compatibility code 2020-12-10 21:30:08 +01:00
test_psa_constant_names.py Move PSAMacroEnumerator to macro_collector 2021-03-10 23:22:35 +01:00
test_zeroize.gdb Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00
travis-log-failure.sh Update copyright notices to use Linux Foundation guidance 2020-08-19 10:35:41 +02:00