aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorStephen Paul Weber <singpolyma@singpolyma.net>2023-07-04 21:59:24 -0500
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-01 21:28:29 +0200
commitb486e36b065183553ddad2eec40b196c9c1d13ac (patch)
tree3035a1e1f579da1fe5479a99eb48d8c82a83ac19 /plugins
parent63a16dce36fecc02cc9db42dcae85ae40dc82290 (diff)
downloaddino-b486e36b065183553ddad2eec40b196c9c1d13ac.tar.gz
Ignore non-DTLS data before handshake is complete
https://datatracker.ietf.org/doc/html/rfc9147#name-demul https://datatracker.ietf.org/doc/html/rfc5764#section-5.1.2 If data is received before handshake is complete, discard it rather than forwarding it blindly to GnuTLS which can get confused.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ice/src/dtls_srtp.vala2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/ice/src/dtls_srtp.vala b/plugins/ice/src/dtls_srtp.vala
index 81ebfcbc..e2fc49f1 100644
--- a/plugins/ice/src/dtls_srtp.vala
+++ b/plugins/ice/src/dtls_srtp.vala
@@ -46,7 +46,7 @@ public class Handler {
return srtp_session.decrypt_rtp(data);
}
if (component_id == 2) return srtp_session.decrypt_rtcp(data);
- } else if (component_id == 1) {
+ } else if (component_id == 1 && (data[0] >= 20 && data[0] <= 63)) {
on_data_rec(data);
}
return null;