Skip to content
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

opentitanlib: accept ECDSA signatures as ASN.1 blobs #26010

Open
wants to merge 1 commit into
base: earlgrey_1.0.0
Choose a base branch
from

Conversation

vbendeb
Copy link

@vbendeb vbendeb commented Jan 24, 2025

When processing ECDSA signatures consider the input file to be either a raw signature, with 32 bytes R and S values in little endian format concatenated into a single 64 bytes blob, or an ASN.1 encoded ECDSA signature, which is a sequence of two big endian big number values, which could be anywhere from one to 33 bytes long.

In case input is in ASN .1 format Convert the values into little endian and truncate/expand as necessary to generated the internal representation of R and S of exactly 32 bytes each.

Tested by attaching the Crypto4a HSM produced ECDSA signature to an owner binary image and verifying the signature, both using opentitantool.

When processing ECDSA signatures consider the input file to be either
a raw signature, with 32 bytes R and S values in little endian format
concatenated into a single 64 bytes blob, or an ASN.1 encoded ECDSA
signature, which is a sequence of two big endian big number values,
which could be anywhere from one to 33 bytes long.

In case input is in ASN .1 format Convert the values into little
endian and truncate/expand as necessary to generated the internal
representation of R and S of exactly 32 bytes each.

Tested by attaching the Crypto4a HSM produced ECDSA signature to an
owner binary image and verifying the signature, both using
opentitantool.

Signed-off-by: Vadim Bendebury <vbendeb@google.com>
@vbendeb vbendeb requested a review from a team as a code owner January 24, 2025 19:13
@vbendeb vbendeb requested review from timothytrippel and removed request for a team January 24, 2025 19:13
@vbendeb
Copy link
Author

vbendeb commented Jan 24, 2025

take two, after more thorough testing.

Support processing of ECDSA signatures represented as ASN.1 DER blobs.

@vbendeb vbendeb requested a review from cfrantz January 24, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant