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

Create an RFC to make capabilities negotiation extensible #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mcy
Copy link
Collaborator

@mcy mcy commented Jun 18, 2021

There are a few opens, namely:

  • Do we want to include the "PFM Support" et al bits? They're underspecified right now and it might make more sense to add them in a future RFC.
  • Is being able to send 16k byte capabilities useful? I think it's not but I included it for completeness. We can instead switch to something like the Zigzag encoding and use only short integers.

@mcy mcy requested a review from chweimer June 18, 2021 18:08
Copy link
Collaborator

@chweimer chweimer left a comment

Choose a reason for hiding this comment

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

I think this generally looks good and achieves what we are looking for. Just a few comments.


This proposal replaces "Device Capabilities" with an extensible negotiation
flow that allow arbitrary new capabilities to be exchanged, while respecting the
maximum 64-byte size of required messages.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I know what you mean here, but I just want to be sure it's clear that there not a maximum size of 64 bytes for required messages. Certain messages, like Get Certificate, will likely return messages larger than 64 bytes. The 64 byte value is the minimum required message size a device must support. Negotiate, but not other commands, need to fit within this 64 byte constraint since you can negotiate a larger message size with the device.

}
```

The `reserved` byte must always be set to zero, and servers must reject
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the current spec, we generally refer to things as 'devices' rather than 'servers'. It comes mostly from the idea that RoTs are components within a server chassis or motherboard that communicate with each other.

Copy link
Collaborator Author

@mcy mcy Oct 4, 2021

Choose a reason for hiding this comment

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

Oops. Yeah, I have a habit of using "client" and "server" here. Host and device makes more sense.

- As a six-bit integer, encoded as a byte with the top two bits forming the
value `0b00`.
- As a fourteen-bit integer, encoded as two bytes, where the value is formed
as `contents[0] | (contents[1] << 6)`. The top two bits form the value
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't left-shifting contents[1] make the MSB of the second byte non-deterministic?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The shift is taking place in 14-bit space (since it's a 14 bit integer). I've clarified this in the text.

- "Mode", `0x00`. Six bit record. Required.
- Bits [1:0] are the device type. They are interpreted as in the Device
Capabilities message (AC-RoT, PA-RoT, etc.).
- Bits [3:2] are the bus role (i.e., can it act as a "client" or "server" on
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems you are generally trying to move to client/server nomenclature. Maybe we should discuss and align on appropriate terminology. My only concern here is the overloading of the term 'server', since the main use-case for Cerberus is in server platforms.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let's stick to host/device; I have a habit of switching to client/server when chatting with folks who work on TLS, but that shouldn't leak into the spec.

I will note that I've intentionally avoided the master/slave nomenclature here.

# Future Work

The encoding described a above leaves us with significant leeway to add even
more capabilities contents. The flags byte, for example, can be used to
Copy link
Collaborator

Choose a reason for hiding this comment

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

Which is the flags byte? Does this refer to 'reserved'?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup. Name changed while I was editing, oops.


The encoding described a above leaves us with significant leeway to add even
more capabilities contents. The flags byte, for example, can be used to
indicate a continuation byte, if all the capabilities don't fit in one byte.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mean one message? If we think could be a possibility, which it certainly could be from the way this is defined, we should probably think through this more carefully and put something in explicitly to cover that case from the beginning.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, message, not byte. Oops.

One thing I've been thinking about is how much of this complexity is necessary if we believe in a version-varying format for this. I'm already burning a reserved byte there for future-compat, so perhaps it's not a big deal... let's discuss this tomorrow.

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