mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Parse DNSSEC AD and CD bits
Parse authentic data (AD) and checking disabled (CD) bits according to RFC 2535. Leaves the Z field as-is, in case users are already handling this elsewhere and depend on the value being the integer for all 3 bits. https://www.rfc-editor.org/rfc/rfc2535#section-6.1 Fixes #2672
This commit is contained in:
parent
c29b98b224
commit
fe8390c646
28 changed files with 305 additions and 285 deletions
|
@ -1791,6 +1791,8 @@ DNS_MsgInfo::DNS_MsgInfo(DNS_RawMsgHdr* hdr, int arg_is_query)
|
|||
RD = (flags & 0x0100) != 0;
|
||||
RA = (flags & 0x0080) != 0;
|
||||
Z = (flags & 0x0070) >> 4;
|
||||
AD = (flags & 0x0020) >> 5;
|
||||
CD = (flags & 0x0010) >> 4;
|
||||
rcode = (flags & 0x000f);
|
||||
|
||||
qdcount = ntohs(hdr->qdcount);
|
||||
|
@ -1823,10 +1825,12 @@ RecordValPtr DNS_MsgInfo::BuildHdrVal()
|
|||
r->Assign(6, static_cast<bool>(RD));
|
||||
r->Assign(7, static_cast<bool>(RA));
|
||||
r->Assign(8, Z);
|
||||
r->Assign(9, qdcount);
|
||||
r->Assign(10, ancount);
|
||||
r->Assign(11, nscount);
|
||||
r->Assign(12, arcount);
|
||||
r->Assign(9, static_cast<bool>(AD));
|
||||
r->Assign(10, static_cast<bool>(CD));
|
||||
r->Assign(11, qdcount);
|
||||
r->Assign(12, ancount);
|
||||
r->Assign(13, nscount);
|
||||
r->Assign(14, arcount);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
|
|
@ -321,7 +321,9 @@ public:
|
|||
int TC; ///< truncated - size > 512 bytes for udp
|
||||
int RD; ///< recursion desired
|
||||
int RA; ///< recursion available
|
||||
int Z; ///< zero - this 3 bit field *must* be zero
|
||||
int Z; ///< 3 bit field (includes AD and CD)
|
||||
int AD; ///< authentic data
|
||||
int CD; ///< checking disabled
|
||||
int qdcount; ///< number of questions
|
||||
int ancount; ///< number of answers
|
||||
int nscount; ///< number of authority RRs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue