From 68bee86af48f3d859f56f6d3c756bc4bf8513d59 Mon Sep 17 00:00:00 2001 From: wangxu43 Date: Tue, 14 Jun 2022 11:51:01 +0800 Subject: [PATCH 1/2] test: change fuzz test name for standard issue Signed-off-by: wangxu43 --- bundle.json | 2 +- test/dslm_fuzzer/BUILD.gn | 4 ++-- test/dslm_fuzzer/{dlsm_fuzzer.cpp => dslm_fuzzer.cpp} | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename test/dslm_fuzzer/{dlsm_fuzzer.cpp => dslm_fuzzer.cpp} (96%) diff --git a/bundle.json b/bundle.json index 9bd5fd4..8a75381 100644 --- a/bundle.json +++ b/bundle.json @@ -66,7 +66,7 @@ ], "test": [ "//base/security/device_security_level/test:dslm_test", - "//base/security/device_security_level/test/dslm_fuzzer:dslm_fuzz_test" + "//base/security/device_security_level/test/dslm_fuzzer:DslmFuzzTest" ] } } diff --git a/test/dslm_fuzzer/BUILD.gn b/test/dslm_fuzzer/BUILD.gn index 44e536f..c257bea 100644 --- a/test/dslm_fuzzer/BUILD.gn +++ b/test/dslm_fuzzer/BUILD.gn @@ -14,7 +14,7 @@ import("//build/ohos.gni") import("//build/test.gni") -ohos_fuzztest("dslm_fuzz_test") { +ohos_fuzztest("DslmFuzzTest") { module_out_path = "security/device_security_level" fuzz_config_file = "//base/security/device_security_level/test/dslm_fuzzer" @@ -32,7 +32,7 @@ ohos_fuzztest("dslm_fuzz_test") { "//base/security/device_security_level/services/sa/standard", ] - sources = [ "dlsm_fuzzer.cpp" ] + sources = [ "dslm_fuzzer.cpp" ] deps = [ "//base/security/device_security_level/oem_property/ohos:dslm_service" ] diff --git a/test/dslm_fuzzer/dlsm_fuzzer.cpp b/test/dslm_fuzzer/dslm_fuzzer.cpp similarity index 96% rename from test/dslm_fuzzer/dlsm_fuzzer.cpp rename to test/dslm_fuzzer/dslm_fuzzer.cpp index 66686cf..4e466d1 100644 --- a/test/dslm_fuzzer/dlsm_fuzzer.cpp +++ b/test/dslm_fuzzer/dslm_fuzzer.cpp @@ -81,7 +81,7 @@ void OnRemoteRequestFuzzer(Parcel &parcel) SECURITY_LOG_INFO("end"); } -void DlsmFuzzTest(const uint8_t *data, size_t size) +void DslmFuzzTest(const uint8_t *data, size_t size) { Parcel parcel; parcel.WriteBuffer(data, size); @@ -100,6 +100,6 @@ void DlsmFuzzTest(const uint8_t *data, size_t size) /* Fuzzer entry point */ extern "C" int32_t LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { - OHOS::Security::DeviceSecurityLevel::DlsmFuzzTest(data, size); + OHOS::Security::DeviceSecurityLevel::DslmFuzzTest(data, size); return 0; } -- Gitee From 32f9756e2bf9b40bb664a12a30eb6e95d80e6037 Mon Sep 17 00:00:00 2001 From: gao-haiyuan Date: Thu, 16 Jun 2022 19:11:17 +0800 Subject: [PATCH 2/2] fix: codeDex Change-Id: Ie0f192af0283162f71b6625b76ec77da4146686f Signed-off-by: gao-haiyuan --- oem_property/common/dslm_credential_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oem_property/common/dslm_credential_utils.c b/oem_property/common/dslm_credential_utils.c index 576cb3e..cd1310e 100644 --- a/oem_property/common/dslm_credential_utils.c +++ b/oem_property/common/dslm_credential_utils.c @@ -501,7 +501,7 @@ static void CredentialCbToDslmCredInfo(CredentialCb *credCb, DslmCredInfo *credI (void)GetDataFromJson(json, CRED_KEY_SECURITY_LEVEL, credInfo->securityLevel, CRED_INFO_LEVEL_LEN); if (verified) { - if (sscanf_s(credInfo->securityLevel, "SL%d", &credInfo->credLevel) <= 0) { + if (sscanf_s(credInfo->securityLevel, "SL%u", &credInfo->credLevel) <= 0) { SECURITY_LOG_ERROR("formatting securityLevel string failed"); } } -- Gitee