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

Update to EDHOC -12 #30

Draft
wants to merge 46 commits into
base: master
Choose a base branch
from

Conversation

chrysn
Copy link
Collaborator

@chrysn chrysn commented Mar 26, 2022

This is more of a staging area than a full PR -- it contanis all I needed to run aiocoap's being-updated edhoc branch interoperably with other EDHOC -12 implementations.

Some of this is rewriting code that has been around and then dumping the old code at a later dead-code-removal stage; this is largely because oftentimes I couldn't find the code when looking for the terms used in the EDHOC draft. Some terms were not used consistently before, and EDHOC's terms changed quite a bit; I found I need them to be aligned to be productive in the code base.

Some "unrelated" changes (in quotes because they are intermingled with the actual changes) are around where things are cached. I'm trying to replace the LRU caches (which make it unclear what is recalculated when) with state clearly held in the EDHOC objects that are getting populated as they are calculated (or received) -- that is not fully complete yet, at the cost of several calculations being done multiple times (which should not happen in a secure production-ready version of this). Also I switched some things about how messages are entered (to facilitate the first-item stripping), I'll have to roll that back as it led to the necessity of message reencoding (which conflicts with the TBD upcoming nop-padding).

Steps forward are for me to clean up, finishing the "we name things as they are named in EDHOC" transition and the "we store things the first time they are used" transition. Then, this'll probably need a look at restoring the test suite (the tests that drove my development were integrated tests with aiocoap), and see whether the API change fall-out (some due to EDHOC's changes) are breaking anything too badly. (Do we have a list of users? At the present stage that might still be feasible.)

chrysn added 30 commits May 18, 2021 18:06
This adds the C_1 in all cases. (The specification makes it optional,
but this library supports only the case in which it is present --
further changes are expected in -07 on this anyway).
by generalizing over the P256 code
... because now the CoAP part can strip off the first element and hand
on the rest easily.
This makes it easier to apply later format changes.
(The indices supported the corr-dependent format of earlier drafts).
This makes processing easier under the new BytesIO based processing
Previous cleanup steps didn't update this consistently
(Picking some C_x is not as easy any more, but it probably never was).
cred to cred_local and conn_id to c_local
Implementation stays BytesIO based as that is easier to process.

This now allows Message1 to override decoding to store the byte string
(as it is needed later).
chrysn added 16 commits March 26, 2022 15:20
This replaces the LRU cache previously used with more precise caching
(in that there never needs to be a question of cache eviction: all
caches have precisely size 1, and expire when the EDHOC object is
dropped).
This allows replacing several @Property implementations with regular
attributes, and allows fine-grained removal if information later.
Nowhere in the code was there need to get the "local" or "remote"
identifier.
They are not valid credentials any more in -12, and were replaced with
CCSs.
This allows handing on encoded data transparently, without any worry of
normalization differences.
@chrysn
Copy link
Collaborator Author

chrysn commented Apr 6, 2022

Some notes for going forward:

  • No known users, and no API stability guarantees to worry about yet. (In particular, nothing in OpenVisualizer is there yet).
  • I'll update this to have a working test suite again.
  • A lot of smushing.
  • ... and then request reviewers.

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.

1 participant