• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #4898

26 Dec 2025 09:58AM UTC coverage: 65.061% (-0.7%) from 65.717%
#4898

push

travis-ci

web-flow
feat: support encryption of configuration files, data files and metadata files (#33801)

350 of 1333 new or added lines in 31 files covered. (26.26%)

2796 existing lines in 159 files now uncovered.

184024 of 282850 relevant lines covered (65.06%)

113940470.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

44.05
/source/dnode/mnode/impl/src/mndEncryptAlgr.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15

16
#define MND_ENCRYPT_ALGR_VER_NUMBER 1
17

18
#include "audit.h"
19
#include "mndEncryptAlgr.h"
20
#include "mndMnode.h"
21
#include "mndShow.h"
22
#include "mndSync.h"
23
#include "mndTrans.h"
24
#include "tencrypt.h"
25

26
static void tFreeEncryptAlgrObj(SEncryptAlgrObj *pEncryptAlgr) {}
2,408,070✔
27

28
static int32_t tSerializeSEncryptAlgrObj(void *buf, int32_t bufLen, const SEncryptAlgrObj *pObj) {
9,161,424✔
29
  SEncoder encoder = {0};
9,161,424✔
30
  int32_t  code = 0;
9,161,424✔
31
  int32_t  lino;
32
  int32_t  tlen;
33
  tEncoderInit(&encoder, buf, bufLen);
9,161,424✔
34

35
  TAOS_CHECK_EXIT(tStartEncode(&encoder));
9,161,424✔
36
  TAOS_CHECK_EXIT(tEncodeI32(&encoder, pObj->id));
18,322,848✔
37
  TAOS_CHECK_EXIT(tEncodeCStr(&encoder, pObj->algorithm_id));
18,322,848✔
38
  TAOS_CHECK_EXIT(tEncodeCStr(&encoder, pObj->name));
18,322,848✔
39
  TAOS_CHECK_EXIT(tEncodeCStr(&encoder, pObj->desc));
18,322,848✔
40
  TAOS_CHECK_EXIT(tEncodeI16(&encoder, pObj->type));
18,322,848✔
41
  TAOS_CHECK_EXIT(tEncodeI8(&encoder, pObj->source));
18,322,848✔
42
  TAOS_CHECK_EXIT(tEncodeCStr(&encoder, pObj->ossl_algr_name));
18,322,848✔
43

44
  tEndEncode(&encoder);
9,161,424✔
45

46
_exit:
9,161,424✔
47
  if (code) {
9,161,424✔
48
    tlen = code;
×
49
  } else {
50
    tlen = encoder.pos;
9,161,424✔
51
  }
52
  tEncoderClear(&encoder);
9,161,424✔
53
  return tlen;
9,161,424✔
54
}
55

56
static int32_t tDeserializeSEncryptAlgrObj(void *buf, int32_t bufLen, SEncryptAlgrObj *pObj) {
2,408,070✔
57
  int32_t  code = 0;
2,408,070✔
58
  int32_t  lino;
59
  SDecoder decoder = {0};
2,408,070✔
60
  tDecoderInit(&decoder, buf, bufLen);
2,408,070✔
61

62
  TAOS_CHECK_EXIT(tStartDecode(&decoder));
2,408,070✔
63
  TAOS_CHECK_EXIT(tDecodeI32(&decoder, &pObj->id));
4,816,140✔
64
  TAOS_CHECK_EXIT(tDecodeCStrTo(&decoder, pObj->algorithm_id));
2,408,070✔
65
  TAOS_CHECK_EXIT(tDecodeCStrTo(&decoder, pObj->name));
2,408,070✔
66
  TAOS_CHECK_EXIT(tDecodeCStrTo(&decoder, pObj->desc));
2,408,070✔
67
  TAOS_CHECK_EXIT(tDecodeI16(&decoder, &pObj->type));
4,816,140✔
68
  TAOS_CHECK_EXIT(tDecodeI8(&decoder, &pObj->source));
4,816,140✔
69
  TAOS_CHECK_EXIT(tDecodeCStrTo(&decoder, pObj->ossl_algr_name));
2,408,070✔
70

71
  tEndDecode(&decoder);
2,408,070✔
72

73
_exit:
2,408,070✔
74
  tDecoderClear(&decoder);
2,408,070✔
75
  return code;
2,408,070✔
76
}
77

78
static SSdbRaw *mndEncryptAlgrActionEncode(SEncryptAlgrObj *pEncryptAlgr) {
4,580,712✔
79
  int32_t code = 0;
4,580,712✔
80
  int32_t lino = 0;
4,580,712✔
81
  terrno = TSDB_CODE_SUCCESS;
4,580,712✔
82

83
  void    *buf = NULL;
4,580,712✔
84
  SSdbRaw *pRaw = NULL;
4,580,712✔
85

86
  int32_t tlen = tSerializeSEncryptAlgrObj(NULL, 0, pEncryptAlgr);
4,580,712✔
87
  if (tlen < 0) {
4,580,712✔
88
    terrno = TSDB_CODE_OUT_OF_MEMORY;
×
89
    goto OVER;
×
90
  }
91

92
  int32_t size = sizeof(int32_t) + tlen;
4,580,712✔
93
  pRaw = sdbAllocRaw(SDB_ENCRYPT_ALGORITHMS, MND_ENCRYPT_ALGR_VER_NUMBER, size);
4,580,712✔
94
  if (pRaw == NULL) {
4,580,712✔
95
    terrno = TSDB_CODE_OUT_OF_MEMORY;
×
96
    goto OVER;
×
97
  }
98

99
  buf = taosMemoryMalloc(tlen);
4,580,712✔
100
  if (buf == NULL) {
4,580,712✔
101
    terrno = TSDB_CODE_OUT_OF_MEMORY;
×
102
    goto OVER;
×
103
  }
104

105
  tlen = tSerializeSEncryptAlgrObj(buf, tlen, pEncryptAlgr);
4,580,712✔
106
  if (tlen < 0) {
4,580,712✔
107
    terrno = TSDB_CODE_OUT_OF_MEMORY;
×
108
    goto OVER;
×
109
  }
110

111
  int32_t dataPos = 0;
4,580,712✔
112
  SDB_SET_INT32(pRaw, dataPos, tlen, OVER);
4,580,712✔
113
  SDB_SET_BINARY(pRaw, dataPos, buf, tlen, OVER);
4,580,712✔
114
  SDB_SET_DATALEN(pRaw, dataPos, OVER);
4,580,712✔
115

116
OVER:
4,580,712✔
117
  taosMemoryFreeClear(buf);
4,580,712✔
118
  if (terrno != TSDB_CODE_SUCCESS) {
4,580,712✔
119
    mError("encrypt_algr:%" PRId32 ", failed to encode to raw:%p since %s", pEncryptAlgr->id, pRaw, terrstr());
×
120
    sdbFreeRaw(pRaw);
×
121
    return NULL;
×
122
  }
123

124
  mTrace("encrypt_algr:%" PRId32 ", encode to raw:%p, row:%p", pEncryptAlgr->id, pRaw, pEncryptAlgr);
4,580,712✔
125
  return pRaw;
4,580,712✔
126
}
127

128
SSdbRow *mndEncryptAlgrActionDecode(SSdbRaw *pRaw) {
2,408,070✔
129
  int32_t      code = 0;
2,408,070✔
130
  int32_t      lino = 0;
2,408,070✔
131
  SSdbRow     *pRow = NULL;
2,408,070✔
132
  SEncryptAlgrObj *pEncryptAlgr = NULL;
2,408,070✔
133
  void        *buf = NULL;
2,408,070✔
134
  terrno = TSDB_CODE_SUCCESS;
2,408,070✔
135

136
  int8_t sver = 0;
2,408,070✔
137
  if (sdbGetRawSoftVer(pRaw, &sver) != 0) {
2,408,070✔
138
    goto OVER;
×
139
  }
140

141
  if (sver != MND_ENCRYPT_ALGR_VER_NUMBER) {
2,408,070✔
142
    terrno = TSDB_CODE_SDB_INVALID_DATA_VER;
×
143
    mError("encrypt_algr read invalid ver, data ver: %d, curr ver: %d", sver, MND_ENCRYPT_ALGR_VER_NUMBER);
×
144
    goto OVER;
×
145
  }
146

147
  pRow = sdbAllocRow(sizeof(SEncryptAlgrObj));
2,408,070✔
148
  if (pRow == NULL) {
2,408,070✔
149
    terrno = TSDB_CODE_OUT_OF_MEMORY;
×
150
    goto OVER;
×
151
  }
152

153
  pEncryptAlgr = sdbGetRowObj(pRow);
2,408,070✔
154
  if (pEncryptAlgr == NULL) {
2,408,070✔
155
    terrno = TSDB_CODE_OUT_OF_MEMORY;
×
156
    goto OVER;
×
157
  }
158

159
  int32_t tlen;
2,407,188✔
160
  int32_t dataPos = 0;
2,408,070✔
161
  SDB_GET_INT32(pRaw, dataPos, &tlen, OVER);
2,408,070✔
162
  buf = taosMemoryMalloc(tlen + 1);
2,408,070✔
163
  if (buf == NULL) {
2,408,070✔
164
    terrno = TSDB_CODE_OUT_OF_MEMORY;
×
165
    goto OVER;
×
166
  }
167
  SDB_GET_BINARY(pRaw, dataPos, buf, tlen, OVER);
2,408,070✔
168

169
  if ((terrno = tDeserializeSEncryptAlgrObj(buf, tlen, pEncryptAlgr)) < 0) {
2,408,070✔
170
    goto OVER;
×
171
  }
172

173
OVER:
2,408,070✔
174
  taosMemoryFreeClear(buf);
2,408,070✔
175
  if (terrno != TSDB_CODE_SUCCESS) {
2,408,070✔
176
    mError("encrypt_algr:%" PRId32 ", failed to decode from raw:%p since %s", pEncryptAlgr->id, pRaw, terrstr());
×
177
    taosMemoryFreeClear(pRow);
×
178
    return NULL;
×
179
  }
180

181
  mTrace("encrypt_algr:%" PRId32 ", decode from raw:%p, row:%p", pEncryptAlgr->id, pRaw, pEncryptAlgr);
2,408,070✔
182
  return pRow;
2,408,070✔
183
}
184

185
int32_t mndEncryptAlgrActionInsert(SSdb *pSdb, SEncryptAlgrObj *pEncryptAlgr) {
2,408,070✔
186
  mTrace("encrypt_algr:%" PRId32 ", perform insert action", pEncryptAlgr->id);
2,408,070✔
187
  return 0;
2,408,070✔
188
}
189

190
int32_t mndEncryptAlgrActionDelete(SSdb *pSdb, SEncryptAlgrObj *pEncryptAlgr) {
2,408,070✔
191
  mTrace("encrypt_algr:%" PRId32 ", perform delete action", pEncryptAlgr->id);
2,408,070✔
192
  tFreeEncryptAlgrObj(pEncryptAlgr);
2,408,070✔
193
  return 0;
2,408,070✔
194
}
195

196
int32_t mndEncryptAlgrActionUpdate(SSdb *pSdb, SEncryptAlgrObj *pOldEncryptAlgr, SEncryptAlgrObj *pNewEncryptAlgr) {
×
197
  mTrace("encrypt_algr:%" PRId32 ", perform update action, old row:%p new row:%p", pOldEncryptAlgr->id, pOldEncryptAlgr,
×
198
         pNewEncryptAlgr);
199

200
  return 0;
×
201
}
202

203
typedef void (*mndSetEncryptAlgrFp)(SEncryptAlgrObj *Obj);
204

205
static void mndSetSM4EncryptAlgr(SEncryptAlgrObj *Obj){
287,693✔
206
  Obj->id = 1;
287,693✔
207
  strncpy(Obj->algorithm_id, "SM4-CBC", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
208
  strncpy(Obj->name, "SM4", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
209
  strncpy(Obj->desc, "SM4 symmetric encryption", TSDB_ENCRYPT_ALGR_DESC_LEN);
287,693✔
210
  Obj->type = ENCRYPT_ALGR_TYPE__SYMMETRIC_CIPHERS;
287,693✔
211
  Obj->source = ENCRYPT_ALGR_SOURCE_BUILTIN;
287,693✔
212
  strncpy(Obj->ossl_algr_name, "SM4-CBC:SM4", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
213
}
287,693✔
214

215
static void mndSetAESEncryptAlgr(SEncryptAlgrObj *Obj){
287,693✔
216
  Obj->id = 2;
287,693✔
217
  strncpy(Obj->algorithm_id, "AES-128-CBC", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
218
  strncpy(Obj->name, "AES", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
219
  strncpy(Obj->desc, "AES symmetric encryption", TSDB_ENCRYPT_ALGR_DESC_LEN);
287,693✔
220
  Obj->type = ENCRYPT_ALGR_TYPE__SYMMETRIC_CIPHERS;
287,693✔
221
  Obj->source = ENCRYPT_ALGR_SOURCE_BUILTIN;
287,693✔
222
  strncpy(Obj->ossl_algr_name, "AES-128-CBC", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
223
}
287,693✔
224

225
static void mndSetSM3EncryptAlgr(SEncryptAlgrObj *Obj) {
287,693✔
226
  Obj->id = 3;
287,693✔
227
  strncpy(Obj->algorithm_id, "SM3", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
228
  strncpy(Obj->name, "SM3", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
229
  strncpy(Obj->desc, "SM3 digests", TSDB_ENCRYPT_ALGR_DESC_LEN);
287,693✔
230
  Obj->type = ENCRYPT_ALGR_TYPE__DIGEST;
287,693✔
231
  Obj->source = ENCRYPT_ALGR_SOURCE_BUILTIN;
287,693✔
232
  strncpy(Obj->ossl_algr_name, "SM3", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
233
}
287,693✔
234

235
static void mndSetSHAEncryptAlgr(SEncryptAlgrObj *Obj) {
287,693✔
236
  Obj->id = 4;
287,693✔
237
  strncpy(Obj->algorithm_id, "SHA-256", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
238
  strncpy(Obj->name, "SHA-256", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
239
  strncpy(Obj->desc, "SHA2 digests", TSDB_ENCRYPT_ALGR_DESC_LEN);
287,693✔
240
  Obj->type = ENCRYPT_ALGR_TYPE__DIGEST;
287,693✔
241
  Obj->source = ENCRYPT_ALGR_SOURCE_BUILTIN;
287,693✔
242
  strncpy(Obj->ossl_algr_name, "SHA-256", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
243
}
287,693✔
244

245
static void mndSetSM2EncryptAlgr(SEncryptAlgrObj *Obj) {
287,693✔
246
  Obj->id = 5;
287,693✔
247
  strncpy(Obj->algorithm_id, "SM2", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
248
  strncpy(Obj->name, "SM2", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
249
  strncpy(Obj->desc, "SM2 Asymmetric Cipher", TSDB_ENCRYPT_ALGR_DESC_LEN);
287,693✔
250
  Obj->type = ENCRYPT_ALGR_TYPE__ASYMMETRIC_CIPHERS;
287,693✔
251
  Obj->source = ENCRYPT_ALGR_SOURCE_BUILTIN;
287,693✔
252
}
287,693✔
253

254
static void mndSetRSAEncryptAlgr(SEncryptAlgrObj *Obj) {
287,693✔
255
  Obj->id = 6;
287,693✔
256
  strncpy(Obj->algorithm_id, "RSA", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
257
  strncpy(Obj->name, "RSA", TSDB_ENCRYPT_ALGR_NAME_LEN);
287,693✔
258
  strncpy(Obj->desc, "RSA Asymmetric Cipher", TSDB_ENCRYPT_ALGR_DESC_LEN);
287,693✔
259
  Obj->type = ENCRYPT_ALGR_TYPE__ASYMMETRIC_CIPHERS;
287,693✔
260
  Obj->source = ENCRYPT_ALGR_SOURCE_BUILTIN;
287,693✔
261
}
287,693✔
262

263
static SSdbRaw * mndCreateEncryptAlgrRaw(STrans *pTrans, SEncryptAlgrObj *Obj) {
1,726,158✔
264
  int32_t code = 0;
1,726,158✔
265

266
  SSdbRaw *pRaw = mndEncryptAlgrActionEncode(Obj);
1,726,158✔
267
  if (pRaw == NULL) {
1,726,158✔
268
    return NULL;
×
269
  }
270
  code = sdbSetRawStatus(pRaw, SDB_STATUS_READY);
1,726,158✔
271
  if (code != 0) {
1,726,158✔
272
    terrno = code;
×
273
    return NULL;
×
274
  }
275

276
  if ((code = mndTransAppendCommitlog(pTrans, pRaw)) != 0) {
1,726,158✔
277
    terrno = code;
×
278
    return NULL;
×
279
  }
280
  return pRaw;
1,726,158✔
281
}
282

283
int32_t mndSendCreateBuiltinReq(SMnode *pMnode) {
287,693✔
284
  int32_t code = 0;
287,693✔
285

286
  SRpcMsg rpcMsg = {.pCont = NULL,
287,693✔
287
                    .contLen = 0,
288
                    .msgType = TDMT_MND_BUILTIN_ENCRYPT_ALGR,
289
                    .info.ahandle = 0,
290
                    .info.notFreeAhandle = 1,
291
                    .info.refId = 0,
292
                    .info.noResp = 0,
293
                    .info.handle = 0};
294
  SEpSet  epSet = {0};
287,693✔
295

296
  mndGetMnodeEpSet(pMnode, &epSet);
287,693✔
297

298
  code = tmsgSendReq(&epSet, &rpcMsg);
287,693✔
299
  if (code != 0) {
287,693✔
300
    mError("failed to send builtin encrypt algr req, since %s", tstrerror(code));
×
301
  }
302
  return code;
287,693✔
303
}
304

305
static int32_t mndCreateBuiltinEncryptAlgr(SMnode *pMnode) {
287,693✔
306
  int32_t code = 0;
287,693✔
307
  STrans *pTrans = NULL;
287,693✔
308

309
  mndSetEncryptAlgrFp setFpArr[] = {mndSetSM4EncryptAlgr
287,693✔
310
#if defined(TD_ENTERPRISE) && defined(LINUX)
311
                                    ,
312
                                    mndSetAESEncryptAlgr,
313
                                    mndSetSM3EncryptAlgr,
314
                                    mndSetSHAEncryptAlgr,
315
                                    mndSetSM2EncryptAlgr,
316
                                    mndSetRSAEncryptAlgr
317
#endif
318
  };
319

320
  int32_t algrNum = sizeof(setFpArr) / sizeof(mndSetEncryptAlgrFp);
287,693✔
321

322
  pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_NOTHING, NULL, "create-enc-algr");
287,693✔
323
  if (pTrans == NULL) {
287,693✔
324
    mError("failed to create since %s",terrstr());
×
325
    code = terrno;
×
326
    goto _OVER;
×
327
  }
328
  mInfo("trans:%d, used to create default encrypt_algr", pTrans->id);
287,693✔
329

330
  for (int32_t i = 0; i < algrNum; i++) {
2,013,851✔
331
    SEncryptAlgrObj *Obj = taosMemoryMalloc(sizeof(SEncryptAlgrObj));
1,726,158✔
332
    if (Obj == NULL) {
1,726,158✔
333
      goto _OVER;
×
334
    }
335
    memset(Obj, 0, sizeof(SEncryptAlgrObj));
1,726,158✔
336
    setFpArr[i](Obj);
1,726,158✔
337
    SSdbRaw *pRaw = mndCreateEncryptAlgrRaw(pTrans, Obj);
1,726,158✔
338
    taosMemoryFree(Obj);
1,726,158✔
339
    if (pRaw == NULL) {
1,726,158✔
340
      mError("trans:%d, failed to commit redo log since %s", pTrans->id, terrstr());
×
341
      goto _OVER;
×
342
    }
343
  }
344

345
  if ((code = mndTransPrepare(pMnode, pTrans)) != 0) {
287,693✔
346
    mError("trans:%d, failed to prepare since %s", pTrans->id, terrstr());
×
347
    goto _OVER;
×
348
  }
349

350
  code = 0;
287,693✔
351

352
_OVER:
287,693✔
353
  mndTransDrop(pTrans);
287,693✔
354
  return code;
287,693✔
355
}
356

357
static int32_t mndProcessBuiltinReq(SRpcMsg *pReq) {
287,693✔
358
  SMnode *pMnode = pReq->info.node;
287,693✔
359
  if (!mndIsLeader(pMnode)) {
287,693✔
360
    return TSDB_CODE_SUCCESS;
×
361
  }
362

363
  return mndCreateBuiltinEncryptAlgr(pMnode);
287,693✔
364
}
365

366
static int32_t mndProcessBuiltinRsp(SRpcMsg *pRsp) {
287,693✔
367
  mInfo("builtin rsp");
287,693✔
368
  return 0;
287,693✔
369
}
370

371
static int32_t mndUpgradeBuiltinEncryptAlgr(SMnode *pMnode, int32_t version) {
361,944✔
372
  if (version >= TSDB_MNODE_BUILTIN_DATA_VERSION) return 0;
361,944✔
373

374
  return mndSendCreateBuiltinReq(pMnode);
287,693✔
375
}
376

377
#define SYMCBC "Symmetric Ciphers CBC mode"
378
#define ASYM       "Asymmetric Ciphers"
379
#define DIGEST     "Digests"
380
#define BUILTIN "build-in"
381
#define CUSTOMIZED "customized"
382
static int32_t mndRetrieveEncryptAlgr(SRpcMsg *pMsg, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows){
×
383
  SMnode      *pMnode = pMsg->info.node;
×
384
  SSdb        *pSdb = pMnode->pSdb;
×
385
  int32_t      code = 0;
×
386
  int32_t      lino = 0;
×
387
  int32_t      numOfRows = 0;
×
388
  int32_t      cols = 0;
×
389
  SEncryptAlgrObj *pObj = NULL;
×
390

391
  char tmpBuf[1000] = {0};
×
392

393
  while (numOfRows < rows) {
×
394
    pShow->pIter = sdbFetch(pSdb, SDB_ENCRYPT_ALGORITHMS, pShow->pIter, (void **)&pObj);
×
395
    if (pShow->pIter == NULL) break;
×
396

397
    cols = 0;
×
398
    SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
399
    COL_DATA_SET_VAL_GOTO((const char *)&pObj->id, false, pObj, pShow->pIter, _OVER);
×
400

401
    pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
402
    tstrncpy(varDataVal(tmpBuf), pObj->algorithm_id, TSDB_ENCRYPT_ALGR_NAME_LEN);
×
403
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
404
    RETRIEVE_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), pObj, &lino, _OVER);
×
405

406
    pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
407
    tstrncpy(varDataVal(tmpBuf), pObj->name, TSDB_ENCRYPT_ALGR_NAME_LEN);
×
408
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
409
    RETRIEVE_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), pObj, &lino, _OVER);
×
410

411
    pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
412
    tstrncpy(varDataVal(tmpBuf), pObj->desc, TSDB_ENCRYPT_ALGR_DESC_LEN);
×
413
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
414
    RETRIEVE_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), pObj, &lino, _OVER);
×
415

416
    pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
417
    if(pObj->type == ENCRYPT_ALGR_TYPE__SYMMETRIC_CIPHERS){
×
418
      tstrncpy(varDataVal(tmpBuf), SYMCBC, strlen(SYMCBC) + 1);
×
419
    } else if (pObj->type == ENCRYPT_ALGR_TYPE__DIGEST) {
×
420
      tstrncpy(varDataVal(tmpBuf), DIGEST, strlen(DIGEST) + 1);
×
421
    } else if (pObj->type == ENCRYPT_ALGR_TYPE__ASYMMETRIC_CIPHERS) {
×
422
      tstrncpy(varDataVal(tmpBuf), ASYM, strlen(ASYM) + 1);
×
423
    }
424
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
425
    RETRIEVE_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), pObj, &lino, _OVER);
×
426

427
    memset(tmpBuf, 0, 1000);
×
428
    pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
429
    if(pObj->source == ENCRYPT_ALGR_SOURCE_BUILTIN){
×
430
      tstrncpy(varDataVal(tmpBuf), BUILTIN, strlen(BUILTIN) + 1);
×
431
    } else if (pObj->source == ENCRYPT_ALGR_SOURCE_CUSTOMIZED) {
×
432
      tstrncpy(varDataVal(tmpBuf), CUSTOMIZED, strlen(CUSTOMIZED) + 1);
×
433
    }
434
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
435
    RETRIEVE_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), pObj, &lino, _OVER);
×
436

437
    pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
438
    tstrncpy(varDataVal(tmpBuf), pObj->ossl_algr_name, TSDB_ENCRYPT_ALGR_NAME_LEN);
×
439
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
440
    RETRIEVE_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), pObj, &lino, _OVER);
×
441

442
    sdbRelease(pSdb, pObj);
×
443
    numOfRows++;
×
444
  }
445

446
  pShow->numOfRows += numOfRows;
×
447

448
_OVER:
×
449
  if (code != 0) {
×
450
    mError("failed to retrieve encrypt_algr info at line %d since %s", lino, tstrerror(code));
×
451
    TAOS_RETURN(code);
×
452
  }
453
  return numOfRows;
×
454
}
455

456
static int32_t mndProcessCreateEncryptAlgrReq(SRpcMsg *pReq) {
×
457
  SMnode               *pMnode = pReq->info.node;
×
458
  int32_t               code = 0;
×
459
  int32_t               lino = 0;
×
460
  SCreateEncryptAlgrReq createReq = {0};
×
461
  STrans               *pTrans = NULL;
×
462

463
  int64_t tss = taosGetTimestampMs();
×
464

465
  if (tDeserializeSCreateEncryptAlgrReq(pReq->pCont, pReq->contLen, &createReq) != 0) {
×
466
    TAOS_CHECK_GOTO(TSDB_CODE_INVALID_MSG, &lino, _OVER);
×
467
  }
468

469
  mInfo("algr:%s, start to create, ossl_name:%s", createReq.algorithmId, createReq.osslAlgrName);
×
470

471
  // TAOS_CHECK_GOTO(grantCheck(TSDB_GRANT_USER), &lino, _OVER);
472

473
  SEncryptAlgrObj *exist = mndAcquireEncryptAlgrByAId(pMnode, createReq.algorithmId);
×
474
  if (exist != NULL) {
×
475
    mndReleaseEncryptAlgr(pMnode, exist);
×
476
    TAOS_CHECK_GOTO(TSDB_CODE_MNODE_ALGR_EXIST, &lino, _OVER);
×
477
  }
478

479
  SEncryptAlgrObj Obj = {0};
×
480
  int32_t         id = sdbGetMaxId(pMnode->pSdb, SDB_ENCRYPT_ALGORITHMS);
×
481
  if (id < 100) id = 101;
×
482
  Obj.id = id;
×
483
  strncpy(Obj.algorithm_id, createReq.algorithmId, TSDB_ENCRYPT_ALGR_NAME_LEN);
×
484
  strncpy(Obj.name, createReq.name, TSDB_ENCRYPT_ALGR_NAME_LEN);
×
485
  strncpy(Obj.desc, createReq.desc, TSDB_ENCRYPT_ALGR_DESC_LEN);
×
486
  if (strncmp(createReq.type, "Symmetric_Ciphers_CBC_mode", TSDB_ENCRYPT_ALGR_TYPE_LEN) == 0) {
×
487
    Obj.type = ENCRYPT_ALGR_TYPE__SYMMETRIC_CIPHERS;
×
488
  } else if (strncmp(createReq.type, "Digests", TSDB_ENCRYPT_ALGR_TYPE_LEN) == 0) {
×
489
    Obj.type = ENCRYPT_ALGR_TYPE__DIGEST;
×
490
  } else if (strncmp(createReq.type, "Asymmetric_Ciphers", TSDB_ENCRYPT_ALGR_TYPE_LEN) == 0) {
×
491
    Obj.type = ENCRYPT_ALGR_TYPE__ASYMMETRIC_CIPHERS;
×
492
  } else {
493
    TAOS_CHECK_GOTO(TSDB_CODE_MNODE_INVALID_ENCRYPT_ALGR_TYPE, &lino, _OVER);
×
494
  }
495
  Obj.source = ENCRYPT_ALGR_SOURCE_CUSTOMIZED;
×
496
  strncpy(Obj.ossl_algr_name, createReq.osslAlgrName, TSDB_ENCRYPT_ALGR_NAME_LEN);
×
497

498
  pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_NOTHING, NULL, "create-enc-algr");
×
499
  if (pTrans == NULL) {
×
500
    mError("failed to create since %s", terrstr());
×
501
    code = terrno;
×
502
    goto _OVER;
×
503
  }
504
  mInfo("trans:%d, used to create encrypt_algr", pTrans->id);
×
505

506
  SSdbRaw *pRaw = mndCreateEncryptAlgrRaw(pTrans, &Obj);
×
507
  if (pRaw == NULL) {
×
508
    mError("trans:%d, failed to commit redo log since %s", pTrans->id, terrstr());
×
509
    goto _OVER;
×
510
  }
511

512
  if ((code = mndTransPrepare(pMnode, pTrans)) != 0) {
×
513
    mError("trans:%d, failed to prepare since %s", pTrans->id, terrstr());
×
514
    goto _OVER;
×
515
  }
516

517
  if (tsAuditLevel >= AUDIT_LEVEL_CLUSTER) {
×
518
    int64_t tse = taosGetTimestampMs();
×
519
    double  duration = (double)(tse - tss);
×
520
    duration = duration / 1000;
×
521
    auditRecord(pReq, pMnode->clusterId, "createEncryptAlgr", "", createReq.algorithmId, createReq.sql,
×
522
                strlen(createReq.sql), duration, 0);
×
523
  }
524

525
  return code;
×
526
_OVER:
×
527
  if (code < 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) {
×
528
    mError("algr:%s, failed to create at line %d since %s", createReq.algorithmId, lino, tstrerror(code));
×
529
  }
530

531
  tFreeSCreateEncryptAlgrReq(&createReq);
×
532
  mndTransDrop(pTrans);
×
533
  TAOS_RETURN(code);
×
534
}
535

536
static int32_t mndDropEncryptAlgr(SMnode *pMnode, SRpcMsg *pReq, SEncryptAlgrObj *pAlgr) {
×
537
  STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_NOTHING, pReq, "drop-encrypt-algr");
×
538
  if (pTrans == NULL) {
×
539
    mError("algr:%s, failed to drop since %s", pAlgr->algorithm_id, terrstr());
×
540
    TAOS_RETURN(terrno);
×
541
  }
542
  mInfo("trans:%d, used to drop algr:%s", pTrans->id, pAlgr->algorithm_id);
×
543

544
  SSdbRaw *pCommitRaw = mndEncryptAlgrActionEncode(pAlgr);
×
545
  if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) {
×
546
    mError("trans:%d, failed to append commit log since %s", pTrans->id, terrstr());
×
547
    mndTransDrop(pTrans);
×
548
    TAOS_RETURN(terrno);
×
549
  }
550
  if (sdbSetRawStatus(pCommitRaw, SDB_STATUS_DROPPED) < 0) {
×
551
    mndTransDrop(pTrans);
×
552
    TAOS_RETURN(terrno);
×
553
  }
554

555
  if (mndTransPrepare(pMnode, pTrans) != 0) {
×
556
    mError("trans:%d, failed to prepare since %s", pTrans->id, terrstr());
×
557
    mndTransDrop(pTrans);
×
558
    TAOS_RETURN(terrno);
×
559
  }
560

561
  mndTransDrop(pTrans);
×
562
  TAOS_RETURN(0);
×
563
}
564

565
static int32_t mndProcessDropEncryptAlgrReq(SRpcMsg *pReq) {
×
566
  SMnode             *pMnode = pReq->info.node;
×
567
  int32_t             code = 0;
×
568
  int32_t             lino = 0;
×
569
  SEncryptAlgrObj    *pObj = NULL;
×
570
  SDropEncryptAlgrReq dropReq = {0};
×
571

572
  int64_t tss = taosGetTimestampMs();
×
573

574
  TAOS_CHECK_GOTO(tDeserializeSDropEncryptAlgrReq(pReq->pCont, pReq->contLen, &dropReq), &lino, _OVER);
×
575

576
  mInfo("algr:%s, start to drop", dropReq.algorithmId);
×
577
  // TAOS_CHECK_GOTO(mndCheckOperPrivilege(pMnode, RPC_MSG_USER(pReq), RPC_MSG_TOKEN(pReq), MND_OPER_DROP_USER), &lino, _OVER);
578

579
  if (dropReq.algorithmId[0] == 0) {
×
580
    TAOS_CHECK_GOTO(TSDB_CODE_MND_INVALID_ENCRYPT_ALGR_FORMAT, &lino, _OVER);
×
581
  }
582

583
  pObj = mndAcquireEncryptAlgrByAId(pMnode, dropReq.algorithmId);
×
584
  if (pObj == NULL) {
×
585
    TAOS_CHECK_GOTO(TSDB_CODE_MNODE_ENCRYPT_ALGR_NOT_EXIST, &lino, _OVER);
×
586
  }
587

588
  bool    exist = false;
×
589
  void   *pIter = NULL;
×
590
  SDbObj *pDb = NULL;
×
591
  while (1) {
592
    pIter = sdbFetch(pMnode->pSdb, SDB_DB, pIter, (void **)&pDb);
×
593
    if (pIter == NULL) break;
×
594

595
    if (pDb->cfg.encryptAlgorithm == pObj->id) {
×
596
      exist = true;
×
597
      sdbRelease(pMnode->pSdb, pDb);
×
598
      sdbCancelFetch(pMnode->pSdb, pIter);
×
599
      break;
×
600
    }
601

602
    sdbRelease(pMnode->pSdb, pDb);
×
603
  }
604

605
  if (exist) {
×
606
    TAOS_CHECK_GOTO(TSDB_CODE_MNODE_ENCRYPT_ALGR_IN_USE, &lino, _OVER);
×
607
  }
608

609
  TAOS_CHECK_GOTO(mndDropEncryptAlgr(pMnode, pReq, pObj), &lino, _OVER);
×
610
  if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS;
×
611

612
  if (tsAuditLevel >= AUDIT_LEVEL_CLUSTER) {
×
613
    int64_t tse = taosGetTimestampMs();
×
614
    double  duration = (double)(tse - tss);
×
615
    duration = duration / 1000;
×
616
    auditRecord(pReq, pMnode->clusterId, "dropEncryptAlgr", "", dropReq.algorithmId, dropReq.sql, dropReq.sqlLen,
×
617
                duration, 0);
618
  }
619

620
_OVER:
×
621
  if (code < 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) {
×
622
    mError("algr:%s, failed to drop at line %d since %s", dropReq.algorithmId, lino, tstrerror(code));
×
623
  }
624

625
  mndReleaseEncryptAlgr(pMnode, pObj);
×
626
  tFreeSDropEncryptAlgrReq(&dropReq);
×
627
  TAOS_RETURN(code);
×
628
}
629

NEW
630
static int32_t mndRetrieveEncryptStatus(SRpcMsg *pMsg, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) {
×
NEW
631
  int32_t code = 0;
×
NEW
632
  int32_t lino = 0;
×
NEW
633
  int32_t numOfRows = 0;
×
NEW
634
  int32_t cols = 0;
×
NEW
635
  char    tmpBuf[1000] = {0};
×
636

637
  // Only return data if not already retrieved
NEW
638
  if (pShow->numOfRows > 0) {
×
NEW
639
    return 0;
×
640
  }
641

642
  // Row 1: config encryption status
NEW
643
  if (numOfRows < rows) {
×
NEW
644
    cols = 0;
×
NEW
645
    SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
NEW
646
    tstrncpy(varDataVal(tmpBuf), "config", 32);
×
NEW
647
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
NEW
648
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), &lino, _OVER);
×
649

NEW
650
    pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
NEW
651
    tstrncpy(varDataVal(tmpBuf), taosGetEncryptAlgoName(tsCfgAlgorithm), 32);
×
NEW
652
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
NEW
653
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), &lino, _OVER);
×
654

NEW
655
    pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
NEW
656
    tstrncpy(varDataVal(tmpBuf), (tsCfgKey[0] != '\0') ? "enabled" : "disabled", 16);
×
NEW
657
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
NEW
658
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), &lino, _OVER);
×
659

NEW
660
    numOfRows++;
×
661
  }
662

663
  // Row 2: metadata encryption status
NEW
664
  if (numOfRows < rows) {
×
NEW
665
    cols = 0;
×
NEW
666
    SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
NEW
667
    tstrncpy(varDataVal(tmpBuf), "metadata", 32);
×
NEW
668
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
NEW
669
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), &lino, _OVER);
×
670

NEW
671
    pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
NEW
672
    tstrncpy(varDataVal(tmpBuf), taosGetEncryptAlgoName(tsMetaAlgorithm), 32);
×
NEW
673
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
NEW
674
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), &lino, _OVER);
×
675

NEW
676
    pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
NEW
677
    tstrncpy(varDataVal(tmpBuf), (tsMetaKey[0] != '\0') ? "enabled" : "disabled", 16);
×
NEW
678
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
NEW
679
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), &lino, _OVER);
×
680

NEW
681
    numOfRows++;
×
682
  }
683

684
  // Row 3: data encryption status
NEW
685
  if (numOfRows < rows) {
×
NEW
686
    cols = 0;
×
NEW
687
    SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
NEW
688
    tstrncpy(varDataVal(tmpBuf), "data", 32);
×
NEW
689
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
NEW
690
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), &lino, _OVER);
×
691

