|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Persistent rolling-sequence counters for one-way (1W) transmit. More...
Go to the source code of this file.
Classes | |
| class | esphome::home_io_control::OneWaySequenceStore |
| Per-controller-identity rolling sequence counters, persisted across reboots. More... | |
Namespaces | |
| namespace | esphome |
| namespace | esphome::home_io_control |
Variables | |
| static constexpr uint16_t | esphome::home_io_control::ONEWAY_SEQUENCE_ACCEPTANCE_WINDOW = 1000 |
| How far ahead of its stored high-water mark a device will still accept a jump. | |
| static constexpr uint16_t | esphome::home_io_control::ONEWAY_SEQUENCE_STRIDE = 8 |
| How many sequences one flash write reserves. | |
| static constexpr uint16_t | esphome::home_io_control::ONEWAY_SEQUENCE_REBOOT_HEADROOM = 8 |
| How many consecutive unclean reboots the stride must survive while staying inside a device's acceptance window. | |
Persistent rolling-sequence counters for one-way (1W) transmit.
1W has no reply, no challenge and no acknowledgement. Its entire replay defence is a rolling 16-bit sequence carried in every frame and mixed into the authenticator's IV: a device remembers the highest sequence it has accepted from each transmitter and rejects anything at or below it. That makes this counter the one piece of state the hub cannot afford to lose, and the reason it is the only thing the component writes to persistent storage — see ADR 0025, which records that exception to ADR 0018 and draws its boundary.
The failure is asymmetric, and every rule below follows from it:
This class is the only place in the component that increments or persists a sequence.
Definition in file oneway_sequence_store.h.