In particular, if interruptible ECDSA is supported but not the deterministic
variant, detect this in psa_sign_hash_start(), whereas before start() would
succeed and psa_sign_hash_complete() would fail. This avoids an
inconsistency between psa_sign_hash() and psa_sign_hash_start() that would
be annoying to handle in test_suite_psa_crypto_op_fail.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
ECDSA has two variants: deterministic (PSA_ALG_DETERMINISTIC_ECDSA) and
randomized (PSA_ALG_ECDSA). The two variants are different for signature but
identical for verification. Mbed TLS accepts either variant as the algorithm
parameter for verification even when only the other variant is supported,
so we need to handle this as a special case when generating not-supported
test cases.
In this commit:
* Add manually written not-supported test cases for the signature
operation when exactly one variant is supported.
* Add manually written positive test cases for the verification
operation when exactly one variant is supported.
* Register that !ECDSA but DETERMINISTIC_ECDSA is not tested yet
(https://github.com/Mbed-TLS/mbedtls/issues/9592).
A commit in the framework will take care of automatically generated test cases.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Following "PSA sign/verify: more uniform error on an unsupported hash", some
error cases are detected earlier, so there is some sloppiness in test case
dependencies that is not longer acceptable.
* In test_suite_psa_crypto, one test case for a hash+sign algorithm now
returns NOT_SUPPORTED rather than INVALID_ARGUMENT when the hash is not
supported and the key is invalid.
* In test_suite_psa_crypto_se_driver_hal_mocks, some test cases now error
out before reaching the mocks rather than after when they attempt to
use an unsupported hash.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Allow imports of an ECC public key on an unsupported curve to return
INVALID_ARGUMENT rather than NOT_SUPPORTED. This can happen in our library
code in edge cases when only certain curve families are supported, and it's
acceptable.
The new code does not trigger yet, but it will be useful for a future commit
"Do run not-supported test cases on not-implemented mechanisms"
(forward port of 995d7d4c15).
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Switch to TF_PSA_CRYPTO_FRAMEWORK_DIR for the
variable holding the path to the framework
submodule. In case of the standalone
TF-PSA-Crypto repo, the path to the
framework submodule has nothing to do
with Mbed TLS.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
config_test_driver.h and
crypto_config_test_driver_extension.h are
configuration files thus they better fit in
mbedtls branches than in the framework.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Rename mbedcrypto target to tfpsacrypto and
prefix all cmake related variables with
tfpsacrypto instead of mbedcrypto.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
The empty framework directory is temporary. It will be
removed when TF-PSA-Crypto uses its framework submodule.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
To avoid conflict between the two targets when
the integration of the TF-PSA-Crypto cmake build
system into the Mbed TLS one is completed.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
It's a crypto test suite, but it was added in the main tree in a careless
forward port from 3.6.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Remove generate key brainpool160r1 & SECP224K1 test cases
as they are scheduled to be removed in 4.0 .
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>