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

let stateless-nonce use SHA-2 #17

Merged
merged 2 commits into from
Mar 13, 2023
Merged

let stateless-nonce use SHA-2 #17

merged 2 commits into from
Mar 13, 2023

Conversation

thomas-fossati
Copy link
Collaborator

No description provided.

Signed-off-by: Thomas Fossati <thomas.fossati@arm.com>
: HMAC w/ SHA-1 computed over the CBOR serialisation of TimeToken encoded as a
20-bytes string.
: HMAC w/ SHA-224 computed over the CBOR serialisation of TimeToken encoded as
a 28-bytes string.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now if we could spend four more bytes to get a hash that is actually widely supported in hardware and software (SHA-256)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could. The whole idea behind SHA-1 was being able to do everything in 32 bytes, which fits well in "a certain RoT"'s API.


A stateless-nonce supports the above use case by encoding a Posix time (i.e.,
the epoch identifier), alongside a minimal set of metadata, authenticated with
a symmetric key in a self-contained and compact (starting at 40 bytes) token.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "starting at" is not Bourne out by the CDDL.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I get your point: with a 0-length Pad (the inf), it serialises to 40 bytes. That's what I wanted to say here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see how to go beyond the 40-byte token, but I probably focused on the non-agile hash too much.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, got it, sorry, not enough coffee :-)

* use SHA-256
* remove wrong size lower bound

Signed-off-by: Thomas Fossati <thomas.fossati@arm.com>
@cabo cabo self-requested a review March 13, 2023 09:53
Copy link
Collaborator

@cabo cabo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. This now looks good.
Adding optional agility might be a next step, but this one can go in.

@cabo cabo changed the title let stateless-nonce use SHA-224 let stateless-nonce use SHA-2 Mar 13, 2023
@thomas-fossati thomas-fossati merged commit 476b550 into main Mar 13, 2023
@thomas-fossati thomas-fossati deleted the sn-again branch March 13, 2023 10:23
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.

2 participants