Commit b7114d4d authored by Ivana Krumlova's avatar Ivana Krumlova Committed by Petr Špaček

Deckard: support case sensitive match for qname (MATCH qcase)

This is handy for simulating broken servers which are 0x20 sensitive.
parent 33ce6bb1
...@@ -174,9 +174,10 @@ Format ...@@ -174,9 +174,10 @@ Format
- **opcode** - check if the incominq query is a standard query (**OPCODE** is 0) - **opcode** - check if the incominq query is a standard query (**OPCODE** is 0)
- **qtype** - check if **QTYPE** fields of both question sections are equal - **qtype** - check if **QTYPE** fields of both question sections are equal
- **qname** - check if domain name (**QNAME**) fields of question sections are equal - **qname** - check if domain name (**QNAME**) fields of question sections are equal (case insensitive)
- **qcase** - check if domain name (**QNAME**) fields of question sections are equal (case sensitive)
- **subdomain** - check if domain from question section of incoming query (answer) - **subdomain** - check if domain from question section of incoming query (answer)
is a subdomain of domain from question section of this **ENTRY** block. is a subdomain of domain from question section of this **ENTRY** block (case insensitive)
- **flags** - check if sets of dns flags (**QR** **AA** **TC** **RD** **RA**) are equal - **flags** - check if sets of dns flags (**QR** **AA** **TC** **RD** **RA**) are equal
- **rcode** - check if response codes are equal - **rcode** - check if response codes are equal
- **question**, - **question**,
......
...@@ -177,6 +177,8 @@ class Entry: ...@@ -177,6 +177,8 @@ class Entry:
return True return True
qname = dns.name.from_text(msg.question[0].name.to_text().lower()) qname = dns.name.from_text(msg.question[0].name.to_text().lower())
return compare_val(expected.question[0].name, qname) return compare_val(expected.question[0].name, qname)
elif code == 'qcase':
return compare_val(msg.question[0].name.labels, expected.question[0].name.labels)
elif code == 'subdomain': elif code == 'subdomain':
if len(expected.question) == 0: if len(expected.question) == 0:
return True return True
......
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