|
223 | 223 | }, |
224 | 224 |
|
225 | 225 | async function checkDtlsKEA() { |
226 | | - // "media.peerconnection.dtls.enable_pq_hybrid_kex" is enabled by default |
227 | | - // "send_mlkem_keyshare" enabled in Nightly and Early Beta |
228 | | - // By default we send 2 key shares, PQ and X25519 |
229 | | - // PQ Key share (ECDH Hybrid) has a higher preference, so it will be chosen as KEA |
230 | | - const pc1 = new RTCPeerConnection(); |
231 | | - const pc2 = new RTCPeerConnection(); |
232 | | - await gleanResetTestValues(); |
233 | | - // SSL Handshake Key Exchange Algorithm (null=0, rsa=1, dh=2, ecdh=4, ecdh_hybrid=8) |
234 | | - let keyExchangeValue = await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue() || 0; |
235 | | - is(keyExchangeValue, 0, "Expected no keyExchange distribution defined"); |
236 | | - |
237 | | - const stream = await navigator.mediaDevices.getUserMedia({ video: true }); |
238 | | - pc1.addTrack(stream.getTracks()[0]); |
239 | | - |
240 | | - await connect(pc1, pc2, 32000, "DTLS connected", true, true); |
241 | | - // This telemetry happens on STS/socket process |
242 | | - await gleanFlushChildren(); |
243 | | - |
244 | | - let count1_0 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["0"] || 0; |
245 | | - let count1_1 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["1"] || 0; |
246 | | - let count1_2 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["2"] || 0; |
247 | | - let count1_4 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["4"] || 0; |
248 | | - let count1_8 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["8"] || 0; |
249 | | - is(count1_0, 0, "Expected 0 connections using NULL"); |
250 | | - is(count1_1, 0, "Expected 0 connections using RSA"); |
251 | | - is(count1_2, 0, "Expected 0 connections using DH"); |
252 | | - is(count1_4, 0, "Expected 0 connections using ECDH"); |
253 | | - is(count1_8, 2, "Expected 2 connections using ECDH Hybrid"); |
254 | | - }, |
255 | | - |
256 | | - async function checkDtlsKEA_DTLSBelow13() { |
257 | | - // DTLS1.2 does not use Kyber |
258 | | - // In this case, X25519 (ECDH) key share will be used |
259 | | - await withPrefs([["media.peerconnection.dtls.version.max", 771]], |
260 | | - async () => { |
261 | | - const pc1 = new RTCPeerConnection(); |
262 | | - const pc2 = new RTCPeerConnection(); |
263 | | - await gleanResetTestValues(); |
264 | | - // SSL Handshake Key Exchange Algorithm (null=0, rsa=1, dh=2, ecdh=4, ecdh_hybrid=8) |
265 | | - let keyExchangeValue = await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue() || 0; |
266 | | - is(keyExchangeValue, 0, "Expected no keyExchange distribution defined"); |
267 | | - |
268 | | - const stream = await navigator.mediaDevices.getUserMedia({ video: true }); |
269 | | - pc1.addTrack(stream.getTracks()[0]); |
270 | | - |
271 | | - await connect(pc1, pc2, 32000, "DTLS connected", true, true); |
272 | | - // This telemetry happens on STS/socket process |
273 | | - await gleanFlushChildren(); |
274 | | - |
275 | | - let count1_0 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["0"] || 0; |
276 | | - let count1_1 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["1"] || 0; |
277 | | - let count1_2 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["2"] || 0; |
278 | | - let count1_4 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["4"] || 0; |
279 | | - let count1_8 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["8"] || 0; |
280 | | - is(count1_0, 0, "Expected 0 connections using NULL"); |
281 | | - is(count1_1, 0, "Expected 0 connections using RSA"); |
282 | | - is(count1_2, 0, "Expected 0 connections using DH"); |
283 | | - is(count1_4, 2, "Expected 2 connections using ECDH"); |
284 | | - is(count1_8, 0, "Expected 0 connections using ECDH Hybrid"); |
285 | | - })}, |
286 | | - |
287 | | - async function checkDtlsKEA_DTLS13DisablePQ() { |
288 | | - await withPrefs([["media.peerconnection.dtls.enable_pq_hybrid_kex", false]], |
289 | | - async () => { |
| 226 | + // Currently, ssl_grp_ec_curve25519 is the default option (ECDH) |
290 | 227 | const pc1 = new RTCPeerConnection(); |
291 | 228 | const pc2 = new RTCPeerConnection(); |
292 | 229 | await gleanResetTestValues(); |
|
311 | 248 | is(count1_2, 0, "Expected 0 connections using DH"); |
312 | 249 | is(count1_4, 2, "Expected 2 connections using ECDH"); |
313 | 250 | is(count1_8, 0, "Expected 0 connections using ECDH Hybrid"); |
314 | | - })}, |
315 | | - |
316 | | - async function checkDtlsKEA_DTLS13DisablePQEnablePQShare() { |
317 | | - // Safety measures, when PQ is disabled, even if the sending ml-kem share is enabled |
318 | | - // it should not be sent. |
319 | | - await withPrefs([["media.peerconnection.dtls.enable_pq_hybrid_kex", false], |
320 | | - ["media.peerconnection.dtls.send_mlkem_keyshare", true] |
321 | | - ], |
322 | | - async () => { |
323 | | - const pc1 = new RTCPeerConnection(); |
324 | | - const pc2 = new RTCPeerConnection(); |
325 | | - await gleanResetTestValues(); |
326 | | - // SSL Handshake Key Exchange Algorithm (null=0, rsa=1, dh=2, ecdh=4, ecdh_hybrid=8) |
327 | | - let keyExchangeValue = await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue() || 0; |
328 | | - is(keyExchangeValue, 0, "Expected no keyExchange distribution defined"); |
329 | | - |
330 | | - const stream = await navigator.mediaDevices.getUserMedia({ video: true }); |
331 | | - pc1.addTrack(stream.getTracks()[0]); |
332 | | - |
333 | | - await connect(pc1, pc2, 32000, "DTLS connected", true, true); |
334 | | - // This telemetry happens on STS/socket process |
335 | | - await gleanFlushChildren(); |
336 | | - |
337 | | - let count1_0 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["0"] || 0; |
338 | | - let count1_1 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["1"] || 0; |
339 | | - let count1_2 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["2"] || 0; |
340 | | - let count1_4 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["4"] || 0; |
341 | | - let count1_8 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["8"] || 0; |
342 | | - is(count1_0, 0, "Expected 0 connections using NULL"); |
343 | | - is(count1_1, 0, "Expected 0 connections using RSA"); |
344 | | - is(count1_2, 0, "Expected 0 connections using DH"); |
345 | | - is(count1_4, 2, "Expected 2 connections using ECDH"); |
346 | | - is(count1_8, 0, "Expected 0 connections using ECDH Hybrid"); |
347 | | - })}, |
348 | | - |
349 | | - async function checkDtlsKEA_DTLS13EnablePQDisablePQShare() { |
350 | | - // We will still advertise PQ, but we won't send a key share. |
351 | | - // See bug 1992457. |
352 | | - await withPrefs([["media.peerconnection.dtls.enable_pq_hybrid_kex", true], |
353 | | - ["media.peerconnection.dtls.send_mlkem_keyshare", false] |
354 | | - ], |
355 | | - async () => { |
356 | | - const pc1 = new RTCPeerConnection(); |
357 | | - const pc2 = new RTCPeerConnection(); |
358 | | - await gleanResetTestValues(); |
359 | | - // SSL Handshake Key Exchange Algorithm (null=0, rsa=1, dh=2, ecdh=4, ecdh_hybrid=8) |
360 | | - let keyExchangeValue = await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue() || 0; |
361 | | - is(keyExchangeValue, 0, "Expected no keyExchange distribution defined"); |
362 | | - |
363 | | - const stream = await navigator.mediaDevices.getUserMedia({ video: true }); |
364 | | - pc1.addTrack(stream.getTracks()[0]); |
365 | | - |
366 | | - await connect(pc1, pc2, 32000, "DTLS connected", true, true); |
367 | | - // This telemetry happens on STS/socket process |
368 | | - await gleanFlushChildren(); |
369 | | - |
370 | | - let count1_0 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["0"] || 0; |
371 | | - let count1_1 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["1"] || 0; |
372 | | - let count1_2 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["2"] || 0; |
373 | | - let count1_4 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["4"] || 0; |
374 | | - let count1_8 = (await GleanTest.webrtcdtls.keyExchangeAlgorithm.testGetValue()).values["8"] || 0; |
375 | | - is(count1_0, 0, "Expected 0 connections using NULL"); |
376 | | - is(count1_1, 0, "Expected 0 connections using RSA"); |
377 | | - is(count1_2, 0, "Expected 0 connections using DH"); |
378 | | - is(count1_4, 2, "Expected 2 connections using ECDH"); |
379 | | - is(count1_8, 0, "Expected 0 connections using ECDH Hybrid"); |
380 | | - })}, |
| 251 | + }, |
381 | 252 |
|
382 | 253 | async function checkRTCRtpSenderCount() { |
383 | 254 | const pc = new RTCPeerConnection(); |
|
0 commit comments