From 2681ad82e11d716510ba951181aa648d20671bfb Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 16 Mar 2021 18:52:25 +0100 Subject: [PATCH] complain if mLineIndex can not be found when receiving candidates --- .../conversations/xmpp/jingle/JingleRtpConnection.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java index ecbf73729..638fa8cf8 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java @@ -288,6 +288,9 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web } final String sdpMid = content.getKey(); final int mLineIndex = indices.indexOf(sdpMid); + if (mLineIndex < 0) { + Log.w(Config.LOGTAG, "mLineIndex not found for " + sdpMid + ". available indices " + indices); + } final IceCandidate iceCandidate = new IceCandidate(sdpMid, mLineIndex, sdp); Log.d(Config.LOGTAG, "received candidate: " + iceCandidate); this.webRTCWrapper.addIceCandidate(iceCandidate); @@ -305,7 +308,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web throw new SecurityException("Unable to verify DTLS Fingerprint with OMEMO", e); } this.omemoVerification.setOrEnsureEqual(omemoVerifiedPayload); - Log.d(Config.LOGTAG,id.account.getJid().asBareJid()+": received verifiable DTLS fingerprint via "+this.omemoVerification); + Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": received verifiable DTLS fingerprint via " + this.omemoVerification); return omemoVerifiedPayload.getPayload(); } else if (expectVerification) { throw new SecurityException("DTLS fingerprint was unexpectedly not verifiable"); @@ -677,7 +680,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web this.omemoVerification.setDeviceId(remoteDeviceId); } else { if (remoteDeviceId != null) { - Log.d(Config.LOGTAG, id.account.getJid().asBareJid()+": remote party signaled support for OMEMO verification but we have OMEMO disabled"); + Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": remote party signaled support for OMEMO verification but we have OMEMO disabled"); } this.omemoVerification.setDeviceId(null); } @@ -781,7 +784,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web try { verifiedPayload = id.account.getAxolotlService().encrypt(rtpContentMap, id.with, omemoVerification.getDeviceId()); } catch (final CryptoFailedException e) { - Log.w(Config.LOGTAG,id.account.getJid().asBareJid()+": unable to use OMEMO DTLS verification on outgoing session initiate. falling back", e); + Log.w(Config.LOGTAG, id.account.getJid().asBareJid() + ": unable to use OMEMO DTLS verification on outgoing session initiate. falling back", e); return rtpContentMap; } this.omemoVerification.setSessionFingerprint(verifiedPayload.getFingerprint());