Closed rsgmodelworks closed 1 year ago
The assumption is made that only the ACU set the sequence cadence. The PD should only reply to the sequence number value it was sent be the ACU command.
Are we assuming that a sequence zero that is sent from PD is a request to reset the connection?
A sequence number of 0 from a PD means the PD thinks the sequencing is screwed up and the ACU should go back to sequence 0. If this happens inside a secure channel the ACU should additionally discard the current secure channel connection because if you can't trust the link layer (i.e frame header/sequence number) then you can't trust the rolling MAC value. And you might be under attack by an intercept-in-the-middle attack.
{"command":"polling","action":"reset"} will make libosdp-conformance as a PD reset the sequence number to zero. Useful for testing this?
With osdp.net configured for 3 PD's (at 0, 3, and 7) It appears that it does not reset the sequence number if it gets a NAK 0 and it was attempting to set up a secure channel. See attached log, packet 11 (a nak-0/s0/a=3) and packet 14 (a chlng/s1/a=3). IMO while this PD has issues the ACU code should be going back to sequence number 0 when it receives a NAK 0. 21.log