Browse Source

reset SRTP ROC to zero when SSRC changes

workaround as per issue #102 for broken audio after SSRC change by
hold/unhold. workaround before full multi-SSRC support is available.
pull/107/head
Richard Fuchs 11 years ago
parent
commit
39a305f4ba
2 changed files with 10 additions and 0 deletions
  1. +2
    -0
      daemon/crypto.h
  2. +8
    -0
      daemon/rtp.c

+ 2
- 0
daemon/crypto.h View File

@ -73,6 +73,7 @@ struct crypto_context {
char session_salt[SRTP_MAX_SESSION_SALT_LEN]; /* k_s */
char session_auth_key[SRTP_MAX_SESSION_AUTH_LEN];
u_int32_t ssrc;
u_int64_t last_index;
/* XXX replay list */
/* <from, to>? */
@ -138,6 +139,7 @@ INLINE void crypto_cleanup(struct crypto_context *c) {
INLINE void crypto_reset(struct crypto_context *c) {
crypto_cleanup(c);
c->last_index = 0;
c->ssrc = 0;
}
INLINE void crypto_params_copy(struct crypto_params *o, const struct crypto_params *i) {
crypto_params_cleanup(o);


+ 8
- 0
daemon/rtp.c View File

@ -189,6 +189,14 @@ int rtp_avp2savp(str *s, struct crypto_context *c) {
if (check_session_keys(c))
return -1;
/* SSRC is part of the crypto context and ROC must be reset when it changes */
if (G_UNLIKELY(!c->ssrc))
c->ssrc = rtp->ssrc;
else if (G_UNLIKELY(c->ssrc != rtp->ssrc)) {
c->last_index = 0;
c->ssrc = rtp->ssrc;
}
index = packet_index(c, rtp);
/* rfc 3711 section 3.1 */


Loading…
Cancel
Save