Commit Graph

101 Commits

Author SHA1 Message Date
J.C. Jones
ac5dfc4597 Bug 1333140 - Require SecureContext for WebCrypto r=bholley,keeler,baku
Adds [SecureContext] for crypto.subtle, CryptoKey, and SubtleCrypto, retiring
the WebCrypto WPT overrides for WebCryptoAPI/historical.any.js.

Rebased on https://phabricator.services.mozilla.com/D58743

Differential Revision: https://phabricator.services.mozilla.com/D58555

--HG--
extra : moz-landing-system : lando
2020-02-11 09:25:09 +00:00
Tom Schuster
989660da15 Bug 1605854 - Remove uneval/toSource from DOM tests. r=smaug
Using JSON.stringify in dom/tests/mochitest/chrome/test_clonewrapper.xhtml might not be the best solution, because
the testObject contains ImageData objects.

Differential Revision: https://phabricator.services.mozilla.com/D58645

--HG--
extra : moz-landing-system : lando
2020-01-06 13:09:27 +00:00
J.C. Jones
529346ab71 Bug 1410403 - Use id-ecPublicKey for ECDH key export from WebCrypto r=keeler
id-ecPublicKey is defined as the OID {iso(1) member-body(2) us(840)
ansi-x962(10045) keyType(2) ecPublicKey(1)}, and is the NSS default, so
remove the override code from CryptoKey.cpp that forced it to the legacy
id-ecDH code.

Differential Revision: https://phabricator.services.mozilla.com/D52570

--HG--
extra : moz-landing-system : lando
2019-11-11 21:25:40 +00:00
J.C. Jones
9c614370ec Bug 1564509 - Remove DH from WebCrypto r=kjacobs,bzbarsky,keeler
Bug 1034856 added support for DH algorithms to WebCrypto, however the final
specification did not choose to include them, making Firefox the only browser
with support.

Bug 1539578 added telemetry to show usage, and it is extremely low (not
appearing on the graphs), which could be expected as Firefox is the only
supporting browser.

Since DH is an ongoing maintenance burden -- and overall cryptanalysis of DH
is progressing -- let's remove it.

Notice to unship went to dev-platform on 29 March 2019 with no objections. [0]

[0] https://groups.google.com/d/msg/mozilla.dev.platform/Ut3-eQmUdWg/O9w1et1aBgAJ

Differential Revision: https://phabricator.services.mozilla.com/D50865

--HG--
extra : moz-landing-system : lando
2019-11-11 21:17:47 +00:00
Geoff Brown
c906073cd5 Bug 1585119 - Re-enable many mochitests on android; r=geckoview-reviewers,snorp
Most of these tests have been disabled for a long time; they run well
in the current test environment.
With the additional tests running, task times increase; I have added one
more test chunk for android mochitest-plain.
These tests were identified from a random sampling of mochitest manifests;
I intend to enable more mochitests in future patches.

Differential Revision: https://phabricator.services.mozilla.com/D48912

--HG--
extra : moz-landing-system : lando
2019-10-15 15:07:09 +00:00
Victor Porof
9bb757c75b Bug 1561435 - Fix linting errors for dom/, r=standard8
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35952

--HG--
extra : source : 0d32f3d8e36ac595589c178339237b88dac55df9
extra : intermediate-source : 5db227e1922c88ab0e3efc67ffbad22da1471c6f
2019-06-28 20:53:14 +02:00
Victor Porof
0a8ff0ad85 Bug 1561435 - Format dom/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35951

--HG--
extra : source : 62f3501af4bc1c0bd1ee1977a28aee04706a6663
2019-07-05 10:44:55 +02:00
Brian Grinstead
0d460e3432 Bug 1544322 - Part 2.2 - Remove the [type] attribute for one-liner <script> tags loading files in /tests/SimpleTest/ in dom/ r=bzbarsky
This is split from the previous changeset since if we include dom/ the file size is too
large for phabricator to handle.

