From 3cb8d4252a3e437cc7fd6a89df27f6a16434f164 Mon Sep 17 00:00:00 2001 From: lwx Date: Mon, 25 Nov 2024 10:17:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lwx --- test/fuzztest/security_component/BUILD.gn | 2 - .../BUILD.gn | 43 -------------- .../corpus/init | 14 ----- .../getenhanceremoteobjectstub_fuzzer.cpp | 55 ----------------- .../getenhanceremoteobjectstub_fuzzer.h | 24 -------- .../project.xml | 25 -------- .../BUILD.gn | 43 -------------- .../corpus/init | 14 ----- .../preregisterseccompprocessstub_fuzz.cpp | 59 ------------------- .../preregisterseccompprocessstub_fuzz.h | 24 -------- .../project.xml | 25 -------- 11 files changed, 328 deletions(-) delete mode 100644 test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/getenhanceremoteobjectstub_fuzzer.cpp delete mode 100644 test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/getenhanceremoteobjectstub_fuzzer.h delete mode 100644 test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/project.xml delete mode 100644 test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/BUILD.gn delete mode 100644 test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/corpus/init delete mode 100644 test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/preregisterseccompprocessstub_fuzz.cpp delete mode 100644 test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/preregisterseccompprocessstub_fuzz.h delete mode 100644 test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/project.xml diff --git a/test/fuzztest/security_component/BUILD.gn b/test/fuzztest/security_component/BUILD.gn index e1e61f4..965dfc0 100644 --- a/test/fuzztest/security_component/BUILD.gn +++ b/test/fuzztest/security_component/BUILD.gn @@ -24,8 +24,6 @@ group("fuzztest") { "innerkits/unregistersecuritycomponent_fuzzer:UnregisterSecurityComponentFuzzTest", "innerkits/updatesecuritycomponent_fuzzer:UpdateSecurityComponentFuzzTest", "innerkits/verifysavepermission_fuzzer:VerifySavePermissionFuzzTest", - "service/getenhanceremoteobjectstub_fuzzer:GetEnhanceRemoteObjectStubFuzzTest", - "service/preregisterseccompprocessstub_fuzzer:PreRegisterSecCompProcessStubFuzzTest", "service/registersecuritycomponentstub_fuzzer:RegisterSecurityComponentStubFuzzTest", "service/reportsecuritycomponentclickeventstub_fuzzer:ReportSecurityComponentClickEventStubFuzzTest", "service/unregistersecuritycomponentstub_fuzzer:UnregisterSecurityComponentStubFuzzTest", diff --git a/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/BUILD.gn b/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/BUILD.gn deleted file mode 100644 index d40a53f..0000000 --- a/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2023-2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/config/features.gni") -import("//build/test.gni") -import("../../../../../security_component.gni") -import("../security_component_fuzz.gni") - -module_output_path = "security_component_manager/security_component_manager" - -ohos_fuzztest("GetEnhanceRemoteObjectStubFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer" - - include_dirs = sc_include_dirs - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - cflags_cc += sc_cflags_cc - sources = [ "getenhanceremoteobjectstub_fuzzer.cpp" ] - - sources += sc_service_sources - sources += sc_mock_sources - deps = sc_deps - - external_deps = sc_external_deps -} diff --git a/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/corpus/init b/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/corpus/init deleted file mode 100644 index bc977bd..0000000 --- a/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/corpus/init +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/getenhanceremoteobjectstub_fuzzer.cpp b/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/getenhanceremoteobjectstub_fuzzer.cpp deleted file mode 100644 index 6645fbf..0000000 --- a/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/getenhanceremoteobjectstub_fuzzer.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "i_sec_comp_service.h" -#include "securec.h" -#include "sec_comp_enhance_adapter.h" -#include "sec_comp_service.h" -#include "token_setproc.h" -#include "getenhanceremoteobjectstub_fuzzer.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void GetEnhanceRemoteObjectStubFuzzTest(const uint8_t *data, size_t size) -{ - uint32_t code = SecurityComponentServiceInterfaceCode::GET_SECURITY_COMPONENT_ENHANCE_OBJECT; - MessageParcel rawData; - MessageParcel input; - MessageParcel reply; - - if (!input.WriteInterfaceToken(ISecCompService::GetDescriptor())) { - return; - } - SecCompEnhanceAdapter::EnhanceClientSerialize(rawData, input); - MessageOption option(MessageOption::TF_SYNC); - auto service = std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); - service->OnRemoteRequest(code, input, reply, option); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::GetEnhanceRemoteObjectStubFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/getenhanceremoteobjectstub_fuzzer.h b/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/getenhanceremoteobjectstub_fuzzer.h deleted file mode 100644 index ffd853a..0000000 --- a/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/getenhanceremoteobjectstub_fuzzer.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef GET_ENHANCE_REMOTE_OBJECT_STUB_FUZZER_H -#define GET_ENHANCE_REMOTE_OBJECT_STUB_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" - -#include "sec_comp_stub.h" -#include "sec_comp_service.h" - -#endif diff --git a/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/project.xml b/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/project.xml deleted file mode 100644 index 6e8ad2c..0000000 --- a/test/fuzztest/security_component/service/getenhanceremoteobjectstub_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - diff --git a/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/BUILD.gn b/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/BUILD.gn deleted file mode 100644 index edcdc4a..0000000 --- a/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2023-2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/config/features.gni") -import("//build/test.gni") -import("../../../../../security_component.gni") -import("../security_component_fuzz.gni") - -module_output_path = "security_component_manager/security_component_manager" - -ohos_fuzztest("PreRegisterSecCompProcessStubFuzzTest") { - module_out_path = module_output_path - fuzz_config_file = "${sec_comp_dir}/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer" - - include_dirs = sc_include_dirs - cflags = [ - "-g", - "-O0", - "-Wno-unused-variable", - "-fno-omit-frame-pointer", - ] - configs = [ "${sec_comp_dir}/config:coverage_flags" ] - - cflags_cc = [ "-DHILOG_ENABLE" ] - cflags_cc += sc_cflags_cc - sources = [ "preregisterseccompprocessstub_fuzz.cpp" ] - - sources += sc_service_sources - sources += sc_mock_sources - deps = sc_deps - - external_deps = sc_external_deps -} diff --git a/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/corpus/init b/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/corpus/init deleted file mode 100644 index e7c3fec..0000000 --- a/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/corpus/init +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FUZZ \ No newline at end of file diff --git a/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/preregisterseccompprocessstub_fuzz.cpp b/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/preregisterseccompprocessstub_fuzz.cpp deleted file mode 100644 index 36a7fd1..0000000 --- a/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/preregisterseccompprocessstub_fuzz.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "preregisterseccompprocessstub_fuzz.h" - -#include -#include -#include -#include -#include "accesstoken_kit.h" -#include "fuzz_common.h" -#include "i_sec_comp_service.h" -#include "sec_comp_enhance_adapter.h" -#include "sec_comp_info.h" -#include "sec_comp_service.h" -#include "securec.h" -#include "token_setproc.h" - -using namespace OHOS::Security::SecurityComponent; -using namespace OHOS::Security::AccessToken; -namespace OHOS { -static void PreRegisterSecCompProcessStubFuzzTest(const uint8_t *data, size_t size) -{ - uint32_t code = - SecurityComponentServiceInterfaceCode::PRE_REGISTER_PROCESS; - MessageParcel rawData; - MessageParcel input; - MessageParcel reply; - - if (!input.WriteInterfaceToken(ISecCompService::GetDescriptor())) { - return; - } - SecCompEnhanceAdapter::EnhanceClientSerialize(rawData, input); - MessageOption option(MessageOption::TF_SYNC); - auto service = - std::make_shared(SA_ID_SECURITY_COMPONENT_SERVICE, true); - service->OnRemoteRequest(code, input, reply, option); -} -} // namespace OHOS - -/* Fuzzer entry point */ -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) -{ - /* Run your code on data */ - OHOS::PreRegisterSecCompProcessStubFuzzTest(data, size); - return 0; -} diff --git a/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/preregisterseccompprocessstub_fuzz.h b/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/preregisterseccompprocessstub_fuzz.h deleted file mode 100644 index 4e79d3e..0000000 --- a/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/preregisterseccompprocessstub_fuzz.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PRE_REGISTER_SEC_COMP_PROCESS_STUB_FUZZER_H -#define PRE_REGISTER_SEC_COMP_PROCESS_STUB_FUZZER_H - -#define FUZZ_PROJECT_NAME "securitycomponent_fuzzer" - -#include "sec_comp_stub.h" -#include "sec_comp_service.h" - -#endif // PRE_REGISTER_SEC_COMP_PROCESS_STUB_FUZZER_H \ No newline at end of file diff --git a/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/project.xml b/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/project.xml deleted file mode 100644 index 7133b2b..0000000 --- a/test/fuzztest/security_component/service/preregisterseccompprocessstub_fuzzer/project.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 1000 - - 300 - - 4096 - - -- Gitee