[ldns-users] ldns-signzone ECDSA random failure

W.C.A. Wijngaards wouter at nlnetlabs.nl
Tue Aug 18 08:12:02 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Matt

On 17/08/15 22:05, Matt Smith wrote:
> On Aug 17 20:49, Matt Smith wrote:
>> If it helps I have saved copies of the syslog, KSK and ZSK keys
>> along with the original zone file and the signed zone file if
>> anybody wants to examine them.
> 
> Actually I've just noticed something that stands out. In a record
> which works fine the RRSIG looks like this:

Thank you for the details, I have worked out that the shorter RRSIG is
wrong.  It is generated because ldns is omitting leading zeroes when
generating the signature encoding, but the RFC mandates equal length
parts (of length curvebits / 8).

The fix is in git and basically adds leading zeroes to the created RRSIG
.

Because ecdsa signatures have a randomised component, this only
happens when the leading bytes randomly happen to be zero.

The ldns_convert_ecdsa_rrsig_asn12rdf is therefore not capable of
generating good signatures, and is removed, replaced with
ldns_convert_ecdsa_rrsig_asn1len2rdf that takes the curve length as a
function call parameter.

Best regards, Wouter

> 
> host1.example.com.        3600    IN      RRSIG   A 13 3 3600 
> 20150914191810 20150817191810 57320 xtaz.uk. 
> ot+ASP55jXoBrNNqxT5yr3KIO/n+YazEc4NEq0/IpwhB4BucBRiBAiKihAdELzSf+CDTr2
X7v8TiqE59mNBeSg==
>
> 
> 
> In one that fails to validate it looks like this:
> 
> host2.example.com.        3600    IN      RRSIG   A 13 3 3600 
> 20150914191810 20150817191810 57320 xtaz.uk. 
> T0zvO7h5yAxTg5TqtGUAZqdsbj3T4EsvoWDzYOe4QaD/QJKs4eCvBwlLQ2DaQpxNIhd9oO
qTWgLeeGL7aRwA
>
> 
> 
> It looks like the signature has been truncated and doesn't have ==
> on the end of it?
> 
> Forgot to say as well, I'm using ldns-tools 1.6.17.
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJV0ujSAAoJEJ9vHC1+BF+N+5wP/jnr51g5UOVJfOBWGmcJk8Xz
uwsvjy43kgW/E3w+2IjPyoNrca1SlyzCGtcrvdNTJ4Mbr9MnN9AXscrrJJSW4oyB
omQfzVKic5gO1YPIfomousXzD9BRL6DjBTrX0HkTR6VVB3rnzEBVll7NbC9ulAcY
aHcTGXANFmG9/jC8DsVzrMc1E7WY+eqOe5kPFR0dfctZVOt1VysiAHkUahJCAndA
uHhBzQ20NxrVv/aYG7j5Y/yK0/KJuEzxHKcwq+kCf88dnReEz3E3JeNUhJVOrY3P
G7yyUn2aoW5THjHLzOu1W6Mi97OtbW/iBko5OCM7qz1bK1JjAw29IDsbJdR7r4GJ
SnKGqiOtsIRSeeUmTGpkP8p164ID70E/VSED7qqAeCCawajpcLAfeuHOvrxeRpEf
t/xNXM+gUqNdgvffRwzs8yM1qlC/Dck1e0Bn0HspF4VaeMhjHfUgT+bHOppP6hMI
IcWHzGxN+3FVGW7+SSpENmR8NOZx0XW/fiOdW5tmtu61Hz4RtLvibZ9dqgrV+vRQ
/qod5rDuADR7ja7NvLOeamu7E2ww6QTxQJCKx/aWnVKNBa6CHtashvo0p2LksMS8
AbO/Nyna4oUWksSpGN7or4v/ZU2MA+2+/AAd9p76bGCUDDvjDQd9brbfmN7DvC/z
6xb2C3eMV8ls//OkRQj9
=NzIJ
-----END PGP SIGNATURE-----



More information about the ldns-users mailing list