This is an autogenerated commit to handle scripts loading mochitest harness files, in
the simple case where the script src is on the same line as the tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 2` argument.

Differential Revision: https://phabricator.services.mozilla.com/D27457

--HG--
extra : moz-landing-system : lando
2019-04-16 03:53:28 +00:00
J.C. Jones
47b914e9b8 Bug 1539578 - Add telemetry for DH use in WebCrypto API r=keeler
Our WebCrypto implementation supports using DH as an algorithm in generateKey,
which is not one of the recognized algorithms in the published specification [0].

We should seek to remove it from Firefox, but before we do, it'd be good to
gather some telemetry on whether it's used at all, even in its' non-standard
form.

[0] https://www.w3.org/TR/WebCryptoAPI/#algorithm-overview

Differential Revision: https://phabricator.services.mozilla.com/D25291

--HG--
extra : moz-landing-system : lando
2019-04-02 22:25:04 +00:00
Bogdan Tara
18ad7ae673 Backed out changeset 37530e362d32 (bug 1539578) for browser_WebCrypto_telemetry.js failures CLOSED TREE 2019-04-03 00:56:53 +03:00
J.C. Jones
e0ec60e836 Bug 1539578 - Add telemetry for DH use in WebCrypto API r=keeler
Our WebCrypto implementation supports using DH as an algorithm in generateKey,
which is not one of the recognized algorithms in the published specification [0].

We should seek to remove it from Firefox, but before we do, it'd be good to
gather some telemetry on whether it's used at all, even in its' non-standard
form.

[0] https://www.w3.org/TR/WebCryptoAPI/#algorithm-overview

Differential Revision: https://phabricator.services.mozilla.com/D25291

--HG--
extra : moz-landing-system : lando
2019-04-02 17:31:25 +00:00
Ciure Andrei
696c9d2139 Backed out changeset e356ebea641d (bug 1539578) for causing browser_WebCrypto_telemetry.js to perma fail CLOSED TREE 2019-03-29 21:21:33 +02:00
J.C. Jones
503d325bbb Bug 1539578 - Add telemetry for DH use in WebCrypto API r=keeler
Our WebCrypto implementation supports using DH as an algorithm in generateKey,
which is not one of the recognized algorithms in the published specification [0].

We should seek to remove it from Firefox, but before we do, it'd be good to
gather some telemetry on whether it's used at all, even in its' non-standard
form.

[0] https://www.w3.org/TR/WebCryptoAPI/#algorithm-overview

Differential Revision: https://phabricator.services.mozilla.com/D25291

--HG--
extra : moz-landing-system : lando
2019-03-29 15:55:54 +00:00
Ian Moody
fe4fab15e3 Bug 1537776 - dom/ automated ESLint no-throw-literal fixes. r=asuth,mccr8
Result of running:
$ mach eslint -funix dom/ | sed -Ee 's/:.+//' - | xargs sed -E \
    -e 's/throw ((["`])[^"]+\2);/throw new Error(\1);/g' \
    -e 's/throw ((["`])[^"]+\2 \+ [^ ";]+);/throw new Error(\1);/g' \
    -e 's/throw \(/throw new Error(/g' -i

Differential Revision: https://phabricator.services.mozilla.com/D24369

--HG--
extra : moz-landing-system : lando
2019-03-25 16:03:38 +00:00
Myk Melez
25349d2601 Bug 1518283 - prohibit blank lines at the beginning and end of blocks (eslint padded-blocks) r=mossop,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D17526

--HG--
extra : moz-landing-system : lando
2019-01-30 17:26:25 +00:00
Volodymyr Klymenko ext:(%3E)
92c4139a6d Bug 1508825 - Enable ESLint for dom/crypto (manual changes) r=Standard8,Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D13694

--HG--
extra : moz-landing-system : lando
2018-12-14 22:54:56 +00:00
Volodymyr Klymenko ext:(%3E)
fbb0aae478 Bug 1508825 - Enable ESLint for dom/crypto/ (automatic changes) r=Standard8,Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D13693

--HG--
extra : moz-landing-system : lando
2018-12-14 00:44:52 +00:00
Mark Banner
a26105ff45 Bug 1501662 - Add more .eslintrc.js files for test directories (dom, modules, netwerk and parser). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D9661

--HG--
extra : moz-landing-system : lando
2018-10-24 19:11:17 +00:00
Edouard Oger
2aa62daff7 Bug 1500292 p1 - Remove 0-length key checks in ImportSymmetricKeyTask and DerivePbkdfBitsTask. r=jcj
Differential Revision: https://phabricator.services.mozilla.com/D9285

--HG--
extra : moz-landing-system : lando
2018-10-23 15:43:44 +00:00
Tim Taubert
ea139d953e Bug 1368859 - Test that the Web Crypto API rejects 0-length AES-GCM IVs r=keeler 2017-06-21 12:48:04 +02:00
Paolo Amadini
375f5f7210 Bug 1362970 - Part 3 - Fix indentation and one misuse of "catch". r=florian
MozReview-Commit-ID: 2oFOmye7EUr

--HG--
extra : rebase_source : 1b575a89ff3f0dc7683f1c25bde12de6859c17be
extra : source : eb61cf8f77d22f0cf026056615a475c2e04f932a
2017-06-16 11:16:00 +01:00
Paolo Amadini
10ee6a5c4e Bug 1362970 - Part 2 - Script-generated patch to convert .then(null, ...) to .catch(...). r=florian
Changes to Promise tests designed to test .then(null) have been reverted, and the browser/extensions directory was excluded because the projects it contains have a separate process for accepting changes.

MozReview-Commit-ID: 1buqgX1EP4P

--HG--
extra : rebase_source : 3a9ea310d3e4a8642aabbc10636c04bfe2e77070
2017-06-19 11:32:37 +01:00
Masatoshi Kimura
7be7b11a1c Bug 1342144 - Remove version parameter from the type attribute of script elements. r=jmaher
This patch is generated by the following sed script:
find . ! -wholename '*/.hg*' -type f \( -iname '*.html' -o -iname '*.xhtml' -o -iname '*.xul' -o -iname '*.js' \) -exec sed -i -e 's/\(\(text\|application\)\/javascript\);version=1.[0-9]/\1/g' {} \;

MozReview-Commit-ID: AzhtdwJwVNg

--HG--
extra : rebase_source : e8f90249454c0779d926f87777f457352961748d
2017-02-23 06:10:07 +09:00
Florian Quèze
0e0865f4fc Bug 1331599 - script-generated patch to replace removeEventListener calls with the once option when possible, r=jaws. 2017-01-25 07:01:52 +01:00
Andrea Marchesini
3120de1ea7 Bug 1315905 - Cleanup Necko http security check - part 2 - tests, r=valentin 2016-11-17 14:53:30 +01:00
Sebastian Hengst
1b0bf4309b Bug 1310297 - Remove test annotations using b2g, mulet or gonk: dom/crypto. r=RyanVM
MozReview-Commit-ID: 7xmkISpGFKt

--HG--
extra : rebase_source : cefa736062aa74bf3b8c1146b7df3645f1c02ba7
2016-11-05 11:29:15 +01:00
Ben Kelly
bdd22287f7 Bug 1281874 P2 Verify that terminating a worker running web crypto works correctly. r=khuey 2016-07-01 06:49:45 -07:00
David Keeler
905443cc71 bug 1264771 - randomize key IDs in WebCrypto r=ttaubert
To import private keys, WebCrypto creates a generic PKCS#11 object with a chosen
key ID with PK11_CreateGenericObject and then looks up that object as a
SECKEYPrivateKey using PK11_FindKeyByKeyID. It turns out that this is only safe
to do as long as the ID is unique. If another SECKEYPrivateKey exists that has
the same key ID (realistically this will only happen if an identical key is
imported again), PK11_FindKeyByKeyID may return the other key. Since
SECKEYPrivateKey objects are unique and not meant to be shared, this causes
problems in that when one key is destroyed, the resources backing the other key
are no longer valid, and any cryptographic operations using that key will fail.
The solution is to use random IDs and check for preexisting keys. NSS doesn't
yet expose an elegant API for this, but this patch implements a workaround.

MozReview-Commit-ID: EvYMZxnBxTv

--HG--
extra : rebase_source : 50408e1af9eb3934b51a0f01e02aa4890e57ed03
2016-05-04 12:48:37 -07:00
David Keeler
cbc656ba88 bug 1271350 - work around PK11_CreatePBEV2AlgorithmID generating a random salt when it shouldn't r=ttaubert
MozReview-Commit-ID: KHjiwPg2SBb

--HG--
extra : rebase_source : b712a557064a6b278f085bac2cbd9bbbc4591c42
2016-05-12 11:12:57 -07:00
Boris Zbarsky
20a2c90769 Bug 1268845. Make sure to set up an XPCWrappedNativeScope for SimpleGlobalObject globals on the main thread. r=bholley,ttaubert,ejpbruel 2016-05-10 20:57:29 -04:00
Kit Cambridge
33ba9ca5c8 Bug 1256488 - Use Base64 URL-encoding in CryptoBuffer. r=ttaubert
MozReview-Commit-ID: AGtDUBuDuu0

--HG--
extra : rebase_source : d4d6edbc9e6b66ea6b2f93bf1875f52621569dfc
2016-03-17 14:13:09 -07:00
Tim Taubert
b89ffb551c Bug 842818 - Enable structured cloning for CryptoKeys across threads r=baku,keeler 2016-01-20 23:22:41 +01:00
Tim Taubert
22b4a52212 Bug 842818 - Run WebCrypto tests in Workers r=mt,rbarnes 2015-09-21 19:53:01 +02:00
Tim Taubert
7703774589 Bug 1243311 - Add structured cloning tests for CryptoKeys r=rbarnes 2016-03-09 21:18:38 +01:00
Tim Taubert
d18dba5486 Bug 1250930 - Add test to ensure we're using the right global when creating WebCrypto objects r=bz 2016-03-08 11:16:29 +01:00
Martin Thomson
e612132ce4 Bug 1241757 - Permit export of JWK with empty key_ops field, r=rbarnes
--HG--
extra : rebase_source : 65bfd25c8c814a236028ddf611f4a0ef0beb7031
2016-01-22 18:07:39 +11:00
Tim Taubert
eb297346b0 Bug 1191936 - Add more test vectors and a test for deterministic signatures r=rbarnes 2016-01-22 15:37:35 +01:00
Tim Taubert
49dd294551 Bug 1191936 - Implement SPKI/PKCS#8/JWK import/export for RSA-PSS r=rbarnes 2015-10-14 13:38:05 +02:00
Tim Taubert
38e4db6e5e Bug 1191936 - Implement RSA-PSS signing and verification r=rbarnes,smaug 2015-10-13 20:22:43 +02:00
Tim Taubert
ae3b4977e3 Bug 1191936 - Implement RSA-PSS key generation r=rbarnes 2015-10-13 18:48:18 +02:00
Tim Taubert
d01d161b5e Bug 1200341 - Implement HKDF for WebCrypto r=rbarnes,smaug 2016-01-26 14:57:52 +01:00
Tim Taubert
b6e7b0db70 Bug 1216109 - Enable SHA-2 test for the WebCrypto API's PBKDF2 implementation r=mt 2015-11-17 11:50:24 +01:00
Tim Taubert
a12e738be5 Bug 1214597 - Ensure that we check the actual result of calling crypto.subtle.verify() in tests r=mt 2015-10-14 13:40:14 +02:00
Tim Taubert
ec47fbba39 Bug 1188750 - Add test to ensure NSS is initialized before the WebCrypto API tries to deserialize a key f=keeler r=khuey 2015-09-01 11:03:27 +02:00
Tim Taubert
9a87f6a0e5 Bug 1050175 - Add raw import/export for EC public keys to the WebCrypto API r=rbarnes,smaug 2015-04-28 09:13:16 +02:00
Tim Taubert
c71dd812ff Bug 1106087 - Add test to ensure we can export newly generated ECDH private keys r=rbarnes 2015-04-24 16:07:56 +02:00
Tim Taubert
46997cc8c2 Bug 1133747 - Fix intermittent test_WebCrypto_Reject_Generating_Keys_Without_Usages.html failures by requesting a longer timeout r=rbarnes 2015-05-22 01:56:18 -04:00
Tim Taubert
fd7b810617 Bug 1074139 - Bump test timeout to fix intermittent test_WebCrypto_RSA_OAEP.html timeouts r=rbarnes 2015-04-27 10:02:12 +02:00
Tim Taubert
5167199f60 Bug 1166031 - Use 1024-bit prime for WebCrypto's DH tests. r=mt
--HG--
extra : rebase_source : 1dcaa181e58700328cae8662386ddcb742a6df9d
2015-05-20 19:51:00 -04:00
Martin Thomson
4c2b709af0 Bug 1158296 - Allow ECDSA key export in WebCrypto, r=rbarnes
--HG--
extra : rebase_source : 40b14fe47652045c063ac40974147b5bfcc91630
2015-04-24 12:56:46 -07:00