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

Side by Side Diff: content/test/data/webcrypto/bad_ec_keys.json

Issue 839653002: Throw a DataError rather than OperationError in some cases when importing invalid EC key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pkcs_export
Patch Set: undo the jwk optimization and just check_key() always Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « content/child/webcrypto/openssl/ec_algorithm_openssl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // This file contains incorrect key data in a variety of formats. 1 // This file contains incorrect key data in a variety of formats.
2 // "key" -- either a dictionary for JWK, or hex encoded bytes for PKCS8/SPKI. 2 // "key" -- either a dictionary for JWK, or hex encoded bytes for PKCS8/SPKI.
3 // "key_format" -- one of: "jwk", "pkcs8", "spki" 3 // "key_format" -- one of: "jwk", "pkcs8", "spki"
4 // "error" -- The expected rejection reason when importing the key. 4 // "error" -- The expected rejection reason when importing the key.
5 [ 5 [
6 // -------------------------------------------------------------------------- 6 // --------------------------------------------------------------------------
7 // Bad public keys 7 // Bad public keys
8 // -------------------------------------------------------------------------- 8 // --------------------------------------------------------------------------
9 // TODO(eroman): Group the bad public keys by format type. 9 // TODO(eroman): Group the bad public keys by format type.
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // Import Error: Invalid key (x was corrupted) 62 // Import Error: Invalid key (x was corrupted)
63 { 63 {
64 "crv": "P-256", 64 "crv": "P-256",
65 "key_format": "jwk", 65 "key_format": "jwk",
66 "key": { 66 "key": {
67 "kty": "EC", 67 "kty": "EC",
68 "crv": "P-256", 68 "crv": "P-256",
69 "x": "nLPPaTA9r8dh1ORoe07PA55tNKuWSvgIENjVWKSo1vc", 69 "x": "nLPPaTA9r8dh1ORoe07PA55tNKuWSvgIENjVWKSo1vc",
70 "y": "LVEjOheIkgqG7gihlix576MX-3h54pfa0hRtuZX6HHg" 70 "y": "LVEjOheIkgqG7gihlix576MX-3h54pfa0hRtuZX6HHg"
71 }, 71 },
72 "error": "OperationError" 72 "error": "DataError"
73 }, 73 },
74 74
75 // Import Error: Incorrect kty. 75 // Import Error: Incorrect kty.
76 { 76 {
77 "crv": "P-384", 77 "crv": "P-384",
78 "key_format": "jwk", 78 "key_format": "jwk",
79 "key": { 79 "key": {
80 "kty": "RSA", 80 "kty": "RSA",
81 "crv": "P-384", 81 "crv": "P-384",
82 "x": "hqwS3Qp_5bgf2uhrEkNdMW75OSo_ULMHq2XZxged0NLYGdwJ4ihhRZwu2Z-6tm-u", 82 "x": "hqwS3Qp_5bgf2uhrEkNdMW75OSo_ULMHq2XZxged0NLYGdwJ4ihhRZwu2Z-6tm-u",
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 { 196 {
197 "crv": "P-384", 197 "crv": "P-384",
198 "key_format": "jwk", 198 "key_format": "jwk",
199 "key": { 199 "key": {
200 "kty": "EC", 200 "kty": "EC",
201 "crv": "P-384", 201 "crv": "P-384",
202 "d": "pJLOj6kAhMIn4aMveXTTnp_2en6HBew0GbNftgdYK-vUYeCxUgrHbsLdTptj665x", 202 "d": "pJLOj6kAhMIn4aMveXTTnp_2en6HBew0GbNftgdYK-vUYeCxUgrHbsLdTptj665x",
203 "x": "5V_ubEnY1SP1znv5wEJc5P9lBwi33lz7CVkBUjl5p_BCYC2zCFRzU2mBO1w_Xvho", 203 "x": "5V_ubEnY1SP1znv5wEJc5P9lBwi33lz7CVkBUjl5p_BCYC2zCFRzU2mBO1w_Xvho",
204 "y": "KPWcxdxQlJKpiNOKjiUZ3j0MT9D72wmT448YUGwXYGxeJCSSRvHOlJg6U2HFvpg-" 204 "y": "KPWcxdxQlJKpiNOKjiUZ3j0MT9D72wmT448YUGwXYGxeJCSSRvHOlJg6U2HFvpg-"
205 }, 205 },
206 "error": "OperationError" 206 "error": "DataError"
207 }, 207 },
208 208
209 // -------------------------------------------------------------------------- 209 // --------------------------------------------------------------------------
210 // Bad private keys (PKCS8) 210 // Bad private keys (PKCS8)
211 // -------------------------------------------------------------------------- 211 // --------------------------------------------------------------------------
212 212
213 // The private key is exactly equal to the order, and the public key is 213 // The private key is exactly equal to the order, and the public key is
214 // private key * order. 214 // private key * order.
215 { 215 {
216 "crv": "P-256", 216 "crv": "P-256",
(...skipping 22 matching lines...) Expand all
239 239
240 // The private key is exactly equal to the order + 11, and the public key is 240 // The private key is exactly equal to the order + 11, and the public key is
241 // omitted. 241 // omitted.
242 { 242 {
243 "crv": "P-521", 243 "crv": "P-521",
244 "key_format": "pkcs8", 244 "key_format": "pkcs8",
245 "key": "3060020100301006072A8648CE3D020106052B8104002304493047020101044201FF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B 7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386414", 245 "key": "3060020100301006072A8648CE3D020106052B8104002304493047020101044201FF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B 7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386414",
246 "error": "DataError: The imported EC key is invalid" 246 "error": "DataError: The imported EC key is invalid"
247 } 247 }
248 ] 248 ]
OLDNEW
« no previous file with comments | « content/child/webcrypto/openssl/ec_algorithm_openssl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698