Add PKCS11 interface for HSM integration into DNSSEC ownership proof signing#30
Open
pinheadmz wants to merge 12 commits intochjj:masterfrom
Open
Add PKCS11 interface for HSM integration into DNSSEC ownership proof signing#30pinheadmz wants to merge 12 commits intochjj:masterfrom
pinheadmz wants to merge 12 commits intochjj:masterfrom
Conversation
Anunayj
reviewed
Jun 25, 2021
| 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.
Any specific reason to have the inception time a day before?
Collaborator
Author
There was a problem hiding this comment.
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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mdexplaining all thebns-proveoptions, 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: