-
Notifications
You must be signed in to change notification settings - Fork 10
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
Allow applications to pick their C_x #104
Allow applications to pick their C_x #104
Conversation
05b06a5
to
be0ab60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. @geonnave do you want to take a look before merging?
lib/src/lib.rs
Outdated
@@ -761,7 +770,8 @@ mod test { | |||
let mut initiator = | |||
EdhocInitiator::new(state, I, G_R, ID_CRED_I, CRED_I, ID_CRED_R, CRED_R); | |||
|
|||
let message_1 = initiator.prepare_message_1(); | |||
let c_i: u8 = generate_connection_identifier_cbor().into(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is .into()
needed here (and other similar lines)? The output of generate_connection_identifier_cbor()
is already a u8
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether the output of generate_connection_identifier is U8 or u8 used to depend on the back-end; those can go away when rebasing onto remove-hacspec, which is my next step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh indeed, great!
Thanks @chrysn, it looks good. Left a minor comment. As for merging, maybe we could merge it directly into the remove-hacspec branch I just pushed upstream. |
8bb8813
to
a5dc9ae
Compare
The change allows applications to pick usable C_x (i.e., C_I and C_R) values, which they are in a position to decide, because unlike the EDHOC library, they keep track of all the ongoing exchanges. The c_wrapper API is *not* changed at this point, because the API change would be way too subtle (the "out" parameter would be changed to an "in" parameter). BREAKING CHANGE: This alters the message 1 and 2 API.
a5dc9ae
to
9699574
Compare
This is now only one commit atop #106. Rebasing was a bit of a hassle, but worked in a mixed cherry-pick and manual application approach. Looks like remove-hacspec is in a stable enough shape to rebase onto, at any rate, and things are much easier on that! From my PoV, this is done once CI says Go. |
Great! Merged into |
Applications may need to pick their own C_x (as opposed to the EDHOC library picking one at random, as it was before) for three reasons:
This will likely need follow-ups for similarly delegating the choice of {ID_,}CRED_peer to the callers (resolving #99 issues from), but those are separate enough that I'd do them in a separate PR.
These are API breaking changes. They're split in two because I did C_R first, and kept them split to ease review especially on the CI side; when ACK'ed, I'd like to squash them.