Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(943)

Unified Diff: content/test/data/webcrypto/bad_ec_keys.json

Issue 1077273002: html_viewer: Move webcrypto to a place where html_viewer can use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/data/webcrypto/aes_kw.json ('k') | content/test/data/webcrypto/bad_rsa_keys.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/webcrypto/bad_ec_keys.json
diff --git a/content/test/data/webcrypto/bad_ec_keys.json b/content/test/data/webcrypto/bad_ec_keys.json
deleted file mode 100644
index d08c86b6b6b692bbc58583941b35d78c63af7f9d..0000000000000000000000000000000000000000
--- a/content/test/data/webcrypto/bad_ec_keys.json
+++ /dev/null
@@ -1,248 +0,0 @@
-// This file contains incorrect key data in a variety of formats.
-// "key" -- either a dictionary for JWK, or hex encoded bytes for PKCS8/SPKI.
-// "key_format" -- one of: "jwk", "pkcs8", "spki"
-// "error" -- The expected rejection reason when importing the key.
-[
-// --------------------------------------------------------------------------
-// Bad public keys
-// --------------------------------------------------------------------------
-// TODO(eroman): Group the bad public keys by format type.
-
- // Import Error: P-521 is requested by importKey(), however the JWK's curve is for P-256.
- {
- "crv": "P-521",
- "key_format": "jwk",
- "key": {
- "kty": "EC",
- "crv": "P-256",
- "x": "APUKCHAyUMFfBDyMRumXg0NSRc-Y9PJpSw4vjQKaUU3W8LCG1O2JIADNVZAQeq5pxMCnqV98905XcKB9XbVbzkq0",
- "y": "APLHcLq4ub5M227NPcJsaY2g0lmc6_PZBPf5yjpV5kcxgQ1zzTFyZOULq6S8KGCFfhbWy7eVAbyeOjK9Fy6opx3u"
- },
- "error": "DataError: The JWK's \"crv\" member specifies a different curve than requested"
- },
-
- // Import Error: P-521 is requested by importKey(), however the JWK's algorithm implies P-256
- {
- "crv": "P-521",
- "key_format": "jwk",
- "key": {
- "kty": "EC",
- "alg": "ES256",
- "crv": "P-521",
- "x": "APUKCHAyUMFfBDyMRumXg0NSRc-Y9PJpSw4vjQKaUU3W8LCG1O2JIADNVZAQeq5pxMCnqV98905XcKB9XbVbzkq0",
- "y": "APLHcLq4ub5M227NPcJsaY2g0lmc6_PZBPf5yjpV5kcxgQ1zzTFyZOULq6S8KGCFfhbWy7eVAbyeOjK9Fy6opx3u"
- },
- "error": "DataError: The JWK \"alg\" member was inconsistent with that specified by the Web Crypto call"
- },
-
- // Import Error: crv is missing
- {
- "crv": "P-384",
- "key_format": "jwk",
- "key": {
- "kty": "EC",
- "x": "hqwS3Qp_5bgf2uhrEkNdMW75OSo_ULMHq2XZxged0NLYGdwJ4ihhRZwu2Z-6tm-u",
- "y": "rIREB3qu1tbMrL5npMqs7gtaCUo1dcoS6ktHdMAw_hyHDJJJAj9dxNmtbjM2aMw4"
- },
- "error": "DataError: The required JWK member \"crv\" was missing"
- },
-
- // Import Error: x is missing
- {
- "crv": "P-384",
- "key_format": "jwk",
- "key": {
- "kty": "EC",
- "crv": "P-384",
- "y": "rIREB3qu1tbMrL5npMqs7gtaCUo1dcoS6ktHdMAw_hyHDJJJAj9dxNmtbjM2aMw4"
- },
- "error": "DataError: The required JWK member \"x\" was missing"
- },
-
- // Import Error: Invalid key (x was corrupted)
- {
- "crv": "P-256",
- "key_format": "jwk",
- "key": {
- "kty": "EC",
- "crv": "P-256",
- "x": "nLPPaTA9r8dh1ORoe07PA55tNKuWSvgIENjVWKSo1vc",
- "y": "LVEjOheIkgqG7gihlix576MX-3h54pfa0hRtuZX6HHg"
- },
- "error": "DataError"
- },
-
- // Import Error: Incorrect kty.
- {
- "crv": "P-384",
- "key_format": "jwk",
- "key": {
- "kty": "RSA",
- "crv": "P-384",
- "x": "hqwS3Qp_5bgf2uhrEkNdMW75OSo_ULMHq2XZxged0NLYGdwJ4ihhRZwu2Z-6tm-u",
- "y": "rIREB3qu1tbMrL5npMqs7gtaCUo1dcoS6ktHdMAw_hyHDJJJAj9dxNmtbjM2aMw4"
- },
- "error": "DataError: The JWK \"kty\" member was not \"EC\""
- },
-
- // Import Error: SPKI data is empty.
- {
- "crv": "P-384",
- "key_format": "spki",
- "key": "",
- "error": "DataError"
- },
-
- // Import Error: SPKI data is invalid.
- {
- "crv": "P-384",
- "key_format": "spki",
- "key": "00010203",
- "error": "DataError"
- },
-
- // Import Error: SPKI data is invalid (1 byte was corrupted)
- {
- "crv": "P-256",
- "key_format": "spki",
- "key": "3059301306072A8648CE3D020106082A8748CE3D030107034200049CB0CF69303DAFC761D4E4687B4ECF039E6D34AB964AF80810D8D558A4A8D6F72D51233A1788920A86EE08A1962C79EFA317FB7879E297DAD2146DB995FA1C78",
- "error": "DataError"
- },
-
- // Import Error: SPKI data is invalid (1 byte truncated from end)
- {
- "crv": "P-256",
- "key_format": "spki",
- "key": "3059301306072A8648CE3D020106082A8648CE3D030107034200049CB0CF69303DAFC761D4E4687B4ECF039E6D34AB964AF80810D8D558A4A8D6F72D51233A1788920A86EE08A1962C79EFA317FB7879E297DAD2146DB995FA1C",
- "error": "DataError"
- },
-
- // Import Error: Valid SPKI data was provided, however it is for an RSA key
- {
- "crv": "P-256",
- "key_format": "spki",
- "key": "30819f300d06092a864886f70d010101050003818d0030818902818100a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a21370203010001",
- "error": "DataError"
- },
-
- // Import Error: JWK was given where the "x" member is not zero-padded.
- {
- "crv": "P-256",
- "key_format": "jwk",
- "key": {
- "kty": "EC",
- "crv": "P-256",
- "x": "2A0aLWA8otEPMLZFAksn2h5JC3HrJNNu4MRksc-b2Q",
- "y": "lZYURbYRHyeqmHQOEKxrVVJZzL0_BByXwMCwRKzAN_k"
- },
- "error": "DataError: The JWK's \"x\" member defines an octet string of length 31 bytes but should be 32"
- },
-
- // Import Error: JWK was given where the "x" member is not zero-padded.
- {
- "crv": "P-256",
- "key_format": "jwk",
- "key": {
- "kty": "EC",
- "crv": "P-256",
- "x": "V_S9kHyUTFiXiIJNovS89K0ctDtXe2qthCWjs4J7Bb0",
- "y": "e-6aI45DddCJGrGWqgH83fFjn_eS7s8ygoeZJbh2Bg"
- },
- "error": "DataError: The JWK's \"y\" member defines an octet string of length 31 bytes but should be 32"
- },
-
- // Import Error: The SPKI is valid, however contains 3 trailing bytes.
- {
- "crv": "P-256",
- "key_format": "spki",
- "key": "3059301306072A8648CE3D020106082A8648CE3D030107034200049CB0CF69303DAFC761D4E4687B4ECF039E6D34AB964AF80810D8D558A4A8D6F72D51233A1788920A86EE08A1962C79EFA317FB7879E297DAD2146DB995FA1C78000000",
- "error": "DataError"
- },
-
-// --------------------------------------------------------------------------
-// Bad private keys (JWK)
-// --------------------------------------------------------------------------
-
- // The "d" parameter was modified, such that it is no longer consistent with
- // the public key.
- {
- "crv": "P-256",
- "key_format": "jwk",
- "key": {
- "kty": "EC",
- "crv": "P-256",
- "d": "H-M5UMX0YRKK6ZLCvf3xxzsWFfVxvVZ-YNGaofSM30I",
- "x": "fBEMZtz9qAf25p5F3bPHT2mhSE0gPo3Frajpqd18s8c",
- "y": "DfRImG5RveXRV2-ZkB-cLGqAakf9kHZDpyuDVZfvyMY"
- },
- "error": "DataError: The imported EC key is invalid"
- },
-
- // The "d" parameter is empty.
- {
- "crv": "P-256",
- "key_format": "jwk",
- "key": {
- "kty": "EC",
- "crv": "P-256",
- "d": "",
- "x": "fBEMZtz9qAf25p5F3bPHT2mhSE0gPo3Frajpqd18s8c",
- "y": "DfRImG5RveXRV2-ZkB-cLGqAakf9kHZDpyuDVZfvyMY"
- },
- "error": "DataError: The JWK's \"d\" member defines an octet string of length 0 bytes but should be 32"
- },
-
- // The y parameter has been modified (no longer a valid point on curve).
- {
- "crv": "P-384",
- "key_format": "jwk",
- "key": {
- "kty": "EC",
- "crv": "P-384",
- "d": "pJLOj6kAhMIn4aMveXTTnp_2en6HBew0GbNftgdYK-vUYeCxUgrHbsLdTptj665x",
- "x": "5V_ubEnY1SP1znv5wEJc5P9lBwi33lz7CVkBUjl5p_BCYC2zCFRzU2mBO1w_Xvho",
- "y": "KPWcxdxQlJKpiNOKjiUZ3j0MT9D72wmT448YUGwXYGxeJCSSRvHOlJg6U2HFvpg-"
- },
- "error": "DataError"
- },
-
-// --------------------------------------------------------------------------
-// Bad private keys (PKCS8)
-// --------------------------------------------------------------------------
-
- // The private key is exactly equal to the order, and the public key is
- // private key * order.
- {
- "crv": "P-256",
- "key_format": "pkcs8",
- "key": "3066020100301306072A8648CE3D020106082A8648CE3D030107044C304A0201010420FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551A12303210000FFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551",
- "error": "DataError"
- },
-
- // The private key is exactly equal to the order, and the public key is
- // omitted.
- {
- "crv": "P-256",
- "key_format": "pkcs8",
- "key": "3041020100301306072A8648CE3D020106082A8648CE3D030107042730250201010420FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551",
- "error": "DataError: The imported EC key is invalid"
- },
-
- // The private key is exactly equal to the order + 11, and the public key is
- // private key * order.
- {
- "crv": "P-521",
- "key_format": "pkcs8",
- "key": "3081EE020100301006072A8648CE3D020106052B810400230481D63081D3020101044201FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386414A181890381860004008A75841259FDEDFF546F1A39573B4315CFED5DC7ED7C17849543EF2C54F2991652F3DBC5332663DA1BD19B1AEBE3191085015C024FA4C9A902ECC0E02DDA0CDB9A0096FB303FCBBA2129849D0CA877054FB2293ADD566210BD0493ED2E95D4E0B9B82B1BC8A90E8B42A4AB3892331914A95336DCAC80E3F4819B5D58874F92CE48C808",
- "error": "DataError: The imported EC key is invalid"
- },
-
- // The private key is exactly equal to the order + 11, and the public key is
- // omitted.
- {
- "crv": "P-521",
- "key_format": "pkcs8",
- "key": "3060020100301006072A8648CE3D020106052B8104002304493047020101044201FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386414",
- "error": "DataError: The imported EC key is invalid"
- }
-]
« no previous file with comments | « content/test/data/webcrypto/aes_kw.json ('k') | content/test/data/webcrypto/bad_rsa_keys.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698