diff --git a/security_lite/datahuks_hal/BUILD.gn b/security_lite/datahuks_hal/BUILD.gn index d16cc683f898edeac29efa310e921700a17a8551..8f779440c84e0f788407c504e14e74fa9f9b9b17 100755 --- a/security_lite/datahuks_hal/BUILD.gn +++ b/security_lite/datahuks_hal/BUILD.gn @@ -12,6 +12,7 @@ # limitations under the License. import("//test/xts/tools/lite/build/suite_lite.gni") +import("//base/security/huks/build/config.gni") hctest_suite("ActsSecurityDataTest") { suite_name = "acts" @@ -22,7 +23,9 @@ hctest_suite("ActsSecurityDataTest") { "src/security_data_huks_gen_del_test.c", "src/security_data_huks_sign_verify_test.c", ] - + if (disable_authenticate == true) { + defines = [ "_CUT_AUTHENTICATE_" ] + } include_dirs = [ "src", "//base/security/huks/interfaces/innerkits/huks_lite/", diff --git a/security_lite/datahuks_hal/src/security_data_huks_export_hash_random_test.c b/security_lite/datahuks_hal/src/security_data_huks_export_hash_random_test.c index 82594b112bec9591d1619b016709fba874047c40..daf7db6787ec53a8e9432674f0cd0983f06b506d 100755 --- a/security_lite/datahuks_hal/src/security_data_huks_export_hash_random_test.c +++ b/security_lite/datahuks_hal/src/security_data_huks_export_hash_random_test.c @@ -53,7 +53,7 @@ static BOOL SecurityDataHuksExportHashRandomHmacTestSuiteTearDown(void) printf("-++++++++++++++++++++++++++++++++++++++++++++-\n"); return TRUE; } - +#ifndef _CUT_AUTHENTICATE_ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Export Public key // begin++++++++++++++++++++++++++++++++++++++++++++++1000-1090 @@ -326,7 +326,9 @@ securityDataExportPublicKey1090, Function | MediumTest | Level2) TEST_ASSERT_EQUAL_INT(NUM1010, status); HksBlobDestroyT1(&publicKey1); } +#endif +#ifndef _CUT_AUTHENTICATE_ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Export Public key // end++++++++++++++++++++++++++++++++++++++++++++++++1000-1090 @@ -545,7 +547,7 @@ LITE_TEST_CASE(SecurityDataHuksExportHashRandomHmacTestSuite, securityDataHash11 HksBlobDestroyT1(&hash); TEST_ASSERT_EQUAL_INT(NUM1007, status); } - +#endif // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Hash // end+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++1100-1190 diff --git a/security_lite/datahuks_hal/src/security_data_huks_gen_del_test.c b/security_lite/datahuks_hal/src/security_data_huks_gen_del_test.c index bd0e029af4b338e1dd05c314913d532920518841..e5563540cbe216490aa7ef680f206596e6adbf3d 100755 --- a/security_lite/datahuks_hal/src/security_data_huks_gen_del_test.c +++ b/security_lite/datahuks_hal/src/security_data_huks_gen_del_test.c @@ -54,6 +54,7 @@ void HksBlobDestroyT1(struct hks_blob *blob) } int TestSecShuksGenerateKeyNormal(void) { +#ifndef _CUT_AUTHENTICATE_ char testFileName[] = "keyalias1"; char testFileName1[] = "key_auth_id1"; struct hks_blob keyAlias; @@ -72,10 +73,12 @@ int TestSecShuksGenerateKeyNormal(void) keyParam.key_pad = 0; int32_t status = hks_generate_key(&keyAlias, &keyParam); TEST_ASSERT_EQUAL_INT(0, status); +#endif return 0; } int TestSecShuksDeleteKeyNormal(void) { +#ifndef _CUT_AUTHENTICATE_ char testFileName[] = "keyalias1"; struct hks_blob keyAlias = { 0 }; @@ -85,12 +88,15 @@ int TestSecShuksDeleteKeyNormal(void) int32_t status = hks_delete_key(&keyAlias); TEST_ASSERT_EQUAL_INT(0, status); +#endif return 0; } int TestSecShuksExportPublicNormal(struct hks_blob *keyAlias, struct hks_blob *publicKey1) { +#ifndef _CUT_AUTHENTICATE_ int32_t status = hks_export_public_key(keyAlias, publicKey1); TEST_ASSERT_EQUAL_INT(0, status); +#endif return 0; } void BuildBlobData(struct hks_blob *param, const char *str, uint8_t type, uint32_t size, uint8_t isDataNull) @@ -171,6 +177,7 @@ void TestInitKeyParam1(struct hks_key_param *keyParam, uint32_t keyType, uint32_ int TestSecShuksImportPublicNormal(void) { +#ifndef _CUT_AUTHENTICATE_ char testFileName[] = "keyalias1"; struct hks_key_param keyParam1 = { 0 }; @@ -196,6 +203,7 @@ int TestSecShuksImportPublicNormal(void) TEST_ASSERT_EQUAL_INT(0, status); HksBlobDestroyT1(&publicKey1); +#endif return 0; } @@ -240,6 +248,7 @@ static BOOL SecurityDataHuksGenDelTestSuiteTearDown(void) * @tc.name : Generate key, normal input parameters keyAlias and keyParam * @tc.desc : [C- SECURITY -1400] */ +#ifndef _CUT_AUTHENTICATE_ LITE_TEST_CASE(SecurityDataHuksGenDelTestSuite, securityDataGenerateKey0000, Function | MediumTest | Level1) { char testFileName[] = "keyalias1"; @@ -831,5 +840,5 @@ LITE_TEST_CASE(SecurityDataHuksGenDelTestSuite, securityDataDeleteKey0190, Funct } // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Delete key // end+++++++++++++++++++++++++++++++++++++++++++++++++++++++0130-0190 - +#endif RUN_TEST_SUITE(SecurityDataHuksGenDelTestSuite); diff --git a/security_lite/datahuks_hal/src/security_data_huks_sign_verify_test.c b/security_lite/datahuks_hal/src/security_data_huks_sign_verify_test.c index f209bd309299313f109870162ef2484c2a00f014..aedc6983fe99eae8362a7fedce20e30005ba82f3 100755 --- a/security_lite/datahuks_hal/src/security_data_huks_sign_verify_test.c +++ b/security_lite/datahuks_hal/src/security_data_huks_sign_verify_test.c @@ -53,7 +53,7 @@ static BOOL SecurityDataHuksSignVerifyTestSuiteTearDown(void) printf("-++++++++++++++++++++++++++++++++++++++++++++-\n"); return TRUE; } - +#ifndef _CUT_AUTHENTICATE_ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Sign key // begin+++++++++++++++++++++++++++++++++++++++++++++++++++++++0200-0340 @@ -1267,7 +1267,7 @@ LITE_TEST_CASE(SecurityDataHuksSignVerifyTestSuite, securityDataAsymmetricVerify status = hks_asymmetric_verify(&keyAlias, &keyParam, &hash, &signature); TEST_ASSERT_EQUAL_INT(NUM135, status); } - +#endif // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Verify key // end+++++++++++++++++++++++++++++++++++++++++++++++++++++++0350-0510