Add parameter ecdsa_deterministic_signing to x509 sign methods #12796
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.
Hi! This is a feature I implemented for myself in order to generate reproducible test vectors for W3C Web Authentication (see also the pull request). The feature already exists in the ECDSA layer, so this patch just plumbs it through to the X.509 layer. I named the parameter
ecdsa_deterministic_signing
to mirror the correspondingdeterministic_signing
parameter in theec
module, and theecdsa_
prefix mirroring its sibling parameterrsa_padding
.I tried to get this to work in
PKCS7SignatureBuilder.add_signer
too, since itssign_and_serialize
Rust implementation also has calls that need a newfalse
argument, but didn't manage to getPKCS7SignatureBuilder.sign()
to produce reproducible outputs. I think one reason for that is thatsign_and_serialize
in Rust internally sets the signing time tonow()
, but making that injectable as a parameter didn't seem to suffice to make the result deterministic. My experiments are available on mywip/pkcs7-sign-ecdsa-deterministic
branch in case there's interest in it.