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

Command Line Validation of Indirect Signatures #78

Merged
merged 9 commits into from
Feb 14, 2024

Conversation

elantiguamsft
Copy link
Contributor

The command line verb validate does not currently support the validation of "COSE detached signatures" - a COSE signing format that I will refer from this point on as "indirect signing".

Indirect signatures, as it exists presently, constitutes an embedded COSE signature where the embedded content represents the hash of the payload. The hashing algorithm is also encoded in the message.

For indirect signatures, validation requires that the payload be hashed using the same algorithm used in the creation of the COSE message. The computed hash is then compared to the hash stored in the content header to ensure the payload has not been mutated. This pull request updates the CoseSignTool.exe validate verb to check if the signature is indirect, in which case the aforementioned extra hash validation steps are taken.

Currently, indirect signatures embed the hash of the payload in the content header of the COSE message, and the hash algorithm is appended to the content type. The industry standard is likely to use a similar format where both the payload hash and algorithm name are stored in the content header encoded as a cbor object. Subsequent updates will be made to respect Microsoft internal practices and industry standards as they mature.

CoseHandler/CoseHandler.cs Fixed Show fixed Hide fixed
CoseHandler.Tests/CoseSignValidateTests.cs Dismissed Show dismissed Hide dismissed
CoseHandler.Tests/CoseSignValidateTests.cs Dismissed Show dismissed Hide dismissed
CoseHandler.Tests/CoseSignValidateTests.cs Dismissed Show dismissed Hide dismissed
CoseHandler/CoseHandler.cs Fixed Show fixed Hide fixed
CoseHandler/CoseHandler.cs Fixed Show fixed Hide fixed
@elantiguamsft elantiguamsft force-pushed the users/edwinlantigua/cmd-cds-validation branch from 8c6e612 to 78395dd Compare February 12, 2024 06:14
@elantiguamsft elantiguamsft marked this pull request as draft February 13, 2024 01:33
CoseHandler/CoseHandler.cs Fixed Show fixed Hide fixed
CoseHandler/CoseHandler.cs Fixed Show fixed Hide fixed
CoseHandler/CoseHandler.cs Fixed Show fixed Hide fixed
@elantiguamsft elantiguamsft marked this pull request as ready for review February 13, 2024 19:31
CoseHandler/CoseHandler.cs Fixed Show fixed Hide fixed
CoseHandler/CoseHandler.cs Dismissed Show dismissed Hide dismissed
@elantiguamsft elantiguamsft merged commit 817cff7 into main Feb 14, 2024
10 checks passed
@elantiguamsft elantiguamsft deleted the users/edwinlantigua/cmd-cds-validation branch February 14, 2024 19:58
elantiguamsft added a commit that referenced this pull request Mar 1, 2024
…idation

Command Line Validation of Indirect Signatures
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.

3 participants