NEW
692
    pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
693
    // Data key uses the master algorithm (usually SM4)
NEW
694
    tstrncpy(varDataVal(tmpBuf), taosGetEncryptAlgoName(tsEncryptAlgorithmType), 32);
×
NEW
695
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
NEW
696
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), &lino, _OVER);
×
697

NEW
698
    pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
×
NEW
699
    tstrncpy(varDataVal(tmpBuf), (tsDataKey[0] != '\0') ? "enabled" : "disabled", 16);
×
NEW
700
    varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf)));
×
NEW
701
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false), &lino, _OVER);
×
702

NEW
703
    numOfRows++;
×
704
  }
705

NEW
706
  pShow->numOfRows += numOfRows;
×
NEW
707
  return numOfRows;
×
708

NEW
709
_OVER:
×
NEW
710
  if (code != 0) {
×
NEW
711
    mError("failed to retrieve encrypt status at line %d since %s", lino, tstrerror(code));
×
712
  }
NEW
713
  return numOfRows;
×
714
}
715

716
int32_t mndInitEncryptAlgr(SMnode *pMnode) {
401,409✔
717
  mndSetMsgHandle(pMnode, TDMT_MND_CREATE_ENCRYPT_ALGR, mndProcessCreateEncryptAlgrReq);
401,409✔
718
  mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_ENCRYPT_ALGORITHMS, mndRetrieveEncryptAlgr);
