From a0068f4f02c47af80685e9c0687c85e74b4e29af Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 8 Jan 2015 10:47:52 -0500 Subject: [PATCH] relax sdes key lifetime validation check fixes #57 --- daemon/Makefile | 1 + daemon/sdp.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon/Makefile b/daemon/Makefile index 07e0da089..001dd5a47 100644 --- a/daemon/Makefile +++ b/daemon/Makefile @@ -33,6 +33,7 @@ CFLAGS+= -DMP_PLUGIN_DIR="\"/usr/lib/rtpengine\"" #CFLAGS+= -DSRTCP_KEY_DERIVATION_RFC_COMPLIANCE #CFLAGS+= -DTERMINATE_SDP_AT_BLANK_LINE +#CFLAGS+= -DSTRICT_SDES_KEY_LIFETIME ifeq ($(DBG),yes) CFLAGS+= -D__DEBUG=1 diff --git a/daemon/sdp.c b/daemon/sdp.c index 2e8e3a517..497adc757 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -495,7 +495,10 @@ static int parse_attribute_crypto(struct sdp_attribute *output) { err = "invalid key lifetime"; if (!c->lifetime || c->lifetime > c->crypto_suite->srtp_lifetime - || c->lifetime > c->crypto_suite->srtcp_lifetime) +#ifdef STRICT_SDES_KEY_LIFETIME + || c->lifetime > c->crypto_suite->srtcp_lifetime +#endif + ) goto error; }