Skip to content

Fix: transaction id#71

Open
sc-vt wants to merge 2 commits into
jselbie:masterfrom
sc-vt:txnid_fix
Open

Fix: transaction id#71
sc-vt wants to merge 2 commits into
jselbie:masterfrom
sc-vt:txnid_fix

Conversation

@sc-vt
Copy link
Copy Markdown

@sc-vt sc-vt commented Mar 31, 2026

  • rfc3489 does not use magic cookie in transaction id
  • the last 4 bytes of transaction id were not populated

* rfc3489 does not use magic cookie in transaction id
* the last 4 bytes of transaction id were not populated
@jselbie
Copy link
Copy Markdown
Owner

jselbie commented Mar 31, 2026

It took me a couple of minutes to see the bug. But yeah, that for-loop is truncated.

And if we really wanted to be pedantic, we'd make sure that the first 4 random bytes in legacy mode are definitely NOT 0x2112A442. It's a 1 in 4 billion chance that would ever happen, but the stunserver has handled up to a billion transactions per day. There's all kinds of simple ways to ensure this never happens.

Can you address that and add some unit tests?

…okie.

Add unit tests to validate transaction id in legacy and non-legacy modes.
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.

2 participants