1 /* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef G_ENHANCE_AUTH_FUNC_H 17 #define G_ENHANCE_AUTH_FUNC_H 18 19 #include "auth_attest_interface_struct.h" 20 #include "auth_common_struct.h" 21 #include "auth_interface_struct.h" 22 #include "auth_session_fsm_struct.h" 23 #include "auth_session_key_struct.h" 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 typedef int32_t (*AuthMetaInitFunc)(const AuthTransCallback *callback); 30 typedef void (*AuthMetaNotifyDataReceivedFunc)( 31 uint32_t connectionId, const SocketPktHead *pktHead, const uint8_t *data); 32 typedef bool (*IsNeedUDIDAbatementFunc)(const AuthSessionInfo *info); 33 typedef int32_t (*GenerateCertificateFunc)(SoftbusCertChain *softbusCertChain, const AuthSessionInfo *info); 34 typedef int32_t (*VerifyCertificateFunc)( 35 SoftbusCertChain *softbusCertChain, const NodeInfo *nodeInfo, const AuthSessionInfo *info); 36 typedef void (*AuthUpdateNormalizeKeyIndexFunc)(const char *udidHash, 37 int64_t index, AuthLinkType type, SessionKey *normalizedKey, 38 bool isServer); 39 typedef void (*DelAuthMetaManagerByConnectionIdFunc)(uint32_t connectionId); 40 typedef int32_t (*AuthMetaGetConnInfoBySideFunc)(const char *uuid, bool isClient, AuthConnInfo *connInfo); 41 typedef void (*AuthClearDeviceKeyFunc)(void); 42 typedef struct TagAuthEnhanceFuncList { 43 AuthMetaInitFunc authMetaInit; 44 AuthMetaNotifyDataReceivedFunc authMetaNotifyDataReceived; 45 IsNeedUDIDAbatementFunc isNeedUDIDAbatement; 46 GenerateCertificateFunc generateCertificate; 47 VerifyCertificateFunc verifyCertificate; 48 AuthUpdateNormalizeKeyIndexFunc authUpdateNormalizeKeyIndex; 49 DelAuthMetaManagerByConnectionIdFunc delAuthMetaManagerByConnectionId; 50 AuthMetaGetConnInfoBySideFunc authMetaGetConnInfoBySide; 51 AuthClearDeviceKeyFunc authClearDeviceKey; 52 } AuthEnhanceFuncList; 53 54 AuthEnhanceFuncList *AuthEnhanceFuncListGet(void); 55 int32_t AuthRegisterEnhanceFunc(void *soHandle); 56 57 #ifdef __cplusplus 58 } 59 #endif 60 61 #endif