This is not very useful at the moment, but will be needed for proper
replay attack protection
const uint8_t *tag = rtcp_digest (s->rtp.mac, buf, len);
memcpy (buf + len, tag, s->tag_len);
*lenp = len + s->tag_len;
const uint8_t *tag = rtcp_digest (s->rtp.mac, buf, len);
memcpy (buf + len, tag, s->tag_len);
*lenp = len + s->tag_len;
+ s->rtcp_index++; /* Update index */
return EACCES;
len -= 4; /* Remove SRTCP index before decryption */
return EACCES;
len -= 4; /* Remove SRTCP index before decryption */
+ uint32_t index;
+ memcpy (&index, buf + len, 4);
+ index = ntohl (index);
+ if (((index - s->rtcp_index) & 0xffffffff) < 0x80000000)
+ s->rtcp_index = index; /* Update index */
return srtp_crypt (s, buf, len);
}
return srtp_crypt (s, buf, len);
}