Skip to content

Introduce Credential and IdCredential as successors to CredentialRpk#274

Closed
chrysn wants to merge 6 commits intolake-rs:mainfrom
chrysn-pull-requests:cred-idcred-split
Closed

Introduce Credential and IdCredential as successors to CredentialRpk#274
chrysn wants to merge 6 commits intolake-rs:mainfrom
chrysn-pull-requests:cred-idcred-split

Conversation

@chrysn
Copy link
Copy Markdown
Member

@chrysn chrysn commented May 16, 2024

Closes: #272, #273

This is a first sketch of how I'd go about #272; the design includes some choices influenced by my assessment of #273. The two new types should eventually replace CredentialRpk completely (and also remove the need for BytesIdCred).

If I'm wrong about #273, Credential may still have a .value_type, but it wouldn't be needed for .by_value() any more, only for .by_thumbprint() (which we don't have yet).

@geonnave, is this a good direction?

@chrysn chrysn force-pushed the cred-idcred-split branch from 356a092 to 0087000 Compare May 23, 2024 07:28
@chrysn
Copy link
Copy Markdown
Member Author

chrysn commented May 23, 2024

This needed updates after understanding the need for #281.

chrysn added 5 commits May 23, 2024 10:53
This is required since learning that not all credentials are encoded,
when sent by value, in {key: 'bytestring'}, but some (such as CCS) are
sent directly as {/kccs/14: encoded_credential}. Consequently, the
generic builder for typed credentials goes away -- one can still have
arbitrarily kinds of credentials in an EDHOC implementation, but passing
them by value will require per-type information.
@chrysn chrysn force-pushed the cred-idcred-split branch from 0087000 to 3114398 Compare May 23, 2024 08:57
/// If set, it enables using the credential by value. Setting this adds the requirement that
/// the value is well-formed according to the type. In particular, when set to KCCS or any
/// other Map-valued types, a value that is not CBOR can result in hard to debug parsing errors
/// on the other end, even before it reaches the credential validation at the peer.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

s/at the peer/at the peer's application/

@geonnave
Copy link
Copy Markdown
Collaborator

Yes I think this is in the right direction.
Not really sure how ByValueStyle will be used, but I think it will become clearer as it progresses.
Thanks for the contributions so far.

@geonnave geonnave added the type:enhancement New feature or request label May 27, 2024
value: EdhocMessageBuffer,
/// Public authentication key (G_I or G_R) expressed in the credential
// For CCSs, this could be a reference into value, but Rust does not allow self-referential structs anyway.
public_key: BytesP256ElemLen,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can you help me understand why the value and public_key are not optional, while the kid is optional?

for context, I will have to add support for an experimental PSK credential (for the emerging edhoc-psk draft), and I am trying to see how things are going to fit here. for example, I was thinking that the PSK can be stored separately (like the private keys), and the credential type might hold only the kid that identifies the PSK.

@chrysn chrysn mentioned this pull request Jun 21, 2024
geonnave added a commit to geonnave/lakers that referenced this pull request Jun 21, 2024
will support more types of credentials,
     including different types of COSE_Key's

the handling of id_cred's is inspired by chrysn's PR lake-rs#274
geonnave added a commit to geonnave/lakers that referenced this pull request Jun 27, 2024
will support more types of credentials,
     including different types of COSE_Key's

the handling of id_cred's is inspired by chrysn's PR lake-rs#274
geonnave added a commit to geonnave/lakers that referenced this pull request Jul 3, 2024
geonnave added a commit to geonnave/lakers that referenced this pull request Jul 3, 2024
geonnave added a commit to geonnave/lakers that referenced this pull request Jul 3, 2024
geonnave added a commit to geonnave/lakers that referenced this pull request Jul 31, 2024
will support more types of credentials,
     including different types of COSE_Key's

the handling of id_cred's is inspired by chrysn's PR lake-rs#274
geonnave added a commit to geonnave/lakers that referenced this pull request Jul 31, 2024
@geonnave
Copy link
Copy Markdown
Collaborator

geonnave commented Aug 2, 2024

This PR served very well as inspiration to the credential-related updates in #284! Since that one is now merged, I am closing this.

@geonnave geonnave closed this Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MACed ID_CRED_x is always {4: "k"}

2 participants