adapt for deviceauth dir change

Signed-off-by: winnieHu <huyu35@huawei.com>
This commit is contained in:
winnieHu
2021-11-24 20:29:24 +08:00
parent 2d1c23bed6
commit 9677f07524
188 changed files with 461 additions and 194 deletions
+7
View File
@@ -28,7 +28,14 @@ typedef uint32_t HcBool;
#define CLIB_MAX_MALLOC_SIZE 4096 /* 4K */
#ifdef __cplusplus
extern "C" {
#endif
void *ClibMalloc(uint32_t size, char val);
void ClibFree(void *addr);
#ifdef __cplusplus
}
#endif
#endif
+7
View File
@@ -19,6 +19,10 @@
#include <stdint.h>
#include "clib_types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define PARCEL_DEFAULT_LENGTH 0
#define PARCEL_DEFAULT_ALLOC_UNIT 0
@@ -86,4 +90,7 @@ HcBool ParcelPopBack(HcParcel *parcel, uint32_t size);
HcBool ParcelPopFront(HcParcel *parcel, uint32_t size);
HcBool ParcelEraseBlock(HcParcel *parcel, uint32_t start, uint32_t data_size, void *dst);
#ifdef __cplusplus
}
#endif
#endif
+7
View File
@@ -18,6 +18,10 @@
#include "hc_parcel.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct HcString {
HcParcel parcel; // parcel data, used to storage the string data
} HcString;
@@ -97,4 +101,7 @@ HcString CreateString(void);
*/
void DeleteString(HcString *str);
#ifdef __cplusplus
}
#endif
#endif
+8
View File
@@ -26,6 +26,10 @@ typedef struct {
uint32_t length;
} Uint8Buff;
#ifdef __cplusplus
extern "C" {
#endif
/*
* Convert hex string to byte.
* @param hexStr: hex string
@@ -67,4 +71,8 @@ void ConvertToAnonymousStr(const char *originalStr, char **anonymousStr);
* @return success(0), otherwise, failure.
*/
int32_t ToUpperCase(const char *oriStr, char **desStr);
#ifdef __cplusplus
}
#endif
#endif
+25
View File
@@ -0,0 +1,25 @@
# 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.
declare_args() {
enable_group = true
enable_account = false
enable_p2p_bind_lite_protocol = true
enable_p2p_auth_lite_protocol = true
enable_p2p_bind_standard_protocol = false
enable_p2p_auth_standard_protocol = false
enable_p2p_pake_dl_prime_len_384 = true
enable_p2p_pake_dl_prime_len_256 = false
}
+25
View File
@@ -0,0 +1,25 @@
# 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.
declare_args() {
enable_group = true
enable_account = false
enable_p2p_bind_lite_protocol = true
enable_p2p_auth_lite_protocol = true
enable_p2p_bind_standard_protocol = true
enable_p2p_auth_standard_protocol = true
enable_p2p_pake_dl_prime_len_384 = true
enable_p2p_pake_dl_prime_len_256 = false
}
+25
View File
@@ -0,0 +1,25 @@
# 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.
declare_args() {
enable_group = true
enable_account = false
enable_p2p_bind_lite_protocol = true
enable_p2p_auth_lite_protocol = true
enable_p2p_bind_standard_protocol = true
enable_p2p_auth_standard_protocol = true
enable_p2p_pake_dl_prime_len_384 = true
enable_p2p_pake_dl_prime_len_256 = false
}
@@ -18,6 +18,14 @@
#include "alg_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
const AlgLoader *GetLoaderInstance(void);
#ifdef __cplusplus
}
#endif
#endif
@@ -76,6 +76,13 @@ union KeyRoleInfoUnion {
uint32_t roleInfo;
};
#ifdef __cplusplus
extern "C" {
#endif
const AlgLoader *GetRealLoaderInstance(void);
#ifdef __cplusplus
}
#endif
#endif
+16 -2
View File
@@ -18,8 +18,22 @@ key_management_adapter_path =
"${deviceauth_path}/deps_adapter/key_management_adapter"
os_adapter_path = "${deviceauth_path}/deps_adapter/os_adapter"
hals_path = "${deviceauth_path}/hals"
innerkits_path = "${deviceauth_path}/interfaces/innerkits"
frameworks_path = "${deviceauth_path}/frameworks"
services_path = "${deviceauth_path}/services"
declare_args() {
deviceauth_feature_config = "//base/security/deviceauth/default_config"
enable_soft_bus_channel = true
}
if (defined(ohos_lite)) {
if (ohos_kernel_type == "liteos_m") {
enable_soft_bus_channel = false
import("${deviceauth_feature_config}/mini/config.gni")
} else {
import("${deviceauth_feature_config}/small/config.gni")
}
} else {
import("${deviceauth_feature_config}/standard/config.gni")
}
+7
View File
@@ -84,6 +84,13 @@ typedef enum {
ACCOUNT_BIND = 5
} GroupOperationCode;
typedef enum {
AUTH_FORM_INVALID_TYPE = -1,
AUTH_FORM_ACCOUNT_UNRELATED = 0,
AUTH_FORM_IDENTICAL_ACCOUNT = 1,
AUTH_FORM_ACROSS_ACCOUNT = 2,
} GroupAuthForm;
typedef enum {
CREDENTIAL_SAVE = 0,
CREDENTIAL_CLEAR = 1,
+26 -20
View File
@@ -27,37 +27,37 @@ if (defined(ohos_lite)) {
"//third_party/cJSON",
"//utils/native/lite/include",
"//third_party/bounds_checking_function/include",
"//foundation/communication/dsoftbus/interfaces/kits/common",
"//foundation/communication/dsoftbus/interfaces/kits/transport",
"//foundation/communication/dsoftbus/interfaces/inner_kits/transport",
]
defines = [ "HILOG_ENABLE" ]
cflags = build_flags
if (ohos_kernel_type == "linux" || ohos_kernel_type == "liteos_a") {
include_dirs += [
"//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog",
"//foundation/communication/dsoftbus/interfaces/kits/common",
"//foundation/communication/dsoftbus/interfaces/kits/transport",
"//foundation/communication/dsoftbus/interfaces/inner_kits/transport",
]
sources = deviceauth_files
} else {
include_dirs +=
[ "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite" ]
sources = deviceauth_lite0_files
}
sources = deviceauth_files
deps = [
"${deps_adapter_path}:${hal_module_name}",
"//build/lite/config/component/cJSON:cjson_shared",
"//foundation/communication/dsoftbus/sdk:softbus_client",
"//utils/native/lite:utils",
]
defines = [ "HILOG_ENABLE" ]
if (enable_p2p_pake_dl_prime_len_384 == true) {
defines += [ "P2P_PAKE_DL_PRIME_LEN_384" ]
}
if (enable_p2p_pake_dl_prime_len_256 == true) {
defines += [ "P2P_PAKE_DL_PRIME_LEN_256" ]
}
cflags = build_flags
if (ohos_kernel_type == "linux" || ohos_kernel_type == "liteos_a") {
include_dirs +=
[ "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog" ]
deps += [
"//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
"//foundation/communication/dsoftbus/sdk:softbus_client",
"//third_party/bounds_checking_function:libsec_shared",
]
} else {
include_dirs +=
[ "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite" ]
deps += [ "//base/hiviewdfx/hilog_lite/frameworks/mini:hilog_lite" ]
}
}
@@ -150,8 +150,14 @@ if (defined(ohos_lite)) {
]
sources = deviceauth_files
cflags = [ "-DHILOG_ENABLE" ]
defines = []
if (enable_p2p_pake_dl_prime_len_384 == true) {
defines += [ "P2P_PAKE_DL_PRIME_LEN_384" ]
}
if (enable_p2p_pake_dl_prime_len_256 == true) {
defines += [ "P2P_PAKE_DL_PRIME_LEN_256" ]
}
cflags += build_flags
if (target_cpu == "arm") {
cflags += [ "-DBINDER_IPC_32BIT" ]
@@ -16,8 +16,6 @@
#ifndef AUTH_COMMON_H
#define AUTH_COMMON_H
#include "stdint.h"
#define AUTH_STEP "authStep"
#define DEV_ID "devId"
#define SALT "salt"
@@ -29,13 +29,6 @@
#define ECC_KEY_ALIAS "tcisEccKeyPair"
#define AUTH_CODE_ALIAS "tcisAuthCode"
#define PRINT_CHAR_ARRAY(x) do { \
for (int i = 0; i < sizeof(x); ++i) { \
printf_s("%c", x[i]); \
} \
printf_s("\n"); \
} while (0)
typedef enum {
CMD_USER_ID = 0,
CMD_DEVICE_ID,
@@ -218,7 +218,7 @@ err:
return res;
}
static int ServerBindExchangeStart(const IsoParams *params, IsoServerBindExchangeTask *task,
static int ServerBindExchangeStart(const IsoParams *params, IsoServerBindExchangeTask *task,
const CJson *in, CJson *out, int *status)
{
int res;
@@ -144,6 +144,7 @@ static int Process(struct SubTaskBaseT *task, const CJson *in, CJson *out, int *
SubTaskBase *CreatePakeClientTask(const CJson *in, CJson *out)
{
(void)out;
PakeClientTask *task = (PakeClientTask *)HcMalloc(sizeof(PakeClientTask), 0);
if (task == NULL) {
LOGE("Malloc for PakeClientTask failed.");
@@ -186,6 +186,7 @@ static int PakeClientConfirm(AsyBaseCurTask *task, PakeParams *params, const CJs
static int PakeClientVerifyConfirm(AsyBaseCurTask *task, PakeParams *params, const CJson *in, CJson *out, int *status)
{
(void)out;
int res;
if (task->taskStatus < TASK_STATUS_CLIENT_PAKE_CONFIRM) {
+284 -150
View File
@@ -13,165 +13,299 @@
import("//base/security/deviceauth/deviceauth_env.gni")
group_auth_path = "${services_path}/group_auth"
authenticators_path = "${services_path}/authenticators"
protocol_path = "${services_path}/protocol"
data_manager_path = "${services_path}/data_manager"
dev_frameworks_path = "${services_path}/frameworks"
group_manager_path = "${services_path}/group_manager"
enable_broadcast = true
inc_path = [
"${innerkits_path}",
"${frameworks_path}/inc",
"${services_path}/common/inc",
"${services_path}/common/inc/broadcast_manager",
"${services_path}/common/inc/callback_manager",
"${services_path}/common/inc/channel_manager",
"${services_path}/common/inc/channel_manager/soft_bus_channel",
"${services_path}/common/inc/data_base",
"${services_path}/common/inc/lcm_adapter",
"${services_path}/common/inc/task_manager",
"${services_path}/group_auth/inc",
"${services_path}/group_auth/inc/account_unrelated_group_auth",
"${services_path}/group_auth/inc/account_related_group_auth",
"${services_path}/group_manager/inc",
"${services_path}/module/inc",
"${services_path}/module/inc/tcis_module",
"${services_path}/module/inc/tcis_module/tcis_auth_token_manager",
"${services_path}/module/inc/das_module",
"${services_path}/module/inc/das_module/iso_task",
"${services_path}/module/inc/das_module/iso_task/iso_protocol_task",
"${services_path}/module/inc/das_module/iso_task/lite_exchange_task",
"${services_path}/module/inc/das_module/pake_task",
"${services_path}/module/inc/das_module/pake_task/new_pake_task",
"${services_path}/module/inc/das_module/pake_task/pake_task",
"${services_path}/module/inc/protocol",
"${services_path}/module/inc/protocol/pake_protocol",
"${services_path}/module/inc/protocol/pake_protocol/pake_protocol",
"${services_path}/module/inc/protocol/pake_protocol/new_pake_protocol",
"${services_path}/module/inc/protocol/iso_protocol",
"${services_path}/session/inc",
"${services_path}/session/inc/auth_session",
"${services_path}/session/inc/auth_session_lite",
"${services_path}/session/inc/bind_session",
"${services_path}/session/inc/bind_session_lite",
"${services_path}/session/inc/key_agree_session",
"${data_manager_path}/inc",
"${group_auth_path}/inc",
"${group_auth_path}/inc/account_unrelated_group_auth",
"${group_auth_path}/inc/account_related_group_auth",
"${group_auth_path}/inc/session",
"${group_auth_path}/inc/session/auth_session",
"${group_auth_path}/inc/session/auth_session_lite",
"${group_manager_path}/inc",
"${group_manager_path}/inc/broadcast_manager",
"${group_manager_path}/inc/callback_manager",
"${group_manager_path}/inc/channel_manager",
"${group_manager_path}/inc/channel_manager/soft_bus_channel",
"${group_manager_path}/inc/lcm_adapter",
"${group_manager_path}/inc/session",
"${group_manager_path}/inc/session/bind_session",
"${group_manager_path}/inc/session/bind_session_lite",
"${group_manager_path}/inc/session/key_agree_session",
"${dev_frameworks_path}/inc/",
"${dev_frameworks_path}/inc/module",
"${dev_frameworks_path}/inc/session",
"${dev_frameworks_path}/inc/task_manager",
"${authenticators_path}/inc/account_related/",
"${authenticators_path}/inc/account_related/tcis_auth_token_manager",
"${authenticators_path}/inc/account_unrelated",
"${authenticators_path}/inc/account_unrelated/iso_task",
"${authenticators_path}/inc/account_unrelated/iso_task/iso_protocol_task",
"${authenticators_path}/inc/account_unrelated/iso_task/lite_exchange_task",
"${authenticators_path}/inc/account_unrelated/pake_task",
"${authenticators_path}/inc/account_unrelated/pake_task/new_pake_task",
"${authenticators_path}/inc/account_unrelated/pake_task/pake_task",
"${protocol_path}/inc",
"${protocol_path}/inc/pake_protocol",
"${protocol_path}/inc/pake_protocol/pake_protocol",
"${protocol_path}/inc/pake_protocol/new_pake_protocol",
"${protocol_path}/inc/iso_protocol",
]
module_only_iso_files = [
"${services_path}/module/src/das_module/iso_task/iso_client_task.c",
"${services_path}/module/src/das_module/iso_task/iso_server_task.c",
"${services_path}/module/src/das_module/iso_task/iso_task_common.c",
"${services_path}/module/src/das_module/iso_task/iso_task_main.c",
"${services_path}/module/src/das_module/iso_task/iso_protocol_task/iso_client_protocol_task.c",
"${services_path}/module/src/das_module/iso_task/iso_protocol_task/iso_server_protocol_task.c",
"${services_path}/module/src/das_module/iso_task/lite_exchange_task/iso_client_bind_exchange_task.c",
"${services_path}/module/src/das_module/iso_task/lite_exchange_task/iso_client_unbind_exchange_task.c",
"${services_path}/module/src/das_module/iso_task/lite_exchange_task/iso_server_bind_exchange_task.c",
"${services_path}/module/src/das_module/iso_task/lite_exchange_task/iso_server_unbind_exchange_task.c",
"${services_path}/module/src/das_module/pake_task/pake_task_common.c",
"${services_path}/module/src/das_module/pake_task/pake_message_util.c",
"${services_path}/module/src/das_module/pake_task/new_pake_task_mock/new_pake_task_main_mock.c",
"${services_path}/module/src/das_module/pake_task/pake_task_mock/pake_task_main_mock.c",
"${services_path}/module/src/das_module/pake_task/standard_exchange_task_mock/standard_exchange_task_mock.c",
"${services_path}/module/src/protocol/protocol_common.c",
"${services_path}/module/src/protocol/pake_protocol/pake_protocol_common.c",
"${services_path}/module/src/protocol/iso_protocol/iso_protocol_common.c",
"${services_path}/module/src/protocol/pake_protocol/pake_protocol_ec_mock/pake_protocol_ec_mock.c",
"${services_path}/module/src/protocol/pake_protocol/pake_protocol_dl_mock/pake_protocol_dl_mock.c",
"${services_path}/module/src/protocol/new_pake_protocol/new_pake_protocol_ec_mock/new_pake_protocol_ec_mock.c",
"${services_path}/module/src/protocol/new_pake_protocol/new_pake_protocol_dl_mock/new_pake_protocol_dl_mock.c",
"${services_path}/module/src/tcis_module_mock/tcis_module_mock.c",
]
module_only_pake_files = [
"${services_path}/module/src/das_module/iso_task_mock/iso_task_main_mock.c",
"${services_path}/module/src/das_module/pake_task/pake_task_common.c",
"${services_path}/module/src/das_module/pake_task/pake_message_util.c",
"${services_path}/module/src/das_module/pake_task/new_pake_task_mock/new_pake_task_main_mock.c",
"${services_path}/module/src/das_module/pake_task/pake_task/pake_task_main.c",
"${services_path}/module/src/das_module/pake_task/pake_task/pake_client_task.c",
"${services_path}/module/src/das_module/pake_task/pake_task/pake_server_task.c",
"${services_path}/module/src/das_module/pake_task/pake_task/pake_protocol_task/pake_client_protocol_task.c",
"${services_path}/module/src/das_module/pake_task/pake_task/pake_protocol_task/pake_server_protocol_task.c",
"${services_path}/module/src/das_module/pake_task/pake_task/pake_protocol_task/pake_protocol_task_common.c",
"${services_path}/module/src/das_module/pake_task/standard_exchange_task/common_standard_bind_exchange.c",
"${services_path}/module/src/das_module/pake_task/standard_exchange_task/common_standard_unbind_exchange.c",
"${services_path}/module/src/das_module/pake_task/standard_exchange_task/standard_client_bind_exchange_task.c",
"${services_path}/module/src/das_module/pake_task/standard_exchange_task/standard_client_unbind_exchange_task.c",
"${services_path}/module/src/das_module/pake_task/standard_exchange_task/standard_server_bind_exchange_task.c",
"${services_path}/module/src/das_module/pake_task/standard_exchange_task/standard_server_unbind_exchange_task.c",
"${services_path}/module/src/das_module/pake_task/standard_exchange_task/das_asy_token_manager.c",
"${services_path}/module/src/das_module/pake_task/standard_exchange_task/standard_exchange_message_util.c",
"${services_path}/module/src/tcis_module_mock/tcis_module_mock.c",
"${services_path}/module/src/protocol/protocol_common.c",
"${services_path}/module/src/protocol/pake_protocol/pake_protocol_common.c",
"${services_path}/module/src/protocol/pake_protocol/pake_protocol_ec/pake_protocol_ec.c",
"${services_path}/module/src/protocol/pake_protocol/pake_protocol_dl/pake_protocol_dl.c",
"${services_path}/module/src/protocol/new_pake_protocol/new_pake_protocol_ec_mock/new_pake_protocol_ec_mock.c",
"${services_path}/module/src/protocol/new_pake_protocol/new_pake_protocol_dl_mock/new_pake_protocol_dl_mock.c",
]
channel_with_soft_bus_files = [ "${services_path}/common/src/channel_manager/soft_bus_channel/soft_bus_channel.c" ]
channel_without_soft_bus_files = [ "${services_path}/common/src/channel_manager/soft_bus_channel_mock/soft_bus_channel_mock.c" ]
deviceauth_base_files = [
deviceauth_common_files = [
"${services_path}/device_auth.c",
"${services_path}/common/src/broadcast_manager/broadcast_manager.c",
"${services_path}/common/src/callback_manager/callback_manager.c",
"${services_path}/common/src/channel_manager/channel_manager.c",
"${services_path}/common/src/data_base/database_manager.c",
"${services_path}/common/src/data_base/database_util.c",
"${services_path}/common/src/lcm_adapter_mock/lcm_adapter_mock.c",
"${services_path}/common/src/task_manager/task_manager.c",
"${services_path}/group_auth/src/group_auth_manager/group_auth_manager.c",
"${services_path}/group_auth/src/group_auth_manager/account_unrelated_group_auth/account_unrelated_group_auth.c",
"${services_path}/group_auth/src/group_auth_manager/account_related_group_auth_mock/account_related_group_auth_mock.c",
"${services_path}/group_manager/src/group_manager_common.c",
"${services_path}/group_manager/src/group_manager.c",
"${services_path}/group_manager/src/group_operation/group_operation.c",
"${services_path}/group_manager/src/group_operation/group_operation_common.c",
"${services_path}/group_manager/src/group_operation/peer_to_peer_group/peer_to_peer_group.c",
"${services_path}/group_manager/src/group_operation/across_account_group_mock/across_account_group_mock.c",
"${services_path}/group_manager/src/group_operation/identical_account_group_mock/identical_account_group_mock.c",
"${services_path}/group_manager/src/bind_peer_mock/bind_peer_mock.c",
"${services_path}/group_manager/src/key_agree_mock/key_agree_mock.c",
"${services_path}/session/src/auth_session/auth_session_client.c",
"${services_path}/session/src/auth_session/auth_session_common.c",
"${services_path}/session/src/auth_session/auth_session_server.c",
"${services_path}/session/src/auth_session/auth_session_util.c",
"${services_path}/session/src/auth_session_lite/auth_session_client_lite.c",
"${services_path}/session/src/auth_session_lite/auth_session_server_lite.c",
"${services_path}/session/src/auth_session_lite/auth_session_common_lite.c",
"${services_path}/session/src/bind_session/bind_session_client.c",
"${services_path}/session/src/bind_session/bind_session_common.c",
"${services_path}/session/src/bind_session/bind_session_server.c",
"${services_path}/session/src/bind_session_lite/bind_session_client_lite.c",
"${services_path}/session/src/bind_session_lite/bind_session_common_lite.c",
"${services_path}/session/src/bind_session_lite/bind_session_server_lite.c",
"${services_path}/session/src/key_agree_session_mock/key_agree_session_client_mock.c",
"${services_path}/session/src/key_agree_session_mock/key_agree_session_server_mock.c",
"${services_path}/session/src/auth_session_common_util.c",
"${services_path}/session/src/bind_session_common_util.c",
"${services_path}/session/src/session_common.c",
"${services_path}/session/src/session_manager.c",
"${services_path}/module/src/dev_auth_module_manager.c",
"${services_path}/module/src/module_common.c",
"${services_path}/module/src/version_util.c",
"${services_path}/module/src/das_module/das_common.c",
"${services_path}/module/src/das_module/das_module.c",
"${services_path}/module/src/das_module/task_main.c",
"${services_path}/module/src/das_module/das_version_util.c",
"${group_auth_path}/src/session/auth_session_common_util.c",
"${group_manager_path}/src/group_manager_common.c",
"${group_manager_path}/src/group_manager.c",
"${group_manager_path}/src/session/bind_session_common_util.c",
"${group_manager_path}/src/channel_manager/channel_manager.c",
"${group_manager_path}/src/callback_manager/callback_manager.c",
"${protocol_path}/src/protocol_common.c",
"${protocol_path}/src/pake_protocol/pake_protocol_common.c",
]
deviceauth_files = deviceauth_base_files
deviceauth_files += module_only_pake_files
deviceauth_files += channel_with_soft_bus_files
dev_frameworks_files = [
"${dev_frameworks_path}/src/session/session_common.c",
"${dev_frameworks_path}/src/session/session_manager.c",
"${dev_frameworks_path}/src/module/dev_auth_module_manager.c",
"${dev_frameworks_path}/src/module/module_common.c",
"${dev_frameworks_path}/src/module/version_util.c",
"${dev_frameworks_path}/src/task_manager/task_manager.c",
]
deviceauth_lite0_files = deviceauth_base_files
deviceauth_lite0_files += module_only_iso_files
deviceauth_lite0_files += channel_without_soft_bus_files
group_auth_files = [
"${group_auth_path}/src/group_auth_manager/group_auth_manager.c",
"${group_auth_path}/src/session/auth_session/auth_session_client.c",
"${group_auth_path}/src/session/auth_session/auth_session_common.c",
"${group_auth_path}/src/session/auth_session/auth_session_server.c",
"${group_auth_path}/src/session/auth_session/auth_session_util.c",
"${group_auth_path}/src/session/auth_session_lite_mock/auth_session_client_lite_mock.c",
"${group_auth_path}/src/session/auth_session_lite_mock/auth_session_server_lite_mock.c",
]
group_auth_lite_files = [
"${group_auth_path}/src/group_auth_manager_lite/group_auth_manager_lite.c",
"${group_auth_path}/src/session/auth_session_lite/auth_session_client_lite.c",
"${group_auth_path}/src/session/auth_session_lite/auth_session_server_lite.c",
"${group_auth_path}/src/session/auth_session_lite/auth_session_common_lite.c",
"${group_auth_path}/src/session/auth_session_mock/auth_session_client_mock.c",
"${group_auth_path}/src/session/auth_session_mock/auth_session_server_mock.c",
]
group_auth_account_unrelated_files = [ "${group_auth_path}/src/group_auth_manager/account_unrelated_group_auth/account_unrelated_group_auth.c" ]
group_auth_account_unrelated_mock_files = [ "${group_auth_path}/src/group_auth_manager/account_unrelated_group_auth_mock/account_unrelated_group_auth_mock.c" ]
group_auth_account_related_mock_files = [ "${group_auth_path}/src/group_auth_manager/account_related_group_auth_mock/account_related_group_auth_mock.c" ]
database_manager_files = [
"${data_manager_path}/src/database_manager.c",
"${data_manager_path}/src/database_util.c",
]
database_manager_lite_files = []
group_manager_files = [
"${group_manager_path}/src/group_operation/group_operation.c",
"${group_manager_path}/src/group_operation/group_operation_common.c",
"${group_manager_path}/src/session/bind_session/bind_session_client.c",
"${group_manager_path}/src/session/bind_session/bind_session_common.c",
"${group_manager_path}/src/session/bind_session/bind_session_server.c",
]
group_manager_lite_files = [
"${group_manager_path}/src/group_operation_mock/group_operation_mock.c",
"${group_manager_path}/src/session/bind_session_mock/bind_session_client_mock.c",
"${group_manager_path}/src/session/bind_session_mock/bind_session_server_mock.c",
]
group_manager_peer_to_peer_files = [ "${group_manager_path}/src/group_operation/peer_to_peer_group/peer_to_peer_group.c" ]
group_manager_peer_to_peer_mock_files = [ "${group_manager_path}/src/group_operation/peer_to_peer_group_mock/peer_to_peer_group_mock.c" ]
group_manager_identical_account_mock_files = [ "${group_manager_path}/src/group_operation/identical_account_group_mock/identical_account_group_mock.c" ]
group_manager_across_account_mock_files = [ "${group_manager_path}/src/group_operation/across_account_group_mock/across_account_group_mock.c" ]
key_agree_files =
[ "${group_manager_path}/src/channel_manager/key_agree/key_agree.c" ]
key_agree_mock_files = [
"${group_manager_path}/src/key_agree_mock/key_agree_mock.c",
"${group_manager_path}/src/session/key_agree_session_mock/key_agree_session_client_mock.c",
"${group_manager_path}/src/session/key_agree_session_mock/key_agree_session_server_mock.c",
]
bind_peer_files = [
"${group_manager_path}/src/bind_peer/bind_peer.c",
"${group_manager_path}/src/session/bind_session_lite/bind_session_client_lite.c",
"${group_manager_path}/src/session/bind_session_lite/bind_session_common_lite.c",
"${group_manager_path}/src/session/bind_session_lite/bind_session_server_lite.c",
]
bind_peer_mock_files = [
"${group_manager_path}/src/bind_peer_mock/bind_peer_mock.c",
"${group_manager_path}/src/session/bind_session_lite_mock/bind_session_client_lite_mock.c",
"${group_manager_path}/src/session/bind_session_lite_mock/bind_session_server_lite_mock.c",
]
authenticators_p2p_files = [
"${authenticators_path}/src/account_unrelated/das_common.c",
"${authenticators_path}/src/account_unrelated/das_module.c",
"${authenticators_path}/src/account_unrelated/das_version_util.c",
"${authenticators_path}/src/account_unrelated/task_main.c",
"${authenticators_path}/src/account_unrelated/pake_task/pake_task_common.c",
"${authenticators_path}/src/account_unrelated/pake_task/pake_message_util.c",
]
authenticators_p2p_mock_files =
[ "${authenticators_path}/src/account_unrelated_mock/das_module_mock.c" ]
authenticators_account_related_mock_files =
[ "${authenticators_path}/src/account_related_mock/tcis_module_mock.c" ]
authenticators_p2p_iso_files = [
"${authenticators_path}/src/account_unrelated/iso_task/iso_client_task.c",
"${authenticators_path}/src/account_unrelated/iso_task/iso_server_task.c",
"${authenticators_path}/src/account_unrelated/iso_task/iso_task_common.c",
"${authenticators_path}/src/account_unrelated/iso_task/iso_task_main.c",
"${authenticators_path}/src/account_unrelated/iso_task/iso_protocol_task/iso_client_protocol_task.c",
"${authenticators_path}/src/account_unrelated/iso_task/iso_protocol_task/iso_server_protocol_task.c",
"${authenticators_path}/src/account_unrelated/iso_task/lite_exchange_task/iso_client_bind_exchange_task.c",
"${authenticators_path}/src/account_unrelated/iso_task/lite_exchange_task/iso_client_unbind_exchange_task.c",
"${authenticators_path}/src/account_unrelated/iso_task/lite_exchange_task/iso_server_bind_exchange_task.c",
"${authenticators_path}/src/account_unrelated/iso_task/lite_exchange_task/iso_server_unbind_exchange_task.c",
]
authenticators_p2p_iso_mock_files = [ "${authenticators_path}/src/account_unrelated/iso_task_mock/iso_task_main_mock.c" ]
authenticators_p2p_pake_files = [
"${authenticators_path}/src/account_unrelated/pake_task/pake_task/pake_task_main.c",
"${authenticators_path}/src/account_unrelated/pake_task/pake_task/pake_client_task.c",
"${authenticators_path}/src/account_unrelated/pake_task/pake_task/pake_server_task.c",
"${authenticators_path}/src/account_unrelated/pake_task/pake_task/pake_protocol_task/pake_client_protocol_task.c",
"${authenticators_path}/src/account_unrelated/pake_task/pake_task/pake_protocol_task/pake_server_protocol_task.c",
"${authenticators_path}/src/account_unrelated/pake_task/pake_task/pake_protocol_task/pake_protocol_task_common.c",
"${authenticators_path}/src/account_unrelated/pake_task/new_pake_task_mock/new_pake_task_main_mock.c",
]
authenticators_p2p_pake_mock_files = [
"${authenticators_path}/src/account_unrelated/pake_task/pake_task_mock/pake_task_main_mock.c",
"${authenticators_path}/src/account_unrelated/pake_task/new_pake_task_mock/new_pake_task_main_mock.c",
]
authenticators_standard_exchange_task_files = [
"${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task/common_standard_bind_exchange.c",
"${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task/common_standard_unbind_exchange.c",
"${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task/standard_client_bind_exchange_task.c",
"${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task/standard_client_unbind_exchange_task.c",
"${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task/standard_server_bind_exchange_task.c",
"${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task/standard_server_unbind_exchange_task.c",
"${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task/das_asy_token_manager.c",
"${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task/standard_exchange_message_util.c",
]
authenticators_standard_exchange_task_mock_files = [ "${authenticators_path}/src/account_unrelated/pake_task/standard_exchange_task_mock/standard_exchange_task_mock.c" ]
soft_bus_channel_files = [ "${group_manager_path}/src/channel_manager/soft_bus_channel/soft_bus_channel.c" ]
soft_bus_channel_mock_files = [ "${group_manager_path}/src/channel_manager/soft_bus_channel_mock/soft_bus_channel_mock.c" ]
broadcast_manager_files =
[ "${group_manager_path}/src/broadcast_manager/broadcast_manager.c" ]
broadcast_manager_mock_files =
[ "${group_manager_path}/src/broadcast_manager/broadcast_manager_mock.c" ]
lcm_adapter_mock_files =
[ "${group_manager_path}/src/lcm_adapter_mock/lcm_adapter_mock.c" ]
deviceauth_files =
dev_frameworks_files + deviceauth_common_files + key_agree_mock_files
if (enable_group == true) {
deviceauth_files +=
group_auth_files + group_manager_files + database_manager_files
} else {
deviceauth_files += group_auth_lite_files + group_manager_lite_files +
database_manager_lite_files
}
account_unrelated_deviceauth =
enable_p2p_bind_lite_protocol || enable_p2p_auth_lite_protocol ||
enable_p2p_bind_standard_protocol || enable_p2p_auth_standard_protocol
if (enable_group == true && account_unrelated_deviceauth == true) {
deviceauth_files +=
group_auth_account_unrelated_files + group_manager_peer_to_peer_files
} else {
deviceauth_files += group_auth_account_unrelated_mock_files +
group_manager_peer_to_peer_mock_files
}
if (account_unrelated_deviceauth == true) {
deviceauth_files += authenticators_p2p_files
} else {
deviceauth_files += authenticators_p2p_mock_files
}
if (enable_p2p_auth_lite_protocol == true) {
deviceauth_files += authenticators_p2p_iso_files
} else {
deviceauth_files += authenticators_p2p_iso_mock_files
}
if (enable_p2p_bind_standard_protocol == true ||
enable_p2p_auth_standard_protocol == true) {
deviceauth_files += authenticators_p2p_pake_files
} else {
deviceauth_files += authenticators_p2p_pake_mock_files
}
if (enable_p2p_auth_standard_protocol == true) {
deviceauth_files += authenticators_standard_exchange_task_files
} else {
deviceauth_files += authenticators_standard_exchange_task_mock_files
}
if (enable_group == true && enable_account == true) {
import("//base/security/deviceauth_account/deviceauth_account.gni")
deviceauth_files += account_related_files + bind_peer_files
} else if (enable_group == false && enable_account == true) {
import("//base/security/deviceauth_account/deviceauth_account.gni")
deviceauth_files +=
account_related_files + group_manager_identical_account_mock_files +
group_manager_across_account_mock_files + bind_peer_mock_files
} else {
deviceauth_files +=
group_auth_account_related_mock_files +
group_manager_identical_account_mock_files +
group_manager_across_account_mock_files + bind_peer_mock_files +
lcm_adapter_mock_files + authenticators_account_related_mock_files
}
if (enable_p2p_bind_lite_protocol == true ||
enable_p2p_auth_lite_protocol == true) {
deviceauth_files +=
[ "${protocol_path}/src/iso_protocol/iso_protocol_common.c" ]
}
if (enable_p2p_bind_standard_protocol == true ||
enable_p2p_auth_standard_protocol == true) {
deviceauth_files += [
"${protocol_path}/src/pake_protocol/pake_protocol_dl/pake_protocol_dl.c",
"${protocol_path}/src/pake_protocol/pake_protocol_ec/pake_protocol_ec.c",
"${protocol_path}/src/new_pake_protocol/new_pake_protocol_dl_mock/new_pake_protocol_dl_mock.c",
"${protocol_path}/src/new_pake_protocol/new_pake_protocol_ec_mock/new_pake_protocol_ec_mock.c",
]
} else {
deviceauth_files += [
"${protocol_path}/src/pake_protocol/pake_protocol_dl_mock/pake_protocol_dl_mock.c",
"${protocol_path}/src/pake_protocol/pake_protocol_ec_mock/pake_protocol_ec_mock.c",
"${protocol_path}/src/new_pake_protocol/new_pake_protocol_dl_mock/new_pake_protocol_dl_mock.c",
"${protocol_path}/src/new_pake_protocol/new_pake_protocol_ec_mock/new_pake_protocol_ec_mock.c",
]
}
if (enable_soft_bus_channel == true) {
deviceauth_files += soft_bus_channel_files
} else {
deviceauth_files += soft_bus_channel_mock_files
}
if (enable_broadcast == true) {
deviceauth_files += broadcast_manager_files
} else {
deviceauth_files += broadcast_manager_mock_files
}
#build_flags = [ "-Wrestrict" ]
build_flags = [ "-Werror" ]
@@ -100,21 +100,17 @@
#define FIELD_MK_AGREE_MSG "mkaMsg"
#define FIELD_PEER_ID_FROM_REQUEST "peerIdFromRequest"
#define AUTH_FORM_INVALID_TYPE -1
#define AUTH_FORM_ACCOUNT_UNRELATED 0
#define AUTH_FORM_IDENTICAL_ACCOUNT 1
#define AUTH_FORM_ACROSS_ACCOUNT 2
#define INVALID_MODULE_TYPE -1
#define INVALID_MODULE_TYPE (-1)
#define GROUP_ERR_MSG 0x8080
/* GroupVisibility */
#define ALL_GROUP_VISIBILITY -2
#define ALL_GROUP_VISIBILITY (-2)
#define GROUP_VISIBILITY_PRIVATE 0
#define GROUP_VISIBILITY_ALLOW_LIST 1
#define GROUP_VISIBILITY_SIGNATURE 2
#define GROUP_VISIBILITY_SYSTEM 4
#define GROUP_VISIBILITY_PRIVILEGE 8
#define GROUP_VISIBILITY_PUBLIC -1
#define GROUP_VISIBILITY_PUBLIC (-1)
#define CLIENT 1
#define SERVER 0
@@ -126,7 +122,7 @@
#define DEFAULT_MEMORY_SIZE 64
#define DEFAULT_USER_ID_HASH ""
#define DEFAULT_REQUEST_ID 0
#define DEFAULT_CHANNEL_ID -1
#define DEFAULT_CHANNEL_ID (-1)
#define DEFAULT_EXPIRE_TIME 90
#define GROUP_MANAGER_PACKAGE_NAME "com.huawei.devicegroupmanage"
#define DEFAULT_RETURN_KEY_LENGTH 32

Some files were not shown because too many files have changed in this diff Show More