Skip to contentSkip to conversation

mesh: Secure Beacon - IV_Index/Key Refresh re-write

PATCH Superseded Brian Gix 1 participant 1 message Oct 10, 2019 Bluetooth drivers

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Brian Gix

author
#0 lore raw

PATCH v3 1/1 mesh: Secure Beacon - IV_Index/Key Refresh re-write

This is a major rewrite of Secure Network Beacon (SNB) handling that includes:

* Seperating Key Refresh from IV_Index handling

This is a clearer handling of the two features. Although both features are represented in SNB's, they run independantly.

* Creating a Seperate IV_Index initialization and updating state distinct from the current values sent and received in SNBs.

If a restart occured during an IV Update procedure (96 hours long) the IVU bit got lost, and Sequence number resetting was not done correctly.

* Assuring that all Nodes handled by daemon receive each incoming beacon. SNB handling previously stopped after the first node successfuly handled it, although the SNB may be valid for many local nodes.

---
 mesh/mesh-config-json.c |   3 +-
 mesh/net.c              | 353 +++++++++++++++-------------------------
 2 files changed, 134 insertions(+), 222 deletions(-)
mesh/mesh-config-json.c +2 -1
index 198fef518..df58cbd7d 100644
@@ -2057,7 +2057,8 @@ bool mesh_config_write_seq_number(struct mesh_config *cfg, uint32_t seq,
 		return mesh_config_save(cfg, true, NULL, NULL);
 	}
 
-	if (get_int(cfg->jnode, "sequenceNumber", &value))
+	/* If resetting seq to Zero, make sure cached value reset as well */
+	if (seq && get_int(cfg->jnode, "sequenceNumber", &value))
 		cached = (uint32_t)value;
 
 	/*
mesh/net.c +132 -221

514 lines not on this page · raw message

Signature · 1 line
2.21.0