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

PowerDNS / pdns / 13112099868

03 Feb 2025 11:07AM UTC coverage: 64.702% (+0.005%) from 64.697%
13112099868

Pull #15054

github

web-flow
Merge 1f4968bf2 into 7e414adc8
Pull Request #15054: more clang-tidy fixups

38329 of 90324 branches covered (42.44%)

Branch coverage included in aggregate %.

43 of 59 new or added lines in 20 files covered. (72.88%)

510 existing lines in 19 files now uncovered.

127840 of 166499 relevant lines covered (76.78%)

4721746.76 hits per line

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

57.01
/modules/bindbackend/binddnssec.cc
1
/*
2
 * This file is part of PowerDNS or dnsdist.
3
 * Copyright -- PowerDNS.COM B.V. and its contributors
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of version 2 of the GNU General Public License as
7
 * published by the Free Software Foundation.
8
 *
9
 * In addition, for the avoidance of any doubt, permission is granted to
10
 * link this program with OpenSSL and to (re)distribute the binaries
11
 * produced as the result of such linking.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
 */
22

23
#ifdef HAVE_CONFIG_H
24
#include "config.h"
25
#endif
26
#include "bindbackend2.hh"
27
#include "pdns/arguments.hh"
28
#include "pdns/dnsrecords.hh"
29

30
#ifndef HAVE_SQLITE3
31

32
void Bind2Backend::setupDNSSEC()
33
{
34
  if (!getArg("dnssec-db").empty()) {
35
    throw runtime_error("bind-dnssec-db requires building PowerDNS with SQLite3");
36
  }
37
}
38

39
bool Bind2Backend::doesDNSSEC()
40
{
41
  return d_hybrid;
42
}
43

44
bool Bind2Backend::getNSEC3PARAM(const DNSName& /* name */, NSEC3PARAMRecordContent* /* ns3p */)
45
{
46
  return false;
47
}
48

49
bool Bind2Backend::getNSEC3PARAMuncached(const DNSName& /* name */, NSEC3PARAMRecordContent* /* ns3p */)
50
{
51
  return false;
52
}
53

54
bool Bind2Backend::getAllDomainMetadata(const DNSName& /* name */, std::map<std::string, std::vector<std::string>>& /* meta */)
55
{
56
  return false;
57
}
58

59
bool Bind2Backend::getDomainMetadata(const DNSName& /* name */, const std::string& /* kind */, std::vector<std::string>& /* meta */)
60
{
61
  return false;
62
}
63

64
bool Bind2Backend::setDomainMetadata(const DNSName& /* name */, const std::string& /* kind */, const std::vector<std::string>& /* meta */)
65
{
66
  return false;
67
}
68

69
bool Bind2Backend::getDomainKeys(const DNSName& /* name */, std::vector<KeyData>& /* keys */)
70
{
71
  return false;
72
}
73

74
bool Bind2Backend::removeDomainKey(const DNSName& /* name */, unsigned int /* id */)
75
{
76
  return false;
77
}
78

79
bool Bind2Backend::addDomainKey(const DNSName& /* name */, const KeyData& /* key */, int64_t& /* id */)
80
{
81
  return false;
82
}
83

84
bool Bind2Backend::activateDomainKey(const DNSName& /* name */, unsigned int /* id */)
85
{
86
  return false;
87
}
88

89
bool Bind2Backend::deactivateDomainKey(const DNSName& /* name */, unsigned int /* id */)
90
{
91
  return false;
92
}
93

94
bool Bind2Backend::publishDomainKey(const DNSName& /* name */, unsigned int /* id */)
95
{
96
  return false;
97
}
98

99
bool Bind2Backend::unpublishDomainKey(const DNSName& /* name */, unsigned int /* id */)
100
{
101
  return false;
102
}
103

104
bool Bind2Backend::getTSIGKey(const DNSName& /* name */, DNSName& /* algorithm */, string& /* content */)
105
{
106
  return false;
107
}
108

109
bool Bind2Backend::setTSIGKey(const DNSName& /* name */, const DNSName& /* algorithm */, const string& /* content */)
110
{
111
  return false;
112
}
113

114
bool Bind2Backend::deleteTSIGKey(const DNSName& /* name */)
115
{
116
  return false;
117
}
118

119
bool Bind2Backend::getTSIGKeys(std::vector<struct TSIGKey>& /* keys */)
120
{
121
  return false;
122
}
123

124
void Bind2Backend::setupStatements()
125
{
126
}
127

128
void Bind2Backend::freeStatements()
129
{
130
}
131

132
#else
133

134
#include "pdns/logger.hh"
135
#include "pdns/ssqlite3.hh"
136

137
#define ASSERT_ROW_COLUMNS(query, row, num)                                                                                                \
138
  {                                                                                                                                        \
122✔
139
    if (row.size() != num) {                                                                                                               \
122✔
140
      throw PDNSException(std::string(query) + " returned wrong number of columns, expected " #num ", got " + std::to_string(row.size())); \
×
141
    }                                                                                                                                      \
×
142
  }
122✔
143

144
void Bind2Backend::setupDNSSEC()
145
{
3,116✔
146
  if (getArg("dnssec-db").empty() || d_hybrid)
3,116!
147
    return;
1,807✔
148
  try {
1,309✔
149
    d_dnssecdb = std::make_shared<SSQLite3>(getArg("dnssec-db"), getArg("dnssec-db-journal-mode"));
1,309✔
150
    setupStatements();
1,309✔
151
  }
1,309✔
152
  catch (SSqlException& se) {
1,309✔
153
    // this error is meant to kill the server dead - it makes no sense to continue..
154
    throw runtime_error("Error opening DNSSEC database in BIND backend: " + se.txtReason());
×
155
  }
×
156

157
  d_dnssecdb->setLog(::arg().mustDo("query-logging"));
1,309✔
158
}
1,309✔
159

160
void Bind2Backend::setupStatements()
161
{
1,309✔
162
  d_getAllDomainMetadataQuery_stmt = d_dnssecdb->prepare("select kind, content from domainmetadata where domain=:domain", 1);
1,309✔
163
  d_getDomainMetadataQuery_stmt = d_dnssecdb->prepare("select content from domainmetadata where domain=:domain and kind=:kind", 2);
1,309✔
164
  d_deleteDomainMetadataQuery_stmt = d_dnssecdb->prepare("delete from domainmetadata where domain=:domain and kind=:kind", 2);
1,309✔
165
  d_insertDomainMetadataQuery_stmt = d_dnssecdb->prepare("insert into domainmetadata (domain, kind, content) values (:domain,:kind,:content)", 3);
1,309✔
166
  d_getDomainKeysQuery_stmt = d_dnssecdb->prepare("select id,flags, active, published, content from cryptokeys where domain=:domain", 1);
1,309✔
167
  d_deleteDomainKeyQuery_stmt = d_dnssecdb->prepare("delete from cryptokeys where domain=:domain and id=:key_id", 2);
1,309✔
168
  d_insertDomainKeyQuery_stmt = d_dnssecdb->prepare("insert into cryptokeys (domain, flags, active, published, content) values (:domain, :flags, :active, :published, :content)", 5);
1,309✔
169
  d_GetLastInsertedKeyIdQuery_stmt = d_dnssecdb->prepare("select last_insert_rowid()", 0);
1,309✔
170
  d_activateDomainKeyQuery_stmt = d_dnssecdb->prepare("update cryptokeys set active=1 where domain=:domain and id=:key_id", 2);
1,309✔
171
  d_deactivateDomainKeyQuery_stmt = d_dnssecdb->prepare("update cryptokeys set active=0 where domain=:domain and id=:key_id", 2);
1,309✔
172
  d_publishDomainKeyQuery_stmt = d_dnssecdb->prepare("update cryptokeys set published=1 where domain=:domain and id=:key_id", 2);
1,309✔
173
  d_unpublishDomainKeyQuery_stmt = d_dnssecdb->prepare("update cryptokeys set published=0 where domain=:domain and id=:key_id", 2);
1,309✔
174
  d_getTSIGKeyQuery_stmt = d_dnssecdb->prepare("select algorithm, secret from tsigkeys where name=:key_name", 1);
1,309✔
175
  d_setTSIGKeyQuery_stmt = d_dnssecdb->prepare("replace into tsigkeys (name,algorithm,secret) values(:key_name, :algorithm, :content)", 3);
1,309✔
176
  d_deleteTSIGKeyQuery_stmt = d_dnssecdb->prepare("delete from tsigkeys where name=:key_name", 1);
1,309✔
177
  d_getTSIGKeysQuery_stmt = d_dnssecdb->prepare("select name,algorithm,secret from tsigkeys", 0);
1,309✔
178
}
1,309✔
179

180
void Bind2Backend::freeStatements()
181
{
2,992✔
182
  d_getAllDomainMetadataQuery_stmt.reset();
2,992✔
183
  d_getDomainMetadataQuery_stmt.reset();
2,992✔
184
  d_deleteDomainMetadataQuery_stmt.reset();
2,992✔
185
  d_insertDomainMetadataQuery_stmt.reset();
2,992✔
186
  d_getDomainKeysQuery_stmt.reset();
2,992✔
187
  d_deleteDomainKeyQuery_stmt.reset();
2,992✔
188
  d_insertDomainKeyQuery_stmt.reset();
2,992✔
189
  d_GetLastInsertedKeyIdQuery_stmt.reset();
2,992✔
190
  d_activateDomainKeyQuery_stmt.reset();
2,992✔
191
  d_deactivateDomainKeyQuery_stmt.reset();
2,992✔
192
  d_publishDomainKeyQuery_stmt.reset();
2,992✔
193
  d_unpublishDomainKeyQuery_stmt.reset();
2,992✔
194
  d_getTSIGKeyQuery_stmt.reset();
2,992✔
195
  d_setTSIGKeyQuery_stmt.reset();
2,992✔
196
  d_deleteTSIGKeyQuery_stmt.reset();
2,992✔
197
  d_getTSIGKeysQuery_stmt.reset();
2,992✔
198
}
2,992✔
199

200
bool Bind2Backend::doesDNSSEC()
201
{
1,668✔
202
  return d_dnssecdb || d_hybrid;
1,668!
203
}
1,668✔
204

205
bool Bind2Backend::getNSEC3PARAM(const DNSName& name, NSEC3PARAMRecordContent* ns3p)
206
{
×
207
  BB2DomainInfo bbd;
×
208
  if (!safeGetBBDomainInfo(name, &bbd))
×
209
    return false;
×
210

211
  if (ns3p != nullptr) {
×
212
    *ns3p = bbd.d_nsec3param;
×
213
  }
×
214

215
  return bbd.d_nsec3zone;
×
216
}
×
217

218
bool Bind2Backend::getNSEC3PARAMuncached(const DNSName& name, NSEC3PARAMRecordContent* ns3p)
219
{
2,739✔
220
  if (!d_dnssecdb || d_hybrid)
2,739!
221
    return false;
23✔
222

223
  string value;
2,716✔
224
  vector<string> meta;
2,716✔
225
  getDomainMetadata(name, "NSEC3PARAM", meta);
2,716✔
226
  if (!meta.empty())
2,716✔
227
    value = *meta.begin();
715✔
228
  else
2,001✔
229
    return false; // No NSEC3 zone
2,001✔
230

231
  static int maxNSEC3Iterations = ::arg().asNum("max-nsec3-iterations");
715✔
232
  if (ns3p) {
715!
233
    auto tmp = std::dynamic_pointer_cast<NSEC3PARAMRecordContent>(DNSRecordContent::make(QType::NSEC3PARAM, 1, value));
715✔
234
    *ns3p = *tmp;
715✔
235

236
    if (ns3p->d_iterations > maxNSEC3Iterations) {
715!
237
      ns3p->d_iterations = maxNSEC3Iterations;
×
238
      g_log << Logger::Error << "Number of NSEC3 iterations for zone '" << name << "' is above 'max-nsec3-iterations'. Value adjusted to: " << maxNSEC3Iterations << endl;
×
239
    }
×
240

241
    if (ns3p->d_algorithm != 1) {
715!
242
      g_log << Logger::Error << "Invalid hash algorithm for NSEC3: '" << std::to_string(ns3p->d_algorithm) << "', setting to 1 for zone '" << name << "'." << endl;
×
243
      ns3p->d_algorithm = 1;
×
244
    }
×
245
  }
715✔
246

247
  return true;
715✔
248
}
2,716✔
249

250
bool Bind2Backend::getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string>>& meta)
251
{
641✔
252
  if (!d_dnssecdb || d_hybrid)
641!
253
    return false;
47✔
254

255
  try {
594✔
256
    d_getAllDomainMetadataQuery_stmt->bind("domain", name)->execute();
594✔
257

258
    SSqlStatement::row_t row;
594✔
259
    while (d_getAllDomainMetadataQuery_stmt->hasNextRow()) {
1,184✔
260
      d_getAllDomainMetadataQuery_stmt->nextRow(row);
590✔
261
      meta[row[0]].push_back(row[1]);
590✔
262
    }
590✔
263

264
    d_getAllDomainMetadataQuery_stmt->reset();
594✔
265
  }
594✔
266
  catch (SSqlException& se) {
594✔
267
    throw PDNSException("Error accessing DNSSEC database in BIND backend, getAllDomainMetadata(): " + se.txtReason());
×
268
  }
×
269
  return true;
594✔
270
}
594✔
271

