Repository navigation
[skus,fake_keygen] Migrate from SPHINCS+ to SLH-DSA signing - #26
Merged
Merged
Conversation
cfrantz
reviewed
Oct 9, 2026
Comment on lines
+138
to
+140
| // The keys may be exported in plaintext so that they can be | ||
| // imported into another HSM. | ||
| CKA_SENSITIVE: false, |
Collaborator
There was a problem hiding this comment.
Some background on this choice:
We'd normally want this to be true: the private keys should always live inside the HSM security boundary. However:
- We are skeptical of HSM backup/restore solutions.
- We don't want HSM vendor lock-in.
- We don't want to have a dependency on the long-term stability/existence of a particular vendor (Google's first-generation RoT chip already has a longer-than-expected lifetime).
Collaborator
|
Overall, this LGTM. |
AlexJones0
force-pushed
the
slh_dsa_migration
branch
from
October 13, 2026 21:24
2cb1566 to
d1d2c01
Compare
Contributor
Author
|
The last force push replaces the checked-in owner/app keys to match, and updates the X.509 DICE CA cert as well. It standardizes to use the |
AlexJones0
force-pushed
the
slh_dsa_migration
branch
from
October 14, 2026 00:43
d1d2c01 to
4ef9967
Compare
cfrantz
approved these changes
Oct 26, 2026
Small clarifications just to make the documentation a little bit clearer about the manual steps that must be performed to use SoftHSM. Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
Now that upstream hsmtool supports SLH-DSA, we can update the fake keygen templates (root, owner, application) to use SLH-DSA keys instead of SPHINCS+ keys. This requires tweaking some of the parameters, and moving the export to happen via the `export` command, rather than at generation time, as before (with `hsmtool spx`). Also update the status of two TODOs related to this in the docs. Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
- Change the bash shebang used for increased compatibility with different systems/environments. - Add some basic status prints to the keygen and export which describe which subdir we are generating keys for - this helps a bit with debugging misconfigured keygen & export templates. - Since the CA subdir currently doesn't export any keys in PEM format, the shell expansion of the `*.pem` globs will fail in the final tar. Since this is expected, set the shell option to not error on null globs whilst executing these tars to silence some noise. - The last time this script was run, only the CA key was generated - and the commenting out of other subdirs was kept in. Restore this to its original state. Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
Most of the subdirs (root, owner, application, but not ca) have changed from using SPHINCS+ keys to SLH-DSA keys. Completely re-generate the SoftHSM2 token from scratch using the full keygen & exporting flow. For posterity, this was generated by following the commands documented in `skus/open/fake_keygen/README.md`. Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
AlexJones0
force-pushed
the
slh_dsa_migration
branch
from
October 28, 2026 03:46
4ef9967 to
3b1ab33
Compare
pamaury
approved these changes
Oct 28, 2026
Replace the root, owner and CA keys with the fake keys that were generated by the latest round of keygen. The owner and application keys are documented as TBD, but they match the previous fake keygen round, so these are updated to match. Changes to use SLH-DSA keys instead of SPHINCS+ keys mean that the SoftHSM2 token containing the fake keys has been regenerated. As such, all fake keys (including existing ECDSA keys) have been rotated. Rotating the root keys also involves updating the OTP configuration, which is included here. The SPHINCS+ keysets now identify the keys as SLH-DSA keys for the downstream OpenTitan signing rules. Some outdated documentation is also replaced - removed a couple of stale TODOs, and changed some extensions from `.pem` to `.der` where required for ECDSA keys. Since the ECDSA CA key has been rotated, the X.509 DICE CA cert is also correspondingly updated. This was done via OpenSSL: ``` openssl req -new -x509 \ -config skus/open/keys/ca/dice_ca.conf \ -engine pkcs11 -keyform engine \ -key "pkcs11:token=temp;object=nuvoton-ot00-ca-ecdsa-0;type=private?pin-value=123456" \ -sha256 -days 99999 \ -out skus/open/keys/ca/dice_ca.pem ``` And self-verified with `openssl verify -CAfile ...` Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
This needs to be updated with the rotated CA key (and thus self-signed cert), and was out-of-date before the latest round of keygen, anyhow. Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
We no longer need to define a custom `HSMTOOL_SPX_MODULE` in our SoftHSM configuration for hsmtool, and the docs should now properly describe how we export our ECDSA and SLH-DSA keys as valid, standard encodings. Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
AlexJones0
force-pushed
the
slh_dsa_migration
branch
from
October 28, 2026 12:18
3b1ab33 to
133b651
Compare
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.
This PR migrates the fake SPHINCS+ keys in the SoftHSM2 test instance to standardized SLH-DSA keys. It defines the fake keygen flow to support these keys and makes improvements to the documentation and supporting scripts to make it more clear how to use these flows to run keygen (aside: some improvements still need to be made to general documentation about the changes that are needed outside of SoftHSM2). To completely remove the SPHINCS+ keys from the SoftHSM2 token and insert new SLH-DSA keys, the fake keygen instance is recreated from scratch -- as a result, all existing keys (including ECDSA keys) are effectively rotated by this change. Relevant key material is then propagated to the OTP configuration.
Targets are created for the SLH-DSA signatures, and the open SKU signing flows are updated to use SLH-DSA signing. Note that, although I've run a test signing/release flow from my fork, this will still need to be run for the changes in this PR so that the release archives are updated appropriately. The handling of this should be clarified before this is merged.
One additional note: the downstream perso signing flows rely on the signature directory having an
spx_keyset, which this PR retains. It might be worth thinking about how we handle this case, as for example maybe we might want to support different keysets / keyset names?See the commit messages for more information.