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

add TL entries for Open-DICE #41

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

Conversation

thomas-fossati
Copy link
Contributor

This PR is a rework of #38 which:

  • narrows the scope to Open-DICE
  • requires one TL for each cert in the chain
  • adds an explicit profile_id field
  • adds a registry for profile_id's
  • populates the profile_id's registry with Android entries

Signed-off-by: Thomas Fossati <thomas.fossati@linaro.org>
@thomas-fossati
Copy link
Contributor Author

cc @danh-arm @apalos @jmarinho

apalos
apalos previously approved these changes Mar 22, 2024
source/transfer_list.rst Show resolved Hide resolved
* - tag_id
- 0x3
- 0x0
- The tag_id field must be set to **0x200**.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to request @manish-pandey-arm to confirm these tag_ids are the best suited, or whether we should use lower values.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say it's too greedy to start a new block of 256. I think TF-A can live with 2 blocks of 16 for now, so we could start this range at 0x120. What do others think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I strongly agree :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

Going back to #38 , i can't see the reasoning why this tag was moved from generic range to 0x200 ? It is a good candidate to stay in generic range.
As mentioned by Dan, i don't think TF-A going to consume more than 32 entries, so 0x120 should be a safe value (if we decide to keep in non-generic range)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both options work for me:

  1. Starting at 0x120
  2. Using the generic range, in which case 8, 9 and 10 are the lowest three that are available - 7 is already taken by the heap carve-outs Add Mbed-TLS crypto heap info entry #45

Let me know what is your preference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@danh-arm @manish-pandey-arm @jmarinho @apalos

I believe I have addressed all the outstanding comments except for this one.

Copy link
Contributor

Choose a reason for hiding this comment

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

8-10 seems fine

Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer it to be in generic range starting at 0x7 as Mbed-TLS heap has now been moved to TF-A range (0x105) https://github.com/FirmwareHandoff/firmware_handoff/pull/45/files

Copy link
Contributor

@danh-arm danh-arm left a comment

Choose a reason for hiding this comment

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

Please also add a commit message.

I'm OK with this PR in essence. My comments should be easy to address.

* - tag_id
- 0x3
- 0x0
- The tag_id field must be set to **0x200**.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say it's too greedy to start a new block of 256. I think TF-A can live with 2 blocks of 16 for now, so we could start this range at 0x120. What do others think?

source/transfer_list.rst Outdated Show resolved Hide resolved
This entry type holds one certificate of the Open DICE certificate chain.

No specific certificate format is mandated.
Examples of certificate formats include X.509, CWT, and C509.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please spell out CWT (or just remove if you agree with my previous point). References would be nice too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will expand CWT and add a reference.


This entry type holds one certificate of the Open DICE certificate chain.

No specific certificate format is mandated.
Copy link
Contributor

Choose a reason for hiding this comment

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

... but the format must be self-describing. Actually the Open DICE spec mandates either x509 or CWT. Wouldn't it be best to just refer to that section of the spec instead of re-specifying here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add a ref to the relevant section in the Open DICE spec.

This entry type holds the "Attestation CDI" described in [Open-DICE]_.

The CDI computed by the Sender's boot stage SHALL be added to the TL.
The CDI received from the previous boot stage (i.e., DICE layer) MUST NOT be forwarded.
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 we need a comment here about what the receiver should do with the profile_id, e.g. use this to generate a CDI that is compatible with the previous layer's CDI as per the Android OpenDICE spec.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we need a comment here about what the receiver should do with the profile_id, e.g. use this to generate a CDI that is compatible with the previous layer's CDI as per the Android OpenDICE spec.

What is the behaviour in case $L_{i+1}$ does not implement a profile compatible with layer $L_i$?

This entry type holds the "Sealing CDI" described in [Open-DICE]_.

The CDI computed by the Sender's boot stage SHALL be added to the TL.
The CDI received from the previous boot stage (i.e., DICE layer) MUST NOT be forwarded.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto a comment about the profile_id would be good. Or you could put this in the "Profile Identifiers" section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I'll add it here so that all requirements are kept together.

* - profile_id
- 0x4
- 0x8
- the Open DICE profile identifier (See :numref:`opendice_profile_id` for the allowed values)
Copy link
Contributor

Choose a reason for hiding this comment

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

In the rendered version, this says 2.7.9 but the section is a 4th level heading without numbering. Maybe change the ref to the section name instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I make html the reference is generated correctly.

For the avoidance of doubt, I will change this into a reference to the table itself.

* - profile_id
- 0x4
- 0x8
- the Open DICE profile identifier (See :numref:`opendice_profile_id` for the allowed values)
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix ref.

thomas-fossati and others added 2 commits June 17, 2024 09:33
Signed-off-by: Thomas Fossati <thomas.fossati@linaro.org>
Signed-off-by: Thomas Fossati <thomas.fossati@linaro.org>
Signed-off-by: Thomas Fossati <thomas.fossati@linaro.org>
Signed-off-by: Thomas Fossati <thomas.fossati@linaro.org>
Entries related to Open DICE
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

These entries contain [Open-DICE]_ information elements that must be transferred between boot stages in a DICE architecture where a DICE Protection Environment (DPE) is not used.
Copy link
Contributor

Choose a reason for hiding this comment

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

It is good that you have expanded the acronyms but can you do the same for DICE, please!


These entries contain [Open-DICE]_ information elements that must be transferred between boot stages in a DICE architecture where a DICE Protection Environment (DPE) is not used.

This includes the Compound Device Identifier (CDI) used for attestation and the CDI used for sealing, as well as the accumulated certificate chain.
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 it is better to wrap to at most 80cols

This entry type holds the "Sealing CDI" described in [Open-DICE]_.

The CDI computed by the Sender's boot stage SHALL be added to the TL.
The CDI received from the previous boot stage (i.e., DICE layer) MUST NOT be forwarded.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please mention why

This entry type holds one certificate of the Open DICE certificate chain.

No specific certificate format is mandated.
Examples of certificate formats include X.509, CWT, and C509.
Copy link
Contributor

Choose a reason for hiding this comment

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

How do you know which format is being used? Why not select one format?

* - tag_id
- 0x3
- 0x0
- The tag_id field must be set to **0x200**.
Copy link
Contributor

Choose a reason for hiding this comment

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

I strongly agree :-)

* - tag_id
- 0x3
- 0x0
- The tag_id field must be set to **0x200**.
Copy link
Contributor

Choose a reason for hiding this comment

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

8-10 seems fine


This entry type holds the "Attestation CDI" described in [Open-DICE]_.

The CDI computed by the Sender's boot stage SHALL be added to the TL.
Copy link
Contributor

Choose a reason for hiding this comment

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

This use of SHALL, MUST and MUST NOT seems new for this spec.

I suggest using lower case, since people will either read it or they won't. Capitals don't help with that.

If we say 'must' or 'should' then I think it is important to say why, e.g. because otherwise xxx will happen

* - cert
- data_size - 0x4
- 0xc
- Holds the certificate for the next layer, produced by the current layer
Copy link
Contributor

Choose a reason for hiding this comment

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

'certifcate' is vague...what format are these in? Please add enough detail so that people know how to create the info

@danh-arm danh-arm self-assigned this Oct 17, 2024
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.

6 participants