272
bool Bind2Backend::getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta)
273
{
3,240✔
274
  if (!d_dnssecdb || d_hybrid)
3,240!
275
    return false;
4✔
276

277
  try {
3,236✔
278
    d_getDomainMetadataQuery_stmt->bind("domain", name)->bind("kind", kind)->execute();
3,236✔
279

280
    SSqlStatement::row_t row;
3,236✔
281
    while (d_getDomainMetadataQuery_stmt->hasNextRow()) {
3,968✔
282
      d_getDomainMetadataQuery_stmt->nextRow(row);
732✔
283
      meta.push_back(row[0]);
732✔
284
    }
732✔
285

286
    d_getDomainMetadataQuery_stmt->reset();
3,236✔
287
  }
3,236✔
288
  catch (SSqlException& se) {
3,236✔
289
    throw PDNSException("Error accessing DNSSEC database in BIND backend, getDomainMetadata(): " + se.txtReason());
×
290
  }
×
291
  return true;
3,236✔
292
}
3,236✔
293

294
bool Bind2Backend::setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector<std::string>& meta)
295
{
261✔
296
  if (!d_dnssecdb || d_hybrid)
261!
297
    return false;
×
298

299
  try {
261✔
300
    d_deleteDomainMetadataQuery_stmt->bind("domain", name)->bind("kind", kind)->execute()->reset();
261✔
301
    if (!meta.empty()) {
261✔
302
      for (const auto& value : meta) {
192✔
303
        d_insertDomainMetadataQuery_stmt->bind("domain", name)->bind("kind", kind)->bind("content", value)->execute()->reset();
192✔
304
      }
192✔
305
    }
192✔
306
  }
261✔
307
  catch (SSqlException& se) {
261✔
308
    throw PDNSException("Error accessing DNSSEC database in BIND backend, setDomainMetadata(): " + se.txtReason());
×
309
  }
×
310
  return true;
261✔
311
}
261✔
312

