Skip to content

Commit 998d827

Browse files
fxduponttmarkwalder
authored andcommitted
[#3133] Checkpoint
1 parent 6911295 commit 998d827

File tree

6 files changed

+26
-3
lines changed

6 files changed

+26
-3
lines changed

doc/examples/ddns/all-keys.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@
138138

139139
// Secret of the TSIG key (required) in base-64.
140140
"secret": "LSWXnfkKZjdPJI5QxlpnfQ=="
141+
},
142+
{
143+
"name": "d2.sha1.key",
144+
"algorithm": "HMAC-SHA1",
145+
146+
// An alternative to secret: specify a file where the secret
147+
// can be found. i.e. the secret is the content of the file.
148+
"secret-file": "/tmp/d2-sha1-secret"
141149
}
142150
],
143151

doc/examples/ddns/sample1.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@
134134
"algorithm": "HMAC-SHA1",
135135
"secret": "hRrp29wzUv3uzSNRLlY68w=="
136136
},
137+
{
138+
"name": "d2.sha256.key",
139+
"algorithm": "HMAC-SHA256",
140+
"secret-file": "/tmp/d2-sha256-secret"
141+
},
137142
{
138143
"name": "d2.sha512.key",
139144
"algorithm": "HMAC-SHA512",

doc/sphinx/arm/ddns.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,10 @@ Every entry in the list has three parameters:
408408
key. This value is case-sensitive and must exactly match the value
409409
specified on the DNS server(s). It is a base64-encoded text value.
410410

411+
- ``secret-file`` - since Kea 2.5.8 a more secure alternative is supported:
412+
specify a file name where the secret can be found, i.e. the base64-encoded
413+
secret is the content of the file.
414+
411415
As an example, suppose that a domain D2 will be updating is maintained
412416
by a BIND 9 DNS server, which requires dynamic updates to be secured
413417
with TSIG. Suppose further that the entry for the TSIG key in BIND 9's

src/bin/d2/tests/d2_simple_parser_unittest.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ bool checkKey(TSIGKeyInfoPtr key, const std::string& name,
9191
(key->getName() == name) &&
9292
(key->getAlgorithm() == algorithm) &&
9393
(key->getDigestbits() == digestbits) &&
94-
(key->getSecret() == secret) &&
94+
(key->getSecret() == secret) &&
9595
(key->getTSIGKey())));
9696
}
9797

@@ -508,7 +508,7 @@ class DdnsDomainParserTest : public D2SimpleParserTest {
508508
void addKey(const std::string& name, const std::string& algorithm,
509509
const std::string& secret) {
510510
TSIGKeyInfoPtr key_info(new TSIGKeyInfo(name, algorithm, secret));
511-
(*keys_)[name]=key_info;
511+
(*keys_)[name] = key_info;
512512
}
513513

514514
/// @brief Adds DDNS Domain values to the given DDNS Domain element

src/bin/d2/tests/parser_unittest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ TEST(ParserTest, file) {
298298
configs.push_back("sample1.json");
299299
configs.push_back("template.json");
300300

301-
for (int i = 0; i<configs.size(); i++) {
301+
for (size_t i = 0; i < configs.size(); ++i) {
302302
testFile(string(CFG_EXAMPLES) + "/" + configs[i]);
303303
}
304304
}

src/bin/d2/tests/testdata/get_config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@
9292
"name": "d2.sha1.key",
9393
"secret": "hRrp29wzUv3uzSNRLlY68w=="
9494
},
95+
{
96+
"algorithm": "HMAC-SHA256",
97+
"digest-bits": 0,
98+
"name": "d2.sha256.key",
99+
"secret-file": "/tmp/d2-sha256-secret"
100+
},
95101
{
96102
"algorithm": "HMAC-SHA512",
97103
"digest-bits": 256,

0 commit comments

Comments
 (0)