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

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

Issue 777403004: [WebCrypto] Throw syntaxError if keyUsage is empty in ImportKey (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated issues in ecdh tests and other review comments. Created 6 years 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/webcrypto_util.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 // TODO(eroman): Use known test vectors. The samples I used here I generated mys elf. 1 // TODO(eroman): Use known test vectors. The samples I used here I generated mys elf.
2 [ 2 [
3 // Test key derivation using ECDH (P-256), using a public and private key from 3 // Test key derivation using ECDH (P-256), using a public and private key from
4 // different key pairs. 4 // different key pairs.
5 { 5 {
6 "public_key": { 6 "public_key": {
7 "crv": "P-256", 7 "crv": "P-256",
8 "kty":"EC", 8 "kty":"EC",
9 "x":"u6dWhaRHrvFF0CiFVuUUFafU6ixveQf9trHDXJ8hgV8", 9 "x":"u6dWhaRHrvFF0CiFVuUUFafU6ixveQf9trHDXJ8hgV8",
10 "y":"thSm4LIY35vDD-5LE454eB7TShn919DVVGZ_7tWdjTE" 10 "y":"thSm4LIY35vDD-5LE454eB7TShn919DVVGZ_7tWdjTE"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 "kty":"EC", 340 "kty":"EC",
341 "crv":"P-256", 341 "crv":"P-256",
342 "x":"S2S3tjygMB0DkM-N9jYUgGLt_9_H6km5P9V6V_KS4_4", 342 "x":"S2S3tjygMB0DkM-N9jYUgGLt_9_H6km5P9V6V_KS4_4",
343 "y":"03j8Tyqgrc4R4FAUV2C7-im96yMmfmO_5Om6Kr8YP3o" 343 "y":"03j8Tyqgrc4R4FAUV2C7-im96yMmfmO_5Om6Kr8YP3o"
344 }, 344 },
345 345
346 "length_bits": 264, 346 "length_bits": 264,
347 "error": "OperationError: Length specified for ECDH key derivation is too la rge. Maximum allowed is 256 bits" 347 "error": "OperationError: Length specified for ECDH key derivation is too la rge. Maximum allowed is 256 bits"
348 }, 348 },
349 349
350 // The public key parameter is in fact a private key
eroman 2014/12/17 21:17:42 This test should not be removed. If it is failing
eroman 2014/12/17 21:21:03 Actually I am OK with removing this test, as we ha
351 // (not allowed by web crypto), even though it could in practice work.
352 {
353 "private_key": {
354 "kty":"EC",
355 "crv":"P-256",
356 "x":"u6dWhaRHrvFF0CiFVuUUFafU6ixveQf9trHDXJ8hgV8",
357 "y":"thSm4LIY35vDD-5LE454eB7TShn919DVVGZ_7tWdjTE",
358 "d":"CQ8uF_-zB1NftLO6ytwKM3Cnuol64PQw5qOuCzQJeFU"
359 },
360 "public_key": {
361 "kty":"EC",
362 "crv":"P-256",
363 "d":"uN2YSQvxuxhQQ9Y1XXjYi1vr2ZTdzuoDX18PYu4LU-0",
364 "x":"S2S3tjygMB0DkM-N9jYUgGLt_9_H6km5P9V6V_KS4_4",
365 "y":"03j8Tyqgrc4R4FAUV2C7-im96yMmfmO_5Om6Kr8YP3o"
366 },
367
368 "length_bits": 256,
369 "error": "InvalidAccess: The public parameter for ECDH key derivation is not a public EC key"
370 },
371
372 // Curve mismatch (public key is for P-521 however private key was for P-256). 350 // Curve mismatch (public key is for P-521 however private key was for P-256).
373 { 351 {
374 "private_key": { 352 "private_key": {
375 "kty":"EC", 353 "kty":"EC",
376 "crv":"P-256", 354 "crv":"P-256",
377 "x":"u6dWhaRHrvFF0CiFVuUUFafU6ixveQf9trHDXJ8hgV8", 355 "x":"u6dWhaRHrvFF0CiFVuUUFafU6ixveQf9trHDXJ8hgV8",
378 "y":"thSm4LIY35vDD-5LE454eB7TShn919DVVGZ_7tWdjTE", 356 "y":"thSm4LIY35vDD-5LE454eB7TShn919DVVGZ_7tWdjTE",
379 "d":"CQ8uF_-zB1NftLO6ytwKM3Cnuol64PQw5qOuCzQJeFU" 357 "d":"CQ8uF_-zB1NftLO6ytwKM3Cnuol64PQw5qOuCzQJeFU"
380 }, 358 },
381 359
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 "d":"uN2YSQvxuxhQQ9Y1XXjYi1vr2ZTdzuoDX18PYu4LU-0", 404 "d":"uN2YSQvxuxhQQ9Y1XXjYi1vr2ZTdzuoDX18PYu4LU-0",
427 "x":"S2S3tjygMB0DkM-N9jYUgGLt_9_H6km5P9V6V_KS4_4", 405 "x":"S2S3tjygMB0DkM-N9jYUgGLt_9_H6km5P9V6V_KS4_4",
428 "y":"03j8Tyqgrc4R4FAUV2C7-im96yMmfmO_5Om6Kr8YP3o", 406 "y":"03j8Tyqgrc4R4FAUV2C7-im96yMmfmO_5Om6Kr8YP3o",
429 "use": "enc" 407 "use": "enc"
430 }, 408 },
431 409
432 "private_key_error": "DataError: The JWK \"use\" member was inconsistent wit h that specified by the Web Crypto call. The JWK usage must be a superset of tho se requested" 410 "private_key_error": "DataError: The JWK \"use\" member was inconsistent wit h that specified by the Web Crypto call. The JWK usage must be a superset of tho se requested"
433 } 411 }
434 ] 412 ]
435 413
OLDNEW
« no previous file with comments | « content/child/webcrypto/webcrypto_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698