From 7080460c6fe92b2e7b034021cab054cb967a5596 Mon Sep 17 00:00:00 2001 From: zhuofan0129 <861080528@qq.com> Date: Thu, 17 Jul 2025 15:07:51 +0800 Subject: [PATCH 1/2] feat: clean codecheck --- baselib/msglib/src/utils/messenger_utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/baselib/msglib/src/utils/messenger_utils.c b/baselib/msglib/src/utils/messenger_utils.c index b15d9b5..8be4b96 100644 --- a/baselib/msglib/src/utils/messenger_utils.c +++ b/baselib/msglib/src/utils/messenger_utils.c @@ -21,10 +21,12 @@ #include "utils_log.h" #include "utils_mem.h" +#define MSG_BUFF_MAX_LENGTH (81920 * 4) + QueueMsgData *CreateQueueMsgData(const DeviceIdentify *devId, const uint8_t *msg, uint32_t msgLen, uint32_t *queueDataLen) { - if (devId == NULL || msg == NULL || msgLen == 0 || queueDataLen == NULL) { + if (devId == NULL || msg == NULL || msgLen == 0 || queueDataLen == NULL || msgLen > MSG_BUFF_MAX_LENGTH) { return NULL; } -- Gitee From 4b9abd3991ada0ec2ed31265b606e0badab69165 Mon Sep 17 00:00:00 2001 From: zhuofan0129 <861080528@qq.com> Date: Fri, 8 Aug 2025 16:32:06 +0800 Subject: [PATCH 2/2] feat: sync Signed-off-by: zhuofan0129 <861080528@qq.com> --- bundle.json | 2 -- interfaces/inner_api/BUILD.gn | 1 - .../src/standard/device_security_info.cpp | 10 +++---- param/BUILD.gn | 28 ------------------- param/device_security_level.para | 14 ---------- 5 files changed, 5 insertions(+), 50 deletions(-) delete mode 100644 param/BUILD.gn delete mode 100644 param/device_security_level.para diff --git a/bundle.json b/bundle.json index a98111e..ffe2e54 100644 --- a/bundle.json +++ b/bundle.json @@ -43,7 +43,6 @@ "hisysevent", "hitrace", "huks", - "init", "ipc", "safwk", "samgr", @@ -60,7 +59,6 @@ "service_group": [ "//base/security/device_security_level/oem_property/ohos:dslm_service", "//base/security/device_security_level/oem_property/ohos:dslm_ohos_cred_file", - "//base/security/device_security_level/param:param_files", "//base/security/device_security_level/profile:dslm_service.rc" ] }, diff --git a/interfaces/inner_api/BUILD.gn b/interfaces/inner_api/BUILD.gn index e5b15a0..db7e859 100644 --- a/interfaces/inner_api/BUILD.gn +++ b/interfaces/inner_api/BUILD.gn @@ -129,7 +129,6 @@ if (defined(ohos_lite)) { external_deps = [ "c_utils:utils", "hilog:libhilog", - "init:libbegetutil", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_api/src/standard/device_security_info.cpp b/interfaces/inner_api/src/standard/device_security_info.cpp index a4b4dde..73fde2e 100644 --- a/interfaces/inner_api/src/standard/device_security_info.cpp +++ b/interfaces/inner_api/src/standard/device_security_info.cpp @@ -18,7 +18,6 @@ #include #include "hilog/log.h" -#include "parameter.h" #include "device_security_level_callback_helper.h" #include "device_security_level_callback_stub.h" @@ -37,13 +36,14 @@ static int32_t RequestDeviceSecurityInfoAsyncImpl(const DeviceIdentify *identify return ERR_INVALID_PARA; } - constexpr uint32_t defaultKeepLen = 45; - constexpr uint32_t maxKeepLen = 300; - static RequestOption defaultOption = {0, defaultKeepLen, 0}; + constexpr uint32_t DEFAULT_KEEP_LEN = 45; + constexpr uint32_t MAX_KEEP_LEN = 300; + static RequestOption defaultOption = {0, DEFAULT_KEEP_LEN, 0}; if (option == nullptr) { option = &defaultOption; + } - if (option->timeout > maxKeepLen) { + if (option->timeout > MAX_KEEP_LEN) { HILOG_ERROR(LOG_CORE, "GetDeviceSecurityInfo input error, timeout too len."); return ERR_INVALID_PARA; } diff --git a/param/BUILD.gn b/param/BUILD.gn deleted file mode 100644 index 2619f76..0000000 --- a/param/BUILD.gn +++ /dev/null @@ -1,28 +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. - -import("//build/ohos.gni") - -## Install device_security_level.para to /system/etc/param/device_security_level.para - -group("param_files") { - deps = [ ":device_security_level.para" ] -} - -ohos_prebuilt_etc("device_security_level.para") { - source = "device_security_level.para" - - relative_install_dir = "param" - part_name = "device_security_level" - subsystem_name = "security" -} diff --git a/param/device_security_level.para b/param/device_security_level.para deleted file mode 100644 index c04f0d7..0000000 --- a/param/device_security_level.para +++ /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. - -const.security.device_security_level = 1 \ No newline at end of file -- Gitee