Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

srtp: fix for possible sequence number corruption on wrap around boun… #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nifigase
Copy link

@nifigase nifigase commented Jun 1, 2018

We encountered and fixed a bug in libre:
Assume we protect with SRTP a sequence of packets with following sequence numbers:
..., 65533, 65535, 0, 1, 65534, 2, ...
Sequence is a little bit out of order, and roc (roll over counter) should increment by 1.
The issue was that it eventually incremented by 2:
SN 0: roc++; s_l = 0
SN 1: s_l = 1
SN 65534: (hdr.seq > strm->s_l) => s_l = 65534
SN 2: roc++; s_l = 2

That led to incorrect "ix" calculation,then incorrect authentication tag was formed, then receiver (i.e. web browser based on libSRTP) failed to unprotect all subsequent packets with err=7 (auth error), stream was frozen.

@alfredh
Copy link
Collaborator

alfredh commented Jun 5, 2018

hi @nifigase

I am the co-maintainer of the libre project, and I just stumbled upon this PR
by chance.

The official libre project is maintained here:

https://github.com/creytiv/re/pulls

Could you please move this PR to that project. You have found a real bug
so it would be good to fix it.

@traviscross perhaps you should consider deleting this project as it is just
confusing people. If you want to keep the project, perhaps it is better to
clone it from creytiv/re.

Alfred

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