| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f91786b commit 1c47da1
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,7 @@ Last update: | |||
| 31 | 31 | - user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing | |
| 32 | 32 | - wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi | |
| 33 | 33 | - wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi | |
| 34 | - - WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/d4e14d714c/WebCryptoAPI | ||
| 34 | + - WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/5e042cbc4e/WebCryptoAPI | ||
| 35 | 35 | - webidl/ecmascript-binding/es-exceptions: https://github.com/web-platform-tests/wpt/tree/a370aad338/webidl/ecmascript-binding/es-exceptions | |
| 36 | 36 | - webmessaging/broadcastchannel: https://github.com/web-platform-tests/wpt/tree/e97fac4791/webmessaging/broadcastchannel | |
| 37 | 37 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,6 +60,15 @@ function define_tests() { | |||
| 60 | 60 | }, algorithmName + " mixed case parameters"); | |
| 61 | 61 | ||
| 62 | 62 | // Null length | |
| 63 | + // "Null" is not valid per the current spec | ||
| 64 | + // - https://github.com/w3c/webcrypto/issues/322 | ||
| 65 | + // - https://github.com/w3c/webcrypto/issues/329 | ||
| 66 | + // | ||
| 67 | + // Proposal for a spec change: | ||
| 68 | + // - https://github.com/w3c/webcrypto/pull/345 | ||
| 69 | + // | ||
| 70 | + // This test case may be replaced by these new tests: | ||
| 71 | + // - https://github.com/web-platform-tests/wpt/pull/43400 | ||
| 63 | 72 | promise_test(function(test) { | |
| 64 | 73 | return subtle.deriveBits({name: algorithmName, public: publicKeys[algorithmName]}, privateKeys[algorithmName], null) | |
| 65 | 74 | .then(function(derivation) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -56,6 +56,15 @@ function define_tests() { | |||
| 56 | 56 | }, namedCurve + " mixed case parameters"); | |
| 57 | 57 | ||
| 58 | 58 | // Null length | |
| 59 | + // "Null" is not valid per the current spec | ||
| 60 | + // - https://github.com/w3c/webcrypto/issues/322 | ||
| 61 | + // - https://github.com/w3c/webcrypto/issues/329 | ||
| 62 | + // | ||
| 63 | + // Proposal for a spec change: | ||
| 64 | + // - https://github.com/w3c/webcrypto/pull/345 | ||
| 65 | + // | ||
| 66 | + // This test case may be replaced by these new tests: | ||
| 67 | + // - https://github.com/web-platform-tests/wpt/pull/43400 | ||
| 59 | 68 | promise_test(function(test) { | |
| 60 | 69 | return subtle.deriveBits({name: "ECDH", public: publicKeys[namedCurve]}, privateKeys[namedCurve], null) | |
| 61 | 70 | .then(function(derivation) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -140,6 +140,15 @@ function define_tests() { | |||
| 140 | 140 | }, testName + " with missing info"); | |
| 141 | 141 | ||
| 142 | 142 | // length null (OperationError) | |
| 143 | + // "Null" is not valid per the current spec | ||
| 144 | + // - https://github.com/w3c/webcrypto/issues/322 | ||
| 145 | + // - https://github.com/w3c/webcrypto/issues/329 | ||
| 146 | + // | ||
| 147 | + // Proposal for a spec change: | ||
| 148 | + // - https://github.com/w3c/webcrypto/pull/345 | ||
| 149 | + // | ||
| 150 | + // This test case may be replaced by these new tests: | ||
| 151 | + // - https://github.com/web-platform-tests/wpt/pull/43400 | ||
| 143 | 152 | subsetTest(promise_test, function(test) { | |
| 144 | 153 | return subtle.deriveBits(algorithm, baseKeys[derivedKeySize], null) | |
| 145 | 154 | .then(function(derivation) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -105,6 +105,15 @@ function define_tests() { | |||
| 105 | 105 | ||
| 106 | 106 | // Test various error conditions for deriveBits below: | |
| 107 | 107 | // length null (OperationError) | |
| 108 | + // "Null" is not valid per the current spec | ||
| 109 | + // - https://github.com/w3c/webcrypto/issues/322 | ||
| 110 | + // - https://github.com/w3c/webcrypto/issues/329 | ||
| 111 | + // | ||
| 112 | + // Proposal for a spec change: | ||
| 113 | + // - https://github.com/w3c/webcrypto/pull/345 | ||
| 114 | + // | ||
| 115 | + // This test case may be replaced by these new tests: | ||
| 116 | + // - https://github.com/web-platform-tests/wpt/pull/43400 | ||
| 108 | 117 | subsetTest(promise_test, function(test) { | |
| 109 | 118 | return subtle.deriveBits({name: "PBKDF2", salt: salts[saltSize], hash: hashName, iterations: parseInt(iterations)}, baseKeys[passwordSize], null) | |
| 110 | 119 | .then(function(derivation) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,6 +80,9 @@ | |||
| 80 | 80 | } | |
| 81 | 81 | ||
| 82 | 82 | testFormat(format, algorithm, data, curve, usages, extractable); | |
| 83 | + if (vector.name === 'ECDH' && format === 'jwk') { | ||
| 84 | + testEcdhJwkAlg(algorithm, { ...data.jwk, alg: 'any alg works here' }, curve, usages, extractable); | ||
| 85 | + } | ||
| 83 | 86 | }); | |
| 84 | 87 | ||
| 85 | 88 | }); | |
@@ -90,11 +93,13 @@ | |||
| 90 | 93 | var data = keyData[curve]; | |
| 91 | 94 | allValidUsages(vector.privateUsages).forEach(function(usages) { | |
| 92 | 95 | testFormat(format, algorithm, data, curve, usages, extractable); | |
| 96 | + if (vector.name === 'ECDH' && format === 'jwk') { | ||
| 97 | + testEcdhJwkAlg(algorithm, { ...data.jwk, alg: 'any alg works here' }, curve, usages, extractable); | ||
| 98 | + } | ||
| 93 | 99 | }); | |
| 94 | 100 | testEmptyUsages(format, algorithm, data, curve, extractable); | |
| 95 | 101 | }); | |
| 96 | 102 | }); | |
| 97 | - | ||
| 98 | 103 | }); | |
| 99 | 104 | }); | |
| 100 | 105 | ||
@@ -151,6 +156,21 @@ | |||
| 151 | 156 | }, "Empty Usages: " + keySize.toString() + " bits " + parameterString(format, false, keyData, algorithm, extractable, usages)); | |
| 152 | 157 | } | |
| 153 | 158 | ||
| 159 | + // Test ECDH importKey with a JWK format | ||
| 160 | + // Should succeed with any "alg" value | ||
| 161 | + function testEcdhJwkAlg(algorithm, keyData, keySize, usages, extractable) { | ||
| 162 | + const format = "jwk"; | ||
| 163 | + promise_test(function(test) { | ||
| 164 | + return subtle.importKey(format, keyData, algorithm, extractable, usages). | ||
| 165 | + then(function(key) { | ||
| 166 | + assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object"); | ||
| 167 | + assert_goodCryptoKey(key, algorithm, extractable, usages, keyData.d ? 'private' : 'public'); | ||
| 168 | + }, function(err) { | ||
| 169 | + assert_unreached("Threw an unexpected error: " + err.toString()); | ||
| 170 | + }); | ||
| 171 | + }, "ECDH any JWK alg: " + keySize.toString() + " bits " + parameterString(format, false, keyData, algorithm, extractable, usages)); | ||
| 172 | + } | ||
| 173 | + | ||
| 154 | 174 | ||
| 155 | 175 | ||
| 156 | 176 | // Helper methods follow: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,7 +84,7 @@ | |||
| 84 | 84 | "path": "wasm/webapi" | |
| 85 | 85 | }, | |
| 86 | 86 | "WebCryptoAPI": { | |
| 87 | - "commit": "d4e14d714c5242e174ba9aec43caf5eb514d0f09", | ||
| 87 | + "commit": "5e042cbc4ecab7b2279a5fd411c6daa24ca886c6", | ||
| 88 | 88 | "path": "WebCryptoAPI" | |
| 89 | 89 | }, | |
| 90 | 90 | "webidl/ecmascript-binding/es-exceptions": { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments