From 5ac39f9a431fef83c7c6fe8d60a214899a6202bd Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 25 Jan 2016 14:22:43 -0500 Subject: [PATCH] don't just ignore but also strip invalid/unknown a=crypto possibly fixes #207 Change-Id: I79df1b12ae7b335cd067be9238d76bf61cfb1536 (cherry picked from commit 59260482a1e7a8a043776543ec2487ad063f8e29) --- daemon/sdp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index a77410636..a98107f2f 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -190,6 +190,7 @@ struct sdp_attribute { ATTR_FINGERPRINT, ATTR_SETUP, ATTR_RTPMAP, + ATTR_IGNORE, } attr; union { @@ -520,8 +521,9 @@ static int parse_attribute_crypto(struct sdp_attribute *output) { return 0; error: - ilog(LOG_ERROR, "Failed to parse a=crypto attribute: %s", err); - return -1; + ilog(LOG_ERROR, "Failed to parse a=crypto attribute, ignoring: %s", err); + output->attr = ATTR_IGNORE; + return 0; } static int parse_attribute_rtcp(struct sdp_attribute *output) { @@ -1533,6 +1535,7 @@ static int process_session_attributes(struct sdp_chopper *chop, struct sdp_attri case ATTR_SENDRECV: case ATTR_FINGERPRINT: case ATTR_SETUP: + case ATTR_IGNORE: goto strip; case ATTR_GROUP: @@ -1596,10 +1599,12 @@ static int process_media_attributes(struct sdp_chopper *chop, struct sdp_media * case ATTR_RTCP_MUX: if (flags->ice_force_relay) break; + // fall thru case ATTR_INACTIVE: case ATTR_SENDONLY: case ATTR_RECVONLY: case ATTR_SENDRECV: + case ATTR_IGNORE: goto strip; case ATTR_EXTMAP: