Skip to content

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

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