313
bool Bind2Backend::getDomainKeys(const DNSName& name, std::vector<KeyData>& keys)
314
{
649✔
315
  if (!d_dnssecdb || d_hybrid)
649!
316
    return false;
43✔
317

318
  try {
606✔
319
    d_getDomainKeysQuery_stmt->bind("domain", name)->execute();
606✔
320

321
    KeyData kd;
606✔
322
    SSqlStatement::row_t row;
606✔
323
    while (d_getDomainKeysQuery_stmt->hasNextRow()) {
1,104✔
324
      d_getDomainKeysQuery_stmt->nextRow(row);
498✔
325
      pdns::checked_stoi_into(kd.id, row[0]);
498✔
326
      pdns::checked_stoi_into(kd.flags, row[1]);
498✔
327
      kd.active = (row[2] == "1");
498✔
328
      kd.published = (row[3] == "1");
498✔
329
      kd.content = row[4];
498✔
330
      keys.push_back(kd);
498✔
331
    }
498✔
332

333
    d_getDomainKeysQuery_stmt->reset();
606✔
334
  }
606✔
335
  catch (SSqlException& se) {
606✔
336
    throw PDNSException("Error accessing DNSSEC database in BIND backend, getDomainKeys(): " + se.txtReason());
×
337
  }
×
338
  return true;
606✔
339
}
606✔
340

341
bool Bind2Backend::removeDomainKey(const DNSName& name, unsigned int id)
342
{
×
343
  if (!d_dnssecdb || d_hybrid)
×
344
    return false;
×
345

346
  try {
×
347
    d_deleteDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", id)->execute()->reset();
×
348
  }
×
349
  catch (SSqlException& se) {
×
350
    throw PDNSException("Error accessing DNSSEC database in BIND backend, removeDomainKeys(): " + se.txtReason());
×
351
  }
×
352
  return true;
×
353
}
×
354

355
bool Bind2Backend::addDomainKey(const DNSName& name, const KeyData& key, int64_t& id)
356
{
122✔
357
  if (!d_dnssecdb || d_hybrid)
122!
358
    return false;
×
359

360
  try {
122✔
361
    d_insertDomainKeyQuery_stmt->bind("domain", name)->bind("flags", key.flags)->bind("active", key.active)->bind("published", key.published)->bind("content", key.content)->execute()->reset();
122✔
362
  }
122✔
363
  catch (SSqlException& se) {
122✔
364
    throw PDNSException("Error accessing DNSSEC database in BIND backend, addDomainKey(): " + se.txtReason());
×
365
  }
×
366

367
  try {
122✔
368
    d_GetLastInsertedKeyIdQuery_stmt->execute();
122✔
369
    if (!d_GetLastInsertedKeyIdQuery_stmt->hasNextRow()) {
122!
370
      id = -2;
×
371
      return true;
×
372
    }
×
373
    SSqlStatement::row_t row;
122✔
374
    d_GetLastInsertedKeyIdQuery_stmt->nextRow(row);
122✔
375
    ASSERT_ROW_COLUMNS("get-last-inserted-key-id-query", row, 1);
122!
376
    id = std::stoi(row[0]);
122✔
377
    d_GetLastInsertedKeyIdQuery_stmt->reset();
122✔
378
    if (id == 0) {
122!
379
      // No insert took place, report as error.
UNCOV
380
      id = -1;
×
381
    }
×
382
    return true;
122✔
383
  }
122✔
384
  catch (SSqlException& e) {
122✔
UNCOV
385
    id = -2;
×
UNCOV
386
    return true;
×
387
  }
×
388
}
122✔
389

390
bool Bind2Backend::activateDomainKey(const DNSName& name, unsigned int id)
391
{
×
392
  if (!d_dnssecdb || d_hybrid)
×
393
    return false;
×
394

395
  try {
×
396
    d_activateDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", id)->execute()->reset();
×
397
  }
×
398
  catch (SSqlException& se) {
×
UNCOV
399
    throw PDNSException("Error accessing DNSSEC database in BIND backend, activateDomainKey(): " + se.txtReason());
×
UNCOV
400
  }
×
401
  return true;
×
402
}
×
403

404
bool Bind2Backend::deactivateDomainKey(const DNSName& name, unsigned int id)
405
{
×
406
  if (!d_dnssecdb || d_hybrid)
×
407
    return false;
×
408

409
  try {
×
410
    d_deactivateDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", id)->execute()->reset();
×
411
  }
×
412
  catch (SSqlException& se) {
×
UNCOV
413
    throw PDNSException("Error accessing DNSSEC database in BIND backend, deactivateDomainKey(): " + se.txtReason());
×
UNCOV
414
  }
×
415
  return true;
×
416
}
×
417

418
bool Bind2Backend::publishDomainKey(const DNSName& name, unsigned int id)
419
{
×
420
  if (!d_dnssecdb || d_hybrid)
×
421
    return false;
×
422

423
  try {
×
424
    d_publishDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", id)->execute()->reset();
×
425
  }
×
426
  catch (SSqlException& se) {
×
UNCOV
427
    throw PDNSException("Error accessing DNSSEC database in BIND backend, publishDomainKey(): " + se.txtReason());
×
UNCOV
428
  }
×
UNCOV
429
  return true;
×
UNCOV
430
}
×
431

432
bool Bind2Backend::unpublishDomainKey(const DNSName& name, unsigned int id)
433
{
5✔
434
  if (!d_dnssecdb || d_hybrid)
5!
UNCOV
435
    return false;
×
436

437
  try {
5✔
438
    d_unpublishDomainKeyQuery_stmt->bind("domain", name)->bind("key_id", id)->execute()->reset();
5✔
439
  }
5✔
440
  catch (SSqlException& se) {
5✔
UNCOV
441
    throw PDNSException("Error accessing DNSSEC database in BIND backend, unpublishDomainKey(): " + se.txtReason());
×
UNCOV
442
  }
×
443
  return true;
5✔
444
}
5✔
445

446
bool Bind2Backend::getTSIGKey(const DNSName& name, DNSName& algorithm, string& content)
447
{
47✔
448
  if (!d_dnssecdb || d_hybrid)
47!
UNCOV
449
    return false;
×
450

451
  try {
47✔
452
    d_getTSIGKeyQuery_stmt->bind("key_name", name)->execute();
47✔
453

454
    SSqlStatement::row_t row;
47✔
455
    while (d_getTSIGKeyQuery_stmt->hasNextRow()) {
94✔
456
      d_getTSIGKeyQuery_stmt->nextRow(row);
47✔
457
      if (row.size() >= 2 && (algorithm.empty() || algorithm == DNSName(row[0]))) {
47!
458
        algorithm = DNSName(row[0]);
47✔
459
        content = row[1];
47✔
460
      }
47✔
461
    }
47✔
462

463
    d_getTSIGKeyQuery_stmt->reset();
47✔
464
  }
47✔
465
  catch (SSqlException& e) {
47✔
UNCOV
466
    throw PDNSException("Error accessing DNSSEC database in BIND backend, getTSIGKey(): " + e.txtReason());
×
UNCOV
467
  }
×
468
  return true;
47✔
469
}
47✔
470

471
bool Bind2Backend::setTSIGKey(const DNSName& name, const DNSName& algorithm, const string& content)
472
{
5✔
473
  if (!d_dnssecdb || d_hybrid)
5!
UNCOV
474
    return false;
×
475

476
  try {
5✔
477
    d_setTSIGKeyQuery_stmt->bind("key_name", name)->bind("algorithm", algorithm)->bind("content", content)->execute()->reset();
5✔
478
  }
5✔
479
  catch (SSqlException& e) {
5✔
UNCOV
480
    throw PDNSException("Error accessing DNSSEC database in BIND backend, setTSIGKey(): " + e.txtReason());
×
UNCOV
481
  }
×
482
  return true;
5✔
483
}
5✔
484

485
bool Bind2Backend::deleteTSIGKey(const DNSName& name)
486
{
×
487
  if (!d_dnssecdb || d_hybrid)
×
488
    return false;
×
489

490
  try {
×
491
    d_deleteTSIGKeyQuery_stmt->bind("key_name", name)->execute()->reset();
×
492
  }
×
493
  catch (SSqlException& e) {
×
UNCOV
494
    throw PDNSException("Error accessing DNSSEC database in BIND backend, deleteTSIGKey(): " + e.txtReason());
×
UNCOV
495
  }
×
496
  return true;
×
497
}
×
498

499
bool Bind2Backend::getTSIGKeys(std::vector<struct TSIGKey>& keys)
500
{
×
501
  if (!d_dnssecdb || d_hybrid)
×
UNCOV
502
    return false;
×
503

504
  try {
×
505
    d_getTSIGKeysQuery_stmt->execute();
×
506

507
    SSqlStatement::row_t row;
×
508
    while (d_getTSIGKeysQuery_stmt->hasNextRow()) {
×
509
      d_getTSIGKeysQuery_stmt->nextRow(row);
×
510
      struct TSIGKey key;
×
511
      key.name = DNSName(row[0]);
×
UNCOV
512
      key.algorithm = DNSName(row[1]);
×
513
      key.key = row[2];
×
514
      keys.push_back(key);
×
515
    }
×
516

517
    d_getTSIGKeysQuery_stmt->reset();
×
518
  }
×
519
  catch (SSqlException& e) {
×
UNCOV
520
    throw PDNSException("Error accessing DNSSEC database in BIND backend, getTSIGKeys(): " + e.txtReason());
×
UNCOV
521
  }
×
UNCOV
522
  return true;
×
UNCOV
523
}
×
524

525
#endif
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

© 2025 Coveralls, Inc