From b0fa1e724cfb374cc41cae46d2293d038b14bf8b Mon Sep 17 00:00:00 2001 From: fangdong7 Date: Mon, 29 Apr 2024 13:32:23 +0000 Subject: [PATCH] fix:update ble createTime and update keyInfo when fastauth Signed-off-by: fangdong7 --- core/authentication/authentication.gni | 1 + core/authentication/include/auth_manager.h | 1 + .../authentication/include/auth_session_key.h | 1 + .../authentication/interface/auth_interface.h | 2 + core/authentication/src/auth_interface.c | 50 +++++++++++++++++++ core/authentication/src/auth_manager.c | 29 +++++++++++ core/authentication/src/auth_session_fsm.c | 14 +++--- core/authentication/src/auth_session_key.c | 23 +++++++++ .../net_ledger/common/src/lnn_net_ledger.c | 10 ++-- .../proxy/src/softbus_proxychannel_message.c | 42 +++++++++++++--- interfaces/kits/common/softbus_error_code.h | 1 + tests/core/authentication/BUILD.gn | 1 + tests/core/bus_center/lnn/BUILD.gn | 1 + .../softbus_proxychannel_message_test.cpp | 3 +- 14 files changed, 159 insertions(+), 20 deletions(-) diff --git a/core/authentication/authentication.gni b/core/authentication/authentication.gni index efddeabc4..7bf9e7c19 100644 --- a/core/authentication/authentication.gni +++ b/core/authentication/authentication.gni @@ -35,6 +35,7 @@ auth_server_inc = [ "$dsoftbus_root_path/core/common/dfx/interface/include", "$dsoftbus_root_path/core/adapter/authentication/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", + "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", "$dsoftbus_root_path/core/adapter/bus_center/include", "$dsoftbus_root_path/core/bus_center/utils/include/", ] diff --git a/core/authentication/include/auth_manager.h b/core/authentication/include/auth_manager.h index 51c939780..f85bd0c10 100644 --- a/core/authentication/include/auth_manager.h +++ b/core/authentication/include/auth_manager.h @@ -85,6 +85,7 @@ bool AuthDeviceCheckConnInfo(const char* uuid, AuthLinkType type, bool checkConn void AuthDeviceGetLatestIdByUuid(const char *uuid, AuthLinkType type, AuthHandle *authHandle); int64_t AuthDeviceGetIdByConnInfo(const AuthConnInfo *connInfo, bool isServer); int64_t AuthDeviceGetIdByUuid(const char *uuid, AuthLinkType type, bool isServer); +int32_t AuthDeviceGetAuthHandleByIndex(const char *udid, bool isServer, int32_t index, AuthHandle *authHandle); AuthManager *NewAuthManager(int64_t authSeq, const AuthSessionInfo *info); int32_t AuthDeviceEncrypt(AuthHandle *authHandle, const uint8_t *inData, uint32_t inLen, uint8_t *outData, diff --git a/core/authentication/include/auth_session_key.h b/core/authentication/include/auth_session_key.h index 01defaacd..aee0d9a44 100644 --- a/core/authentication/include/auth_session_key.h +++ b/core/authentication/include/auth_session_key.h @@ -50,6 +50,7 @@ int32_t DupSessionKeyList(const SessionKeyList *srcList, SessionKeyList *dstList uint64_t GetLatestAvailableSessionKeyTime(const SessionKeyList *list, AuthLinkType type); bool HasSessionKey(const SessionKeyList *list); +AuthLinkType GetSessionKeyTypeByIndex(const SessionKeyList *list, int32_t index); int32_t AddSessionKey(SessionKeyList *list, int32_t index, const SessionKey *key, AuthLinkType type); int32_t SetSessionKeyAvailable(SessionKeyList *list, int32_t index); int32_t GetLatestSessionKey(const SessionKeyList *list, AuthLinkType type, int32_t *index, SessionKey *key); diff --git a/core/authentication/interface/auth_interface.h b/core/authentication/interface/auth_interface.h index 164b308d6..0fe533d86 100644 --- a/core/authentication/interface/auth_interface.h +++ b/core/authentication/interface/auth_interface.h @@ -167,6 +167,8 @@ int32_t AuthGetLatestAuthSeqListByType(const char *udid, int64_t *seqList, uint6 DiscoveryType type); /* for ProxyChannel & P2P TcpDirectchannel */ void AuthGetLatestIdByUuid(const char *uuid, AuthLinkType type, bool isMeta, AuthHandle *authHandle); +int32_t AuthGetAuthHandleByIndex(const AuthConnInfo *connInfo, bool isServer, int32_t index, + AuthHandle *authHandle); int64_t AuthGetIdByConnInfo(const AuthConnInfo *connInfo, bool isServer, bool isMeta); int64_t AuthGetIdByUuid(const char *uuid, AuthLinkType type, bool isServer, bool isMeta); int32_t AuthSetTcpKeepAlive(const AuthConnInfo *connInfo, ModeCycle cycle); diff --git a/core/authentication/src/auth_interface.c b/core/authentication/src/auth_interface.c index 3ae9f63bf..873ff1ed3 100644 --- a/core/authentication/src/auth_interface.c +++ b/core/authentication/src/auth_interface.c @@ -29,6 +29,7 @@ #include "bus_center_manager.h" #include "customized_security_protocol.h" #include "lnn_decision_db.h" +#include "lnn_distributed_net_ledger.h" #include "lnn_ohos_account.h" #include "softbus_adapter_mem.h" #include "softbus_def.h" @@ -220,6 +221,55 @@ int64_t AuthGetIdByUuid(const char *uuid, AuthLinkType type, bool isServer, bool return AuthDeviceGetIdByUuid(uuid, type, isServer); } +int32_t AuthGetAuthHandleByIndex(const AuthConnInfo *connInfo, bool isServer, int32_t index, + AuthHandle *authHandle) +{ + if (connInfo == NULL || authHandle == NULL) { + AUTH_LOGE(AUTH_CONN, "param is null"); + return SOFTBUS_INVALID_PARAM; + } + int32_t ret = SOFTBUS_OK; + char networkId[NETWORK_ID_BUF_LEN] = { 0 }; + NodeInfo info; + (void)memset_s(&info, sizeof(NodeInfo), 0, sizeof(NodeInfo)); + switch (connInfo->type) { + case AUTH_LINK_TYPE_WIFI: + ret = LnnGetRemoteNodeInfoByKey(connInfo->info.ipInfo.ip, &info); + if (ret != SOFTBUS_OK) { + AUTH_LOGE(AUTH_CONN, "get remote nodeInfo by ip failed, ret=%{public}d", ret); + return ret; + } + break; + case AUTH_LINK_TYPE_BLE: + if (LnnGetNetworkIdByUdidHash(connInfo->info.bleInfo.deviceIdHash, UDID_HASH_LEN, networkId, + sizeof(networkId)) != SOFTBUS_OK) { + AUTH_LOGE(AUTH_CONN, "get networkId fail"); + return SOFTBUS_NOT_FIND; + } + ret = LnnGetRemoteNodeInfoByKey(networkId, &info); + if (ret != SOFTBUS_OK) { + AUTH_LOGE(AUTH_CONN, "get remote nodeInfo by networkId failed, ret=%{public}d", ret); + return ret; + } + break; + case AUTH_LINK_TYPE_BR: + ret = LnnGetRemoteNodeInfoByKey(connInfo->info.brInfo.brMac, &info); + if (ret != SOFTBUS_OK) { + AUTH_LOGE(AUTH_CONN, "get remote nodeInfo by brMac failed, ret=%{public}d", ret); + return ret; + } + break; + default: + AUTH_LOGE(AUTH_CONN, "unknown connType. type=%{public}d", connInfo->type); + return SOFTBUS_INVALID_PARAM; + } + if (!IsSupportFeatureByCapaBit(info.feature, BIT_SUPPORT_NORMALIZED_LINK)) { + AUTH_LOGE(AUTH_CONN, "not support normalize"); + return SOFTBUS_AUTH_NOT_SUPPORT_NORMALIZE; + } + return AuthDeviceGetAuthHandleByIndex(info.deviceInfo.deviceUdid, isServer, index, authHandle); +} + static int32_t FillAuthSessionInfo(AuthSessionInfo *info, const NodeInfo *nodeInfo, uint32_t requestId, AuthDeviceKeyInfo *keyInfo, const AuthConnInfo *connInfo) { diff --git a/core/authentication/src/auth_manager.c b/core/authentication/src/auth_manager.c index f7897544a..65fae4b92 100644 --- a/core/authentication/src/auth_manager.c +++ b/core/authentication/src/auth_manager.c @@ -2148,6 +2148,35 @@ int64_t AuthDeviceGetIdByUuid(const char *uuid, AuthLinkType type, bool isServer return authId; } +int32_t AuthDeviceGetAuthHandleByIndex(const char *udid, bool isServer, int32_t index, AuthHandle *authHandle) +{ + if (udid == NULL || authHandle == NULL) { + AUTH_LOGE(AUTH_FSM, "param error"); + return SOFTBUS_INVALID_PARAM; + } + if (!RequireAuthLock()) { + AUTH_LOGE(AUTH_CONN, "RequireAuthLock fail"); + return SOFTBUS_LOCK_ERR; + } + AuthManager *auth = FindNormalizedKeyAuthManagerByUdid(udid, isServer); + if (auth == NULL) { + AUTH_LOGE(AUTH_CONN, "not found auth manager, side=%{public}s", GetAuthSideStr(isServer)); + ReleaseAuthLock(); + return SOFTBUS_AUTH_NOT_FOUND; + } + AuthLinkType type = GetSessionKeyTypeByIndex(&auth->sessionKeyList, index); + ReleaseAuthLock(); + if (type == AUTH_LINK_TYPE_MAX || type < AUTH_LINK_TYPE_WIFI) { + AUTH_LOGE(AUTH_CONN, "auth type error"); + return SOFTBUS_AUTH_NOT_FOUND; + } + authHandle->authId = auth->authId; + authHandle->type = type; + AUTH_LOGI(AUTH_CONN, "found auth manager, side=%{public}s, type=%{public}d, authId=%{public}" PRId64, + GetAuthSideStr(isServer), type, auth->authId); + return SOFTBUS_OK; +} + uint32_t AuthGetEncryptSize(uint32_t inLen) { return inLen + ENCRYPT_OVER_HEAD_LEN; diff --git a/core/authentication/src/auth_session_fsm.c b/core/authentication/src/auth_session_fsm.c index 797c20709..5fdbe9cc9 100644 --- a/core/authentication/src/auth_session_fsm.c +++ b/core/authentication/src/auth_session_fsm.c @@ -29,6 +29,7 @@ #include "auth_session_message.h" #include "bus_center_manager.h" #include "lnn_event.h" +#include "lnn_distributed_net_ledger.h" #include "softbus_adapter_hitrace.h" #include "softbus_adapter_mem.h" #include "softbus_def.h" @@ -36,7 +37,6 @@ #define AUTH_TIMEOUT_MS (10 * 1000) #define TO_AUTH_FSM(ptr) CONTAINER_OF(ptr, AuthFsm, fsm) #define SHORT_UDID_HASH_LEN 8 -#define SHORT_UDID_HASH_HEX_LEN 17 typedef enum { STATE_SYNC_DEVICE_ID = 0, @@ -190,8 +190,8 @@ static int32_t ProcAuthFsm(uint32_t requestId, bool isServer, AuthFsm *authFsm) AUTH_LOGE(AUTH_FSM, "get auth request fail"); return SOFTBUS_ERR; } - char udidHash[SHORT_UDID_HASH_HEX_LEN] = {0}; - int32_t ret = ConvertBytesToHexString(udidHash, SHORT_UDID_HASH_HEX_LEN, + char udidHash[SHORT_UDID_HASH_HEX_LEN + 1] = {0}; + int32_t ret = ConvertBytesToHexString(udidHash, SHORT_UDID_HASH_HEX_LEN + 1, (const unsigned char *)request.connInfo.info.bleInfo.deviceIdHash, SHORT_UDID_HASH_LEN); if (ret == SOFTBUS_OK && LnnRetrieveDeviceInfo((const char *)udidHash, &nodeInfo) == SOFTBUS_OK && IsNeedExchangeNetworkId(nodeInfo.authCapacity, BIT_SUPPORT_EXCHANGE_NETWORKID)) { @@ -498,8 +498,8 @@ static int32_t RecoveryNormalizedDeviceKey(AuthFsm *authFsm) AUTH_LOGE(AUTH_FSM, "generate udidHash fail"); return ret; } - char udidShortHash[SHORT_UDID_HASH_HEX_LEN] = {0}; - if (ConvertBytesToUpperCaseHexString(udidShortHash, SHORT_UDID_HASH_HEX_LEN, + char udidShortHash[SHORT_UDID_HASH_HEX_LEN + 1] = {0}; + if (ConvertBytesToUpperCaseHexString(udidShortHash, SHORT_UDID_HASH_HEX_LEN + 1, hash, SHORT_UDID_HASH_LEN) != SOFTBUS_OK) { AUTH_LOGE(AUTH_FSM, "convert bytes to string fail"); return SOFTBUS_ERR; @@ -524,8 +524,8 @@ static int32_t RecoveryFastAuthKey(AuthFsm *authFsm) AUTH_LOGE(AUTH_FSM, "generate udidHash fail"); return ret; } - char udidShortHash[SHORT_UDID_HASH_HEX_LEN] = {0}; - if (ConvertBytesToUpperCaseHexString(udidShortHash, SHORT_UDID_HASH_HEX_LEN, + char udidShortHash[SHORT_UDID_HASH_HEX_LEN + 1] = {0}; + if (ConvertBytesToUpperCaseHexString(udidShortHash, SHORT_UDID_HASH_HEX_LEN + 1, hash, SHORT_UDID_HASH_LEN) != SOFTBUS_OK) { AUTH_LOGE(AUTH_FSM, "convert bytes to string fail"); return SOFTBUS_ERR; diff --git a/core/authentication/src/auth_session_key.c b/core/authentication/src/auth_session_key.c index fd17dc0cc..4f5719204 100644 --- a/core/authentication/src/auth_session_key.c +++ b/core/authentication/src/auth_session_key.c @@ -153,6 +153,29 @@ bool HasSessionKey(const SessionKeyList *list) return !IsListEmpty(list); } +AuthLinkType GetSessionKeyTypeByIndex(const SessionKeyList *list, int32_t index) +{ + CHECK_NULL_PTR_RETURN_VALUE(list, AUTH_LINK_TYPE_MAX); + SessionKeyItem *item = NULL; + uint32_t type = 0; + LIST_FOR_EACH_ENTRY(item, (const ListNode *)list, SessionKeyItem, node) { + if (item->index == index) { + type = item->type; + break; + } + } + if (type == 0) { + return AUTH_LINK_TYPE_MAX; + } + for (uint32_t i = AUTH_LINK_TYPE_WIFI; i < AUTH_LINK_TYPE_MAX; i++) { + if (SessionKeyHasAuthLinkType(type, (AuthLinkType)i)) { + AUTH_LOGI(AUTH_FSM, "auth link type=%{public}d", i); + return (AuthLinkType)i; + } + } + return AUTH_LINK_TYPE_MAX; +} + uint64_t GetLatestAvailableSessionKeyTime(const SessionKeyList *list, AuthLinkType type) { CHECK_NULL_PTR_RETURN_VALUE(list, 0); diff --git a/core/bus_center/lnn/net_ledger/common/src/lnn_net_ledger.c b/core/bus_center/lnn/net_ledger/common/src/lnn_net_ledger.c index 295663916..772b8fb4c 100644 --- a/core/bus_center/lnn/net_ledger/common/src/lnn_net_ledger.c +++ b/core/bus_center/lnn/net_ledger/common/src/lnn_net_ledger.c @@ -74,14 +74,15 @@ static bool IsBleDirectlyOnlineFactorChange(NodeInfo *info) char softBusVersion[VERSION_MAX_LEN] = {0}; if (LnnGetLocalStrInfo(STRING_KEY_HICE_VERSION, softBusVersion, sizeof(softBusVersion)) == SOFTBUS_OK) { if (strcmp(softBusVersion, info->softBusVersion) != 0) { - LNN_LOGW(LNN_LEDGER, "softbus version change, version:%s", softBusVersion); + LNN_LOGW(LNN_LEDGER, "softbus version change, version:%{public}s", softBusVersion); return true; } } uint64_t softbusFeature = 0; if (LnnGetLocalNumU64Info(NUM_KEY_FEATURE_CAPA, &softbusFeature) == SOFTBUS_OK) { if (softbusFeature != info->feature) { - LNN_LOGW(LNN_LEDGER, "feature change, old:%" PRIu64 ", new:%" PRIu64, info->feature, softbusFeature); + LNN_LOGW(LNN_LEDGER, "feature change, old:%{public}" PRIu64 ", new:%{public}" PRIu64, + info->feature, softbusFeature); return true; } } @@ -95,14 +96,15 @@ static bool IsBleDirectlyOnlineFactorChange(NodeInfo *info) int32_t osType = 0; if (LnnGetLocalNumInfo(NUM_KEY_OS_TYPE, &osType) == SOFTBUS_OK) { if (osType != info->deviceInfo.osType) { - LNN_LOGW(LNN_LEDGER, "osType change, old:%d, new:%d", info->deviceInfo.osType, osType); + LNN_LOGW(LNN_LEDGER, "osType change, old:%{public}d, new:%{public}d", info->deviceInfo.osType, osType); return true; } } uint32_t authCapacity = 0; if (LnnGetLocalNumInfo(NUM_KEY_AUTH_CAP, (int32_t *)&authCapacity) == SOFTBUS_OK) { if (authCapacity != info->authCapacity) { - LNN_LOGW(LNN_LEDGER, "authCapacity change, old:%d, new:%d", info->authCapacity, authCapacity); + LNN_LOGW(LNN_LEDGER, "authCapacity change, old:%{public}d, new:%{public}d", + info->authCapacity, authCapacity); return true; } } diff --git a/core/transmission/trans_channel/proxy/src/softbus_proxychannel_message.c b/core/transmission/trans_channel/proxy/src/softbus_proxychannel_message.c index 09cf0729e..d7d3c73b8 100644 --- a/core/transmission/trans_channel/proxy/src/softbus_proxychannel_message.c +++ b/core/transmission/trans_channel/proxy/src/softbus_proxychannel_message.c @@ -182,7 +182,7 @@ static int32_t ConvertBleConnInfo2BrConnInfo(AuthConnInfo *connInfo) return SOFTBUS_OK; } -static int32_t GetAuthIdByHandshakeMsg(uint32_t connId, uint8_t cipher, AuthHandle *authHandle) +static int32_t GetAuthIdByHandshakeMsg(uint32_t connId, uint8_t cipher, AuthHandle *authHandle, int32_t index) { AuthConnInfo connInfo; if (TransProxyGetAuthConnInfo(connId, &connInfo) != SOFTBUS_OK) { @@ -204,9 +204,34 @@ static int32_t GetAuthIdByHandshakeMsg(uint32_t connId, uint8_t cipher, AuthHand bool isAuthServer = !((cipher & AUTH_SERVER_SIDE) != 0); authHandle->type = connInfo.type; authHandle->authId = AuthGetIdByConnInfo(&connInfo, isAuthServer, false); + if (authHandle->authId == AUTH_INVALID_ID) { + if (AuthGetAuthHandleByIndex(&connInfo, isAuthServer, index, authHandle) != SOFTBUS_OK && + AuthGetAuthHandleByIndex(&connInfo, !isAuthServer, index, authHandle) != SOFTBUS_OK) { + TRANS_LOGE(TRANS_CTRL, "get auth handle fail"); + return SOFTBUS_NOT_FIND; + } + } return SOFTBUS_OK; } +static int32_t GetAuthIdReDecrypt(AuthHandle *authHandle, ProxyMessage *msg, uint8_t *decData, uint32_t *decDataLen) +{ + AuthConnInfo connInfo; + (void)memset_s(&connInfo, sizeof(AuthConnInfo), 0, sizeof(AuthConnInfo)); + int32_t ret = TransProxyGetAuthConnInfo(msg->connId, &connInfo); + if (ret != SOFTBUS_OK) { + TRANS_LOGE(TRANS_CTRL, "get connInfo fail connId=%{public}d", msg->connId); + return ret; + } + int32_t index = (int32_t)SoftBusLtoHl(*(uint32_t *)msg->data); + if (AuthGetAuthHandleByIndex(&connInfo, false, index, authHandle) != SOFTBUS_OK && + AuthGetAuthHandleByIndex(&connInfo, true, index, authHandle) != SOFTBUS_OK) { + TRANS_LOGE(TRANS_CTRL, "get auth handle fail"); + return SOFTBUS_NOT_FIND; + } + return AuthDecrypt(authHandle, (uint8_t *)msg->data, (uint32_t)msg->dateLen, decData, decDataLen); +} + int32_t GetBrMacFromConnInfo(uint32_t connId, char *peerBrMac, uint32_t len) { AuthConnInfo connInfo; @@ -236,27 +261,28 @@ int32_t TransProxyParseMessage(char *data, int32_t len, ProxyMessage *msg) } if ((msg->msgHead.cipher & ENCRYPTED) != 0) { int32_t ret; - AuthHandle authHandle = { .authId = AUTH_INVALID_ID }; + AuthHandle auth = { .authId = AUTH_INVALID_ID }; if (msg->msgHead.type == PROXYCHANNEL_MSG_TYPE_HANDSHAKE) { TRANS_LOGD(TRANS_CTRL, "prxoy recv handshake cipher=0x%{public}02x", msg->msgHead.cipher); - ret = GetAuthIdByHandshakeMsg(msg->connId, msg->msgHead.cipher, &authHandle); + ret = GetAuthIdByHandshakeMsg(msg->connId, msg->msgHead.cipher, &auth, + (int32_t)SoftBusLtoHl(*(uint32_t *)msg->data)); } else { - ret = TransProxyGetAuthId(msg->msgHead.myId, &authHandle); + ret = TransProxyGetAuthId(msg->msgHead.myId, &auth); } - if (ret != SOFTBUS_OK || authHandle.authId == AUTH_INVALID_ID) { + if (ret != SOFTBUS_OK || auth.authId == AUTH_INVALID_ID) { TRANS_LOGE(TRANS_CTRL, "get authId fail, connId=%{public}d, myChannelId=%{public}d, type=%{public}d", msg->connId, msg->msgHead.myId, msg->msgHead.type); return SOFTBUS_AUTH_NOT_FOUND; } - msg->authHandle = authHandle; + msg->authHandle = auth; uint32_t decDataLen = AuthGetDecryptSize((uint32_t)msg->dateLen); uint8_t *decData = (uint8_t *)SoftBusCalloc(decDataLen); if (decData == NULL) { return SOFTBUS_MALLOC_ERR; } msg->keyIndex = (int32_t)SoftBusLtoHl(*(uint32_t *)msg->data); - if (AuthDecrypt(&authHandle, (uint8_t *)msg->data, (uint32_t)msg->dateLen, - decData, &decDataLen) != SOFTBUS_OK) { + if (AuthDecrypt(&auth, (uint8_t *)msg->data, (uint32_t)msg->dateLen, decData, &decDataLen) != SOFTBUS_OK && + GetAuthIdReDecrypt(&auth, msg, decData, &decDataLen) != SOFTBUS_OK) { SoftBusFree(decData); TRANS_LOGE(TRANS_CTRL, "parse msg decrypt fail"); return SOFTBUS_DECRYPT_ERR; diff --git a/interfaces/kits/common/softbus_error_code.h b/interfaces/kits/common/softbus_error_code.h index d261bfefb..309951040 100644 --- a/interfaces/kits/common/softbus_error_code.h +++ b/interfaces/kits/common/softbus_error_code.h @@ -292,6 +292,7 @@ enum SoftBusErrNo { SOFTBUS_AUTH_CONN_START_ERR, SOFTBUS_AUTH_START_ERR, SOFTBUS_AUTH_EXCHANGE_DEVICE_INFO_START_ERR, + SOFTBUS_AUTH_NOT_SUPPORT_NORMALIZE, /* errno begin: -((203 << 21) | (4 << 16) | 0xFFFF) */ SOFTBUS_NETWORK_ERR_BASE = SOFTBUS_ERRNO(LNN_SUB_MODULE_CODE), diff --git a/tests/core/authentication/BUILD.gn b/tests/core/authentication/BUILD.gn index 5d58d58ef..98b8f07a2 100644 --- a/tests/core/authentication/BUILD.gn +++ b/tests/core/authentication/BUILD.gn @@ -30,6 +30,7 @@ ohos_unittest("AuthTest") { "$dsoftbus_root_path/core/bus_center/utils/include", "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", + "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/core/common/message_handler/include", "$dsoftbus_root_path/core/connection/interface", diff --git a/tests/core/bus_center/lnn/BUILD.gn b/tests/core/bus_center/lnn/BUILD.gn index 3cb9322ba..de3f0c5ee 100644 --- a/tests/core/bus_center/lnn/BUILD.gn +++ b/tests/core/bus_center/lnn/BUILD.gn @@ -1617,6 +1617,7 @@ ohos_unittest("LNNDiscoveryInterfaceTest") { "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", + "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", "$dsoftbus_root_path/core/bus_center/utils/include", "$dsoftbus_root_path/core/bus_center/interface", "$dsoftbus_root_path/core/bus_center/service/include", diff --git a/tests/core/transmission/trans_channel/proxy_channel/softbus_proxychannel_message_test.cpp b/tests/core/transmission/trans_channel/proxy_channel/softbus_proxychannel_message_test.cpp index 9b39a36df..a4863d7fd 100644 --- a/tests/core/transmission/trans_channel/proxy_channel/softbus_proxychannel_message_test.cpp +++ b/tests/core/transmission/trans_channel/proxy_channel/softbus_proxychannel_message_test.cpp @@ -976,7 +976,8 @@ HWTEST_F(SoftbusProxyChannelMessageTest, TransProxyGetAuthIdTest001, TestSize.Le msg.connId = 1; msg.msgHead.cipher = 1; AuthHandle authHandle = { 0 }; - int32_t ret = GetAuthIdByHandshakeMsg(msg.connId, msg.msgHead.cipher, &authHandle); + int32_t index = 1; + int32_t ret = GetAuthIdByHandshakeMsg(msg.connId, msg.msgHead.cipher, &authHandle, index); EXPECT_NE(SOFTBUS_OK, ret); }