openwsn-berkeley / lakers

EDHOC implemented in Rust, optimized for microcontrollers, with bindings for C and Python.
https://crates.io/crates/lakers
BSD 3-Clause "New" or "Revised" License
12 stars 10 forks source link

Refactor EADs to not use global state #170

Closed geonnave closed 6 months ago

geonnave commented 7 months ago

This is a step in the direction of the separate message processing, initially discussed in #99, and further discussed in the meeting this week.

Edit: this includes:

geonnave commented 7 months ago

The new lakers-ead-authz crate is ready by itself, but now it depends on lakers to be updated to support multi-step message processing. Thus for now I'll keep it as draft.

geonnave commented 7 months ago

@chrysn I tried to use the typestate pattern here, could you please take a look? (see the 2 commits with "typestatify" in the name")

chrysn commented 6 months ago

The typestatification looks about right (as far as I can tell that from mainly looking at types and signatures). It looks like there are fewer types than there were enum states before, but apparently not all were used. Is ZeroTouchAuthenticatorState left around on purpose?

geonnave commented 6 months ago

Thank you for the review.

apparently not all (types) were used

Yes, some were unused and the Error state is now simply a variant of Result.

I can't find the symbol ZeroTouchAuthenticatorState, but maybe you are referring to the whole lakers-ead-zeroconf crate, which I did not remove yet because it breaks tests this new EAD approach cannot be used without the changes in the split PR (#174). I plan to remove it once the split is merged.