Add HMAC-SHA-384 TSIG support, document HMAC-SHA-512 truncation limitation

BIND 9.18+ truncates HMAC-SHA-512 MACs by default, and hickory-dns
does not support verifying truncated HMACs. Document the workaround
(use hmac-sha256) and add hmac-sha384 as an additional option.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Roman Kivalin
2026-04-13 20:35:12 +02:00
co-authored by Claude Opus 4.6
parent 25722231e0
commit 0726e829a9
4 changed files with 15 additions and 1 deletions
+6
View File
@@ -11,6 +11,12 @@
### Fixes
- Add HMAC-SHA-384 TSIG algorithm support
### Known limitations
- TSIG with HMAC-SHA-512 may fail with BIND 9.18+ which truncates MACs by default. Use HMAC-SHA-256 as a workaround (hickory-dns does not support truncated HMAC verification).
### Changes
- **Breaking**: Configuration format overhauled
+7 -1
View File
@@ -125,7 +125,7 @@ server = "ns1.example.com"
zone = "example.com"
tsig_key_path = "/etc/certforge/tsig.key"
tsig_key_name = "certforge."
tsig_algorithm = "hmac-sha256" # or hmac-sha512
tsig_algorithm = "hmac-sha256" # hmac-sha256, hmac-sha384, or hmac-sha512
```
### Challenge solvers
@@ -231,6 +231,12 @@ systemctl enable --now certforge.timer
For encrypted credentials, add `LoadCredentialEncrypted=` directives to service units that need access to TLS keys. Run `certforge init` to see the required directives.
## Known limitations
- **TSIG HMAC-SHA-512**: BIND 9.18+ truncates HMAC-SHA-512 MACs by default, and the underlying DNS library (hickory-dns) does not support verifying truncated HMACs. Use `hmac-sha256` instead.
- RSA key types not yet supported (ECDSA only).
- `dane-check` shows expected TLSA records but does not query DNS to verify.
## License
MIT
+1
View File
@@ -62,6 +62,7 @@ pub struct DnsClientConfig {
#[serde(rename_all = "kebab-case")]
pub enum TsigAlgorithm {
HmacSha256,
HmacSha384,
HmacSha512,
}
+1
View File
@@ -26,6 +26,7 @@ pub async fn load_tsig_signer(
let algorithm = match dns_config.tsig_algorithm {
config::TsigAlgorithm::HmacSha256 => TsigAlgorithm::HmacSha256,
config::TsigAlgorithm::HmacSha384 => TsigAlgorithm::HmacSha384,
config::TsigAlgorithm::HmacSha512 => TsigAlgorithm::HmacSha512,
};