File: sdes-dont-dont-dont.html

package info (click to toggle)
thunderbird 1%3A140.4.0esr-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 4,609,432 kB
  • sloc: cpp: 7,672,442; javascript: 5,901,613; ansic: 3,898,954; python: 1,413,343; xml: 653,997; asm: 462,286; java: 180,927; sh: 113,489; makefile: 20,460; perl: 14,288; objc: 13,059; yacc: 4,583; pascal: 3,352; lex: 1,720; ruby: 1,222; exp: 762; sql: 715; awk: 580; php: 436; lisp: 430; sed: 70; csh: 10
file content (49 lines) | stat: -rw-r--r-- 1,468 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!doctype html>
<meta charset=utf-8>
<meta name="timeout" content="long">
<title>RTCPeerConnection MUST NOT support SDES</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../RTCPeerConnection-helper.js"></script>
<script src="/webrtc/third_party/sdp/sdp.js"></script>
<script>
'use strict';

// Test support for
// https://www.rfc-editor.org/rfc/rfc8826#section-4.3.1

const sdp = `v=0
o=- 0 3 IN IP4 127.0.0.1
s=-
t=0 0
m=video 9 UDP/TLS/RTP/SAVPF 100
c=IN IP4 0.0.0.0
a=rtcp-mux
a=sendonly
a=mid:video
a=rtpmap:100 VP8/90000
a=fmtp:100 max-fr=30;max-fs=3600
a=crypto:0 AES_CM_128_HMAC_SHA1_80 inline:2nra27hTUb9ilyn2rEkBEQN9WOFts26F/jvofasw
a=ice-ufrag:ETEn
a=ice-pwd:OtSK0WpNtpUjkY4+86js7Z/l
`;

// Negative test for Chrome legacy behavior.
promise_test(async t => {
  const sdes_constraint = {'mandatory': {'DtlsSrtpKeyAgreement': false}};
  const pc = new RTCPeerConnection(null, sdes_constraint);
  t.add_cleanup(() => pc.close());

  pc.addTransceiver('audio');
  const offer = await pc.createOffer();
  assert_false(offer.sdp.includes('\na=crypto:'));
}, 'Does not create offers with SDES');

promise_test(t => {
  const pc = new RTCPeerConnection();
  t.add_cleanup(() => pc.close());

  return promise_rejects_dom(t, 'InvalidAccessError',
      pc.setRemoteDescription({type: 'offer', sdp}));
}, 'rejects a remote offer that only includes SDES and no DTLS fingerprint');
</script>