[Opendnssec-develop] Adding ECC to ods-signer
Rick van Rein
rick at openfortress.nl
Wed Sep 28 12:51:37 UTC 2016
Great news. (replicates #450 and adds an enforcerish script)
I have tried my suspicion that the Signer is so agnostic to key material
that it will sign with ECDSA based on the libhsm extension. This is
true, with the side-remark of the issues noted before. There is a need
for the ECDSA public key to be present, though.
I have created a simple script to create .signconf files for a named
zone, and it will generate a key pair and produce the corresponding
.signconf. A single pass by ods-signer got a result that satisfied
ldns-verify-zone. (The downlink from the parent is a different matter
altogether, as far as I'm concerned).
In other words, I saved the required patch to OpenDNSSEC to support
ECDSA on your machines already; you can find it in /dev/null and yes, it
amounts to 0 lines of changes. The patch was made relative to devel-2.0
but should be trivial to backport ;-)
There are a few Enforcer-level differences between ECDSA and RSA worth
noting:
1. ECDSA signatures use CKA_EC_POINT which is only present in the public
key object. Because of that, the public key is required for signing and
so <SkipPublicKey/> cannot be applied to ECDSA keys. I did confirm that
the presence of <SkipPublicKey/> has no impact on the behaviour of the
Signer.
2. RSA key policy dictates a key size. This is insufficient information
for EC, as there may be multiple curves of any given size. This is why
libhsm desires a string argument (currently "P-256" or "P-384" for
signature algos 13 and 14) as 3rd argument to hsm_generate_ecdsa_key(),
whereas RSA's 3rd parameter constitutes a numeric key size. This
probably reflects on the policy parsing and handling.
Attached is my Enforcer-replacing Python script, based on PyKCS11. It
generates a .signconf with keys mentioned like
<Key>
<Flags>257</Flags>
<Algorithm>14</Algorithm>
<Locator>20160928132644982984</Locator>
<KSK/>
<ZSK/>
<Publish/>
</Key>
Yeah:
- I've assumed signalling both <KSK/> and <ZSK/> is the way to specify a
CSK. It seems to work, except that the .backup2 mentions "ksk" but not
"zsk" on the key;
- I'm using locators that enhance log file readability by using BCD
notation for YYYYMMDDhhmmssuuuuuu so a decimal time with microsecond
resolution. As long as the number of digits is even, the BCD format is
great when information is regularly dumped in hexadecimal :-D
I hope this is enough preparation for the Enforcer updates; otherwise
talk, sing or shout to me!
Cheers,
-Rick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zone2signconf.py
Type: text/x-python-script
Size: 7094 bytes
Desc: not available
URL: <http://lists.opendnssec.org/pipermail/opendnssec-develop/attachments/20160928/dc75f41b/attachment.bin>
More information about the Opendnssec-develop
mailing list