-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport 3.6: Switch generate_psa_test.py to automatic dependencies for positive test cases #9796
base: mbedtls-3.6
Are you sure you want to change the base?
Commits on Nov 19, 2024
-
PSA sign/verify: more uniform error on an unsupported hash
Uniformly return PSA_ERROR_NOT_SUPPORTED if given an algorithm that includes a hash, but that hash algorithm is not supported. This will make it easier to have a uniform treatment of unsupported hashes in automatically generated tests. Signed-off-by: Gilles Peskine <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 808b541 - Browse repository at this point
Copy the full SHA 808b541View commit details -
import_not_supported: edge case of unsupported curves
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 995d7d4). Signed-off-by: Gilles Peskine <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 67cd8db - Browse repository at this point
Copy the full SHA 67cd8dbView commit details -
Add some missing test case dependencies
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 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 85bc82c - Browse repository at this point
Copy the full SHA 85bc82cView commit details
Commits on Nov 21, 2024
-
Fix edge case with half-supported ECDSA (manual test cases)
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 (Mbed-TLS#9592). A commit in the framework will take care of automatically generated test cases. Signed-off-by: Gilles Peskine <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8729b10 - Browse repository at this point
Copy the full SHA 8729b10View commit details -
Add missing resource cleanup on test failure
Signed-off-by: Gilles Peskine <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6bf0b2e - Browse repository at this point
Copy the full SHA 6bf0b2eView commit details -
PSA interruptible sign/verify: detect unsupported mechanism in start
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 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8a8aa59 - Browse repository at this point
Copy the full SHA 8a8aa59View commit details -
p256-m: allow deterministic ECDSA verification
For ECDSA verification, there is no difference between the deterministic and randomized algorithm. The PSA core consider the two variants as identical as far as key policies are concerned, and the built-in implementation accepts either variant even if only the other variant is supported for signature. In p256-m, accept to perform an ECDSA verification when the algorithm is specified as deterministic ECDSA. This makes the behavior identical to the built-in implementation, which is less surprising for users and saves us from having to cope with a difference in our testing. Signed-off-by: Gilles Peskine <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ad04f96 - Browse repository at this point
Copy the full SHA ad04f96View commit details
Commits on Nov 22, 2024
-
Fix
make dir/file
not rebuilding existing filesRunning `make library/foo`, `make programs/foo` or `make tests/foo` only rebuilt the given target if it was not an existing file, because the toplevel makefile does not know the file's dependencies and thus thought that every such target had empty dependencies. Fix this by always invoking make recursively. Signed-off-by: Gilles Peskine <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f5e74ce - Browse repository at this point
Copy the full SHA f5e74ceView commit details -
Create a new Python module used by generate_psa_tests.py
Signed-off-by: Gilles Peskine <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 725acf6 - Browse repository at this point
Copy the full SHA 725acf6View commit details -
Signed-off-by: Gilles Peskine <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6e6cebd - Browse repository at this point
Copy the full SHA 6e6cebdView commit details