From 211bef7fcc6a49708acd549376cfeca3b204b1cd Mon Sep 17 00:00:00 2001 From: limerence Date: Tue, 7 May 2024 13:13:35 +0800 Subject: [PATCH] Sync ownerid enum from kernel Signed-off-by: limerence --- .../include/code_sign_attr_utils.h | 28 ++++++++++++------- .../trusted_cert_path_test.json | 4 +-- .../openharmony/dev/trusted_cert_path.json | 2 +- .../release/trusted_cert_path.json | 2 +- .../key_enable/config/trusted_cert_path.json | 2 +- .../config/trusted_cert_path_test.json | 2 +- .../invalid_structure_cert_path.json | 2 +- 7 files changed, 25 insertions(+), 17 deletions(-) diff --git a/interfaces/innerkits/code_sign_attr_utils/include/code_sign_attr_utils.h b/interfaces/innerkits/code_sign_attr_utils/include/code_sign_attr_utils.h index c2354ff..190a511 100755 --- a/interfaces/innerkits/code_sign_attr_utils/include/code_sign_attr_utils.h +++ b/interfaces/innerkits/code_sign_attr_utils/include/code_sign_attr_utils.h @@ -37,22 +37,30 @@ extern "C" { enum FileOwneridType { FILE_OWNERID_UNINT = 0, - FILE_OWNERID_SYSTEM, - FILE_OWNERID_APP, - FILE_OWNERID_DEBUG, - FILE_OWNERID_SHARED, - FILE_OWNERID_COMPAT, + FILE_OWNERID_SYSTEM, // 1 + FILE_OWNERID_APP, // 2 + FILE_OWNERID_DEBUG, // 3 + FILE_OWNERID_SHARED, // 4 + FILE_OWNERID_COMPAT, // 5 + FILE_OWNERID_EXTEND, // 6 + FILE_OWNERID_DEBUG_PLATFORM, // 7 + FILE_OWNERID_PLATFORM, // 8 + FILE_OWNERID_NWEB, // 9 FILE_OWNERID_MAX }; /* process and file ownerid types need to correspond to each other */ enum ProcessOwneridType { PROCESS_OWNERID_UNINIT = FILE_OWNERID_UNINT, - PROCESS_OWNERID_SYSTEM = FILE_OWNERID_SYSTEM, - PROCESS_OWNERID_APP = FILE_OWNERID_APP, - PROCESS_OWNERID_DEBUG = FILE_OWNERID_DEBUG, - PROCESS_OWNERID_COMPAT = FILE_OWNERID_COMPAT, - PROCESS_OWNERID_EXTEND, + PROCESS_OWNERID_SYSTEM, // 1 + PROCESS_OWNERID_APP, // 2 + PROCESS_OWNERID_DEBUG, // 3 + PROCESS_OWNERID_SHARED, // 4 + PROCESS_OWNERID_COMPAT, // 5 + PROCESS_OWNERID_EXTEND, // 6 + PROCESS_OWNERID_DEBUG_PLATFORM, // 7 + PROCESS_OWNERID_PLATFORM, // 8 + PROCESS_OWNERID_NWEB, // 9 PROCESS_OWNERID_MAX }; diff --git a/services/key_enable/config/not_sign_hap_py_path/trusted_cert_path_test.json b/services/key_enable/config/not_sign_hap_py_path/trusted_cert_path_test.json index a5c3bb3..e40fd11 100644 --- a/services/key_enable/config/not_sign_hap_py_path/trusted_cert_path_test.json +++ b/services/key_enable/config/not_sign_hap_py_path/trusted_cert_path_test.json @@ -39,14 +39,14 @@ }, { "mode":"Release", - "type":"Authed", + "type":"Platform", "subject":"ALL", "issuer":"C=CN, O=Huawei, OU=Huawei CBG, CN=Huawei CBG Software Signing Service CA Test", "max-certs-path":3 }, { "mode":"Release", - "type":"Authed", + "type":"Platform", "subject":"C=CN, O=OpenHarmony, OU=OpenHarmony Team, CN=OpenHarmony Application Release", "issuer":"C=CN, O=OpenHarmony, OU=OpenHarmony Team, CN=OpenHarmony Application CA", "max-certs-path":3 diff --git a/services/key_enable/config/openharmony/dev/trusted_cert_path.json b/services/key_enable/config/openharmony/dev/trusted_cert_path.json index 6df369b..939e972 100644 --- a/services/key_enable/config/openharmony/dev/trusted_cert_path.json +++ b/services/key_enable/config/openharmony/dev/trusted_cert_path.json @@ -46,7 +46,7 @@ }, { "mode":"Release", - "type":"Authed", + "type":"Platform", "subject":"ALL", "issuer":"C=CN, O=Huawei, OU=Huawei CBG, CN=Huawei CBG Software Signing Service CA", "max-certs-path":3 diff --git a/services/key_enable/config/openharmony/release/trusted_cert_path.json b/services/key_enable/config/openharmony/release/trusted_cert_path.json index fd49474..27b5338 100644 --- a/services/key_enable/config/openharmony/release/trusted_cert_path.json +++ b/services/key_enable/config/openharmony/release/trusted_cert_path.json @@ -46,7 +46,7 @@ }, { "mode":"Release", - "type":"Authed", + "type":"Platform", "subject":"ALL", "issuer":"C=CN, O=Huawei, OU=Huawei CBG, CN=Huawei CBG Software Signing Service CA", "max-certs-path":3 diff --git a/services/key_enable/config/trusted_cert_path.json b/services/key_enable/config/trusted_cert_path.json index 2b843e2..ad03e42 100644 --- a/services/key_enable/config/trusted_cert_path.json +++ b/services/key_enable/config/trusted_cert_path.json @@ -39,7 +39,7 @@ }, { "mode":"Release", - "type":"Authed", + "type":"Platform", "subject":"ALL", "issuer":"C=CN, O=Huawei, OU=Huawei CBG, CN=Huawei CBG Software Signing Service CA", "max-certs-path":3 diff --git a/services/key_enable/config/trusted_cert_path_test.json b/services/key_enable/config/trusted_cert_path_test.json index 0802282..5b6847d 100644 --- a/services/key_enable/config/trusted_cert_path_test.json +++ b/services/key_enable/config/trusted_cert_path_test.json @@ -39,7 +39,7 @@ }, { "mode":"Release", - "type":"Authed", + "type":"Platform", "subject":"ALL", "issuer":"C=CN, O=Huawei, OU=Huawei CBG, CN=Huawei CBG Software Signing Service CA Test", "max-certs-path":3 diff --git a/test/unittest/resources/demo_cert/cert_path/invalid_structure_cert_path.json b/test/unittest/resources/demo_cert/cert_path/invalid_structure_cert_path.json index d4ab721..7de560c 100644 --- a/test/unittest/resources/demo_cert/cert_path/invalid_structure_cert_path.json +++ b/test/unittest/resources/demo_cert/cert_path/invalid_structure_cert_path.json @@ -18,7 +18,7 @@ }, { "mode":"Release", - "type":"Authed", + "type":"Platform", "subject":"ALL", "wrong-issuer":"C=CN, O=Huawei, OU=Huawei CBG, CN=Huawei CBG Software Signing Service CA", "max-certs-path":3 -- Gitee