[Webkit-unassigned] [Bug 180842] srflx and relay ICE candidates lack raddr (rel-addr) and rport (rel-port) attributes if getUserMedia access has not been granted
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Dec 14 15:09:59 PST 2017
https://bugs.webkit.org/show_bug.cgi?id=180842
--- Comment #2 from Mark Roberts <mroberts at twilio.com> ---
Hi Youenn,
Thanks for the quick response.
> host candidates are filtered out for privacy reasons
Yes, this is what I expected. I think I remember you mentioning this at Kranky Geek. IMO, there should be no problem there.
> and so are raddr/rport information on reflexive and relay candidates.
However, this seems to be the source of the interop problem with Firefox. If I write a little function to patch these up before sending them out:
function patchIceCandidate(candidate) {
var candidateStr = candidate.candidate;
var type = candidateStr.match(/typ ([^ ]*)/)[1];
switch (type) {
case 'srflx':
case 'prflx':
case 'relay':
var raddr = candidateStr.match(/raddr ([^ ]*)/);
var rport = candidateStr.match(/rport ([^ ]*)/);
if (!raddr || !rport) {
console.warn(type + ' ICE candidate lacks raddr and/or rport: ' + candidateStr);
if (!raddr) {
candidateStr = candidateStr.replace('generation', 'raddr 0.0.0.0 generation');
}
if (!rport) {
candidateStr = candidateStr.replace('generation', 'rport 0 generation');
}
candidate = new RTCIceCandidate({
candidate: candidateStr,
sdpMid: candidate.sdpMid,
sdpMLineIndex: candidate.sdpMLineIndex
});
}
default:
break;
}
return candidate;
}
Then there are no more ICE failures in Firefox.
I can understand filtering the raddr and rport attributes if they include sensitive information; however, I suppose Firefox may be a bit stricter in its parsing of ICE candidates (since technically raddr and rport are required). Strangely, though, it doesn't raise an error. I will probably open an issue with them next.
Also, I can understand filtering the raddr and rport attributes if they includes sensitive information; however, in the test I shared, I see they are just set to 0.0.0.0 and 0 _if `getUserMedia` was previously called_ (note that it doesn't matter if the resulting MediaStreamTracks are added to any RTCPeerConnections or not). So maybe instead of filtering, Safari could use these dummy values?
Thanks!
Mark
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20171214/d693322e/attachment-0001.html>
More information about the webkit-unassigned
mailing list