Skip to content

Fix initial value check on legacy sequence numbers#202

Merged
einarmo merged 1 commit intomasterfrom
fix-legacy-sequence-initial-value
Feb 23, 2026
Merged

Fix initial value check on legacy sequence numbers#202
einarmo merged 1 commit intomasterfrom
fix-legacy-sequence-initial-value

Conversation

@einarmo
Copy link
Copy Markdown
Contributor

@einarmo einarmo commented Feb 23, 2026

A dumb bug, because the comment in the code actually describes correct behavior. It just happened to work anyway
because most OPC-UA servers set 1 as the initial value, because there's no apparent reason to pick any other number even if the standard allows it. They even realized that this was stupid, and decided to fix it by introducing yet another way for sequence numbers to work, under the assumption that it will "eventually" get phased out as computing gets stronger and old security policies become deprecated.

This fixes it and also includes a proper test. The fix itself is trivial, just check expected == self.min_value() instead of incoming_sequence_number == self.min_value()... I also moved the is_legacy check first, since technically that's more correct.

Should fix #125.

A dumb bug, because the _comment_ in the code actually describes correct
behavior. It just happened to work anyway
because most OPC-UA servers set 1 as the initial value, because there's
no apparent reason to pick any other number even if the standard allows
it.

This fixes it and also includes a proper test.
@einarmo einarmo merged commit 9a2b529 into master Feb 23, 2026
6 checks passed
@einarmo einarmo deleted the fix-legacy-sequence-initial-value branch February 23, 2026 09:11
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.

BadSequenceNumberInvalid

2 participants