Commit 330c81df authored by Mark Andrews's avatar Mark Andrews

report bad-expire

parent 77995e53
Pipeline #43944 passed with stages
in 3 minutes and 29 seconds
......@@ -2351,7 +2351,7 @@ process(struct workitem *item, unsigned char *buf, int buflen, int port) {
int tsig_wrong_key = 0, tsig_wrong_alg = 0, tsig_bad_time = 0;
int tsig_bad_other_len = 0, tsig_bad_sig = 0, tsig_bad_fudge = 0;
int n, cname = 0, dname = 0, rrsig = 0, found = 0;
int badecs;
int badecs = 0, badexpire = 0;
char addrbuf[64];
int ednsvers = 0;
int ok = 1;
......@@ -2696,13 +2696,18 @@ process(struct workitem *item, unsigned char *buf, int buflen, int port) {
seenecs = 1;
if (optlen != 4 ||
memcmp(options,
"\x00\x01\x00", 3)) {
"\x00\x01\x00", 3) ||
options[3] > 32) {
badecs = 1;
}
}
if (code == 9 && optlen == 4)
seenexpire = 1;
if (code == 9) {
if (optlen == 4)
seenexpire = 1;
else
badexpire = 1;
}
/* Server Cookie. */
if (code == 10 &&
optlen >= 16 && optlen <= 40) {
......@@ -2891,14 +2896,14 @@ process(struct workitem *item, unsigned char *buf, int buflen, int port) {
"aucount=%u adcount=%u\n"
"\tseensoa=%u seenrrsig=%u seenopt=%u "
"seennsid=%u seenecs=%u badecs=%u "
"seenexpire=%u seencookie=%u\n"
"seenexpire=%u badexpire-%u seencookie=%u\n"
"\tednsudpsize=%u\n",
id, testname, opcode, rcode,
qr, aa, tc, rd, ra, z, ad, cd,
qrcount, ancount, aucount, adcount,
seensoa, seenrrsig, seenopt,
seennsid, seenecs, badecs, seenexpire, seencookie,
ednssize);
seennsid, seenecs, badecs, seenexpire, badexpire,
seencookie, ednssize);
}
if (item->summary->type) {
......@@ -3070,6 +3075,8 @@ process(struct workitem *item, unsigned char *buf, int buflen, int port) {
addtag(item, "nsid");
if (seenexpire)
addtag(item, "expire");
if (badexpire)
addtag(item, "expire-bad");
if (seencookie && goodcookie && opts[item->test].cookie) {
if (rcode == ns_r_badcookie)
addtag(item, "cookie+badcookie");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment