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

[nrf noup] For Attestation, use message instead of hash #180

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hellesvik-nordic
Copy link

Also updated T_COSE library to support this

@@ -241,6 +241,9 @@ attest_token_encode_start(struct attest_token_encode_ctx *me,
me->opt_flags = opt_flags;
me->key_select = key_select;

if (opt_flags & TOKEN_OPT_SIGN_MESSAGE) {
Copy link
Author

Choose a reason for hiding this comment

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

Should I make sure this is only added for nRF54L15, or should we use sign_message for all chips?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that it makes sense to keep the default as is and not use sign_message.

But we need to have this as an option in TFM. We can sync with a call tomorrow or something and we can find a way to do that.

lib/ext/t_cose/src/t_cose_sign1_sign.c Outdated Show resolved Hide resolved
lib/ext/t_cose/crypto_adapters/t_cose_psa_crypto.c Outdated Show resolved Hide resolved
@@ -496,6 +496,14 @@ struct t_cose_parameters {
*/
#define T_COSE_OPT_DECODE_ONLY 0x00000008

/**
* By defualt, the cose t_cose_sign1_sign will calculate the hash
Copy link
Contributor

Choose a reason for hiding this comment

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

"defualt" -> "default"

And the function t_cose_sign1_sign doesnt exit now.

lib/ext/t_cose/inc/t_cose_sign1_sign.h Outdated Show resolved Hide resolved
lib/ext/t_cose/src/t_cose_crypto.h Outdated Show resolved Hide resolved
@@ -241,6 +241,9 @@ attest_token_encode_start(struct attest_token_encode_ctx *me,
me->opt_flags = opt_flags;
me->key_select = key_select;

if (opt_flags & TOKEN_OPT_SIGN_MESSAGE) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that it makes sense to keep the default as is and not use sign_message.

But we need to have this as an option in TFM. We can sync with a call tomorrow or something and we can find a way to do that.

@hellesvik-nordic hellesvik-nordic force-pushed the t_cose_add_message_sign branch 13 times, most recently from c9cd993 to dc8b931 Compare November 22, 2024 12:44
The t_cose library only had support for signing a hash/digest.
Adding support for signing message instead by using
the option T_COSE_OPT_SIGN_MESSAGE.

Signed-off-by: Sigurd Hellesvik <[email protected]>
For attestation, sign the full token instead of the hash of the token.

Signed-off-by: Sigurd Hellesvik <[email protected]>
Copy link
Contributor

@tomi-font tomi-font Nov 25, 2024

Choose a reason for hiding this comment

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

Why are we making changes to lib/ext/t_cose as a noup while it exists upstream?

Copy link
Author

Choose a reason for hiding this comment

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

Good point. I will make a PR upstream instead, and then fix this PR accordingly.

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