complain if mLineIndex can not be found when receiving candidates

This commit is contained in:
Daniel Gultsch 2021-03-16 18:52:25 +01:00
parent 8764d11cce
commit 2681ad82e1

View file

@ -288,6 +288,9 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
} }
final String sdpMid = content.getKey(); final String sdpMid = content.getKey();
final int mLineIndex = indices.indexOf(sdpMid); 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); final IceCandidate iceCandidate = new IceCandidate(sdpMid, mLineIndex, sdp);
Log.d(Config.LOGTAG, "received candidate: " + iceCandidate); Log.d(Config.LOGTAG, "received candidate: " + iceCandidate);
this.webRTCWrapper.addIceCandidate(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); throw new SecurityException("Unable to verify DTLS Fingerprint with OMEMO", e);
} }
this.omemoVerification.setOrEnsureEqual(omemoVerifiedPayload); 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(); return omemoVerifiedPayload.getPayload();
} else if (expectVerification) { } else if (expectVerification) {
throw new SecurityException("DTLS fingerprint was unexpectedly not verifiable"); throw new SecurityException("DTLS fingerprint was unexpectedly not verifiable");
@ -677,7 +680,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
this.omemoVerification.setDeviceId(remoteDeviceId); this.omemoVerification.setDeviceId(remoteDeviceId);
} else { } else {
if (remoteDeviceId != null) { 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); this.omemoVerification.setDeviceId(null);
} }
@ -781,7 +784,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
try { try {
verifiedPayload = id.account.getAxolotlService().encrypt(rtpContentMap, id.with, omemoVerification.getDeviceId()); verifiedPayload = id.account.getAxolotlService().encrypt(rtpContentMap, id.with, omemoVerification.getDeviceId());
} catch (final CryptoFailedException e) { } 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; return rtpContentMap;
} }
this.omemoVerification.setSessionFingerprint(verifiedPayload.getFingerprint()); this.omemoVerification.setSessionFingerprint(verifiedPayload.getFingerprint());