diff --git a/dsoftbus/build/0001-add-dsoftbus-build-support-for-embedded-env.patch b/dsoftbus/build/0001-add-dsoftbus-build-support-for-embedded-env.patch deleted file mode 100644 index 6eccb07bc149d53fe1d509301c00de44e829ddb9..0000000000000000000000000000000000000000 --- a/dsoftbus/build/0001-add-dsoftbus-build-support-for-embedded-env.patch +++ /dev/null @@ -1,390 +0,0 @@ -From a7244bd742f999e7ec8462797c7e7a393a844a7b Mon Sep 17 00:00:00 2001 -From: hmilylmk -Date: Sat, 13 Aug 2022 08:21:36 +0800 -Subject: [PATCH] add dsoftbus build support for embedded env - -Signed-off-by: hmilylmk ---- - build_scripts/build.sh | 9 ++++---- - config/BUILDCONFIG.gn | 11 ++++----- - config/compiler/compiler.gni | 6 +---- - config/ohos/BUILD.gn | 32 +------------------------- - config/ohos/abi.gni | 5 ----- - config/ohos/config.gni | 4 ++-- - config/ohos/musl.gni | 4 +++- - core/gn/BUILD.gn | 35 ++--------------------------- - loader/preloader/platforms.template | 4 ++-- - ohos.gni | 7 ------ - subsystem_config.json | 6 +++++ - toolchain/linux/BUILD.gn | 8 +++++-- - 12 files changed, 31 insertions(+), 100 deletions(-) - -diff --git a/build_scripts/build.sh b/build_scripts/build.sh -index 3514b36..e2404ca 100755 ---- a/build_scripts/build.sh -+++ b/build_scripts/build.sh -@@ -70,22 +70,22 @@ do - shift - done - -- - if [[ "${source_root_dir}x" == "x" ]]; then - echo "Error: source_root_dir cannot be empty." - exit 1 - fi -+ - if [[ ! -d "${source_root_dir}" ]]; then - echo "Error: source_root_dir is incorrect." - exit 1 - fi -+ - if [[ "${product_name}x" == "x" ]]; then - echo -e "\033[31mError: the product name should be specified!\033[0m" - help - exit 1 - fi - -- - case $(uname -s) in - Darwin) - HOST_DIR="darwin-x86" -@@ -102,10 +102,9 @@ case $(uname -s) in - esac - - # set python3 --PYTHON3=${source_root_dir}/prebuilts/python/${HOST_DIR}/3.8.5/bin/python3 -- -+PYTHON3=`which python` - if [[ ! -f "${PYTHON3}" ]]; then -- echo -e "\033[33m Please execute the build/prebuilts_download.sh \033[0m" -+ echo -e "\033[33m python3 not found, please check\033[0m" - exit 1 - fi - -diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn -index 98bb98b..9e016df 100755 ---- a/config/BUILDCONFIG.gn -+++ b/config/BUILDCONFIG.gn -@@ -130,10 +130,7 @@ declare_args() { - is_desktop_linux = current_os == "linux" - - # Set to true when compiling with the Clang compiler. -- is_clang = current_os != "linux" || -- (current_cpu != "s390x" && current_cpu != "s390" && -- current_cpu != "ppc64" && current_cpu != "ppc" && -- current_cpu != "mips" && current_cpu != "mips64") -+ is_clang = false - - # Allows the path to a custom target toolchain to be injected as a single - # argument, and set as the default toolchain. -@@ -154,7 +151,7 @@ declare_args() { - } - - declare_args() { -- use_musl = true -+ use_musl = false - } - - asdk_libs_dir = "//prebuilts/asdk_libs" -@@ -220,7 +217,7 @@ if (host_toolchain == "") { - - if (host_os == "linux") { - if (target_os != "linux") { -- host_toolchain = "//build/toolchain/linux:clang_$host_cpu" -+ host_toolchain = "//build/toolchain/linux:$host_cpu" - } else if (is_clang) { - host_toolchain = "//build/toolchain/linux:clang_$host_cpu" - } else { -@@ -250,7 +247,7 @@ _default_toolchain = "" - if (target_os == "ohos") { - assert(host_os == "linux" || host_os == "mac", - "ohos builds are only supported on Linux and Mac hosts.") -- _default_toolchain = "//build/toolchain/ohos:ohos_clang_$target_cpu" -+ _default_toolchain = "//build/toolchain/linux:$target_cpu" - } else if (target_os == "linux") { - if (is_clang) { - _default_toolchain = "//build/toolchain/linux:clang_$target_cpu" -diff --git a/config/compiler/compiler.gni b/config/compiler/compiler.gni -index b77100a..ae45cc8 100755 ---- a/config/compiler/compiler.gni -+++ b/config/compiler/compiler.gni -@@ -152,11 +152,7 @@ declare_args() { - - declare_args() { - # Whether to use the gold linker from binutils instead of lld or bfd. -- use_gold = !use_lld && -- ((is_linux && (current_cpu == "x64" || current_cpu == "x86" || -- current_cpu == "arm")) || -- (is_ohos && (current_cpu == "x86" || current_cpu == "x64" || -- current_cpu == "arm" || current_cpu == "arm64"))) -+ use_gold = false - } - - # If it wasn't manually set, set to an appropriate default. -diff --git a/config/ohos/BUILD.gn b/config/ohos/BUILD.gn -index aa5ac7c..941cc2e 100755 ---- a/config/ohos/BUILD.gn -+++ b/config/ohos/BUILD.gn -@@ -24,31 +24,17 @@ config("compiler") { - "HAVE_SYS_UIO_H", - ] - -- defines += [ -- "__MUSL__", -- "_LIBCPP_HAS_MUSL_LIBC", -- "__BUILD_LINUX_WITH_CLANG", -- ] -- - ldflags = [ - "-Wl,--no-undefined", -- "-Wl,--exclude-libs=libunwind_llvm.a", -- "-Wl,--exclude-libs=libc++_static.a", - - # Don't allow visible symbols from libraries that contain - # assembly code with symbols that aren't hidden properly. - # http://crbug.com/448386 -- "-Wl,--exclude-libs=libvpx_assembly_arm.a", - ] - -- cflags += [ "--target=$abi_target" ] - include_dirs = [ -- "${musl_sysroot}/usr/include/${abi_target}", -- "${clang_base_path}/include/c++/v1", - ] - -- ldflags += [ "--target=$abi_target" ] -- - # Assign any flags set for the C compiler to asmflags so that they are sent - # to the assembler. - asmflags = cflags -@@ -66,13 +52,6 @@ config("runtime_library") { - "CHROMIUM_CXX_TWEAK_INLINES", # Saves binary size. - ] - -- defines += [ -- "__MUSL__", -- "_LIBCPP_HAS_MUSL_LIBC", -- "__BUILD_LINUX_WITH_CLANG", -- ] -- ldflags = [ "-nostdlib" ] -- - libs = [] - - # arm builds of libc++ starting in NDK r12 depend on unwind. -@@ -80,20 +59,11 @@ config("runtime_library") { - libs += [ "unwind" ] - } - -- ldflags += [ -- "-L" + -- rebase_path("${clang_base_path}/lib/${abi_target}/c++", root_build_dir), -- "-L" + rebase_path("${musl_sysroot}/usr/lib/${abi_target}", root_build_dir), -- "-L" + rebase_path("${clang_base_path}/lib/clang/10.0.1/lib/${abi_target}", -- root_build_dir), -+ ldflags = [ - ] -- ldflags += [ "-Wl,--dynamic-linker,/system/bin/ld-musl-${musl_arch}.so.1" ] - - libs += [ -- rebase_path(libclang_rt_file), - "c", -- "c++", -- "c++abi", - ] - - if (current_cpu == "arm" && arm_version == 6) { -diff --git a/config/ohos/abi.gni b/config/ohos/abi.gni -index 57d1dca..600bc3e 100755 ---- a/config/ohos/abi.gni -+++ b/config/ohos/abi.gni -@@ -61,8 +61,3 @@ if (target_cpu == "arm64") { - ohos_secondary_abi_cpu = "x86" - ohos_app_secondary_abi = "x86" - } -- --if (defined(ohos_secondary_abi_cpu)) { -- ohos_secondary_abi_toolchain = -- "//build/toolchain/ohos:ohos_clang_${ohos_secondary_abi_cpu}" --} -diff --git a/config/ohos/config.gni b/config/ohos/config.gni -index 072bce1..00c7311 100644 ---- a/config/ohos/config.gni -+++ b/config/ohos/config.gni -@@ -26,11 +26,11 @@ if (is_ohos) { - } - - if (current_cpu == "arm") { -- abi_target = "arm-linux-ohosmusl" -+ abi_target = "" - } else if (current_cpu == "x86") { - abi_target = "" - } else if (current_cpu == "arm64") { -- abi_target = "aarch64-linux-ohosmusl" -+ abi_target = "" - } else if (current_cpu == "x86_64") { - abi_target = "" - } else { -diff --git a/config/ohos/musl.gni b/config/ohos/musl.gni -index 2468ca8..f9cead9 100644 ---- a/config/ohos/musl.gni -+++ b/config/ohos/musl.gni -@@ -16,4 +16,6 @@ if (use_musl){ - musl_target = "//third_party/musl:musl_libs" - musl_sysroot = get_label_info(musl_target, "target_out_dir") - import("//third_party/musl/musl_config.gni") --} -\ No newline at end of file -+} else { -+ musl_sysroot = "" -+} -diff --git a/core/gn/BUILD.gn b/core/gn/BUILD.gn -index 38d3cc9..cde44b1 100755 ---- a/core/gn/BUILD.gn -+++ b/core/gn/BUILD.gn -@@ -86,41 +86,10 @@ if (product_name == "ohos-sdk") { - deps = [ "//build/ohos/sdk:ohos_sdk" ] - } - } else { -- group("make_all") { -- deps = [ -- ":images", -- ":make_inner_kits", -- ":packages", -- ] -- } -- - group("images") { -- deps = [ "//build/ohos/images:make_images" ] -- } -- -- group("packages") { -- deps = [ "//build/ohos/packages:make_packages" ] -- } -- -- group("make_inner_kits") { -- deps = [ "$root_build_dir/build_configs:inner_kits" ] -- } -- -- group("build_all_test_pkg") { -- testonly = true - deps = [ -- "$root_build_dir/build_configs:parts_test", -- "//test/developertest:make_temp_test", -+ "//foundation/communication/dsoftbus/core/frame:softbus_server_main", -+ "//foundation/communication/dsoftbus/sdk:softbus_client", - ] - } -- -- group("make_test") { -- testonly = true -- deps = [ ":build_all_test_pkg" ] -- deps += [ "//build/ohos/packages:package_testcase_mlf" ] -- deps += [ "//build/ohos/packages:package_testcase" ] -- if (archive_component) { -- deps += [ "//build/ohos/testfwk:archive_testcase" ] -- } -- } - } -diff --git a/loader/preloader/platforms.template b/loader/preloader/platforms.template -index 5cad64d..7577fd6 100644 ---- a/loader/preloader/platforms.template -+++ b/loader/preloader/platforms.template -@@ -4,13 +4,13 @@ - { - "target_os": "ohos", - "target_cpu": "arm64", -- "toolchain": "//build/toolchain/ohos:ohos_clang_arm64", -+ "toolchain": "//build/toolchain/linux:arm64", - "parts_config": "./parts.json" - }, - { - "target_os": "ohos", - "target_cpu": "arm", -- "toolchain": "//build/toolchain/ohos:ohos_clang_arm", -+ "toolchain": "//build/toolchain/linux:arm", - "parts_config": "./parts.json" - } - ] -diff --git a/ohos.gni b/ohos.gni -index 77be836..a34baa3 100755 ---- a/ohos.gni -+++ b/ohos.gni -@@ -11,19 +11,12 @@ - # See the License for the specific language governing permissions and - # limitations under the License. - --import("//build/config/sanitizers/sanitizers.gni") --import("//build/ohos/ndk/ndk.gni") --import("//build/ohos/notice/notice.gni") --import("//build/ohos/sa_profile/sa_profile.gni") - import("//build/ohos_var.gni") - import("//build/toolchain/toolchain.gni") - - # import cxx base templates - import("//build/templates/cxx/cxx.gni") - --import("//build/ohos/ace/ace.gni") --import("//build/ohos/app/app.gni") -- - import("//build/templates/common/ohos_templates.gni") - - # import prebuilt templates -diff --git a/subsystem_config.json b/subsystem_config.json -index f04f29e..ebc0869 100644 ---- a/subsystem_config.json -+++ b/subsystem_config.json -@@ -178,5 +178,11 @@ - "path": "kernel/linux/build", - "name": "kernel", - "dir": "kernel/linux" -+ }, -+ "depend": { -+ "project":"openEuler/depend", -+ "path": "depend", -+ "name": "depend", -+ "dir": "depend" - } - } -diff --git a/toolchain/linux/BUILD.gn b/toolchain/linux/BUILD.gn -index 1a4c4e9..c811cf9 100755 ---- a/toolchain/linux/BUILD.gn -+++ b/toolchain/linux/BUILD.gn -@@ -22,7 +22,8 @@ clang_toolchain("clang_arm64") { - } - - gcc_toolchain("arm64") { -- toolprefix = "aarch64-linux-gnu-" -+ tool_path = rebase_path("//toolchain/bin", root_build_dir) -+ toolprefix = "${tool_path}/aarch64-openeuler-linux-gnu-" - - cc = "${toolprefix}gcc" - cxx = "${toolprefix}g++" -@@ -31,6 +32,7 @@ gcc_toolchain("arm64") { - ld = cxx - readelf = "${toolprefix}readelf" - nm = "${toolprefix}nm" -+ strip = "${toolprefix}strip" - - toolchain_args = { - current_cpu = "arm64" -@@ -40,7 +42,8 @@ gcc_toolchain("arm64") { - } - - gcc_toolchain("arm") { -- toolprefix = "arm-linux-gnueabihf-" -+ tool_path = rebase_path("//toolchain/bin", root_build_dir) -+ toolprefix = "${tool_path}/arm-openeuler-linux-gnu-" - - cc = "${toolprefix}gcc" - cxx = "${toolprefix}g++" -@@ -49,6 +52,7 @@ gcc_toolchain("arm") { - ld = cxx - readelf = "${toolprefix}readelf" - nm = "${toolprefix}nm" -+ strip = "${toolprefix}strip" - - toolchain_args = { - current_cpu = "arm" --- -2.34.1 - diff --git a/dsoftbus/build/0002-support-hichian-for-openeuler.patch b/dsoftbus/build/0002-support-hichian-for-openeuler.patch deleted file mode 100644 index 4c9469766c0ef791a61658fc40555ca2ab1d5e8d..0000000000000000000000000000000000000000 --- a/dsoftbus/build/0002-support-hichian-for-openeuler.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 4a7242c3bb1360510094ee099780e5237f8f0d53 Mon Sep 17 00:00:00 2001 -From: "beiling.xie" -Date: Fri, 2 Sep 2022 22:36:29 +0800 -Subject: [PATCH 2/2] support hichian for openeuler - -Signed-off-by: beiling.xie ---- - config/BUILDCONFIG.gn | 3 +++ - core/gn/BUILD.gn | 1 + - 2 files changed, 4 insertions(+) - -diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn -index 9e016df..4cc5b41 100755 ---- a/config/BUILDCONFIG.gn -+++ b/config/BUILDCONFIG.gn -@@ -517,3 +517,6 @@ foreach(_target_type, target_type_list) { - } - } - } -+ -+support_jsapi = false -+os_level = "standard" -diff --git a/core/gn/BUILD.gn b/core/gn/BUILD.gn -index 9784cda..9c38fe4 100755 ---- a/core/gn/BUILD.gn -+++ b/core/gn/BUILD.gn -@@ -90,6 +90,7 @@ if (product_name == "ohos-sdk") { - deps = [ - "//foundation/communication/dsoftbus/core/frame:softbus_server_main", - "//foundation/communication/dsoftbus/sdk:softbus_client", -+ "//base/security/deviceauth/services:deviceauth_sdk", - ] - } - } --- -2.25.1 - diff --git a/dsoftbus/build/0003-remove-build_configs-to-simplify-third-party-tools.patch b/dsoftbus/build/0003-remove-build_configs-to-simplify-third-party-tools.patch deleted file mode 100644 index 79864b343932a0af7b05cdcc609dbaecf65a8b55..0000000000000000000000000000000000000000 --- a/dsoftbus/build/0003-remove-build_configs-to-simplify-third-party-tools.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 1fb10c696cdde31c5fe30097cc38bbc0d054c812 Mon Sep 17 00:00:00 2001 -From: "beiling.xie" -Date: Thu, 10 Nov 2022 10:50:33 +0800 -Subject: [PATCH] remove build_configs to simplify third-party tools - -Signed-off-by: beiling.xie ---- - config/ohos/musl.gni | 2 +- - core/build_scripts/make_main.sh | 2 +- - core/gn/BUILD.gn | 12 ------------ - ohos/notice/notice.gni | 1 - - 4 files changed, 2 insertions(+), 15 deletions(-) - -diff --git a/config/ohos/musl.gni b/config/ohos/musl.gni -index f9cead9..628e93c 100644 ---- a/config/ohos/musl.gni -+++ b/config/ohos/musl.gni -@@ -17,5 +17,5 @@ if (use_musl){ - musl_sysroot = get_label_info(musl_target, "target_out_dir") - import("//third_party/musl/musl_config.gni") - } else { -- musl_sysroot = "" -+ musl_sysroot = getenv("STAGING_DIR_TARGET") - } -diff --git a/core/build_scripts/make_main.sh b/core/build_scripts/make_main.sh -index 770145c..e1168d8 100755 ---- a/core/build_scripts/make_main.sh -+++ b/core/build_scripts/make_main.sh -@@ -78,7 +78,7 @@ do_make() - if [ "${TARGET_PLATFORM}" != "" ];then - ninja_build_args="$ninja_build_args --target-platform ${TARGET_PLATFORM}" - fi -- real_build_target=$(python ${BASE_HOME}/build/scripts/build_target_handler.py $ninja_build_args) -+ real_build_target="images" - echo "build_target: "$real_build_target - - if [ "${USE_NARUTO}"x = "truex" ];then -diff --git a/core/gn/BUILD.gn b/core/gn/BUILD.gn -index 9c38fe4..0dc0260 100755 ---- a/core/gn/BUILD.gn -+++ b/core/gn/BUILD.gn -@@ -20,9 +20,6 @@ print("root_gen_dir=$root_gen_dir") - print("current_toolchain=$current_toolchain") - print("host_toolchain=$host_toolchain") - --# load build configs and write load result to out_build_dir/build_configs --build_loader_script = rebase_path("//build/loader/load.py") -- - _platforms_config_file = "//out/build_configs/standard_system/platforms.build" - - build_platform = "" -@@ -71,15 +68,6 @@ arguments += [ - "subsystem_examples", - ] - --load_result = exec_script(build_loader_script, arguments, "string") -- --if (load_result != "") { -- print() -- print(load_result) --} -- --print("build configs generation is complete.") -- - # gn target defined - if (product_name == "ohos-sdk") { - group("build_ohos_sdk") { -diff --git a/ohos/notice/notice.gni b/ohos/notice/notice.gni -index db49684..566aeb4 100755 ---- a/ohos/notice/notice.gni -+++ b/ohos/notice/notice.gni -@@ -14,7 +14,6 @@ - import("//build/config/python.gni") - import("//build/ohos/build_var.gni") - import("//build/ohos_var.gni") --import("${build_configs_path}/platforms_list.gni") - - declare_args() { - sdk_notice_dir = "$root_build_dir/NOTICE_FILES/sdk" --- -2.25.1 - diff --git a/dsoftbus/build/build-OpenHarmony-v3.0.2-LTS.zip b/dsoftbus/build/build-OpenHarmony-v3.0.2-LTS.zip deleted file mode 100644 index 9dfbc91f9939fa5bdedc249202cf5859a245255e..0000000000000000000000000000000000000000 Binary files a/dsoftbus/build/build-OpenHarmony-v3.0.2-LTS.zip and /dev/null differ diff --git a/dsoftbus/build_tools/ninja-linux-x86-1.10.1.tar.gz b/dsoftbus/build_tools/ninja-linux-x86-1.10.1.tar.gz deleted file mode 100644 index 81ce7c2d4931d2ef6aa05224dbddf6472a22880e..0000000000000000000000000000000000000000 Binary files a/dsoftbus/build_tools/ninja-linux-x86-1.10.1.tar.gz and /dev/null differ diff --git a/dsoftbus/build_tools/ninja-linux-x86-1.10.1.tar.gz.sha256 b/dsoftbus/build_tools/ninja-linux-x86-1.10.1.tar.gz.sha256 deleted file mode 100644 index 4284c2fd5dce80b0c9d6fe89b4a13704dc033bd8..0000000000000000000000000000000000000000 --- a/dsoftbus/build_tools/ninja-linux-x86-1.10.1.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -bcd35fdfc5f690537691a47733894fbca6a321bb2361de4f32eae1cbfbce7e92 diff --git a/dsoftbus/depend/BUILD.gn b/dsoftbus/depend/BUILD.gn deleted file mode 100644 index 14a5b0e7868786a2f9cd9d06156ddb38434efc8a..0000000000000000000000000000000000000000 --- a/dsoftbus/depend/BUILD.gn +++ /dev/null @@ -1,59 +0,0 @@ -import("//build/ohos.gni") - -config("hilog_config") { - include_dirs = [ - "hilog/include", - "//third_party/bounds_checking_function/include", - ] -} - -ohos_shared_library("libhilog") { - public_configs = [ ":hilog_config" ] - sources = [ - "hilog/hilog.c", - ] - deps = [ - "//third_party/bounds_checking_function:libsec_shared", - ] -} - -group("system_ability_fwk") { -} - -group("samgr_proxy") { -} - -group("libpermissionsdk_standard") { -} - -group("cesfwk_innerkits") { -} - -group("want") { -} - -group("appexecfwk_core") { -} - -group("libaccesstoken_sdk") { -} - -config("syspara_config") { - include_dirs = [ - "syspara/include", - ] -} - -ohos_shared_library("syspara") { - include_dirs = [ - "syspara/include", - ] - sources = [ - "syspara/syspara.c", - ] - public_configs = [ ":syspara_config" ] - deps = [ - "//third_party/bounds_checking_function:libsec_shared", - "//third_party/mbedtls:mbedtls_shared", - ] -} diff --git a/dsoftbus/depend/hilog/hilog.c b/dsoftbus/depend/hilog/hilog.c deleted file mode 100644 index 46d69f7ceb6e7ce02e9b3a1204c5ec23648516c3..0000000000000000000000000000000000000000 --- a/dsoftbus/depend/hilog/hilog.c +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include -#include -#include "securec.h" -#include "hilog_base/log_base.h" - -#ifndef LOG_PRINT_MAX_LEN -#define LOG_PRINT_MAX_LEN 256 -#endif - -char *adapterStrForPrintfFormat(const char *fmt) { - char *left, *right; - char *buffer = (char *)malloc(LOG_PRINT_MAX_LEN * sizeof(char)); - (void)memset_s(buffer, LOG_PRINT_MAX_LEN * sizeof(char), 0, LOG_PRINT_MAX_LEN * sizeof(char)); - strcpy_s(buffer, LOG_PRINT_MAX_LEN * sizeof(char), fmt); - while (strstr(buffer, "{")) { - left = strstr(buffer, "{"); - right = strstr(buffer, "}"); - right++; - while (*right != '\0') { - *left = *right; - left++; - right++; - } - *left = '\0'; - } - return buffer; -} - -void printfAdapter(const char *fmt, ...) { - char *buffer; - buffer = adapterStrForPrintfFormat(fmt); - va_list ap; - va_start(ap, fmt); - vprintf(buffer, ap); - va_end(ap); - free(buffer); -} diff --git a/dsoftbus/depend/hilog/include/hilog/log.h b/dsoftbus/depend/hilog/include/hilog/log.h deleted file mode 100644 index 237ad7bb1005deb80dc3ef2819ef5347bd7ccc94..0000000000000000000000000000000000000000 --- a/dsoftbus/depend/hilog/include/hilog/log.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _HILOG_H -#define _HILOG_H - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif -#endif - -// Log type -typedef enum { - LOG_TYPE_MIN = 0, - LOG_APP = 0, - // Log to kmsg, only used by init phase. - LOG_INIT = 1, - // Used by core service, framework. - LOG_CORE = 3, - LOG_TYPE_MAX -} LogType; - -char *adapterStrForPrintfFormat(const char *fmt); -void printfAdapter(const char *fmt, ...); - -#define HILOG_DEBUG(type, fmt, ...) printfAdapter(fmt"\n", ##__VA_ARGS__) -#define HILOG_INFO(type, fmt, ...) printfAdapter(fmt"\n", ##__VA_ARGS__) -#define HILOG_WARN(type, fmt, ...) printfAdapter(fmt"\n", ##__VA_ARGS__) -#define HILOG_ERROR(type, fmt, ...) printfAdapter(fmt"\n", ##__VA_ARGS__) -#define HiLogPrint(type, level, domain, tag, fmt, ...) printf(fmt"\n", ##__VA_ARGS__) -#define HiLogBasePrint(type, level, domain, tag, fmt, ...) printfAdapter(fmt"\n", ##__VA_ARGS__) - -#ifdef __cplusplus -#if __cplusplus -} -#endif -#endif - -#endif diff --git a/dsoftbus/depend/hilog/include/hilog_base/log_base.h b/dsoftbus/depend/hilog/include/hilog_base/log_base.h deleted file mode 100644 index b3e84fb7d2f34590a9d0e9daff19be309808ec3a..0000000000000000000000000000000000000000 --- a/dsoftbus/depend/hilog/include/hilog_base/log_base.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/dsoftbus/depend/ohos.build b/dsoftbus/depend/ohos.build deleted file mode 100644 index 67e63884a96e627ad42076f7d601531e2d6f5c0d..0000000000000000000000000000000000000000 --- a/dsoftbus/depend/ohos.build +++ /dev/null @@ -1,114 +0,0 @@ -{ - "subsystem": "depend", - "parts": { - "hiviewdfx_hilog_native": { - "module_list": [ ], - "inner_kits": [ - { - "name": "//depend:libhilog", - "header": { - "header_files": [ ], - "header_base": "//depend" - } - } - ] - }, - "ces_standard": { - "module_list": [ ], - "inner_kits": [ - { - "name": "//depend:cesfwk_innerkits", - "header": { - "header_files": [ ], - "header_base": "//depend" - } - } - ] - }, - "aafwk_standard": { - "module_list": [ ], - "inner_kits": [ - { - "name": "//depend:want", - "header": { - "header_files": [ ], - "header_base": "//depend" - } - } - ] - }, - "appexecfwk_standard": { - "module_list": [ ], - "inner_kits": [ - { - "name": "//depend:appexecfwk_core", - "header": { - "header_files": [ ], - "header_base": "//depend" - } - } - ] - }, - "permission_standard": { - "module_list": [ ], - "inner_kits": [ - { - "name": "//depend:libpermissionsdk_standard", - "header": { - "header_files": [ ], - "header_base":"//depend" - } - } - ] - }, - "safwk": { - "module_list": [ ], - "inner_kits": [ - { - "name": "//depend:system_ability_fwk", - "header": { - "header_files": [ ], - "header_base": "//depend" - } - } - ] - }, - "samgr_L2": { - "module_list": [ ], - "inner_kits": [ - { - "name": "//depend:samgr_proxy", - "header": { - "header_files": [ ], - "header_base": "//depend" - } - } - ] - }, - "samgr_standard": { - "module_list": [ ], - "inner_kits": [ - { - "name": "//depend:samgr_proxy", - "header": { - "header_files": [ ], - "header_base": "//depend" - } - } - ] - }, - "access_token": { - "module_list": [ ], - "inner_kits": [ - { - "name": "//depend:libaccesstoken_sdk", - "header": { - "header_files": [ ], - "header_base": "//depend" - } - } - ] - } - } -} - diff --git a/dsoftbus/depend/syspara/include/parameter.h b/dsoftbus/depend/syspara/include/parameter.h deleted file mode 100644 index f565bf14a83494afd180a10c9fa483e26f42daa3..0000000000000000000000000000000000000000 --- a/dsoftbus/depend/syspara/include/parameter.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef SYSPARA_PARAMETER_H -#define SYSPARA_PARAMETER_H - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif -#endif /* __cplusplus */ - -int GetDevUdid(char *udid, int size); - -char * GetDeviceType(void); - -#ifdef __cplusplus -#if __cplusplus -} -#endif -#endif /* __cplusplus */ - -#endif /* SYSPARA_PARAMETER_H */ diff --git a/dsoftbus/depend/syspara/syspara.c b/dsoftbus/depend/syspara/syspara.c deleted file mode 100644 index 677c5d3f3a870876c29657ab7e1c5cc8f61f3f8e..0000000000000000000000000000000000000000 --- a/dsoftbus/depend/syspara/syspara.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include "securec.h" -#include "parameter.h" -#include "sha256.h" - -#define SN_FILE "/etc/SN" -#define SN_LEN 65 -#define UDID_LEN 65 -#define DEV_BUF_LENGTH 3 -#define HASH_LENGTH 32 -static char *deviceType = "UNKNOWN"; - -static int GetHash(const char *input, char *output, int size) -{ - char buf[DEV_BUF_LENGTH] = { 0 }; - unsigned char hash[HASH_LENGTH] = { 0 }; - mbedtls_sha256_context context; - - mbedtls_sha256_init(&context); - mbedtls_sha256_starts_ret(&context, 0); - mbedtls_sha256_update_ret(&context, (const unsigned char*)input, strlen(input)); - mbedtls_sha256_finish_ret(&context, hash); - - for (size_t i = 0; i < HASH_LENGTH; i++) { - unsigned char value = hash[i]; - memset_s(buf, DEV_BUF_LENGTH, 0, DEV_BUF_LENGTH); - sprintf_s(buf, sizeof(buf), "%02X", value); - if (strcat_s(output, size, buf) != 0) { - return -1; - } - } - return 0; -} - -int GetDevUdid(char *udid, int size) -{ - FILE *fp; - char *realPath = NULL; - char sn[SN_LEN] = {0}; - char out[UDID_LEN] = {0}; - int ret; - - realPath = realpath(SN_FILE, NULL); - if (realPath == NULL) { - printf("realpath fail.\n"); - goto err_realpath; - } - - fp = fopen(realPath, "r"); - if (fp == NULL) { - printf("open SN fail.\n"); - goto err_fopen; - } - - ret = fscanf_s(fp, "%s", sn, SN_LEN); - if (ret < 1) { - printf("get sn fail.\n"); - goto err_out; - } - - ret = GetHash(sn, out, UDID_LEN); - if (ret < 0) { - printf("get hash fail.\n"); - goto err_out; - } - - ret = sprintf_s(udid, size, "%s", out); - if (ret <= 0) { - printf("sprintf_s error.\n"); - goto err_out; - } - - fclose(fp); - return 0; -err_out: - fclose(fp); -err_fopen: - free(realPath); -err_realpath: - return -1; -} - -char * GetDeviceType(void) -{ - return deviceType; -} diff --git a/dsoftbus/hichain/deviceauth/0001-support-deviceauth-for-openeuler.patch b/dsoftbus/hichain/deviceauth/0001-support-deviceauth-for-openeuler.patch deleted file mode 100644 index 8bfb0ef7d48c21da0cca84b7eb5908cadffd6161..0000000000000000000000000000000000000000 --- a/dsoftbus/hichain/deviceauth/0001-support-deviceauth-for-openeuler.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 6a4234339518e8be293aacee4aeef6aaa38d7e69 Mon Sep 17 00:00:00 2001 -From: "beiling.xie" -Date: Wed, 14 Sep 2022 00:12:20 +0800 -Subject: [PATCH] support deviceauth for openeuler - -Signed-off-by: beiling.xie ---- - deps_adapter/BUILD.gn | 3 ++- - deps_adapter/os_adapter/interfaces/linux/hc_log.h | 8 ++++---- - services/BUILD.gn | 2 +- - .../src/permission_adapter/permission_adapter.cpp | 11 +++++++---- - 4 files changed, 14 insertions(+), 10 deletions(-) - -diff --git a/deps_adapter/BUILD.gn b/deps_adapter/BUILD.gn -index 28df2d9..906b8ca 100644 ---- a/deps_adapter/BUILD.gn -+++ b/deps_adapter/BUILD.gn -@@ -118,10 +118,11 @@ if (defined(ohos_lite)) { - cflags = [ "-DHILOG_ENABLE" ] - deps = [ - "//base/security/huks/interfaces/innerkits/huks_standard/main:libhukssdk", -- "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", -+ "//depend:syspara", - "//third_party/cJSON:cjson_static", - "//third_party/openssl:libcrypto_static", - "//utils/native/base:utils", -+ "//third_party/bounds_checking_function:libsec_shared", - ] - external_deps = [ "hiviewdfx_hilog_native:libhilog" ] - } -diff --git a/deps_adapter/os_adapter/interfaces/linux/hc_log.h b/deps_adapter/os_adapter/interfaces/linux/hc_log.h -index 7cfd649..f881d1e 100644 ---- a/deps_adapter/os_adapter/interfaces/linux/hc_log.h -+++ b/deps_adapter/os_adapter/interfaces/linux/hc_log.h -@@ -44,10 +44,10 @@ void DevAuthLogPrint(DevAuthLogLevel level, const char *funName, const char *fmt - #define LOGW(fmt, ...) (DevAuthLogPrint(DEV_AUTH_LOG_LEVEL_WARN, __FUNCTION__, fmt, ##__VA_ARGS__)) - #define LOGE(fmt, ...) (DevAuthLogPrint(DEV_AUTH_LOG_LEVEL_ERROR, __FUNCTION__, fmt, ##__VA_ARGS__)) - --#define DEV_AUTH_LOG_DEBUG(buf) HiLogPrint(LOG_CORE, LOG_DEBUG, LOG_DOMAIN, "[DEVAUTH]", "%{public}s", buf) --#define DEV_AUTH_LOG_INFO(buf) HiLogPrint(LOG_CORE, LOG_INFO, LOG_DOMAIN, "[DEVAUTH]", "%{public}s", buf) --#define DEV_AUTH_LOG_WARN(buf) HiLogPrint(LOG_CORE, LOG_WARN, LOG_DOMAIN, "[DEVAUTH]", "%{public}s", buf) --#define DEV_AUTH_LOG_ERROR(buf) HiLogPrint(LOG_CORE, LOG_ERROR, LOG_DOMAIN, "[DEVAUTH]", "%{public}s", buf) -+#define DEV_AUTH_LOG_DEBUG(buf) HiLogPrint(LOG_CORE, LOG_DEBUG, LOG_DOMAIN, "[DEVAUTH]", "%s", buf) -+#define DEV_AUTH_LOG_INFO(buf) HiLogPrint(LOG_CORE, LOG_INFO, LOG_DOMAIN, "[DEVAUTH]", "%s", buf) -+#define DEV_AUTH_LOG_WARN(buf) HiLogPrint(LOG_CORE, LOG_WARN, LOG_DOMAIN, "[DEVAUTH]", "%s", buf) -+#define DEV_AUTH_LOG_ERROR(buf) HiLogPrint(LOG_CORE, LOG_ERROR, LOG_DOMAIN, "[DEVAUTH]", "%s", buf) - - #else - -diff --git a/services/BUILD.gn b/services/BUILD.gn -index bb15b89..b2cdb17 100644 ---- a/services/BUILD.gn -+++ b/services/BUILD.gn -@@ -159,10 +159,10 @@ if (defined(ohos_lite)) { - "${deps_adapter_path}:${hal_module_name}", - "//third_party/cJSON:cjson_static", - "//utils/native/base:utils", -+ "//foundation/communication/dsoftbus/sdk:softbus_client" - ] - - external_deps = [ -- "dsoftbus_standard:softbus_client", - "hiviewdfx_hilog_native:libhilog", - ] - if (support_jsapi) { -diff --git a/services/frameworks/src/permission_adapter/permission_adapter.cpp b/services/frameworks/src/permission_adapter/permission_adapter.cpp -index dcdb912..6f4f8a3 100644 ---- a/services/frameworks/src/permission_adapter/permission_adapter.cpp -+++ b/services/frameworks/src/permission_adapter/permission_adapter.cpp -@@ -15,17 +15,18 @@ - - #include "permission_adapter.h" - --#include "accesstoken_kit.h" -+//#include "accesstoken_kit.h" - #include "ipc_skeleton.h" - - #include "device_auth_defines.h" - #include "hc_log.h" - --using namespace OHOS; --using namespace OHOS::Security::AccessToken; -+//using namespace OHOS; -+//using namespace OHOS::Security::AccessToken; - - int32_t CheckPermission(void) - { -+#if 0 - AccessTokenID tokenId = IPCSkeleton::GetCallingTokenID(); - ATokenTypeEnum tokenType = AccessTokenKit::GetTokenType(tokenId); - if (tokenType == TOKEN_NATIVE) { -@@ -45,4 +46,6 @@ int32_t CheckPermission(void) - LOGE("Invalid token type: %d", tokenType); - return HC_ERROR; - } --} -\ No newline at end of file -+#endif -+ return HC_SUCCESS; -+} --- -2.25.1 - diff --git a/dsoftbus/hichain/deviceauth/0002-adapter-deviceauth-ipc-service.patch b/dsoftbus/hichain/deviceauth/0002-adapter-deviceauth-ipc-service.patch deleted file mode 100644 index e94772aaead6f5f51a1f47bda6d42f7c18f73826..0000000000000000000000000000000000000000 --- a/dsoftbus/hichain/deviceauth/0002-adapter-deviceauth-ipc-service.patch +++ /dev/null @@ -1,276 +0,0 @@ -From 31f1a71fee10a1248de00ea1f36eeaf80e683673 Mon Sep 17 00:00:00 2001 -From: "beiling.xie" -Date: Fri, 16 Sep 2022 01:11:40 +0800 -Subject: [PATCH] adapter deviceauth ipc service - -Signed-off-by: beiling.xie ---- - frameworks/inc/ipc_service.h | 2 ++ - frameworks/src/ipc_service.c | 16 +----------- - frameworks/src/standard/ipc_adapt.cpp | 18 +++++++------ - .../src/standard/ipc_dev_auth_proxy.cpp | 25 ++++--------------- - frameworks/src/standard/ipc_dev_auth_stub.cpp | 7 +----- - services/BUILD.gn | 15 ++++++++++- - services/device_auth.c | 6 +++++ - 7 files changed, 39 insertions(+), 50 deletions(-) - -diff --git a/frameworks/inc/ipc_service.h b/frameworks/inc/ipc_service.h -index e3eb11b..ed73555 100755 ---- a/frameworks/inc/ipc_service.h -+++ b/frameworks/inc/ipc_service.h -@@ -20,6 +20,8 @@ - extern "C" { - #endif - -+int DeviceAuthIpcInit(); -+ - #ifdef __cplusplus - } - #endif -diff --git a/frameworks/src/ipc_service.c b/frameworks/src/ipc_service.c -index afc21fc..3db6bb5 100644 ---- a/frameworks/src/ipc_service.c -+++ b/frameworks/src/ipc_service.c -@@ -1038,20 +1038,10 @@ int32_t MainRescInit(void) - return HC_SUCCESS; - } - --int32_t main(int32_t argc, char const *argv[]) -+int DeviceAuthIpcInit() - { - uintptr_t serviceCtx = 0x0; - int32_t ret; -- HcCondition cond; -- -- (void)argc; -- (void)argv; -- LOGI("device authentication service starting ..."); -- ret = InitDeviceAuthService(); -- if (ret != HC_SUCCESS) { -- LOGE("device auth service main, InitDeviceAuthService failed, ret %d", ret); -- return 1; -- } - - ret = MainRescInit(); - if (ret != HC_SUCCESS) { -@@ -1070,10 +1060,6 @@ int32_t main(int32_t argc, char const *argv[]) - } - (void)AddMethodMap(serviceCtx); - LOGI("device authentication service register to IPC manager done, service running..."); -- (void)memset_s(&cond, sizeof(cond), 0, sizeof(cond)); -- InitHcCond(&cond, NULL); -- cond.wait(&cond); -- DestroyHcCond(&cond); - return 0; - } - -diff --git a/frameworks/src/standard/ipc_adapt.cpp b/frameworks/src/standard/ipc_adapt.cpp -index 3dd4ec8..3910726 100644 ---- a/frameworks/src/standard/ipc_adapt.cpp -+++ b/frameworks/src/standard/ipc_adapt.cpp -@@ -23,12 +23,14 @@ - #include "ipc_dev_auth_stub.h" - #include "ipc_sdk.h" - #include "ipc_service.h" --#include "iservice_registry.h" - #include "securec.h" - #include "system_ability_definition.h" -+#include "ipc_center.h" -+ - - using namespace std; - using namespace OHOS; -+static IpcCenter *g_deviceIpc = nullptr; - namespace { - static const int32_t BUFF_MAX_SZ = 128; - static const int32_t IPC_CALL_BACK_MAX_NODES = 64; -@@ -1335,19 +1337,19 @@ void DestroyServiceInstance(uintptr_t *ipcInstance) - - int32_t AddDevAuthServiceToManager(uintptr_t *serviceCtx) - { -- int32_t ret = ERR_OK; -+ int32_t ret = HC_SUCCESS; - ServiceDevAuth *sPtr = nullptr; - -- sptr sysMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); -- if (sysMgr == nullptr) { -- return HC_ERR_IPC_GET_SERVICE; -- } - sPtr = new(std::nothrow) ServiceDevAuth(); - if (sPtr == nullptr) { - return HC_ERR_ALLOC_MEMORY; - } -- ret = sysMgr->AddSystemAbility(DEVICE_AUTH_SERVICE_ID, sPtr); -- if (ret != ERR_OK) { -+ sPtr->isDSoftBusObj = false; -+ if (!g_deviceIpc->Init(true, static_cast(sPtr))) { -+ LOGE("deviceIpc init failed"); -+ } -+ ret = IPCSkeleton::SetDeviceAuthObj(sPtr); -+ if (ret != true) { - LOGE("add service failed"); - delete sPtr; - return HC_ERROR; -diff --git a/frameworks/src/standard/ipc_dev_auth_proxy.cpp b/frameworks/src/standard/ipc_dev_auth_proxy.cpp -index bc3abeb..c493f7a 100644 ---- a/frameworks/src/standard/ipc_dev_auth_proxy.cpp -+++ b/frameworks/src/standard/ipc_dev_auth_proxy.cpp -@@ -19,9 +19,9 @@ - #include "hc_log.h" - #include "ipc_adapt.h" - #include "ipc_sdk.h" --#include "iservice_registry.h" - #include "system_ability_definition.h" - -+ - namespace OHOS { - ProxyDevAuth::ProxyDevAuth(const sptr &impl) : IRemoteProxy(impl) - {} -@@ -33,7 +33,7 @@ int32_t ProxyDevAuth::DoCallRequest(MessageParcel &dataParcel, MessageParcel &re - { - int32_t ret; - sptr remote = nullptr; -- MessageOption option = { MessageOption::TF_SYNC }; -+ MessageOption option; - - LOGI("ProxyDevAuth, SendRequest..."); - remote = Remote(); -@@ -42,9 +42,6 @@ int32_t ProxyDevAuth::DoCallRequest(MessageParcel &dataParcel, MessageParcel &re - return HC_ERR_IPC_INTERNAL_FAILED; - } - -- if (withSync == false) { -- option = { MessageOption::TF_ASYNC }; -- } - ret = remote->SendRequest(DEV_AUTH_CALL_REQUEST, dataParcel, replyParcel, option); - LOGI("SendRequest done, ret %d", ret); - (ret == ERR_NONE) ? replyParcel.ReadInt32(ret) : (ret = HC_ERR_IPC_INTERNAL_FAILED); -@@ -53,15 +50,8 @@ int32_t ProxyDevAuth::DoCallRequest(MessageParcel &dataParcel, MessageParcel &re - - bool ProxyDevAuth::ServiceRunning(void) - { -- auto saMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); -- if (saMgr == nullptr) { -- return false; -- } -- auto daSa = saMgr->GetSystemAbility(DEVICE_AUTH_SERVICE_ID); -- if (daSa == nullptr) { -- return false; -- } -- return true; -+ auto daSa = IPCSkeleton::GetDeviceAuthObj(); -+ return daSa != nullptr; - } - - int32_t ProxyDevAuthData::EncodeCallRequest(int32_t type, const uint8_t *param, int32_t paramSz) -@@ -117,12 +107,7 @@ int32_t ProxyDevAuthData::FinalCallRequest(int32_t methodId) - - sptr ProxyDevAuthData::GetProxy() const - { -- auto saMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); -- if (saMgr == nullptr) { -- LOGE("GetSystemAbilityManager failed"); -- return nullptr; -- } -- auto daSa = saMgr->GetSystemAbility(DEVICE_AUTH_SERVICE_ID); -+ auto daSa = IPCSkeleton::GetDeviceAuthObj(); - if (daSa == nullptr) { - LOGE("GetSystemAbility failed"); - return nullptr; -diff --git a/frameworks/src/standard/ipc_dev_auth_stub.cpp b/frameworks/src/standard/ipc_dev_auth_stub.cpp -index e33b770..648bc3b 100644 ---- a/frameworks/src/standard/ipc_dev_auth_stub.cpp -+++ b/frameworks/src/standard/ipc_dev_auth_stub.cpp -@@ -286,12 +286,7 @@ void ServiceDevAuth::ActCallback(int32_t objIdx, int32_t callbackId, bool sync, - LOGW("nothing to do, callback id %d, remote object id %d", callbackId, objIdx); - return; - } -- MessageOption option(MessageOption::TF_SYNC); -- option.SetWaitTime(DEV_AUTH_CALL_WAIT_TIME); -- if (!sync) { -- option.SetFlags(MessageOption::TF_ASYNC); -- option.SetWaitTime(0); -- } -+ MessageOption option; - std::lock_guard autoLock(g_cBMutex); - sptr proxy = iface_cast(g_cbStub[objIdx].cbStub); - proxy->DoCallBack(callbackId, cbHook, dataParcel, reply, option); -diff --git a/services/BUILD.gn b/services/BUILD.gn -index b2cdb17..ce6e24b 100644 ---- a/services/BUILD.gn -+++ b/services/BUILD.gn -@@ -142,9 +142,14 @@ if (defined(ohos_lite)) { - "//foundation/communication/dsoftbus/interfaces/kits/transport", - "//foundation/communication/dsoftbus/interfaces/inner_kits/transport", - "//third_party/json/include", -+ "${frameworks_path}/inc", -+ "${dev_frameworks_path}/inc/permission_adapter", - ] - - sources = deviceauth_files -+ sources += deviceauth_ipc_files -+ sources += permission_adapter_files -+ sources += [ "${frameworks_path}/src/ipc_service.c" ] - cflags = [ "-DHILOG_ENABLE" ] - defines = deviceauth_defines - cflags += build_flags -@@ -164,6 +169,7 @@ if (defined(ohos_lite)) { - - external_deps = [ - "hiviewdfx_hilog_native:libhilog", -+ "ipc:ipc_core", - ] - if (support_jsapi) { - external_deps += [ "os_account_standard:os_account_innerkits" ] -@@ -238,6 +244,12 @@ if (defined(ohos_lite)) { - sources = deviceauth_ipc_files - sources += permission_adapter_files - sources += [ "${frameworks_path}/src/ipc_sdk.c" ] -+ sources += [ "${os_adapter_path}/impl/src/hc_log.c" ] -+ sources += [ "${os_adapter_path}/impl/src/linux/hc_types.c" ] -+ sources += [ "${os_adapter_path}/impl/src/hc_mutex.c" ] -+ sources += [ "${common_lib_path}/impl/src/json_utils.c" ] -+ sources += [ "${common_lib_path}/impl/src/string_util.c" ] -+ sources += [ "${common_lib_path}/impl/src/clib_types.c" ] - - defines = [ - "__LINUX__", -@@ -250,9 +262,10 @@ if (defined(ohos_lite)) { - } - - deps = [ -- "${deps_adapter_path}:${hal_module_name}", - "//third_party/cJSON:cjson_static", - "//utils/native/base:utils", -+ "//third_party/bounds_checking_function:libsec_shared", -+ "//third_party/cJSON:cjson_static", - ] - - external_deps = [ -diff --git a/services/device_auth.c b/services/device_auth.c -index e09dce4..16f6200 100644 ---- a/services/device_auth.c -+++ b/services/device_auth.c -@@ -14,6 +14,7 @@ - */ - - #include "device_auth.h" -+#include "ipc_service.h" - - #include "alg_loader.h" - #include "callback_manager.h" -@@ -241,6 +242,11 @@ DEVICE_AUTH_API_PUBLIC int InitDeviceAuthService(void) - DestroyGmAndGa(); - return res; - } -+ res = DeviceAuthIpcInit(); -+ if (res != HC_SUCCESS) { -+ DestroyGmAndGa(); -+ return res; -+ } - SetInitStatus(); - LOGI("[End]: [Service]: Init device auth service successfully!"); - return HC_SUCCESS; --- -2.25.1 - diff --git a/dsoftbus/hichain/deviceauth/0003-simplify-dependency-on-third-party-packages.patch b/dsoftbus/hichain/deviceauth/0003-simplify-dependency-on-third-party-packages.patch deleted file mode 100644 index 38e943e2c4af8b34b7698e8be51301daf0a7c19d..0000000000000000000000000000000000000000 --- a/dsoftbus/hichain/deviceauth/0003-simplify-dependency-on-third-party-packages.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 382ff16702df5f06b96a76abd2b542ab00650487 Mon Sep 17 00:00:00 2001 -From: "beiling.xie" -Date: Thu, 10 Nov 2022 14:34:05 +0800 -Subject: [PATCH] simplify dependency on third-party packages - -Signed-off-by: beiling.xie ---- - deps_adapter/BUILD.gn | 4 ++-- - services/BUILD.gn | 23 +++++++++-------------- - 2 files changed, 11 insertions(+), 16 deletions(-) - -diff --git a/deps_adapter/BUILD.gn b/deps_adapter/BUILD.gn -index 906b8ca..722d974 100644 ---- a/deps_adapter/BUILD.gn -+++ b/deps_adapter/BUILD.gn -@@ -120,10 +120,10 @@ if (defined(ohos_lite)) { - "//base/security/huks/interfaces/innerkits/huks_standard/main:libhukssdk", - "//depend:syspara", - "//third_party/cJSON:cjson_static", -- "//third_party/openssl:libcrypto_static", - "//utils/native/base:utils", - "//third_party/bounds_checking_function:libsec_shared", - ] -- external_deps = [ "hiviewdfx_hilog_native:libhilog" ] -+ deps += [ "//depend:libhilog" ] -+ libs = [ "crypto" ] - } - } -diff --git a/services/BUILD.gn b/services/BUILD.gn -index ce6e24b..0c37820 100644 ---- a/services/BUILD.gn -+++ b/services/BUILD.gn -@@ -167,9 +167,9 @@ if (defined(ohos_lite)) { - "//foundation/communication/dsoftbus/sdk:softbus_client" - ] - -- external_deps = [ -- "hiviewdfx_hilog_native:libhilog", -- "ipc:ipc_core", -+ deps += [ -+ "//depend:libhilog", -+ "//depend/ipc:ipc_core", - ] - if (support_jsapi) { - external_deps += [ "os_account_standard:os_account_innerkits" ] -@@ -217,12 +217,9 @@ if (defined(ohos_lite)) { - "//utils/native/base:utils", - ] - -- external_deps = [ -- "access_token:libaccesstoken_sdk", -- "hiviewdfx_hilog_native:libhilog", -- "ipc:ipc_core", -- "safwk:system_ability_fwk", -- "samgr_standard:samgr_proxy", -+ deps += [ -+ "//depend:libhilog", -+ "//depend/ipc:ipc_core", - ] - } - -@@ -268,11 +265,9 @@ if (defined(ohos_lite)) { - "//third_party/cJSON:cjson_static", - ] - -- external_deps = [ -- "access_token:libaccesstoken_sdk", -- "hiviewdfx_hilog_native:libhilog", -- "ipc:ipc_core", -- "samgr_standard:samgr_proxy", -+ deps += [ -+ "//depend:libhilog", -+ "//depend/ipc:ipc_core", - ] - } - } --- -2.25.1 - diff --git a/dsoftbus/hichain/deviceauth/security_device_auth-OpenHarmony-v3.1.2-Release.zip b/dsoftbus/hichain/deviceauth/security_device_auth-OpenHarmony-v3.1.2-Release.zip deleted file mode 100644 index f0cbe1565a5dfda760c6b73661510795314286fe..0000000000000000000000000000000000000000 Binary files a/dsoftbus/hichain/deviceauth/security_device_auth-OpenHarmony-v3.1.2-Release.zip and /dev/null differ diff --git a/dsoftbus/hichain/huks/0001-support-huks-for-openeuler.patch b/dsoftbus/hichain/huks/0001-support-huks-for-openeuler.patch deleted file mode 100644 index ebeb757fdb3b64b4c5eb00b3cb0cfb584b240c25..0000000000000000000000000000000000000000 --- a/dsoftbus/hichain/huks/0001-support-huks-for-openeuler.patch +++ /dev/null @@ -1,236 +0,0 @@ -From c7fe7e1422af2a0b4fdbd7e514f8b8c6054170e8 Mon Sep 17 00:00:00 2001 -From: "beiling.xie" -Date: Tue, 19 Jul 2022 21:01:41 +0800 -Subject: [PATCH] support huks for openeuler - -Signed-off-by: beiling.xie ---- - frameworks/huks_standard/main/BUILD.gn | 1 + - .../huks_standard/main/core/src/hks_verifier.c | 10 ++++++---- - .../crypto_engine/openssl/src/hks_openssl_kdf.c | 4 +++- - .../huks_standard/main/os_dependency/BUILD.gn | 15 ++++++++++----- - .../main/os_dependency/log/hks_log.c | 14 +++++++------- - interfaces/innerkits/huks_standard/main/BUILD.gn | 1 + - .../huks_service/main/os_dependency/BUILD.gn | 2 +- - .../huks_service/main/os_dependency/idl/BUILD.gn | 6 +++--- - utils/file_operator/hks_file_operator.c | 6 +++--- - 9 files changed, 35 insertions(+), 24 deletions(-) - -diff --git a/frameworks/huks_standard/main/BUILD.gn b/frameworks/huks_standard/main/BUILD.gn -index 83d7750..cd899cd 100755 ---- a/frameworks/huks_standard/main/BUILD.gn -+++ b/frameworks/huks_standard/main/BUILD.gn -@@ -20,6 +20,7 @@ group("huks_standard_frameworks") { - "//base/security/huks/frameworks/huks_standard/main/core:libhuks_core_standard_static", - "//base/security/huks/frameworks/huks_standard/main/crypto_engine:libhuks_crypto_engine_standard_static", - "//base/security/huks/frameworks/huks_standard/main/os_dependency:libhuks_os_dependency_standard_static", -+ "//base/security/huks/services/huks_standard/huks_service/main/os_dependency:libhuks_service_os_dependency_standard_static", - ] - } - } -diff --git a/frameworks/huks_standard/main/core/src/hks_verifier.c b/frameworks/huks_standard/main/core/src/hks_verifier.c -index 149137d..a65f27e 100755 ---- a/frameworks/huks_standard/main/core/src/hks_verifier.c -+++ b/frameworks/huks_standard/main/core/src/hks_verifier.c -@@ -250,8 +250,9 @@ static int32_t ExtractTlvLength(const uint8_t *in, uint32_t inLen, uint32_t *hea - uint8_t *buf = (uint8_t *)in; - uint32_t length = 0; /* length of the payload */ - -- uint32_t tmp; -- HKS_ASN1_DECODE_BYTE(buf, tmp); /* get type */ -+// uint32_t tmp; -+// HKS_ASN1_DECODE_BYTE(buf, tmp); /* get type */ -+ buf++; - if (buf[0] < ASN_1_MIN_VAL_1_EXTRA_LEN_BYTE) { - /* Current byte tells the length */ - HKS_ASN1_DECODE_BYTE(buf, length); -@@ -301,8 +302,9 @@ static int32_t ExtractTlvData(const uint8_t *in, uint32_t inLen, uint8_t *out, u - uint8_t *buf = (uint8_t *)in; - uint32_t length = 0; /* length of the payload */ - -- uint32_t tmp; -- HKS_ASN1_DECODE_BYTE(buf, tmp); /* get type */ -+// uint32_t tmp; -+// HKS_ASN1_DECODE_BYTE(buf, tmp); /* get type */ -+ buf++; - if (buf[0] < ASN_1_MIN_VAL_1_EXTRA_LEN_BYTE) { - /* Current byte tells the length */ - HKS_ASN1_DECODE_BYTE(buf, length); -diff --git a/frameworks/huks_standard/main/crypto_engine/openssl/src/hks_openssl_kdf.c b/frameworks/huks_standard/main/crypto_engine/openssl/src/hks_openssl_kdf.c -index 258b206..5db3e4d 100755 ---- a/frameworks/huks_standard/main/crypto_engine/openssl/src/hks_openssl_kdf.c -+++ b/frameworks/huks_standard/main/crypto_engine/openssl/src/hks_openssl_kdf.c -@@ -57,6 +57,7 @@ int32_t HksOpensslHkdf(const struct HksBlob *mainKey, const struct HksKeySpec *d - EVP_PKEY_CTX *pctx; - pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL); - int32_t ret = HKS_FAILURE; -+ - do { - if (EVP_PKEY_derive_init(pctx) <= 0) { - HksLogOpensslError(); -@@ -78,7 +79,8 @@ int32_t HksOpensslHkdf(const struct HksBlob *mainKey, const struct HksKeySpec *d - HksLogOpensslError(); - break; - } -- if (EVP_PKEY_derive(pctx, derivedKey->data, (size_t *)&derivedKey->size) <= 0) { -+ size_t new = derivedKey->size; -+ if (EVP_PKEY_derive(pctx, derivedKey->data, &new) <= 0) { - HksLogOpensslError(); - break; - } -diff --git a/frameworks/huks_standard/main/os_dependency/BUILD.gn b/frameworks/huks_standard/main/os_dependency/BUILD.gn -index 7d03e55..6da94a5 100755 ---- a/frameworks/huks_standard/main/os_dependency/BUILD.gn -+++ b/frameworks/huks_standard/main/os_dependency/BUILD.gn -@@ -26,6 +26,8 @@ ohos_static_library("libhuks_os_dependency_standard_static") { - public_configs = [ ":huks_config" ] - include_dirs = [ - "log", -+ "sysinfo/include", -+ "../../../../services/huks_standard/huks_service/main/core/include/", - "//utils/native/base/include", - "//utils/system/safwk/native/include", - ] -@@ -35,17 +37,20 @@ ohos_static_library("libhuks_os_dependency_standard_static") { - "_HUKS_LOG_ENABLE_", - ] - sources = [ -- "./ipc/src/hks_client_service_ipc.c", -- "./ipc/src/hks_ipc_check.c", -- "./ipc/src/hks_ipc_serialization.c", -- "./ipc/src/hks_ipc_slice.c", -- "./ipc/src/hks_request.cpp", -+# "./ipc/src/hks_client_service_ipc.c", -+# "./ipc/src/hks_ipc_check.c", -+# "./ipc/src/hks_ipc_serialization.c", -+# "./ipc/src/hks_ipc_slice.c", -+# "./ipc/src/hks_request.cpp", -+ "./ipc/src/hks_client_service_passthrough.c", -+ "./sysinfo/src/hks_get_process_info_passthrough.c", - "./log/hks_log.c", - "./posix/hks_mem.c", - ] - deps = [ - "//base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static", - "//utils/native/base:utils", -+ "//third_party/bounds_checking_function:libsec_shared", - ] - external_deps = [ - "hiviewdfx_hilog_native:libhilog", -diff --git a/frameworks/huks_standard/main/os_dependency/log/hks_log.c b/frameworks/huks_standard/main/os_dependency/log/hks_log.c -index ef7d264..5beadab 100755 ---- a/frameworks/huks_standard/main/os_dependency/log/hks_log.c -+++ b/frameworks/huks_standard/main/os_dependency/log/hks_log.c -@@ -22,8 +22,8 @@ - - #undef LOG_DOMAIN - #undef LOG_TAG --static const unsigned int LOG_DOMAIN = 0xD002F01; --static const char* LOG_TAG = "HUKS"; -+//static const unsigned int LOG_DOMAIN = 0xD002F01; -+//static const char* LOG_TAG = "HUKS"; - - #define MAX_LOG_BUFF_LEN 512 - -@@ -48,16 +48,16 @@ void HksLog(uint32_t logLevel, const char *funcName, uint32_t lineNo, const char - - switch (logLevel) { - case HKS_LOG_LEVEL_I: -- HILOG_INFO(LOG_CORE, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); -+ HILOG_INFO(LOG_CORE, "%s[%u]: %s\n", funcName, lineNo, buf); - break; - case HKS_LOG_LEVEL_E: -- HILOG_ERROR(LOG_CORE, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); -+ HILOG_ERROR(LOG_CORE, "%s[%u]: %s\n", funcName, lineNo, buf); - break; - case HKS_LOG_LEVEL_W: -- HILOG_WARN(LOG_CORE, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); -+ HILOG_WARN(LOG_CORE, "%s[%u]: %s\n", funcName, lineNo, buf); - break; - case HKS_LOG_LEVEL_D: -- HILOG_DEBUG(LOG_CORE, "%{public}s[%{public}u]: %{private}s\n", funcName, lineNo, buf); -+ HILOG_DEBUG(LOG_CORE, "%s[%u]: %s\n", funcName, lineNo, buf); - break; - default: - HKS_FREE_PTR(buf); -@@ -65,4 +65,4 @@ void HksLog(uint32_t logLevel, const char *funcName, uint32_t lineNo, const char - } - - HKS_FREE_PTR(buf); --} -\ No newline at end of file -+} -diff --git a/interfaces/innerkits/huks_standard/main/BUILD.gn b/interfaces/innerkits/huks_standard/main/BUILD.gn -index 1ca1e02..88e620d 100755 ---- a/interfaces/innerkits/huks_standard/main/BUILD.gn -+++ b/interfaces/innerkits/huks_standard/main/BUILD.gn -@@ -41,6 +41,7 @@ if (os_level == "standard") { - deps = [ - "//base/security/huks/frameworks/huks_standard/main:huks_standard_frameworks", - "//base/security/huks/utils/crypto_adapter:libhuks_utils_client_service_adapter_static", -+ "//base/security/huks/services/huks_standard/huks_engine/main/core:huks_engine_core_standard", - ] - } - } -diff --git a/services/huks_standard/huks_service/main/os_dependency/BUILD.gn b/services/huks_standard/huks_service/main/os_dependency/BUILD.gn -index 931d20c..01078b7 100755 ---- a/services/huks_standard/huks_service/main/os_dependency/BUILD.gn -+++ b/services/huks_standard/huks_service/main/os_dependency/BUILD.gn -@@ -34,7 +34,7 @@ ohos_static_library("libhuks_service_os_dependency_standard_static") { - ] - sources = [ - "posix/hks_rwlock.c", -- "sa/hks_sa.cpp", -+# "sa/hks_sa.cpp", - ] - deps = [ - "//base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static", -diff --git a/services/huks_standard/huks_service/main/os_dependency/idl/BUILD.gn b/services/huks_standard/huks_service/main/os_dependency/idl/BUILD.gn -index e86a491..3ffcfa1 100755 ---- a/services/huks_standard/huks_service/main/os_dependency/idl/BUILD.gn -+++ b/services/huks_standard/huks_service/main/os_dependency/idl/BUILD.gn -@@ -32,9 +32,9 @@ ohos_static_library("libhuks_service_idl_standard_static") { - "_HUKS_LOG_ENABLE_", - ] - sources = [ -- "ipc/hks_ipc_serialization.c", -- "ipc/hks_ipc_service.c", -- "ipc/hks_response.cpp", -+# "ipc/hks_ipc_serialization.c", -+# "ipc/hks_ipc_service.c", -+# "ipc/hks_response.cpp", - "passthrough/huks_access.c", - "passthrough/huks_core_dynamic_hal.c", - ] -diff --git a/utils/file_operator/hks_file_operator.c b/utils/file_operator/hks_file_operator.c -index 5543c38..5c2e704 100755 ---- a/utils/file_operator/hks_file_operator.c -+++ b/utils/file_operator/hks_file_operator.c -@@ -93,7 +93,7 @@ static uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, ui - } - - char filePath[PATH_MAX + 1] = {0}; -- (void)realpath(fileName, filePath); -+ char *path __attribute__((unused)) = realpath(fileName, filePath); - if (strstr(filePath, "../") != NULL) { - HKS_LOG_E("invalid filePath, path %s", filePath); - return 0; -@@ -137,7 +137,7 @@ static int32_t FileWrite(const char *fileName, uint32_t offset, const uint8_t *b - if (memcpy_s(filePath, sizeof(filePath) - 1, fileName, strlen(fileName)) != EOK) { - return HKS_ERROR_BAD_STATE; - } -- (void)realpath(fileName, filePath); -+ char *path __attribute__((unused)) = realpath(fileName, filePath); - if (strstr(filePath, "../") != NULL) { - HKS_LOG_E("invalid filePath, path %s", filePath); - return HKS_ERROR_INVALID_KEY_FILE; -@@ -519,4 +519,4 @@ uint32_t HksFileSize(const char *path, const char *fileName) - int32_t HksGetFileName(const char *path, const char *fileName, char *fullFileName, uint32_t fullFileNameLen) - { - return GetFileName(path, fileName, fullFileName, fullFileNameLen); --} -\ No newline at end of file -+} --- -2.25.1 - diff --git a/dsoftbus/hichain/huks/0002-simplify-dependency-on-third-party-packages.patch b/dsoftbus/hichain/huks/0002-simplify-dependency-on-third-party-packages.patch deleted file mode 100644 index 38753e191fab0c59a15819047162e79ea00b20e0..0000000000000000000000000000000000000000 --- a/dsoftbus/hichain/huks/0002-simplify-dependency-on-third-party-packages.patch +++ /dev/null @@ -1,114 +0,0 @@ -From bda2efdae0c4df2c2d64796dd3469bc53f53604f Mon Sep 17 00:00:00 2001 -From: "beiling.xie" -Date: Thu, 10 Nov 2022 14:37:25 +0800 -Subject: [PATCH] simplify dependency on third-party packages - -Signed-off-by: beiling.xie ---- - frameworks/huks_standard/main/core/BUILD.gn | 3 ++- - .../huks_standard/main/crypto_engine/openssl/BUILD.gn | 4 +++- - frameworks/huks_standard/main/os_dependency/BUILD.gn | 7 +++---- - .../huks_service/main/os_dependency/BUILD.gn | 8 +++----- - .../huks_service/main/os_dependency/idl/BUILD.gn | 2 +- - utils/crypto_adapter/BUILD.gn | 3 ++- - 6 files changed, 14 insertions(+), 13 deletions(-) - -diff --git a/frameworks/huks_standard/main/core/BUILD.gn b/frameworks/huks_standard/main/core/BUILD.gn -index b601eda..6ac01d4 100755 ---- a/frameworks/huks_standard/main/core/BUILD.gn -+++ b/frameworks/huks_standard/main/core/BUILD.gn -@@ -40,7 +40,8 @@ ohos_static_library("libhuks_core_standard_static") { - ] - deps = [ - "//base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static", -- "//third_party/openssl:libcrypto_static", - ] -+ -+ libs = [ "crypto" ] - complete_static_lib = true - } -diff --git a/frameworks/huks_standard/main/crypto_engine/openssl/BUILD.gn b/frameworks/huks_standard/main/crypto_engine/openssl/BUILD.gn -index ab4d1a2..f02b701 100755 ---- a/frameworks/huks_standard/main/crypto_engine/openssl/BUILD.gn -+++ b/frameworks/huks_standard/main/crypto_engine/openssl/BUILD.gn -@@ -51,8 +51,10 @@ ohos_static_library("libhuks_openssl_standard_static") { - - deps = [ - "//base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static", -- "//third_party/openssl:libcrypto_static", - ] -+ -+ libs = [ "crypto" ] -+ - cflags = [ - "-DHILOG_ENABLE", - "-Wall", -diff --git a/frameworks/huks_standard/main/os_dependency/BUILD.gn b/frameworks/huks_standard/main/os_dependency/BUILD.gn -index 6da94a5..bfe2941 100755 ---- a/frameworks/huks_standard/main/os_dependency/BUILD.gn -+++ b/frameworks/huks_standard/main/os_dependency/BUILD.gn -@@ -52,10 +52,9 @@ ohos_static_library("libhuks_os_dependency_standard_static") { - "//utils/native/base:utils", - "//third_party/bounds_checking_function:libsec_shared", - ] -- external_deps = [ -- "hiviewdfx_hilog_native:libhilog", -- "ipc:ipc_core", -- "samgr_standard:samgr_proxy", -+ deps += [ -+ "//depend:libhilog", -+ "//depend/ipc:ipc_core", - ] - cflags_cc = [ - "-DHILOG_ENABLE", -diff --git a/services/huks_standard/huks_service/main/os_dependency/BUILD.gn b/services/huks_standard/huks_service/main/os_dependency/BUILD.gn -index 01078b7..dfa2c4f 100755 ---- a/services/huks_standard/huks_service/main/os_dependency/BUILD.gn -+++ b/services/huks_standard/huks_service/main/os_dependency/BUILD.gn -@@ -43,11 +43,9 @@ ohos_static_library("libhuks_service_os_dependency_standard_static") { - ] - public_deps = [ "//base/security/huks/services/huks_standard/huks_service/main/os_dependency/idl:libhuks_service_idl_standard_static" ] - -- external_deps = [ -- "hiviewdfx_hilog_native:libhilog", -- "ipc:ipc_core", -- "safwk:system_ability_fwk", -- "samgr_standard:samgr_proxy", -+ deps += [ -+ "//depend:libhilog", -+ "//depend/ipc:ipc_core", - ] - if (support_jsapi) { - sources += [ "sa/hks_event_observer.cpp" ] -diff --git a/services/huks_standard/huks_service/main/os_dependency/idl/BUILD.gn b/services/huks_standard/huks_service/main/os_dependency/idl/BUILD.gn -index 3ffcfa1..0650b2c 100755 ---- a/services/huks_standard/huks_service/main/os_dependency/idl/BUILD.gn -+++ b/services/huks_standard/huks_service/main/os_dependency/idl/BUILD.gn -@@ -43,7 +43,7 @@ ohos_static_library("libhuks_service_idl_standard_static") { - "//base/security/huks/services/huks_standard/huks_service/main/core:libhuks_service_core_standard_static", - "//utils/native/base:utils", - ] -- external_deps = [ "ipc:ipc_core" ] -+ deps += [ "//depend/ipc:ipc_core" ] - if (support_jsapi) { - external_deps += [ - "access_token:libaccesstoken_sdk", -diff --git a/utils/crypto_adapter/BUILD.gn b/utils/crypto_adapter/BUILD.gn -index 0ca8f61..7d28eea 100755 ---- a/utils/crypto_adapter/BUILD.gn -+++ b/utils/crypto_adapter/BUILD.gn -@@ -39,9 +39,10 @@ ohos_static_library("libhuks_utils_client_service_adapter_static") { - deps = [ - "//base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static", - "//base/security/huks/frameworks/huks_standard/main/os_dependency:libhuks_os_dependency_standard_static", -- "//third_party/openssl:libcrypto_static", - "//utils/native/base:utils", - ] - -+ libs = [ "crypto" ] -+ - complete_static_lib = true - } --- -2.25.1 - diff --git a/dsoftbus/hichain/huks/security_huks-OpenHarmony-v3.1.2-Release.zip b/dsoftbus/hichain/huks/security_huks-OpenHarmony-v3.1.2-Release.zip deleted file mode 100644 index 28c08b993cceea355b928796df9ca58ae4af20ba..0000000000000000000000000000000000000000 Binary files a/dsoftbus/hichain/huks/security_huks-OpenHarmony-v3.1.2-Release.zip and /dev/null differ diff --git a/dsoftbus/productdefine/common/base/standard_system.json b/dsoftbus/productdefine/common/base/standard_system.json deleted file mode 100755 index 0967ef424bce6791893e9a57bb952f80fd536e93..0000000000000000000000000000000000000000 --- a/dsoftbus/productdefine/common/base/standard_system.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/dsoftbus/productdefine/common/device/openEuler.json b/dsoftbus/productdefine/common/device/openEuler.json deleted file mode 100755 index 65141d8e3eae1d03da34193ededb5875167025a6..0000000000000000000000000000000000000000 --- a/dsoftbus/productdefine/common/device/openEuler.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "device_name": "openEuler", - "device_company": "hisilicon", - "target_os": "ohos", - "target_cpu": "arm64", - "kernel_version": "", - "device_build_path": "device/hisilicon/build" -} diff --git a/dsoftbus/productdefine/common/products/openEuler.json b/dsoftbus/productdefine/common/products/openEuler.json deleted file mode 100755 index 1f5f2892cfdb9b38077a0e93dd43d2549f87cb07..0000000000000000000000000000000000000000 --- a/dsoftbus/productdefine/common/products/openEuler.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "product_name": "openEuler", - "product_company": "hisilicon", - "product_device": "openEuler", - "version": "2.0", - "type": "standard", - "product_build_path": "device/hisilicon/build", - "parts": { - "communication:dsoftbus_standard": {}, - "security:huks_standard": {}, - "security:deviceauth_standard": {}, - "depend:hiviewdfx_hilog_native": {}, - "depend:ipc": {}, - "depend:ces_standard": {}, - "depend:aafwk_standard": {}, - "depend:appexecfwk_standard": {}, - "depend:permission_standard": {}, - "depend:safwk": {}, - "depend:samgr_L2": {}, - "depend:samgr_standard": {}, - "depend:access_token": {} - } -} diff --git a/dsoftbus/third_party/bounds_checking_function/0001-Adaptation-for-dsoftbus.patch b/dsoftbus/third_party/bounds_checking_function/0001-Adaptation-for-dsoftbus.patch deleted file mode 100644 index e57ae485f2723d2682780ec833b4abbc47d3d84b..0000000000000000000000000000000000000000 --- a/dsoftbus/third_party/bounds_checking_function/0001-Adaptation-for-dsoftbus.patch +++ /dev/null @@ -1,134 +0,0 @@ -From f3054acbbb67d6e4889f3a7c2641dc1d74ee1984 Mon Sep 17 00:00:00 2001 -From: "beiling.xie" -Date: Tue, 20 Sep 2022 09:45:38 +0800 -Subject: [PATCH] Adaptation for dsoftbus - -Signed-off-by: beiling.xie ---- - BUILD.gn | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 114 insertions(+) - create mode 100644 BUILD.gn - -diff --git a/BUILD.gn b/BUILD.gn -new file mode 100644 -index 0000000..9bec199 ---- /dev/null -+++ b/BUILD.gn -@@ -0,0 +1,114 @@ -+# Copyright (c) 2021 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. -+ -+if (defined(ohos_lite)) { -+ import("//build/lite/config/component/lite_component.gni") -+ import("//build/lite/ndk/ndk.gni") -+} else { -+ import("//build/ohos.gni") -+} -+ -+config("libsec_public_config") { -+ include_dirs = [ "include" ] -+} -+ -+libsec_sources = [ -+ "src/fscanf_s.c", -+ "src/fwscanf_s.c", -+ "src/gets_s.c", -+ "src/memcpy_s.c", -+ "src/memmove_s.c", -+ "src/memset_s.c", -+ "src/scanf_s.c", -+ "src/securecutil.c", -+ "src/secureinput_a.c", -+ "src/secureinput_w.c", -+ "src/secureprintoutput_a.c", -+ "src/secureprintoutput_w.c", -+ "src/snprintf_s.c", -+ "src/sprintf_s.c", -+ "src/sscanf_s.c", -+ "src/strcat_s.c", -+ "src/strcpy_s.c", -+ "src/strncat_s.c", -+ "src/strncpy_s.c", -+ "src/strtok_s.c", -+ "src/swprintf_s.c", -+ "src/swscanf_s.c", -+ "src/vfscanf_s.c", -+ "src/vfwscanf_s.c", -+ "src/vscanf_s.c", -+ "src/vsnprintf_s.c", -+ "src/vsprintf_s.c", -+ "src/vsscanf_s.c", -+ "src/vswprintf_s.c", -+ "src/vswscanf_s.c", -+ "src/vwscanf_s.c", -+ "src/wcscat_s.c", -+ "src/wcscpy_s.c", -+ "src/wcsncat_s.c", -+ "src/wcsncpy_s.c", -+ "src/wcstok_s.c", -+ "src/wmemcpy_s.c", -+ "src/wmemmove_s.c", -+ "src/wscanf_s.c", -+] -+ -+if (defined(ohos_lite)) { -+ lite_library("libsec_static") { -+ target_type = "static_library" -+ sources = libsec_sources -+ public_configs = [ ":libsec_public_config" ] -+ } -+ lite_library("libsec_shared") { -+ target_type = "shared_library" -+ sources = libsec_sources -+ public_configs = [ ":libsec_public_config" ] -+ } -+ group("sec_shared") { -+ deps = [ ":libsec_shared" ] -+ } -+ ndk_lib("libsec_ndk") { -+ lib_extension = ".so" -+ deps = [ ":sec_shared" ] -+ head_files = [ "inlcude" ] -+ } -+} else { -+ ohos_static_library("libsec_static") { -+ sources = libsec_sources -+ public_configs = [ ":libsec_public_config" ] -+ cflags = [ -+ "-D_INC_STRING_S", -+ "-D_INC_WCHAR_S", -+ "-D_SECIMP=//", -+ "-D_STDIO_S_DEFINED", -+ "-D_INC_STDIO_S", -+ "-D_INC_STDLIB_S", -+ "-D_INC_MEMORY_S", -+ ] -+ } -+ -+ ohos_shared_library("libsec_shared") { -+ sources = libsec_sources -+ public_configs = [ ":libsec_public_config" ] -+ cflags = [ -+ "-D_INC_STRING_S", -+ "-D_INC_WCHAR_S", -+ "-D_SECIMP=//", -+ "-D_STDIO_S_DEFINED", -+ "-D_INC_STDIO_S", -+ "-D_INC_STDLIB_S", -+ "-D_INC_MEMORY_S", -+ ] -+ } -+} --- -2.25.1 - diff --git a/dsoftbus/third_party/cJSON/0001-adapter-cjson-in-openEuler-for-softbus.patch b/dsoftbus/third_party/cJSON/0001-adapter-cjson-in-openEuler-for-softbus.patch deleted file mode 100644 index fab0cd76e7938f1b50e424244323be0de3a00112..0000000000000000000000000000000000000000 --- a/dsoftbus/third_party/cJSON/0001-adapter-cjson-in-openEuler-for-softbus.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 7100861f832c43ef9b272666989f3ffd5107bc7a Mon Sep 17 00:00:00 2001 -From: "beiling.xie" -Date: Thu, 10 Nov 2022 11:04:23 +0800 -Subject: [PATCH] adapter cjson in openEuler for softbus - -Signed-off-by: beiling.xie ---- - BUILD.gn | 26 ++++++++++++++++++++++++++ - 1 file changed, 26 insertions(+) - create mode 100755 BUILD.gn - -diff --git a/BUILD.gn b/BUILD.gn -new file mode 100755 -index 0000000..b15e1db ---- /dev/null -+++ b/BUILD.gn -@@ -0,0 +1,26 @@ -+#Copyright (c) 2019-2021 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("cJSON_config") { -+ include_dirs = [ "." ] -+} -+ohos_static_library("cjson_static") { -+ sources = [ "cJSON.c" ] -+ public_configs = [ ":cJSON_config" ] -+} -+ohos_shared_library("cjson") { -+ deps = [ ":cjson_static" ] -+ public_configs = [ ":cJSON_config" ] -+ subsystem_name = "hiviewdfx" -+} --- -2.25.1 - diff --git a/dsoftbus/third_party/libcoap/third_party_libcoap-OpenHarmony-v3.0.2-LTS.zip b/dsoftbus/third_party/libcoap/third_party_libcoap-OpenHarmony-v3.0.2-LTS.zip deleted file mode 100644 index 66f4ff6233104d7b85da2b1943028ac0cf747ab2..0000000000000000000000000000000000000000 Binary files a/dsoftbus/third_party/libcoap/third_party_libcoap-OpenHarmony-v3.0.2-LTS.zip and /dev/null differ diff --git a/dsoftbus/third_party/libcoap/third_party_libcoap-OpenHarmony-v3.1.2-Release.zip b/dsoftbus/third_party/libcoap/third_party_libcoap-OpenHarmony-v3.1.2-Release.zip deleted file mode 100644 index 583618775d560b95f6cb0a6733daba097bb410fe..0000000000000000000000000000000000000000 Binary files a/dsoftbus/third_party/libcoap/third_party_libcoap-OpenHarmony-v3.1.2-Release.zip and /dev/null differ diff --git a/dsoftbus/third_party/mbedtls/0001-Adaptation-for-dsoftbus-v3.1.2.patch b/dsoftbus/third_party/mbedtls/0001-Adaptation-for-dsoftbus-v3.1.2.patch deleted file mode 100644 index afe75d4bd22d88609d7e9360633b1f8b4e27d6ae..0000000000000000000000000000000000000000 --- a/dsoftbus/third_party/mbedtls/0001-Adaptation-for-dsoftbus-v3.1.2.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/BUILD.gn -+++ b/BUILD.gn -@@ -117,12 +117,13 @@ if (defined(ohos_lite)) { - ohos_shared_library("mbedtls_shared") { - public_configs = [ ":mbedtls_config" ] - output_name = "mbedtls" -- subsystem_name = "common" -+ subsystem_name = "communication" - part_name = "dsoftbus_standard" - sources = MBEDTLS_SOURCES - } - - group("mbedtls") { -+ public_configs = [ ":mbedtls_config" ] - public_deps = [ ":mbedtls_shared" ] - } - } diff --git a/dsoftbus/third_party/mbedtls/0002-fix-CVE-2021-43666.patch b/dsoftbus/third_party/mbedtls/0002-fix-CVE-2021-43666.patch deleted file mode 100644 index 4a2cb68b776cabbbf24b1edefb1114d039a2c988..0000000000000000000000000000000000000000 --- a/dsoftbus/third_party/mbedtls/0002-fix-CVE-2021-43666.patch +++ /dev/null @@ -1,409 +0,0 @@ -From: maoyufeng -Date: Mon, 23 May 2022 14:57:48 +0800 -Subject: [PATCH] Fix issue CVE-2021-43666 - -Signed-off-by: maoyufeng ---- - ChangeLog.d/fix-pkcs12-null-password.txt | 5 ++ - include/mbedtls/pkcs12.h | 34 ++++++---- - library/pkcs12.c | 82 ++++++++++++++++++------ - tests/CMakeLists.txt | 1 + - tests/scripts/all.sh | 30 +++++++++ - tests/suites/test_suite_pkcs12.data | 35 ++++++++++ - tests/suites/test_suite_pkcs12.function | 68 ++++++++++++++++++++ - 7 files changed, 223 insertions(+), 32 deletions(-) - create mode 100644 ChangeLog.d/fix-pkcs12-null-password.txt - mode change 100755 => 100644 library/pkcs12.c - create mode 100644 tests/suites/test_suite_pkcs12.data - create mode 100644 tests/suites/test_suite_pkcs12.function - -diff --git a/ChangeLog.d/fix-pkcs12-null-password.txt b/ChangeLog.d/fix-pkcs12-null-password.txt -new file mode 100644 -index 0000000000000000000000000000000000000000..a6ce140fdc3479cfac671542692ab646f7c8b5f3 ---- /dev/null -+++ b/ChangeLog.d/fix-pkcs12-null-password.txt -@@ -0,0 +1,5 @@ -+Bugfix -+ * Fix a potential invalid pointer dereference and infinite loop bugs in -+ pkcs12 functions when the password is empty. Fix the documentation to -+ better describe the inputs to these functions and their possible values. -+ Fixes #5136. -\ No newline at end of file -diff --git a/include/mbedtls/pkcs12.h b/include/mbedtls/pkcs12.h -index 9cbcb1730559bb7d3a22a378467b9f6aa1b1c3fa..9e11e24a8d07b9e377fd49d9206fd300330bcdbf 100755 ---- a/include/mbedtls/pkcs12.h -+++ b/include/mbedtls/pkcs12.h -@@ -83,8 +83,9 @@ extern "C" { - * \brief PKCS12 Password Based function (encryption / decryption) - * for pbeWithSHAAnd128BitRC4 - * -- * \param pbe_params an ASN1 buffer containing the pkcs-12PbeParams structure -- * \param mode either MBEDTLS_PKCS12_PBE_ENCRYPT or MBEDTLS_PKCS12_PBE_DECRYPT -+ * \param pbe_params an ASN1 buffer containing the pkcs-12 PbeParams structure -+ * \param mode either #MBEDTLS_PKCS12_PBE_ENCRYPT or -+ * #MBEDTLS_PKCS12_PBE_DECRYPT - * \param pwd the password used (may be NULL if no password is used) - * \param pwdlen length of the password (may be 0) - * \param input the input data -@@ -105,8 +106,9 @@ int mbedtls_pkcs12_pbe_sha1_rc4_128( mbedtls_asn1_buf *pbe_params, int mode, - * \param pbe_params an ASN1 buffer containing the pkcs-12PbeParams structure - * \param mode either MBEDTLS_PKCS12_PBE_ENCRYPT or MBEDTLS_PKCS12_PBE_DECRYPT - * \param cipher_type the cipher used -- * \param md_type the mbedtls_md used -- * \param pwd the password used (may be NULL if no password is used) -+ * \param md_type the mbedtls_md used -+ * \param pwd Latin1-encoded password used. This may only be \c NULL when -+ * \p pwdlen is 0. No null terminator should be used. - * \param pwdlen length of the password (may be 0) - * \param input the input data - * \param len data length -@@ -127,18 +129,24 @@ int mbedtls_pkcs12_pbe( mbedtls_asn1_buf *pbe_params, int mode, - * to produce pseudo-random bits for a particular "purpose". - * - * Depending on the given id, this function can produce an -- * encryption/decryption key, an nitialization vector or an -+ * encryption/decryption key, an initialization vector or an - * integrity key. - * - * \param data buffer to store the derived data in -- * \param datalen length to fill -- * \param pwd password to use (may be NULL if no password is used) -- * \param pwdlen length of the password (may be 0) -- * \param salt salt buffer to use -- * \param saltlen length of the salt -- * \param mbedtls_md mbedtls_md type to use during the derivation -- * \param id id that describes the purpose (can be MBEDTLS_PKCS12_DERIVE_KEY, -- * MBEDTLS_PKCS12_DERIVE_IV or MBEDTLS_PKCS12_DERIVE_MAC_KEY) -+ * \param datalen length of buffer to fill -+ * \param pwd The password to use. For compliance with PKCS#12 §B.1, this -+ * should be a BMPString, i.e. a Unicode string where each -+ * character is encoded as 2 bytes in big-endian order, with -+ * no byte order mark and with a null terminator (i.e. the -+ * last two bytes should be 0x00 0x00). -+ * \param pwdlen length of the password (may be 0). -+ * \param salt Salt buffer to use This may only be \c NULL when -+ * \p saltlen is 0. -+ * \param saltlen length of the salt (may be zero) -+ * \param mbedtls_md mbedtls_md type to use during the derivation -+ * \param id id that describes the purpose (can be -+ * #MBEDTLS_PKCS12_DERIVE_KEY, #MBEDTLS_PKCS12_DERIVE_IV or -+ * #MBEDTLS_PKCS12_DERIVE_MAC_KEY) - * \param iterations number of iterations - * - * \return 0 if successful, or a MD, BIGNUM type error. -diff --git a/library/pkcs12.c b/library/pkcs12.c -old mode 100755 -new mode 100644 -index 3d23d5e354923cd01d69a479fcf572d80af540a6..05ade49e93b3d2cb8e03f7915f0ead4b79e919c4 ---- a/library/pkcs12.c -+++ b/library/pkcs12.c -@@ -209,6 +209,9 @@ int mbedtls_pkcs12_pbe( mbedtls_asn1_buf *pbe_params, int mode, - mbedtls_cipher_context_t cipher_ctx; - size_t olen = 0; - -+ if( pwd == NULL && pwdlen != 0 ) -+ return( MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA ); -+ - cipher_info = mbedtls_cipher_info_from_type( cipher_type ); - if( cipher_info == NULL ) - return( MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE ); -@@ -261,12 +264,23 @@ static void pkcs12_fill_buffer( unsigned char *data, size_t data_len, - unsigned char *p = data; - size_t use_len; - -- while( data_len > 0 ) -+ if( filler != NULL && fill_len != 0 ) - { -- use_len = ( data_len > fill_len ) ? fill_len : data_len; -- memcpy( p, filler, use_len ); -- p += use_len; -- data_len -= use_len; -+ while( data_len > 0 ) -+ { -+ use_len = ( data_len > fill_len ) ? fill_len : data_len; -+ memcpy( p, filler, use_len ); -+ p += use_len; -+ data_len -= use_len; -+ } -+ } -+ else -+ { -+ /* If either of the above are not true then clearly there is nothing -+ * that this function can do. The function should *not* be called -+ * under either of those circumstances, as you could end up with an -+ * incorrect output but for safety's sake, leaving the check in as -+ * otherwise we could end up with memory corruption.*/ - } - } - -@@ -283,6 +297,8 @@ int mbedtls_pkcs12_derivation( unsigned char *data, size_t datalen, - unsigned char hash_output[MBEDTLS_MD_MAX_SIZE]; - unsigned char *p; - unsigned char c; -+ int use_password = 0; -+ int use_salt = 0; - - size_t hlen, use_len, v, i; - -@@ -293,6 +309,15 @@ int mbedtls_pkcs12_derivation( unsigned char *data, size_t datalen, - if( datalen > 128 || pwdlen > 64 || saltlen > 64 ) - return( MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA ); - -+ if( pwd == NULL && pwdlen != 0 ) -+ return( MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA ); -+ -+ if( salt == NULL && saltlen != 0 ) -+ return( MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA ); -+ -+ use_password = ( pwd && pwdlen != 0 ); -+ use_salt = ( salt && saltlen != 0 ); -+ - md_info = mbedtls_md_info_from_type( md_type ); - if( md_info == NULL ) - return( MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE ); -@@ -310,8 +335,15 @@ int mbedtls_pkcs12_derivation( unsigned char *data, size_t datalen, - - memset( diversifier, (unsigned char) id, v ); - -- pkcs12_fill_buffer( salt_block, v, salt, saltlen ); -- pkcs12_fill_buffer( pwd_block, v, pwd, pwdlen ); -+ if( use_salt != 0 ) -+ { -+ pkcs12_fill_buffer( salt_block, v, salt, saltlen ); -+ } -+ -+ if( use_password != 0 ) -+ { -+ pkcs12_fill_buffer( pwd_block, v, pwd, pwdlen ); -+ } - - p = data; - while( datalen > 0 ) -@@ -323,11 +355,17 @@ int mbedtls_pkcs12_derivation( unsigned char *data, size_t datalen, - if( ( ret = mbedtls_md_update( &md_ctx, diversifier, v ) ) != 0 ) - goto exit; - -- if( ( ret = mbedtls_md_update( &md_ctx, salt_block, v ) ) != 0 ) -- goto exit; -+ if( use_salt != 0 ) -+ { -+ if( ( ret = mbedtls_md_update( &md_ctx, salt_block, v )) != 0 ) -+ goto exit; -+ } - -- if( ( ret = mbedtls_md_update( &md_ctx, pwd_block, v ) ) != 0 ) -- goto exit; -+ if( use_password != 0) -+ { -+ if( ( ret = mbedtls_md_update( &md_ctx, pwd_block, v )) != 0 ) -+ goto exit; -+ } - - if( ( ret = mbedtls_md_finish( &md_ctx, hash_output ) ) != 0 ) - goto exit; -@@ -355,22 +393,28 @@ int mbedtls_pkcs12_derivation( unsigned char *data, size_t datalen, - if( ++hash_block[i - 1] != 0 ) - break; - -- // salt_block += B -- c = 0; -- for( i = v; i > 0; i-- ) -+ if( use_salt != 0 ) - { -- j = salt_block[i - 1] + hash_block[i - 1] + c; -+ // salt_block += B -+ c = 0; -+ for( i = v; i > 0; i-- ) -+ { -+ j = salt_block[i - 1] + hash_block[i - 1] + c; - c = (unsigned char) (j >> 8); - salt_block[i - 1] = j & 0xFF; -+ } - } - -- // pwd_block += B -- c = 0; -- for( i = v; i > 0; i-- ) -+ if( use_password != 0 ) - { -- j = pwd_block[i - 1] + hash_block[i - 1] + c; -+ // pwd_block += B -+ c = 0; -+ for( i = v; i > 0; i-- ) -+ { -+ j = pwd_block[i - 1] + hash_block[i - 1] + c; - c = (unsigned char) (j >> 8); - pwd_block[i - 1] = j & 0xFF; -+ } - } - } - -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index a8e7523e504bc5cff9925648dd1b3bd7fb55f0cf..c5d484f924328bde2d2525b6f89e125974c3b770 100644 ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -120,6 +120,7 @@ add_test_suite(pem) - add_test_suite(pkcs1_v15) - add_test_suite(pkcs1_v21) - add_test_suite(pkcs5) -+add_test_suite(pkcs12) - add_test_suite(pk) - add_test_suite(pkparse) - add_test_suite(pkwrite) -diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh -index 1a4de44b665f8df822adbd83bece912119bca98f..00222f379e808d8662967fdf200e18739cbabe61 100755 ---- a/tests/scripts/all.sh -+++ b/tests/scripts/all.sh -@@ -1683,6 +1683,36 @@ component_test_valgrind () { - fi - } - -+support_test_cmake_out_of_source () { -+ distrib_id="" -+ distrib_ver="" -+ distrib_ver_minor="" -+ distrib_ver_major="" -+ -+ # Attempt to parse lsb-release to find out distribution and version. If not -+ # found this should fail safe (test is supported). -+ if [[ -f /etc/lsb-release ]]; then -+ -+ while read -r lsb_line; do -+ case "$lsb_line" in -+ "DISTRIB_ID"*) distrib_id=${lsb_line/#DISTRIB_ID=};; -+ "DISTRIB_RELEASE"*) distrib_ver=${lsb_line/#DISTRIB_RELEASE=};; -+ esac -+ done < /etc/lsb-release -+ -+ distrib_ver_major="${distrib_ver%%.*}" -+ distrib_ver="${distrib_ver#*.}" -+ distrib_ver_minor="${distrib_ver%%.*}" -+ fi -+ -+ # Running the out of source CMake test on Ubuntu 16.04 using more than one -+ # processor (as the CI does) can create a race condition whereby the build -+ # fails to see a generated file, despite that file actually having been -+ # generated. This problem appears to go away with 18.04 or newer, so make -+ # the out of source tests unsupported on Ubuntu 16.04. -+ [ "$distrib_id" != "Ubuntu" ] || [ "$distrib_ver_major" -gt 16 ] -+} -+ - component_test_cmake_out_of_source () { - msg "build: cmake 'out-of-source' build" - MBEDTLS_ROOT_DIR="$PWD" -diff --git a/tests/suites/test_suite_pkcs12.data b/tests/suites/test_suite_pkcs12.data -new file mode 100644 -index 0000000000000000000000000000000000000000..bda7d9921caad35c1835e0093df8a9644d4bd9cb ---- /dev/null -+++ b/tests/suites/test_suite_pkcs12.data -@@ -0,0 +1,35 @@ -+PKCS#12 derive key : MD5: Zero length password and hash -+depends_on:MBEDTLS_MD5_C -+pkcs12_derive_key:MBEDTLS_MD_MD5:48:"":USE_GIVEN_INPUT:"":USE_GIVEN_INPUT:3:"6afdcbd5ebf943272134f1c3de2dc11b6afdcbd5ebf943272134f1c3de2dc11b6afdcbd5ebf943272134f1c3de2dc11b":0 -+ -+PKCS#12 derive key: MD5: NULL password and hash -+depends_on:MBEDTLS_MD5_C -+pkcs12_derive_key:MBEDTLS_MD_MD5:48:"":USE_NULL_INPUT:"":USE_NULL_INPUT:3:"6afdcbd5ebf943272134f1c3de2dc11b6afdcbd5ebf943272134f1c3de2dc11b6afdcbd5ebf943272134f1c3de2dc11b":0 -+ -+PKCS#12 derive key: MD5: Zero length password -+depends_on:MBEDTLS_MD5_C -+pkcs12_derive_key:MBEDTLS_MD_MD5:48:"":USE_GIVEN_INPUT:"0123456789abcdef":USE_GIVEN_INPUT:3:"832d8502114fcccfd3de0c2b2863b1c45fb92a8db2ed1e704727b324adc267bdd66ae4918a81fa2d1ba15febfb9e6c4e":0 -+ -+PKCS#12 derive key: MD5: NULL password -+depends_on:MBEDTLS_MD5_C -+pkcs12_derive_key:MBEDTLS_MD_MD5:48:"":USE_NULL_INPUT:"0123456789abcdef":USE_GIVEN_INPUT:3:"832d8502114fcccfd3de0c2b2863b1c45fb92a8db2ed1e704727b324adc267bdd66ae4918a81fa2d1ba15febfb9e6c4e":0 -+ -+PKCS#12 derive key: MD5: Invalid length NULL password -+depends_on:MBEDTLS_MD5_C -+pkcs12_derive_key:MBEDTLS_MD_MD5:48:"0123456789abcdef":USE_NULL_INPUT:"0123456789abcdef":USE_GIVEN_INPUT:3:"":MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA -+ -+PKCS#12 derive key: MD5: Zero length salt -+depends_on:MBEDTLS_MD5_C -+pkcs12_derive_key:MBEDTLS_MD_MD5:48:"0123456789abcdef":USE_GIVEN_INPUT:"":USE_GIVEN_INPUT:3:"832d8502114fcccfd3de0c2b2863b1c45fb92a8db2ed1e704727b324adc267bdd66ae4918a81fa2d1ba15febfb9e6c4e":0 -+ -+PKCS#12 derive key: MD5: NULL salt -+depends_on:MBEDTLS_MD5_C -+pkcs12_derive_key:MBEDTLS_MD_MD5:48:"0123456789abcdef":USE_GIVEN_INPUT:"":USE_NULL_INPUT:3:"832d8502114fcccfd3de0c2b2863b1c45fb92a8db2ed1e704727b324adc267bdd66ae4918a81fa2d1ba15febfb9e6c4e":0 -+ -+PKCS#12 derive key: MD5: Invalid length NULL salt -+depends_on:MBEDTLS_MD5_C -+pkcs12_derive_key:MBEDTLS_MD_MD5:48:"0123456789abcdef":USE_GIVEN_INPUT:"0123456789abcdef":USE_NULL_INPUT:3:"":MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA -+ -+PKCS#12 derive key: MD5: Valid password and salt -+depends_on:MBEDTLS_MD5_C -+pkcs12_derive_key:MBEDTLS_MD_MD5:48:"0123456789abcdef":USE_GIVEN_INPUT:"0123456789abcdef":USE_GIVEN_INPUT:3:"46559deeee036836ab1b633ec620178d4c70eacf42f72a2ad7360c812efa09ca3d7567b489a109050345c2dc6a262995":0 -diff --git a/tests/suites/test_suite_pkcs12.function b/tests/suites/test_suite_pkcs12.function -new file mode 100644 -index 0000000000000000000000000000000000000000..56b896c8253b5d9734d27b0bd7cd315b3cbc7ee7 ---- /dev/null -+++ b/tests/suites/test_suite_pkcs12.function -@@ -0,0 +1,68 @@ -+/* BEGIN_HEADER */ -+#include "mbedtls/pkcs12.h" -+ -+typedef enum -+{ -+ USE_NULL_INPUT = 0, -+ USE_GIVEN_INPUT = 1, -+} input_usage_method_t; -+ -+/* END_HEADER */ -+ -+/* BEGIN_DEPENDENCIES -+ * depends_on:MBEDTLS_PKCS12_C -+ * END_DEPENDENCIES -+ */ -+ -+/* BEGIN_CASE */ -+void pkcs12_derive_key( int md_type, int key_size_arg, -+ data_t *password_arg, int password_usage, -+ data_t *salt_arg, int salt_usage, -+ int iterations, -+ data_t* expected_output, int expected_status ) -+ -+{ -+ int ret = 0; -+ unsigned char *output_data = NULL; -+ -+ unsigned char *password = NULL; -+ size_t password_len = 0; -+ unsigned char *salt = NULL; -+ size_t salt_len = 0; -+ size_t key_size = key_size_arg; -+ -+ if( password_usage == USE_GIVEN_INPUT ) -+ password = password_arg->x; -+ -+ password_len = password_arg->len; -+ -+ if( salt_usage == USE_GIVEN_INPUT ) -+ salt = salt_arg->x; -+ -+ salt_len = salt_arg->len; -+ -+ ASSERT_ALLOC( output_data, key_size ); -+ -+ ret = mbedtls_pkcs12_derivation( output_data, -+ key_size, -+ password, -+ password_len, -+ salt, -+ salt_len, -+ md_type, -+ MBEDTLS_PKCS12_DERIVE_KEY, -+ iterations ); -+ -+ TEST_EQUAL( ret, expected_status ); -+ -+ if( expected_status == 0 ) -+ { -+ ASSERT_COMPARE( expected_output->x, expected_output->len, -+ output_data, key_size ); -+ } -+ -+exit: -+ mbedtls_free( output_data ); -+ -+} -+/* END_CASE */ -\ No newline at end of file diff --git a/dsoftbus/third_party/mbedtls/0003-fix-CVE-2021-45451.patch b/dsoftbus/third_party/mbedtls/0003-fix-CVE-2021-45451.patch deleted file mode 100644 index ce1251dc5e1e0f6087b8adffb261509ebe737b73..0000000000000000000000000000000000000000 --- a/dsoftbus/third_party/mbedtls/0003-fix-CVE-2021-45451.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: =?UTF-8?q?=E6=AF=9B=E5=AE=87=E9=94=8B?= -Date: Mon, 18 Jul 2022 02:20:45 +0000 -Subject: [PATCH] [session] fix a session copy bug fix a possible double - reference on 'ticket' when peer_cert/peer_cert_digest calloc failed. - Cherry-pick from - https://github.com/Mbed-TLS/mbedtls/commit/eb490aabf6a9f47c074ec476d0d4997c2362cdbc - -Signed-off-by: maoyufeng - -diff --git a/library/ssl_tls.c b/library/ssl_tls.c -index 3c1e9175981c4c0d175af94914e4c8ebb4558fc9..962d6254353e92b8422842362f603228850184b7 100755 ---- a/library/ssl_tls.c -+++ b/library/ssl_tls.c -@@ -301,6 +301,10 @@ static int ssl_session_copy( mbedtls_ssl_session *dst, const mbedtls_ssl_session - mbedtls_ssl_session_free( dst ); - memcpy( dst, src, sizeof( mbedtls_ssl_session ) ); - -+#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_CLI_C) -+ dst->ticket = NULL; -+#endif -+ - #if defined(MBEDTLS_X509_CRT_PARSE_C) - if( src->peer_cert != NULL ) - { diff --git a/dsoftbus/third_party/mbedtls/0004-CVE-2020-36477.patch b/dsoftbus/third_party/mbedtls/0004-CVE-2020-36477.patch deleted file mode 100644 index 30539343854f93a90a491a22272e2604c54064ac..0000000000000000000000000000000000000000 --- a/dsoftbus/third_party/mbedtls/0004-CVE-2020-36477.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 533328f6a4d5af8b5c7428919920f314ab9b14f9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=E6=AF=9B=E5=AE=87=E9=94=8B?= -Date: Tue, 27 Sep 2022 07:04:14 +0000 -Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8DCVE-2020-36477?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: 毛宇锋 ---- - include/mbedtls/x509.h | 22 ++++++++++++++++++++++ - library/x509_crt.c | 21 ++++++++++++++++++++- - 2 files changed, 42 insertions(+), 1 deletion(-) - -diff --git a/include/mbedtls/x509.h b/include/mbedtls/x509.h -index 5bb9b00..87243c6 100755 ---- a/include/mbedtls/x509.h -+++ b/include/mbedtls/x509.h -@@ -131,6 +131,28 @@ - #define MBEDTLS_X509_BADCRL_BAD_PK 0x040000 /**< The CRL is signed with an unacceptable PK alg (eg RSA vs ECDSA). */ - #define MBEDTLS_X509_BADCRL_BAD_KEY 0x080000 /**< The CRL is signed with an unacceptable key (eg bad curve, RSA too short). */ - -+/* -+ * X.509 v3 Subject Alternative Name types. -+ * otherName [0] OtherName, -+ * rfc822Name [1] IA5String, -+ * dNSName [2] IA5String, -+ * x400Address [3] ORAddress, -+ * directoryName [4] Name, -+ * ediPartyName [5] EDIPartyName, -+ * uniformResourceIdentifier [6] IA5String, -+ * iPAddress [7] OCTET STRING, -+ * registeredID [8] OBJECT IDENTIFIER -+ */ -+#define MBEDTLS_X509_SAN_OTHER_NAME 0 -+#define MBEDTLS_X509_SAN_RFC822_NAME 1 -+#define MBEDTLS_X509_SAN_DNS_NAME 2 -+#define MBEDTLS_X509_SAN_X400_ADDRESS_NAME 3 -+#define MBEDTLS_X509_SAN_DIRECTORY_NAME 4 -+#define MBEDTLS_X509_SAN_EDI_PARTY_NAME 5 -+#define MBEDTLS_X509_SAN_UNIFORM_RESOURCE_IDENTIFIER 6 -+#define MBEDTLS_X509_SAN_IP_ADDRESS 7 -+#define MBEDTLS_X509_SAN_REGISTERED_ID 8 -+ - /* \} name */ - /* \} addtogroup x509_module */ - -diff --git a/library/x509_crt.c b/library/x509_crt.c -index 14c53fc..644e71c 100755 ---- a/library/x509_crt.c -+++ b/library/x509_crt.c -@@ -2452,6 +2452,25 @@ static int x509_crt_check_cn( const mbedtls_x509_buf *name, - return( -1 ); - } - -+/* -+ * Check for SAN match, see RFC 5280 Section 4.2.1.6 -+ */ -+static int x509_crt_check_san( const mbedtls_x509_buf *name, -+ const char *cn, size_t cn_len ) -+{ -+ const unsigned char san_type = (unsigned char) name->tag & -+ MBEDTLS_ASN1_TAG_VALUE_MASK; -+ -+ /* dNSName */ -+ if( san_type == MBEDTLS_X509_SAN_DNS_NAME ) -+ return( x509_crt_check_cn( name, cn, cn_len ) ); -+ -+ /* (We may handle other types here later.) */ -+ -+ /* Unrecognized type */ -+ return( -1 ); -+} -+ - /* - * Verify the requested CN - only call this if cn is not NULL! - */ -@@ -2467,7 +2486,7 @@ static void x509_crt_verify_name( const mbedtls_x509_crt *crt, - { - for( cur = &crt->subject_alt_names; cur != NULL; cur = cur->next ) - { -- if( x509_crt_check_cn( &cur->buf, cn, cn_len ) == 0 ) -+ if( x509_crt_check_san( &cur->buf, cn, cn_len ) == 0 ) - break; - } - --- -2.32.0 - diff --git a/dsoftbus/third_party/mbedtls/third_party_mbedtls-OpenHarmony-v3.1.2-Release.zip b/dsoftbus/third_party/mbedtls/third_party_mbedtls-OpenHarmony-v3.1.2-Release.zip deleted file mode 100644 index 91956e94e47c7a9635ab7d3e0a6bef05c384197c..0000000000000000000000000000000000000000 Binary files a/dsoftbus/third_party/mbedtls/third_party_mbedtls-OpenHarmony-v3.1.2-Release.zip and /dev/null differ diff --git a/dsoftbus/utils/0001-Adaptation-for-dsoftbus.patch b/dsoftbus/utils/0001-Adaptation-for-dsoftbus.patch deleted file mode 100644 index 22229bf878ee32ae9a84cc46b48043bf29d931f3..0000000000000000000000000000000000000000 --- a/dsoftbus/utils/0001-Adaptation-for-dsoftbus.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 1e7842b01138c2313b2d8d8e736f461a9690c027 Mon Sep 17 00:00:00 2001 -From: "beiling.xie" -Date: Wed, 21 Sep 2022 11:57:27 +0800 -Subject: [PATCH] Adaptation for dsoftbus - -Signed-off-by: beiling.xie ---- - base/BUILD.gn | 37 ++++--------------------------------- - base/src/parcel.cpp | 1 + - 2 files changed, 5 insertions(+), 33 deletions(-) - -diff --git a/base/BUILD.gn b/base/BUILD.gn -index 883b1ec..723627b 100644 ---- a/base/BUILD.gn -+++ b/base/BUILD.gn -@@ -38,24 +38,8 @@ config("static_utils_config") { - } - - sources_utils = [ -- "src/string_ex.cpp", -- "src/unicode_ex.cpp", -- "src/directory_ex.cpp", -- "src/datetime_ex.cpp", - "src/refbase.cpp", - "src/parcel.cpp", -- "src/semaphore_ex.cpp", -- "src/thread_pool.cpp", -- "src/file_ex.cpp", -- "src/observer.cpp", -- "src/thread_ex.cpp", -- "src/event_demultiplexer.cpp", -- "src/event_handler.cpp", -- "src/event_reactor.cpp", -- "src/timer.cpp", -- "src/timer_event_handler.cpp", -- "src/ashmem.cpp", -- "src/rwlock.cpp", - ] - - securec_sources = [ -@@ -110,21 +94,18 @@ ohos_static_library("utilsbase") { - ] - public_configs = [ ":static_utils_config" ] - defines = [ "CONFIG_HILOG" ] -- external_deps = [ "hilog_native:libhilog_base" ] - } - - ohos_shared_library("utils") { - sources = sources_utils -- sources += securec_sources - configs = [ - ":utils_config", - ":private_securec_config", - ] - public_configs = [ ":static_utils_config" ] -- subsystem_name = "utils" - defines = [ "CONFIG_HILOG" ] -- external_deps = [ "hilog_native:libhilog_base" ] -- part_name = "utils_base" -+ deps = [ "//third_party/bounds_checking_function:libsec_shared" ] -+ deps += [ "//depend:libhilog" ] - install_images = [ - "system", - "updater", -@@ -159,17 +140,7 @@ ohos_static_library("utilsecurec_ace_allplatforms") { - public_configs = [ ":static_utils_config" ] - } - --ohos_shared_library("utilsecurec_shared") { -- sources = securec_sources -- configs = [ -- ":utils_config", -- ":private_securec_config", -- ] -- public_configs = [ ":utils_config" ] -- part_name = "utils_base" -- install_images = [ -- "system", -- "updater", -- ] -+group("utilsecurec_shared") { - } -+ - ############################################################################### -diff --git a/base/src/parcel.cpp b/base/src/parcel.cpp -index 855f7cf..1abaec5 100755 ---- a/base/src/parcel.cpp -+++ b/base/src/parcel.cpp -@@ -13,6 +13,7 @@ - * limitations under the License. - */ - -+#include - #include "parcel.h" - #include "securec.h" - #include "utils_log.h" --- -2.25.1 - diff --git a/dsoftbus/utils/commonlibrary_c_utils-OpenHarmony-v3.1.2-Release.zip b/dsoftbus/utils/commonlibrary_c_utils-OpenHarmony-v3.1.2-Release.zip deleted file mode 100644 index f72030507e34304d540c03e4ac639ed10b22bb51..0000000000000000000000000000000000000000 Binary files a/dsoftbus/utils/commonlibrary_c_utils-OpenHarmony-v3.1.2-Release.zip and /dev/null differ