Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

Processing API: Accept messages #11

Open
chrysn opened this issue Apr 15, 2021 · 2 comments
Open

Processing API: Accept messages #11

chrysn opened this issue Apr 15, 2021 · 2 comments

Comments

@chrysn
Copy link
Collaborator

chrysn commented Apr 15, 2021

Functions like finish and create_message_two currently take messages as bytes.

Typical usage is that the application needs to decode the message beforehand anyway -- in the m1 case to pick out method, correlation and supported suites (to pick suitable own credentials), and in the m3 case to get the c_r to find the right responder.

Given that, I suggest these should take the decoded message instead. (For compatibility or the cases where things are hardcoded, there may stay an option to pass in bytes too, but for consistency it's probably better to always make the application do the decoding).

(This is a bit of a note-to-self as I don't want to rewrite the API while I have other things in the air; can provide a PR for this at a later stage).

@TimothyClaeys
Copy link
Member

Hi @chrysn, so far I've neglected the case where there could be multiple exchanges going on at the same time. This is why I took in the received message as bytes and decoded everything inside the API calls (create_message_two, create_message_three, ...). Just to be clear are you suggesting something like this:

  1. application decodes CBOR sequence and extracts connection identifier (if applicable) and authentication method (for message 1)
  2. It passes to the EDHOC engine:
    • an EDHOC processing context (which it has fetched with the connection identifier or other connection identifying information such as the CoAP token or five tuple)
    • the decoded CBOR sequence (for example as a list of decoded CBOR elements)
    • and the credentials it has selected (based on authentication method in message 1)

@chrysn
Copy link
Collaborator Author

chrysn commented Apr 15, 2021 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants