From b62d8c5552ba535ff362f47ddb439a549404c886 Mon Sep 17 00:00:00 2001 From: Bryce Date: Tue, 29 Jul 2025 11:34:01 +0800 Subject: [PATCH] Add build config to control user version do not authenticate Signed-off-by: Bryce --- BUILD.gn | 4 ++++ src/daemon/daemon.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index 314e788f..54a888cd 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -21,6 +21,7 @@ declare_args() { # suggestion: uv threads number from 16 - 256 hdcd_uv_thread_size = 4 hdc_uv_thread_size = 128 + hdc_ospm_auth_disable = false } hdc_common_sources = [ @@ -70,6 +71,9 @@ config("hdc_config") { cflags_cc += [ "-Wno-inconsistent-dllimport" ] # in mingw some sec api will # overwrite by utilsecurec } + if (hdc_ospm_auth_disable) { + cflags_cc += [ "-DCONFIG_HDC_OSPM_AUTH_DISABLE" ] + } } template("hdcd_source_set") { diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp index c7e63ce4..59ed93fc 100755 --- a/src/daemon/daemon.cpp +++ b/src/daemon/daemon.cpp @@ -115,6 +115,10 @@ bool HdcDaemon::GetAuthByPassValue() { // enable security string secure; +#ifdef CONFIG_HDC_OSPM_AUTH_DISABLE + WRITE_LOG(LOG_INFO, "Get param secure failed caused by hdc ospm auth disable"); + return false; +#endif if (!SystemDepend::GetDevItem("const.hdc.secure", secure)) { WRITE_LOG(LOG_INFO, "Get param secure failed"); return true; -- Gitee