ldns(3)
π ldns_pkt_tsig_verify, ldns_pkt_tsig_sign β tsig signing and verification π
okay bestie, so we're in ldns(3), the Library Functions Manual, and today's main characters are two functions that handle TSIG stuff β that's the shared-secret signature vibe that keeps DNS packets from getting catfished. one verifies, one signs. iconic duo, honestly. π«Ά
β¨ SYNOPSIS β¨
#include <stdint.h>
#include <stdbool.h>
#include <ldns/ldns.h>
bool ldns_pkt_tsig_verify(ldns_pkt *pkt, const uint8_t *wire, size_t
wire_size, const char *key_name, const char *key_data, const ldns_rdf
*mac);
ldns_status ldns_pkt_tsig_sign(ldns_pkt *pkt, const char *key_name,
const char *key_data, uint16_t fudge, const char *algorithm_name, const
ldns_rdf *query_mac);
πΈ DESCRIPTION πΈ
π
ldns_pkt_tsig_verify()
she checks the tsig rr for the given packet and key. and listen, you have to hand her the wire too, because tsig does not sign normalized packets β it signs the raw bytes, so the raw bytes are literally required, no exceptions, periodt.
pktβ the packet to verify πwireβ needed to verify the mac, fr fr, you can't skip thiswire_sizeβ size of wirekey_nameβ the name of the shared key πkey_dataβ the key in base 64 formatmacβ original mac
Returns true if tsig is correct, false if not, or if tsig is not set. so like, false is doing double duty here β not correct or not even there. vibe check failed either way bestie π
β¨ ldns_pkt_tsig_sign()
she creates a tsig rr for the given packet and key. the glow-up where your packet gets its signature. π
pktβ the packet to signkey_nameβ the name of the shared key πkey_dataβ the key in base 64 formatfudgeβ seconds of error permitted in time signed (a lil clock-sync grace period, we love her)algorithm_nameβ the name of the algorithm usedquery_macβ is added to the digest if notNULL(soNULLis for signing queries, notNULLis for signing answers) π
Returns status (OK if success).
ngl thatquery_macone is a whole vibe:NULL= you're signing a query, notNULL= you're signing an answer. don't mix them up, bestie, that's the whole plot twist. π
π AUTHOR π
The ldns team at NLnet Labs. legends, honestly.
π REPORTING BUGS π
found a bug? don't suffer in silence, bestie. please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues π«Ά
π COPYRIGHT π
Copyright (c) 2004 - 2006 NLnet Labs.
Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. so like, she's gorgeous but she comes as-is, no promises. π
π SEE ALSO π
ldns_key- And
perldoc Net::DNS,RFC1034,RFC1035,RFC4033,RFC4034andRFC4035. the whole reading list, slay π
π¦ REMARKS π¦
This manpage was automatically generated from the ldns source code. not me being a robot-written queen π€β¨
and that's the tea, bestie β page from 30 May 2006, and yep, she lives in section ldns(3). go sign something. ππβ¨
π¦ where this page comes from
- alpine 3.22: ldns-doc 1.8.4-r0 Β· BSD-3-Clause
- alpine 3.23: ldns-doc 1.8.4-r1 Β· BSD-3-Clause
- alpine 3.24: ldns-doc 1.8.4-r1 Β· BSD-3-Clause
- arch rolling: ldns 1.9.2-1 Β· custom:BSD
- debian trixie: libldns-dev 1.8.4-2+b1
- fedora 43: ldns-devel 1.8.4-8.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.8.4-8.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.9.2-1.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.9.2-1.fc43 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.0-2.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.0-2.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.2-1.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.2-1.fc44 Β· BSD-3-Clause
- nixos 26.05: ldns 1.9.2
- nixpkgs unstable: ldns 1.9.2
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- ubuntu questing: libldns-dev 1.8.4-2build1
- ubuntu resolute: libldns-dev 1.8.4-2build3
- ubuntu stonking: libldns-dev 1.9.2-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms