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
AuthMetaGetConnInfoBySide(const char * uuid,bool isClient,AuthConnInfo * connInfo)68 int32_t AuthMetaGetConnInfoBySide(const char *uuid, bool isClient, AuthConnInfo *connInfo)
69 {
70 (void)uuid;
71 (void)isClient;
72 (void)connInfo;
73 AUTH_LOGI(AUTH_CONN, "auth meta get conninfo by side");
74 return SOFTBUS_NOT_IMPLEMENT;
75 }
76
AuthMetaOpenConn(const AuthConnInfo * info,uint32_t requestId,const AuthConnCallback * callback)77 int32_t AuthMetaOpenConn(const AuthConnInfo *info, uint32_t requestId, const AuthConnCallback *callback)
78 {
79 (void)info;
80 (void)requestId;
81 (void)callback;
82 AUTH_LOGI(AUTH_CONN, "auth meta open connection");
83 return SOFTBUS_NOT_IMPLEMENT;
84 }
85
AuthMetaNotifyDataReceived(uint32_t connectionId,const SocketPktHead * pktHead,const uint8_t * data)86 void AuthMetaNotifyDataReceived(uint32_t connectionId, const SocketPktHead *pktHead, const uint8_t *data)
87 {
88 (void)connectionId;
89 (void)pktHead;
90 (void)data;
91 AUTH_LOGI(AUTH_CONN, "auth meta notify data received");
92 }
93
AuthMetaCloseConn(int64_t authId)94 void AuthMetaCloseConn(int64_t authId)
95 {
96 (void)authId;
97 AUTH_LOGI(AUTH_CONN, "auth meta close connection");
98 }
99
AuthMetaPostTransData(int64_t authId,const AuthTransData * dataInfo)100 int32_t AuthMetaPostTransData(int64_t authId, const AuthTransData *dataInfo)
101 {
102 (void)authId;
103 (void)dataInfo;
104 AUTH_LOGI(AUTH_CONN, "auth meta start post transdata");
105 return SOFTBUS_NOT_IMPLEMENT;
106 }
107
AuthMetaGetIdByConnInfo(const AuthConnInfo * connInfo,bool isServer)108 int64_t AuthMetaGetIdByConnInfo(const AuthConnInfo *connInfo, bool isServer)
109 {
110 (void)connInfo;
111 (void)isServer;
112 AUTH_LOGI(AUTH_CONN, "auth meta get auth id by connection info");
113 return SOFTBUS_NOT_IMPLEMENT;
114 }
115
AuthMetaGetIdByUuid(const char * uuid,AuthLinkType type,bool isServer)116 int64_t AuthMetaGetIdByUuid(const char *uuid, AuthLinkType type, bool isServer)
117 {
118 (void)uuid;
119 (void)type;
120 (void)isServer;
121 AUTH_LOGI(AUTH_CONN, "auth meta get auth id by uuid");
122 return SOFTBUS_NOT_IMPLEMENT;
123 }
124
AuthMetaSetP2pMac(int64_t authId,const char * p2pMac)125 int32_t AuthMetaSetP2pMac(int64_t authId, const char *p2pMac)
126 {
127 (void)authId;
128 (void)p2pMac;
129 AUTH_LOGI(AUTH_CONN, "auth meta set p2p mac info by auth id");
130 return SOFTBUS_NOT_IMPLEMENT;
131 }
132
AuthMetaGetConnInfo(int64_t authId,AuthConnInfo * connInfo)133 int32_t AuthMetaGetConnInfo(int64_t authId, AuthConnInfo *connInfo)
134 {
135 (void)authId;
136 (void)connInfo;
137 AUTH_LOGI(AUTH_CONN, "auth meta get connection info by auth id");
138 return SOFTBUS_NOT_IMPLEMENT;
139 }
140
AuthMetaGetServerSide(int64_t authId,bool * isServer)141 int32_t AuthMetaGetServerSide(int64_t authId, bool *isServer)
142 {
143 (void)authId;
144 (void)isServer;
145 AUTH_LOGI(AUTH_CONN, "auth meta get server side");
146 return SOFTBUS_NOT_IMPLEMENT;
147 }
148
AuthMetaGetDeviceUuid(int64_t authId,char * uuid,uint16_t size)149 int32_t AuthMetaGetDeviceUuid(int64_t authId, char *uuid, uint16_t size)
150 {
151 (void)authId;
152 (void)uuid;
153 (void)size;
154 AUTH_LOGI(AUTH_CONN, "auth meta get device uuid by auth id");
155 return SOFTBUS_NOT_IMPLEMENT;
156 }
157
AuthMetaGetVersion(int64_t authId,SoftBusVersion * version)158 int32_t AuthMetaGetVersion(int64_t authId, SoftBusVersion *version)
159 {
160 (void)authId;
161 (void)version;
162 AUTH_LOGI(AUTH_CONN, "auth meta get version by auth id");
163 return SOFTBUS_NOT_IMPLEMENT;
164 }
165
AuthMetaInit(const AuthTransCallback * callback)166 int32_t AuthMetaInit(const AuthTransCallback *callback)
167 {
168 (void)callback;
169 AUTH_LOGI(AUTH_INIT, "auth meta init");
170 return SOFTBUS_OK;
171 }
172
AuthMetaDeinit(void)173 void AuthMetaDeinit(void)
174 {
175 AUTH_LOGI(AUTH_INIT, "auth meta deinit");
176 }
177
DelAuthMetaManagerByPid(const char * pkgName,int32_t pid)178 void DelAuthMetaManagerByPid(const char *pkgName, int32_t pid)
179 {
180 (void)pkgName;
181 (void)pid;
182 }
183
AuthMetaGetConnIdByInfo(const AuthConnInfo * connInfo,uint32_t * connectionId)184 int32_t AuthMetaGetConnIdByInfo(const AuthConnInfo *connInfo, uint32_t *connectionId)
185 {
186 (void)connInfo;
187 (void)connectionId;
188 return SOFTBUS_OK;
189 }
190
AuthMetaCheckMetaExist(const AuthConnInfo * connInfo,bool * isExist)191 void AuthMetaCheckMetaExist(const AuthConnInfo *connInfo, bool *isExist)
192 {
193 (void)connInfo;
194 (void)isExist;
195 }
196
DelAuthMetaManagerByConnectionId(uint32_t connectionId)197 void DelAuthMetaManagerByConnectionId(uint32_t connectionId)
198 {
199 (void)connectionId;
200 }
201