1 /*
2  * Copyright (c) 2022 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 #include "auth_log.h"
17 #include "auth_meta_manager.h"
18 #include "auth_common.h"
19 
AuthMetaStartVerify(uint32_t connectionId,const AuthKeyInfo * authKeyInfo,uint32_t requestId,int32_t callingPid,const AuthVerifyCallback * callBack)20 int32_t AuthMetaStartVerify(uint32_t connectionId, const AuthKeyInfo *authKeyInfo, uint32_t requestId,
21     int32_t callingPid, const AuthVerifyCallback *callBack)
22 {
23     (void)connectionId;
24     (void)authKeyInfo;
25     (void)requestId;
26     (void)callingPid;
27     (void)callBack;
28     AUTH_LOGI(AUTH_INIT, "auth meta not support verify");
29     return SOFTBUS_NOT_IMPLEMENT;
30 }
31 
AuthMetaReleaseVerify(int64_t authId)32 void AuthMetaReleaseVerify(int64_t authId)
33 {
34     (void)authId;
35     AUTH_LOGI(AUTH_INIT, "auth meta not support verify");
36 }
37 
AuthMetaEncrypt(int64_t authId,const uint8_t * inData,uint32_t inLen,uint8_t * outData,uint32_t * outLen)38 int32_t AuthMetaEncrypt(int64_t authId, const uint8_t *inData, uint32_t inLen, uint8_t *outData, uint32_t *outLen)
39 {
40     (void)authId;
41     (void)inData;
42     (void)inLen;
43     (void)outData;
44     (void)outLen;
45     AUTH_LOGI(AUTH_CONN, "auth meta encrypt data");
46     return SOFTBUS_NOT_IMPLEMENT;
47 }
48 
AuthMetaDecrypt(int64_t authId,const uint8_t * inData,uint32_t inLen,uint8_t * outData,uint32_t * outLen)49 int32_t AuthMetaDecrypt(int64_t authId, const uint8_t *inData, uint32_t inLen, uint8_t *outData, uint32_t *outLen)
50 {
51     (void)authId;
52     (void)inData;
53     (void)inLen;
54     (void)outData;
55     (void)outLen;
56     AUTH_LOGI(AUTH_CONN, "auth meta decrypt data");
57     return SOFTBUS_NOT_IMPLEMENT;
58 }
59 
AuthMetaGetPreferConnInfo(const char * uuid,AuthConnInfo * connInfo)60 int32_t AuthMetaGetPreferConnInfo(const char *uuid, AuthConnInfo *connInfo)
61 {
62     (void)uuid;
63     (void)connInfo;
64     AUTH_LOGI(AUTH_CONN, "auth meta get prefer conninfo");
65     return SOFTBUS_NOT_IMPLEMENT;
66 }
67 
AuthMetaOpenConn(const AuthConnInfo * info,uint32_t requestId,const AuthConnCallback * callback)68 int32_t AuthMetaOpenConn(const AuthConnInfo *info, uint32_t requestId, const AuthConnCallback *callback)
69 {
70     (void)info;
71     (void)requestId;
72     (void)callback;
73     AUTH_LOGI(AUTH_CONN, "auth meta open connection");
74     return SOFTBUS_NOT_IMPLEMENT;
75 }
76 
AuthMetaNotifyDataReceived(uint32_t connectionId,const SocketPktHead * pktHead,const uint8_t * data)77 void AuthMetaNotifyDataReceived(uint32_t connectionId, const SocketPktHead *pktHead, const uint8_t *data)
78 {
79     (void)connectionId;
80     (void)pktHead;
81     (void)data;
82     AUTH_LOGI(AUTH_CONN, "auth meta notify data received");
83 }
84 
AuthMetaCloseConn(int64_t authId)85 void AuthMetaCloseConn(int64_t authId)
86 {
87     (void)authId;
88     AUTH_LOGI(AUTH_CONN, "auth meta close connection");
89 }
90 
AuthMetaPostTransData(int64_t authId,const AuthTransData * dataInfo)91 int32_t AuthMetaPostTransData(int64_t authId, const AuthTransData *dataInfo)
92 {
93     (void)authId;
94     (void)dataInfo;
95     AUTH_LOGI(AUTH_CONN, "auth meta start post transdata");
96     return SOFTBUS_NOT_IMPLEMENT;
97 }
98 
AuthMetaGetIdByConnInfo(const AuthConnInfo * connInfo,bool isServer)99 int64_t AuthMetaGetIdByConnInfo(const AuthConnInfo *connInfo, bool isServer)
100 {
101     (void)connInfo;
102     (void)isServer;
103     AUTH_LOGI(AUTH_CONN, "auth meta get auth id by connection info");
104     return SOFTBUS_NOT_IMPLEMENT;
105 }
106 
AuthMetaGetIdByUuid(const char * uuid,AuthLinkType type,bool isServer)107 int64_t AuthMetaGetIdByUuid(const char *uuid, AuthLinkType type, bool isServer)
108 {
109     (void)uuid;
110     (void)type;
111     (void)isServer;
112     AUTH_LOGI(AUTH_CONN, "auth meta get auth id by uuid");
113     return SOFTBUS_NOT_IMPLEMENT;
114 }
115 
AuthMetaSetP2pMac(int64_t authId,const char * p2pMac)116 int32_t AuthMetaSetP2pMac(int64_t authId, const char *p2pMac)
117 {
118     (void)authId;
119     (void)p2pMac;
120     AUTH_LOGI(AUTH_CONN, "auth meta set p2p mac info by auth id");
121     return SOFTBUS_NOT_IMPLEMENT;
122 }
123 
AuthMetaGetConnInfo(int64_t authId,AuthConnInfo * connInfo)124 int32_t AuthMetaGetConnInfo(int64_t authId, AuthConnInfo *connInfo)
125 {
126     (void)authId;
127     (void)connInfo;
128     AUTH_LOGI(AUTH_CONN, "auth meta get connection info by auth id");
129     return SOFTBUS_NOT_IMPLEMENT;
130 }
131 
AuthMetaGetServerSide(int64_t authId,bool * isServer)132 int32_t AuthMetaGetServerSide(int64_t authId, bool *isServer)
133 {
134     (void)authId;
135     (void)isServer;
136     AUTH_LOGI(AUTH_CONN, "auth meta get server side");
137     return SOFTBUS_NOT_IMPLEMENT;
138 }
139 
AuthMetaGetDeviceUuid(int64_t authId,char * uuid,uint16_t size)140 int32_t AuthMetaGetDeviceUuid(int64_t authId, char *uuid, uint16_t size)
141 {
142     (void)authId;
143     (void)uuid;
144     (void)size;
145     AUTH_LOGI(AUTH_CONN, "auth meta get device uuid by auth id");
146     return SOFTBUS_NOT_IMPLEMENT;
147 }
148 
AuthMetaGetVersion(int64_t authId,SoftBusVersion * version)149 int32_t AuthMetaGetVersion(int64_t authId, SoftBusVersion *version)
150 {
151     (void)authId;
152     (void)version;
153     AUTH_LOGI(AUTH_CONN, "auth meta get version by auth id");
154     return SOFTBUS_NOT_IMPLEMENT;
155 }
156 
AuthMetaInit(const AuthTransCallback * callback)157 int32_t AuthMetaInit(const AuthTransCallback *callback)
158 {
159     (void)callback;
160     AUTH_LOGI(AUTH_INIT, "auth meta init");
161     return SOFTBUS_OK;
162 }
163 
AuthMetaDeinit(void)164 void AuthMetaDeinit(void)
165 {
166     AUTH_LOGI(AUTH_INIT, "auth meta deinit");
167 }
168 
DelAuthMetaManagerByPid(const char * pkgName,int32_t pid)169 void DelAuthMetaManagerByPid(const char *pkgName, int32_t pid)
170 {
171     (void)pkgName;
172     (void)pid;
173 }
174 
AuthMetaGetConnIdByInfo(const AuthConnInfo * connInfo,uint32_t * connectionId)175 int32_t AuthMetaGetConnIdByInfo(const AuthConnInfo *connInfo, uint32_t *connectionId)
176 {
177     (void)connInfo;
178     (void)connectionId;
179     return SOFTBUS_OK;
180 }
181 
AuthMetaCheckMetaExist(const AuthConnInfo * connInfo,bool * isExist)182 void AuthMetaCheckMetaExist(const AuthConnInfo *connInfo, bool *isExist)
183 {
184     (void)connInfo;
185     (void)isExist;
186 }
187 
DelAuthMetaManagerByConnectionId(uint32_t connectionId)188 void DelAuthMetaManagerByConnectionId(uint32_t connectionId)
189 {
190     (void)connectionId;
191 }
192