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

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

Issue 675453003: Add tests for RSA private key import using JWK when p and q are swapped. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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/test/test_helpers.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
(Empty)
1 // This file contains incorrect key data in a variety of formats.
2 // "data" -- either a dictionary for JWK, or hex encoded bytes for PKCS8/SPKI.
3 // "format" -- one of: "jwk", "pkcs8", "spki"
4 // "error" -- The expected rejection reason when importing the key.
5 [
6
7 // This is a valid key (ValidKey). It forms the basis for later manipulations
8 // so its validity is tested separatelty.
9 {
10 "format": "jwk",
11 "data": {
12 "kty": "RSA",
13 "d": "ZmJJJ3PBfirgPEOb844fI_1_zXn3A09X9fkk-65xeTNo3JeigTPpuB54FC_GXUmqiXLV x5gynO6cwl9wjxVKYQ",
14 "dp": "DOUuUiDhtjpnCuIjcGRWhQYok8NeUO5XV1Uwx1-DxtU",
15 "dq": "mKOBL1e74J8OuGtW1kc2-s4VEP5Eeiwe__TAeBm-roE",
16 "e": "AQAB",
17 "n": "tFJAFt_UiJsHlRavDgOxOnYKTHkV-cF1aTDtkzNg6WYt9geaPbAvFnR3FVO0BFsl8tzP zMOTkI_kbOfCfAw3FQ",
18 "p": "7kMQn01JVhyHM7B85hLUuNBDsXiboMc4Di81qmxX7r0",
19 "q": "wb7rEiGxG4CrybVYns9voNQM2NPCuCEgWPLA_vCkuzk",
20 "qi": "6rrPQ4YaOLNGtG7TrLXUR_FSWpOFSUveHTHbFQU6iNU"
21 },
22 // This should pass import.
23 "error": "Success"
24 },
25
26 // This was a valid key (ValidKey), and then "p" and "q" were switched.
27 // (making dp, dq, and qi invalid).
28 {
29 "format": "jwk",
30 "data": {
31 "kty": "RSA",
32 "d": "ZmJJJ3PBfirgPEOb844fI_1_zXn3A09X9fkk-65xeTNo3JeigTPpuB54FC_GXUmqiXLV x5gynO6cwl9wjxVKYQ",
33 "dp": "DOUuUiDhtjpnCuIjcGRWhQYok8NeUO5XV1Uwx1-DxtU",
34 "dq": "mKOBL1e74J8OuGtW1kc2-s4VEP5Eeiwe__TAeBm-roE",
35 "e": "AQAB",
36 "n": "tFJAFt_UiJsHlRavDgOxOnYKTHkV-cF1aTDtkzNg6WYt9geaPbAvFnR3FVO0BFsl8tzP zMOTkI_kbOfCfAw3FQ",
37 "q": "7kMQn01JVhyHM7B85hLUuNBDsXiboMc4Di81qmxX7r0",
38 "p": "wb7rEiGxG4CrybVYns9voNQM2NPCuCEgWPLA_vCkuzk",
39 "qi": "6rrPQ4YaOLNGtG7TrLXUR_FSWpOFSUveHTHbFQU6iNU"
40 },
41 "error": "OperationError"
42 },
43
44 // This was a valid key (ValidKey), and then "p" and "q" were switched, as
45 // well as "dp" and "dq" (making qi invalid).
46 {
47 "format": "jwk",
48 "data": {
49 "kty": "RSA",
50 "d": "ZmJJJ3PBfirgPEOb844fI_1_zXn3A09X9fkk-65xeTNo3JeigTPpuB54FC_GXUmqiXLV x5gynO6cwl9wjxVKYQ",
51 "dq": "DOUuUiDhtjpnCuIjcGRWhQYok8NeUO5XV1Uwx1-DxtU",
52 "dp": "mKOBL1e74J8OuGtW1kc2-s4VEP5Eeiwe__TAeBm-roE",
53 "e": "AQAB",
54 "n": "tFJAFt_UiJsHlRavDgOxOnYKTHkV-cF1aTDtkzNg6WYt9geaPbAvFnR3FVO0BFsl8tzP zMOTkI_kbOfCfAw3FQ",
55 "q": "7kMQn01JVhyHM7B85hLUuNBDsXiboMc4Di81qmxX7r0",
56 "p": "wb7rEiGxG4CrybVYns9voNQM2NPCuCEgWPLA_vCkuzk",
57 "qi": "6rrPQ4YaOLNGtG7TrLXUR_FSWpOFSUveHTHbFQU6iNU"
58 },
59 "error": "OperationError"
60 },
61
62 // This was (ValidKey), where p and q were switched (dp, and dq were also
63 // flipped, and qi was recomputed using the new q).
64 //
65 // TODO(eroman): This test is commented out because it does not pass when
66 // using certain versions of NSS, due to:
67 // https://bugzilla.mozilla.org/show_bug.cgi?id=1049435
68 // Versions of NSS after 3.17.2 will pass this test.
69 // Enable this test once NSS is updated on all the bots, or chromium has
70 // switched to BoringSSL.
71 //{
72 // "format": "jwk",
73 // "data": {
74 // "kty": "RSA",
75 // "d": "ZmJJJ3PBfirgPEOb844fI_1_zXn3A09X9fkk-65xeTNo3JeigTPpuB54FC_GXUmqiXLV x5gynO6cwl9wjxVKYQ",
76 // "dq": "DOUuUiDhtjpnCuIjcGRWhQYok8NeUO5XV1Uwx1-DxtU",
77 // "dp": "mKOBL1e74J8OuGtW1kc2-s4VEP5Eeiwe__TAeBm-roE",
78 // "e": "AQAB",
79 // "n": "tFJAFt_UiJsHlRavDgOxOnYKTHkV-cF1aTDtkzNg6WYt9geaPbAvFnR3FVO0BFsl8tzP zMOTkI_kbOfCfAw3FQ",
80 // "q": "7kMQn01JVhyHM7B85hLUuNBDsXiboMc4Di81qmxX7r0",
81 // "p": "wb7rEiGxG4CrybVYns9voNQM2NPCuCEgWPLA_vCkuzk",
82 // "qi": "At9OiWPsUGogvxI5FR0mMURSjnu1mZgyFXi7fX56Bl0"
83 // },
84 // // This should pass import.
85 // "error": "Success"
86 //},
87
88 // The provided SPKI is empty.
89 {
90 "format": "spki",
91 "data": "",
92 "error": "DataError: No key data was provided"
93 },
94
95 // The provided PKCS8 is empty.
96 {
97 "format": "pkcs8",
98 "data": "",
99 "error": "DataError: No key data was provided"
100 },
101
102 // Bad DER encoding for SPKI.
103 {
104 "format": "spki",
105 "data": "618333c4cb",
106 "error": "DataError"
107 },
108
109 // Bad DER encoding for PKCS8.
110 {
111 "format": "pkcs8",
112 "data": "618333c4cb",
113 "error": "DataError"
114 }
115 ]
OLDNEW
« no previous file with comments | « content/child/webcrypto/test/test_helpers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698