-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PKCS11 interface for HSM integration into DNSSEC ownership proof signing #30
base: master
Are you sure you want to change the base?
Conversation
rd.keyTag = dnskey.data.keyTag(); | ||
rd.signerName = dnskey.name; | ||
rd.algorithm = alg; | ||
rd.inception = util.now() - (24 * 60 * 60); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason to have the inception time a day before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how we do it in bns dnssec.sign()
as well: https://github.com/chjj/bns/blob/master/lib/dnssec.js#L191
My guess is, its just to ensure that when you deploy there will be very few machines on earth that think the timestamp is invalid. This is especially true for blockchains which have a weird concept of "now".
Closes #29
This PR enables ICANN TLD holders to claim their reserved names on Handshake by signing offline with an HSM. This was an explicit ask by such an interested party that keeps their DNSSEC keys on a hardware signing module that has a PKCS#11 interface. They can not use their production system to sign arbitrary TXT records like Handshake requires, so we need to offer them custom software that still works with their hardware.
Unfortunately this required adding a dependency: https://github.com/PeculiarVentures/pkcs11js
This library could be vendored, but it also contains native code because the PKCS11 interface is literally a C header file. HSM manufacturers provide this library file to their customers who pass it directly into their software clients like OpenDNSSEC and now also,
bns-prove
;-)Great docs about the standard: https://www.cryptsoft.com/pkcs11doc/v230/
I used this HSM emulator with PKCS11 support for testing: https://github.com/opendnssec/SoftHSMv2
The test suite in this PR will skip automatically if it is not installed (it expects the pkcs11 interface library to exist at
/usr/local/lib/softhsm/libsofthsm2.so
).I added an extra doc
PROVE.md
explaining all thebns-prove
options, and linked to it from the main README.I have a few test names reserved in a hard-fork of hsd that I've been using to integrate claims in Bob Wallet. The test for this PR actually reads that ZSK private key from a file and inserts it into the SoftHSM database as a PKCS11 token. After running the test once, I successfully claimed the name on regtest using the command-line utility: