Changeset 5c09dbbad9c76ea76d7060b0fee10b7d3c8abb3a

Show
Ignore:
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
  • libs/srtp/srtp.c

    r54a4638 r5c09dbb  
    652652    memcpy (buf + len, tag, s->tag_len); 
    653653    *lenp = len + s->tag_len; 
     654    s->rtcp_index++; /* Update index */ 
    654655    return 0; 
    655656} 
     
    683684 
    684685    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 
    685692    *lenp = len; 
    686  
    687693    return srtp_crypt (s, buf, len); 
    688694}