diff --git a/README.en.md b/README.en.md index 0b2897b04f551238de33af51f09bc16b269c6e46..7cac46087a82ff6d3ec7ac8e176cf589ebfb1dc3 100644 --- a/README.en.md +++ b/README.en.md @@ -1,7 +1,7 @@ # security_device_security_level #### Description -Device security level management module to ensure the security of data flow in each node. +{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} #### Software Architecture Software architecture description diff --git a/README.md b/README.md index 98fecdf895dea6348454738f9fe79b9407c1711f..1e5ba4480da1f2d9e57e6f04d91ea9a1398fd608 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # security_device_security_level #### 介绍 -Device security level management module to ensure the security of data flow in each node. +{**以下是 Gitee 平台说明,您可以替换此简介** +Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 +无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} #### 软件架构 软件架构说明 diff --git a/dslm_sdk.BUILD.gn b/dslm_sdk.BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..00452cc58557af7ae3c2754bddf570409eeca4e7 --- /dev/null +++ b/dslm_sdk.BUILD.gn @@ -0,0 +1,23 @@ +# 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. + +import("//build/ohos.gni") + +config("device_security_level_sdk_config") { + include_dirs = [ "/usr/include/device_security_level" ] + libs=["dslm_sdk.z"] +} + +group("dslm_sdk") { + public_configs = [ ":device_security_level_sdk_config" ] +} \ No newline at end of file diff --git a/dslm_sdk.bundle.json b/dslm_sdk.bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..768786087d7adcb3944f49fad86222a192a5b293 --- /dev/null +++ b/dslm_sdk.bundle.json @@ -0,0 +1,69 @@ +{ + "name": "@ohos/device_security_level", + "description": "openharmony's device security level management", + "version": "3.0.0", + "license": "Apache License 2.0", + "publishAs": "code-segment", + "segment": { + "destPath": "base/security/device_security_level" + }, + "dirs": {}, + "scripts": {}, + "author": {}, + "repository": "", + "component": { + "name": "device_security_level", + "subsystem": "security", + "syscap": [ + "SystemCapability.Security.DeviceSecurityLevel" + ], + "features": [ + "device_security_level_feature_coverage = false" + ], + "hisysevent_config": [ + "//base/security/device_security_level/hisysevent.yaml" + ], + "adapted_system_type": [ + "standard" + ], + "rom": "200KB", + "ram": "2500KB", + "deps": { + "components": [ + "huks", + "dsoftbus", + "safwk", + "utils_base", + "ipc", + "samgr", + "hisysevent_native", + "device_auth", + "hilog_native" + ], + "third_party": [ + "cjson" + ] + }, + "build": { + "group_type": { + "base_group": [] + }, + "inner_kits": [ + { + "name": "//base/security/device_security_level/interfaces/inner_api:dslm_sdk", + "header": { + "header_files": [ + "device_security_info.h", + "device_security_defines.h" + ], + "header_base": "//base/security/device_security_level/interfaces/inner_api/include" + } + } + ], + "test": [ + "//base/security/device_security_level/test/dslm_unit_test:dslm_test", + "//base/security/device_security_level/test/dslm_fuzz_test:dslm_fuzz" + ] + } + } +} \ No newline at end of file diff --git a/security_device_security_level.spec b/security_device_security_level.spec new file mode 100644 index 0000000000000000000000000000000000000000..9c814fd4741b8f9117314370d1cf20db2dd0785f --- /dev/null +++ b/security_device_security_level.spec @@ -0,0 +1,107 @@ +%define debug_package %{nil} +%global build_opt /opt/distributed-middleware-build +%global oh_version OpenHarmony-v3.2-Release +%global security_path %{_builddir}/base/security +%global third_party_path %{_builddir}/third_party + +Name: security_device_security_level +Version: 1.0.0 +Release: 1%{?dist} +Summary: Device Safety Level Management Service +License: Apache-2.0 +URL: https://gitee.com/openharmony/security_device_security_level +Source1: security_device_security_level.tar.gz +Source2: dslm_sdk.bundle.json +Source3: dslm_sdk.BUILD.gn + +BuildRequires: gcc, make, hilog +BuildRequires: distributed-build, distributed-beget +BuildRequires: commonlibrary_c_utils +BuildRequires: distributedhardware_device_manager +BuildRequires: notification_eventhandler +BuildRequires: communication_ipc +BuildRequires: security_device_auth, security_huks +BuildRequires: systemabilitymgr_safwk, systemabilitymgr_samgr +BuildRequires: cjson-devel, compat-openssl11-devel + +Requires: hilog +Requires: distributed-beget +Requires: commonlibrary_c_utils +Requires: distributedhardware_device_manager +Requires: notification_eventhandler +Requires: communication_ipc +Requires: security_device_auth, security_huks +Requires: systemabilitymgr_safwk, systemabilitymgr_samgr +Requires: cjson-devel, compat-openssl11-devel + +%description +The OpenHarmony distributed technology can converge resources from different devices to form a Super Device. Poor security capabilities of any device may threaten the security of the Super Device. The Device Security Level Management (DSLM) module is introduced to manage the security levels of OpenHarmony devices. + +# Decompress source code package, make patches to the source code. +%prep + +rm -rf %{_builddir}/* + +cp -rf %{build_opt} %{_builddir}/build +[ ! -L "%{_builddir}/build.sh" ] && ln -s %{_builddir}/build/build_scripts/build.sh %{_builddir}/build.sh +[ ! -L "%{_builddir}/.gn" ] && ln -s %{_builddir}/build/core/gn/dotfile.gn %{_builddir}/.gn +[ ! -L "%{_builddir}/build.py" ] && ln -s %{_builddir}/build/lite/build.py %{_builddir}/build.py +cp -rf %{_builddir}/build/openeuler/vendor %{_builddir}/ +cp -rf %{_builddir}/build/openeuler/compiler_gn/* %{_builddir} + +%setup -q -D -T -a 1 -c -n %{security_path} + + + +# make. +%build + +%ifarch x86_64 +%{_builddir}/build.sh --product-name openeuler --target-cpu x86_64 +%endif + +%ifarch aarch64 +%{_builddir}/build.sh --product-name openeuler --target-cpu arm64 +%endif + +%install +install -d -m 0755 %{buildroot}/%{_includedir}/device_security_level +install -d -m 0755 %{buildroot}/%{_libdir} +install -d -m 0755 %{buildroot}/system/lib64 +install -d -m 0755 %{buildroot}%{build_opt}/openeuler/compiler_gn/base/security/device_security_level/interfaces/inner_api +install -d -m 0755 %{buildroot}%{build_opt}/openeuler/compiler_gn/base/security/device_security_level/oem_property/ohos/ + +%ifarch aarch64 +%define header_out_path out/openeuler/innerkits/linux-arm64/device_security_level +%define module_out_path out/openeuler/linux_clang_arm64/security/device_security_level +%endif +%ifarch x86_64 +%define header_out_path out/openeuler/innerkits/linux-x86_64/device_security_level +%define module_out_path out/openeuler/linux_clang_x86_64/security/device_security_level +%endif + +#cp .h file to /usr/include +find %{_builddir}/%{header_out_path} -name *.h -print0 | xargs -0 -i cp -rf {} %{buildroot}%{_includedir}/device_security_level/ + +#cp .so file to /system/lib and /user/lib +install -m 0755 %{_builddir}/%{module_out_path}/*.so %{buildroot}%{_libdir} +install -m 0755 %{_builddir}/%{module_out_path}/*.so %{buildroot}/system/lib64 + +#cp bundle.json +install -m 0755 %{SOURCE2} %{buildroot}%{build_opt}/openeuler/compiler_gn/base/security/device_security_level/bundle.json + +#cp BUILD.gn +install -m 0755 %{SOURCE3} %{buildroot}%{build_opt}/openeuler/compiler_gn/base/security/device_security_level/interfaces/inner_api/BUILD.gn + +#cp yaml +install -m 0755 %{security_path}/device_security_level/hisysevent.yaml %{buildroot}%{build_opt}/openeuler/compiler_gn/base/security/device_security_level/ + +# copy ko file to the certain path on deployment environment. +%files +%{_libdir}/*.so +/system/* +%{_includedir}/device_security_level/* +%{build_opt}/* +%changelog +* Mon Nov 6 2023 Jiaqi Zhao - 1.0.0-1 +- Separating the device_security_level component from the master package diff --git a/security_device_security_level.tar.gz b/security_device_security_level.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..36e7312c55c16b4087822cfcf96619e362ae4062 Binary files /dev/null and b/security_device_security_level.tar.gz differ