Skip to content

Commit

Permalink
xtest: pkcs11_1021: skip CKM_RSA_PKCS test is not supported
Browse files Browse the repository at this point in the history
Skip CKM_RSA_PKCS test in pkcs11_1021 if the mechanism is not supported.
This is likely to happen when OP-TEE core is built with
CFG_CRYPTO_RSASSA_NA1 disabled as when built with MbedTLS as core crypto
library.

Signed-off-by: Etienne Carriere <[email protected]>
Reviewed-by: Jerome Forissier <[email protected]>
  • Loading branch information
etienne-lms committed Nov 26, 2024
1 parent 55adb62 commit 166550e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions host/xtest/pkcs11_1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -6758,6 +6758,10 @@ static int test_rsa_pkcs_operations(ADBG_Case_t *c,
signature_len = sizeof(signature);

rv = C_SignInit(session, &sign_mechanism, private_key);
if (rv == CKR_MECHANISM_INVALID) {
Do_ADBG_Log("CKM_RSA_PKCS is not supported (CFG_CRYPTO_RSASSA_NA1 maybe disabled), skip test");
goto non_prehashed_rsa_tests;
}
if (!ADBG_EXPECT_CK_OK(c, rv))
goto err_destr_obj;

Expand All @@ -6777,6 +6781,8 @@ static int test_rsa_pkcs_operations(ADBG_Case_t *c,
if (!ADBG_EXPECT_CK_OK(c, rv))
goto err_destr_obj;

non_prehashed_rsa_tests:

for (i = 0; i < ARRAY_SIZE(rsa_pkcs_sign_tests); i++) {
/*
* Note: this order of end/begin here is just to get ADBG
Expand Down

0 comments on commit 166550e

Please sign in to comment.