Summary
TurnServer.cs contained two workarounds for bugs that have since been fixed upstream:
These should be replaced with the fixed library methods:
new STUNErrorCodeAttribute(code, reason) (8 call sites)
request.CheckIntegrity(key) (1 call site)
Additionally, 5 of the 8 STUNErrorCodeAttribute error paths have no test coverage:
- 437 — Duplicate allocation (allocate when allocation already exists)
- 437 — Refresh without allocation
- 437 — CreatePermission without allocation
- 437 — ChannelBind without allocation
- 400 — ChannelBind missing channel number or peer address
Acceptance criteria
Summary
TurnServer.cscontained two workarounds for bugs that have since been fixed upstream:BuildErrorCodeAttribute(code, reason)— manual ERROR-CODE construction to work around the brokenSTUNErrorCodeAttribute(int, string)constructor (fixed in Fix STUNErrorCodeAttribute(int, string) constructor #1509)VerifyMessageIntegrity(rawBytes, key)— manual HMAC verification to work aroundCheckIntegrity()requiring FINGERPRINT (fixed in Fix CheckIntegrity() failing when FINGERPRINT is absent #1510)These should be replaced with the fixed library methods:
new STUNErrorCodeAttribute(code, reason)(8 call sites)request.CheckIntegrity(key)(1 call site)Additionally, 5 of the 8
STUNErrorCodeAttributeerror paths have no test coverage:Acceptance criteria
BuildErrorCodeAttribute()helper and replace all 8 call sites withnew STUNErrorCodeAttribute(code, reason)VerifyMessageIntegrity()helper and replace withrequest.CheckIntegrity(key)rawBytesparameter threaded throughProcessMessageandHandleAllocate