Subject: [DNSOP] TSIG - BADKEY error handling appears to be underspecified.

From: Mark Andrews <[email-masked]>
Date: Fri, 14 Sep 2018 08:55:19 +1000

I was testing TSIG with a well known key against TLD servers and got the following response.  Once you get past the bad class field (reported to the operator) there were a
number of other items:

* the tsig name does not match the request.
* the algorithm doesn’t match the algorithm in the request.
* time signed is not set.
* the fudge value is zero.

Should these match the request / be set for BADKEY?

Mark

% dig alstom. @195.253.64.11 soa -y xxxx:AAAA
14-Sep-2018 08:41:34.347 the key 'xxxx' is too short to be secure
;; Warning: Message parser reports malformed message packet.
;; Couldn't verify signature: not implemented

; <<>> DiG 9.13.1+hotspot+add-prefetch+marka <<>> alstom. @195.253.64.11 soa -y xxxx:AAAA
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOTAUTH, id: 56054
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 2
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;alstom.				IN	SOA

;; TSIG PSEUDOSECTION:
.			0	IN	TSIG	\# 17 0000000000000000000000DAF600110000

;; Query time: 566 msec
;; SERVER: 195.253.64.11#53(195.253.64.11)
;; WHEN: Fri Sep 14 08:41:34 AEST 2018
;; MSG SIZE  rcvd: 63
;; WARNING -- Some TSIG could not be validated

% 

-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742              INTERNET: [email-masked]

---

From: Klaus Malorny <[email-masked]>
Date: Fri, 14 Sep 2018 11:12:26 +0200

> Should these match the request / be set for BADKEY?

Hi Mark,

thanks for bringing this to our attention. I have fixed the DNS class, the key 
and algorithm name. For the latter two, it makes some sense to return the values 
from the request. Regarding the time and fudge, I have currently left it to 
zero, as IMHO they have no meaning without having a signature. But I am open to 
conviction...

By the way, the parsing error of DiG seemed to be solely caused by the wrong 
class; after changing it to ANY, the RDATA was parsed and displayed correctly.

Regards,

Klaus

---

From: Mark Andrews <[email-masked]>
Date: Mon, 17 Sep 2018 10:27:10 +1000

> On 14 Sep 2018, at 7:12 pm, Klaus Malorny <[email-masked]> wrote:
> 
> thanks for bringing this to our attention. I have fixed the DNS class, the key and algorithm name. For the latter two, it makes some sense to return the values from the request. Regarding the time and fudge, I have currently left it to zero, as IMHO they have no meaning without having a signature. But I am open to conviction…

Actually having the clients time and fudge in those fields for BADKEY provides spoofing protection for the unsigned responses. This is especially important with opportunistic TSIG,which is what TSIG with a WKK will be, as there is no longer the presumption that server is configured for the key that there was when TSIG was originally drafted.  It’s all about getting answers through acceptance filters.

For non opportunistic TSIG the client is still expected to wait for a valid TSIG response even if it sees a BADKEY response.

> By the way, the parsing error of DiG seemed to be solely caused by the wrong class; after changing it to ANY, the RDATA was parsed and displayed correctly.
> 
> Regards,
> 
> Klaus
> 
>

---

From: Klaus Malorny <[email-masked]>
Date: Mon, 17 Sep 2018 09:23:43 +0200

On 17.09.18 02:27, Mark Andrews wrote:
> Actually having the clients time and fudge in those fields for BADKEY
> provides spoofing protection for the unsigned responses. This is especially
> important with opportunistic TSIG,which is what TSIG with a WKK will be, as
> there is no longer the presumption that server is configured for the key that
> there was when TSIG was originally drafted.  It’s all about getting answers
> through acceptance filters.
Hi Mark,

thanks for the explanation, this sounds reasonable, I will fix our software in 
the next release.

Regards,

Klaus