401,409✔
719
  mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_ENCRYPT_STATUS, mndRetrieveEncryptStatus);
401,409✔
720
  mndSetMsgHandle(pMnode, TDMT_MND_DROP_ENCRYPT_ALGR, mndProcessDropEncryptAlgrReq);
401,409✔
721
  mndSetMsgHandle(pMnode, TDMT_MND_BUILTIN_ENCRYPT_ALGR, mndProcessBuiltinReq);
401,409✔
722
  mndSetMsgHandle(pMnode, TDMT_MND_BUILTIN_ENCRYPT_ALGR_RSP, mndProcessBuiltinRsp);
401,409✔
723

724
  SSdbTable table = {
401,409✔
725
      .sdbType = SDB_ENCRYPT_ALGORITHMS,
726
      .keyType = SDB_KEY_INT32,
727
      .upgradeFp = (SdbUpgradeFp)mndUpgradeBuiltinEncryptAlgr,
728
      .encodeFp = (SdbEncodeFp)mndEncryptAlgrActionEncode,
729
      .decodeFp = (SdbDecodeFp)mndEncryptAlgrActionDecode,
730
      .insertFp = (SdbInsertFp)mndEncryptAlgrActionInsert,
731
      .updateFp = (SdbUpdateFp)mndEncryptAlgrActionUpdate,
732
      .deleteFp = (SdbDeleteFp)mndEncryptAlgrActionDelete,
733
  };
734

735
  return sdbSetTable(pMnode->pSdb, table);
401,409✔
736
}
737

738
void mndCleanupEncryptAlgr(SMnode *pMnode) { mDebug("mnd encrypt algorithms cleanup"); }
401,345✔
739

740
SEncryptAlgrObj *mndAcquireEncryptAlgrById(SMnode *pMnode, int64_t id) {
1,580,491✔
741
  SSdb        *pSdb = pMnode->pSdb;
1,580,491✔
742
  SEncryptAlgrObj *pAlgr = sdbAcquire(pSdb, SDB_ENCRYPT_ALGORITHMS, &id);
1,580,491✔
743
  if (pAlgr == NULL && terrno == TSDB_CODE_SDB_OBJ_NOT_THERE) {
1,580,491✔
744
    terrno = TSDB_CODE_SUCCESS;
1,580,491✔
745
  }
746
  return pAlgr;
1,580,491✔
747
}
748

749
void mndGetEncryptOsslAlgrNameById(SMnode *pMnode, int64_t id, char* out){
1,580,491✔
750
  SEncryptAlgrObj *obj = mndAcquireEncryptAlgrById(pMnode, id);
1,580,491✔
751
  if(obj != NULL){
1,580,491✔
UNCOV
752
    tstrncpy(out, obj->ossl_algr_name, TSDB_ENCRYPT_ALGR_NAME_LEN);
×
UNCOV
753
    mndReleaseEncryptAlgr(pMnode, obj);
×
754
  }
755
}
1,580,491✔
756

757
SEncryptAlgrObj *mndAcquireEncryptAlgrByAId(SMnode *pMnode, char* algorithm_id) {
2,166✔
758
  SSdb        *pSdb = pMnode->pSdb;
2,166✔
759
  SEncryptAlgrObj *pObj = NULL;
2,166✔
760
  void *pIter = NULL;
2,166✔
761
  while (1) {
762
    pIter = sdbFetch(pSdb, SDB_ENCRYPT_ALGORITHMS, pIter, (void **)&pObj);
6,552✔
763
    if (pIter == NULL) break;
6,552✔
764

765
    if (strncasecmp(pObj->algorithm_id, algorithm_id, TSDB_ENCRYPT_ALGR_NAME_LEN) == 0) {
5,821✔
766
      sdbCancelFetch(pSdb, pIter);
1,435✔
767
      break;
1,435✔
768
    }
769

770
    sdbRelease(pSdb, pObj);
4,386✔
771
  }
772
  return pObj;
2,166✔
773
}
774

UNCOV
775
void mndReleaseEncryptAlgr(SMnode *pMnode, SEncryptAlgrObj *pObj) {
×
UNCOV
776
  SSdb *pSdb = pMnode->pSdb;
×
UNCOV
777
  sdbRelease(pSdb, pObj);
×
UNCOV
778
  pObj = NULL;
×
UNCOV
779
}
×
780

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc