From: Daniel Kita Date: Thu, 28 Nov 2024 07:59:29 +0000 (+0100) Subject: Enable DSA 1024 tests X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8558f0eacbf807de230bae2a45df1d58a33c59a;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git Enable DSA 1024 tests Change-Id: I64bb4ac51002aa1b0286018839a8adebac0ea5dd --- diff --git a/src/ckm/unprivileged/capi-testcases.cpp b/src/ckm/unprivileged/capi-testcases.cpp index 5a21c62c..c6884711 100644 --- a/src/ckm/unprivileged/capi-testcases.cpp +++ b/src/ckm/unprivileged/capi-testcases.cpp @@ -920,11 +920,10 @@ RUNNER_TEST(T3048_get_public_rsa_key_from_TZ) get_public_key_from_tz(ckmc_create_key_pair_rsa, 1024); } -// Not supported yet from key-manager-ta. -// RUNNER_TEST(T3049_get_public_dsa_key_from_TZ) -// { -// get_public_key_from_tz(ckmc_create_key_pair_dsa, 1024); -// } +RUNNER_TEST(T3049_get_public_dsa_key_from_TZ) +{ + get_public_key_from_tz(ckmc_create_key_pair_dsa, 1024); +} RUNNER_TEST(T3050_deinit_C_API) { @@ -1225,9 +1224,11 @@ RUNNER_TEST(T3063_CAPI_CreateKeyPairDSA) Info(public_key_alias_2, policy_public_key_2), Info(private_key_alias_3, - policy_private_key_3), + policy_private_key_3, + backend()), Info(public_key_alias_3, - policy_public_key_3), + policy_public_key_3, + backend()), Info(private_key_alias_4, policy_private_key_4, backend()), diff --git a/src/ckm/unprivileged/sign-verify.cpp b/src/ckm/unprivileged/sign-verify.cpp index cdc966de..f5441af9 100644 --- a/src/ckm/unprivileged/sign-verify.cpp +++ b/src/ckm/unprivileged/sign-verify.cpp @@ -161,7 +161,7 @@ public: for (int i = 0; i < KEY_IDX_MAX; i++) { Policy prvPolicy(Password(), false, m_backend); - Policy pubPolicy(Password(), type != DSA, m_backend); + Policy pubPolicy(Password(), true, m_backend); if (i == PASSWORD_PROTECTED) { prvPolicy.password.assign(PASSWORD); pubPolicy.password.assign(PASSWORD); @@ -676,28 +676,30 @@ RUNNER_TEST(TSV_0412_verify_with_exported_pubkey_ecdsa_SECP384R1) testSignVerifyWithExportedPubkey(ECDSA, EC_SECP384R1, PRIMARY); } -// Not supported yet from key-manager-ta. -// RUNNER_TEST(TSV_0420_verify_with_exported_pubkey_dsa_1024) -// { -// testSignVerifyWithExportedPubkey(DSA, 1024, PRIMARY); -// } - -// RUNNER_TEST(TSV_0421_verify_with_exported_pubkey_dsa_2048) -// { -// testSignVerifyWithExportedPubkey(DSA, 2048, PRIMARY); -// } - -// RUNNER_TEST(TSV_0422_verify_with_exported_pubkey_dsa_3072) -// { -// testSignVerifyWithExportedPubkey(DSA, 3072, PRIMARY); -// } - -// #ifndef TZ_LEGACY_BACKEND // no support for DSA 4k keys in old TEE implementations -// RUNNER_TEST(TSV_0423_verify_with_exported_pubkey_dsa_4096) -// { -// testSignVerifyWithExportedPubkey(DSA, 4096, PRIMARY); -// } -// #endif +RUNNER_TEST(TSV_0420_verify_with_exported_pubkey_dsa_1024) +{ + testSignVerifyWithExportedPubkey(DSA, 1024, PRIMARY); +} + +// Not supported from tef-simulator & key-manager-ta +#ifndef TZ_BACKEND +RUNNER_TEST(TSV_0421_verify_with_exported_pubkey_dsa_2048) +{ + testSignVerifyWithExportedPubkey(DSA, 2048, PRIMARY); +} + +RUNNER_TEST(TSV_0422_verify_with_exported_pubkey_dsa_3072) +{ + testSignVerifyWithExportedPubkey(DSA, 3072, PRIMARY); +} + +#ifndef TZ_LEGACY_BACKEND // no support for DSA 4k keys in old TEE implementations +RUNNER_TEST(TSV_0423_verify_with_exported_pubkey_dsa_4096) +{ + testSignVerifyWithExportedPubkey(DSA, 4096, PRIMARY); +} +#endif +#endif // TODO: border cases for padding // TODO: invalid arguments