Changeset 5c09dbbad9c76ea76d7060b0fee10b7d3c8abb3a
- Timestamp:
- 03/10/07 21:08:33
(1 year ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1173557313 +0000
- git-parent:
[54a4638723464f86744b43be273474367a131891]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1173557313 +0000
- Message:
Maintain the SRTCP index
This is not very useful at the moment, but will be needed for proper
replay attack protection
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r54a4638 |
r5c09dbb |
|
| 652 | 652 | memcpy (buf + len, tag, s->tag_len); |
|---|
| 653 | 653 | *lenp = len + s->tag_len; |
|---|
| | 654 | s->rtcp_index++; /* Update index */ |
|---|
| 654 | 655 | return 0; |
|---|
| 655 | 656 | } |
|---|
| … | … | |
| 683 | 684 | |
|---|
| 684 | 685 | len -= 4; /* Remove SRTCP index before decryption */ |
|---|
| | 686 | uint32_t index; |
|---|
| | 687 | memcpy (&index, buf + len, 4); |
|---|
| | 688 | index = ntohl (index); |
|---|
| | 689 | if (((index - s->rtcp_index) & 0xffffffff) < 0x80000000) |
|---|
| | 690 | s->rtcp_index = index; /* Update index */ |
|---|
| | 691 | |
|---|
| 685 | 692 | *lenp = len; |
|---|
| 686 | | |
|---|
| 687 | 693 | return srtp_crypt (s, buf, len); |
|---|
| 688 | 694 | } |
|---|