Enable DSA 1024 tests 10/315510/4
authorDaniel Kita <d.kita@samsung.com>
Thu, 28 Nov 2024 07:59:29 +0000 (08:59 +0100)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 10 Jan 2025 15:44:39 +0000 (16:44 +0100)
Change-Id: I64bb4ac51002aa1b0286018839a8adebac0ea5dd

src/ckm/unprivileged/capi-testcases.cpp
src/ckm/unprivileged/sign-verify.cpp

index 5a21c62c7538d282921b7c818b2eb917cac9ee99..c688471133c9d5cd3d3b13af1a2ac1ac4ecb33c6 100644 (file)
@@ -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()),
index cdc966de7e406c5e2aeeba705de4442f449b2033..f5441af96f39ff702f000f141f3b56c9d25f8011 100644 (file)
@@ -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