gecko-dev/dom/crypto/test
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
..
file_indexedDB.html 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
mochitest.ini bug 1264771 - randomize key IDs in WebCrypto r=ttaubert 2016-05-04 12:48:37 -07:00
test-array.js Bug 842818 - Run WebCrypto tests in Workers r=mt,rbarnes 2015-09-21 19:53:01 +02:00
test-vectors.js bug 1271350 - work around PK11_CreatePBEV2AlgorithmID generating a random salt when it shouldn't r=ttaubert 2016-05-12 11:12:57 -07:00
test-worker.js Bug 842818 - Run WebCrypto tests in Workers r=mt,rbarnes 2015-09-21 19:53:01 +02:00
test_WebCrypto.css
test_WebCrypto.html Bug 842818 - Enable structured cloning for CryptoKeys across threads r=baku,keeler 2016-01-20 23:22:41 +01:00
test_WebCrypto_DH.html
test_WebCrypto_ECDH.html 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
test_WebCrypto_ECDSA.html 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
test_WebCrypto_HKDF.html Bug 1200341 - Implement HKDF for WebCrypto r=rbarnes,smaug 2016-01-26 14:57:52 +01:00
test_WebCrypto_Import_Multiple_Identical_Keys.html bug 1264771 - randomize key IDs in WebCrypto r=ttaubert 2016-05-04 12:48:37 -07:00
test_WebCrypto_JWK.html Bug 842818 - Run WebCrypto tests in Workers r=mt,rbarnes 2015-09-21 19:53:01 +02:00
test_WebCrypto_Normalize.html
test_WebCrypto_PBKDF2.html bug 1271350 - work around PK11_CreatePBEV2AlgorithmID generating a random salt when it shouldn't r=ttaubert 2016-05-12 11:12:57 -07:00
test_WebCrypto_RSA_OAEP.html Bug 1074139 - Bump test timeout to fix intermittent test_WebCrypto_RSA_OAEP.html timeouts r=rbarnes 2015-04-27 10:02:12 +02:00
test_WebCrypto_RSA_PSS.html Bug 1191936 - Add more test vectors and a test for deterministic signatures r=rbarnes 2016-01-22 15:37:35 +01:00
test_WebCrypto_Reject_Generating_Keys_Without_Usages.html 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
test_WebCrypto_Structured_Cloning.html Bug 1243311 - Add structured cloning tests for CryptoKeys r=rbarnes 2016-03-09 21:18:38 +01:00
test_WebCrypto_Workers.html Bug 842818 - Enable structured cloning for CryptoKeys across threads r=baku,keeler 2016-01-20 23:22:41 +01:00
test_WebCrypto_Wrap_Unwrap.html 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
test_indexedDB.html 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
util.js Bug 1243311 - Add structured cloning tests for CryptoKeys r=rbarnes 2016-03-09 21:18:38 +01:00