Skip to content

Commit 9134220

Browse files
fippochromium-wpt-export-bot
authored andcommitted
Reland "webrtc wpt: add test for RSA keysizes supported by generateCertificate"
This is a reland of commit 4ed65e8472a746b369fe8bc6c4b862dd3a7cb780 setting the long timeout flag and restrict to 1024 and 2048 bits. Original change's description: > webrtc wpt: add test for RSA keysizes supported by generateCertificate > > testing 1024 (not good), 2048, 4096 and 8192 bit keys > > BUG=webrtc:364338811 > > Change-Id: I94320a47c07f2ba2b6338a5d364470c69ef6a5bc > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5836127 > Reviewed-by: Guido Urdaneta <[email protected]> > Commit-Queue: Philipp Hancke <[email protected]> > Reviewed-by: Harald Alvestrand <[email protected]> > Cr-Commit-Position: refs/heads/main@{#1352010} Bug: webrtc:364338811 Change-Id: Ibafe0e7b1bb712ce49646da98baf0e6bf405be59 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5842681 Reviewed-by: Guido Urdaneta <[email protected]> Reviewed-by: Harald Alvestrand <[email protected]> Commit-Queue: Philipp Hancke <[email protected]> Cr-Commit-Position: refs/heads/main@{#1352583}
1 parent ec9b870 commit 9134220

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

webrtc/RTCPeerConnection-generateCertificate.html

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!doctype html>
22
<meta charset="utf-8">
3+
<meta name="timeout" content="long">
34
<title>Test RTCPeerConnection.generateCertificate</title>
45
<script src="/resources/testharness.js"></script>
56
<script src="/resources/testharnessreport.js"></script>
@@ -33,20 +34,23 @@
3334
* publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256" },
3435
* and { name: "ECDSA", namedCurve: "P-256" }.
3536
*/
36-
promise_test(t =>
37-
RTCPeerConnection.generateCertificate({
38-
name: 'RSASSA-PKCS1-v1_5',
39-
modulusLength: 2048,
40-
publicExponent: new Uint8Array([1, 0, 1]),
41-
hash: 'SHA-256'
42-
}).then(cert => {
43-
assert_true(cert instanceof RTCCertificate,
44-
'Expect cert to be instance of RTCCertificate');
37+
[1024, 2048].forEach(modulusLength => {
38+
promise_test(t =>
39+
// Test common RSA key sizes. Only 2048 is mandatory to support.
40+
RTCPeerConnection.generateCertificate({
41+
name: 'RSASSA-PKCS1-v1_5',
42+
modulusLength,
43+
publicExponent: new Uint8Array([1, 0, 1]),
44+
hash: 'SHA-256'
45+
}).then(cert => {
46+
assert_true(cert instanceof RTCCertificate,
47+
'Expect cert to be instance of RTCCertificate');
4548

46-
assert_greater_than(cert.expires, Date.now(),
47-
'Expect generated certificate to expire reasonably long after current time');
48-
}),
49-
'generateCertificate() with compulsary RSASSA-PKCS1-v1_5 parameters should succeed');
49+
assert_greater_than(cert.expires, Date.now(),
50+
'Expect generated certificate to expire reasonably long after current time');
51+
}),
52+
`generateCertificate({modulusLength: ${modulusLength}}) with RSASSA-PKCS1-v1_5 parameters should succeed`);
53+
});
5054

5155
promise_test(t =>
5256
RTCPeerConnection.generateCertificate({

0 commit comments

Comments
 (0)