Skip to content

rtsp: prioritise digest authentication#104

Open
gabridego wants to merge 1 commit into
deepch:masterfrom
gabridego:patch-1
Open

rtsp: prioritise digest authentication#104
gabridego wants to merge 1 commit into
deepch:masterfrom
gabridego:patch-1

Conversation

@gabridego
Copy link
Copy Markdown

This pull request solves a problem with security cameras that send both basic and digest realms, prioritising digest authentication.

This pull request solves a problem with security cameras that send both basic and digest realms, prioritising digest authentication.
Cacsjep added a commit to Cacsjep/vdk that referenced this pull request May 27, 2026
Add several robustness fixes to the RTSP demuxer and client and introduce unit tests.

- Add mergeResponseHeader to preserve Digest over Basic in WWW-Authenticate responses (prefer strongest scheme) to avoid downgrading to Basic (backports upstream PR deepch#104) and use it when parsing response headers.
- Use RFC 7826 default ports: 322 for rtsps and 554 for rtsp (backports upstream PR deepch#118) when parsing URLs; normalize unknown schemes to rtsp. Add URL parsing tests.
- Fix RTP timestamp slice to read exactly 4 bytes (avoid leaking SSRC into timestamp) (backports upstream PR deepch#119) and add tests verifying timestamp behavior.
- Harden H.264 STAP-A parsing to guard against size==0 causing OOB reads (prevents panics, referenced upstream issue deepch#114).
- Add bounds checks in AAC handling to avoid panics from malformed AU headers and frame sizes (backports upstream PR deepch#126).
- Add comprehensive tests: client_test.go and demuxer_test.go covering URL parsing, WWW-Authenticate merging, H.264 STAP-A, AAC malformed packets, metadata reassembly, and other demuxer behaviors. Remove older demuxer_metadata_test.go in favor of unified tests.
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.

1 participant