Commit faa577025470b36627e359489a115c27c490a730
update message type in invalid message tests
Dominic Tarr committed on 12/14/2018, 9:52:17 PMParent: 01848051f7ae17dff5c454e94d433a5c61d76dfa
Files changed
test/invalid.js | changed |
test/invalid.js | ||
---|---|---|
@@ -30,9 +30,9 @@ | ||
30 | 30 … | //construct a message where host does not match |
31 | 31 … | var seed = hash('seed2') |
32 | 32 … | var keys = ssbKeys.generate(null, seed) |
33 | 33 … | var invalid = ssbKeys.signObj(keys, invite_key, { |
34 | - type: 'invite', | |
34 … | + type: 'user-invite', | |
35 | 35 … | invite: ssbKeys.generate(null, hash('seed3')), |
36 | 36 … | host: alice.id |
37 | 37 … | }) |
38 | 38 … | |
@@ -56,9 +56,9 @@ | ||
56 | 56 … | var seed = hash('seed2') |
57 | 57 … | var keys = ssbKeys.generate(null, seed) |
58 | 58 … | var wrong_seed = hash('wrong_seed') |
59 | 59 … | var invalid = ssbKeys.signObj(keys, invite_key, { |
60 | - type: 'invite', | |
60 … | + type: 'user-invite', | |
61 | 61 … | invite: keys.id, //correct key |
62 | 62 … | reveal: u.box({hidden: true}, u.hash(u.hash(wrong_seed))), |
63 | 63 … | host: alice.id |
64 | 64 … | }) |
@@ -81,9 +81,9 @@ | ||
81 | 81 … | i.createAccept(invite_msg, seed, bob.id) |
82 | 82 … | }, 'user-invites:decrypt-reveal-failed') |
83 | 83 … | |
84 | 84 … | var accept = ssbKeys.signObj(ssbKeys.generate(null, seed), invite_key, { |
85 | - type: 'invite/accept', | |
85 … | + type: 'user-invite/accept', | |
86 | 86 … | receipt: '%'+ssbKeys.hash(JSON.stringify(invite_msg, null, 2)), |
87 | 87 … | id: bob.id, |
88 | 88 … | key: u.hash(u.hash(seed)) //what the reveal key should be. |
89 | 89 … | }) |
@@ -95,9 +95,9 @@ | ||
95 | 95 … | i.verifyAccept(accept_msg, invite_msg) |
96 | 96 … | }, 'user-invites:decrypt-accept-reveal-failed') |
97 | 97 … | |
98 | 98 … | var accept2 = ssbKeys.signObj(ssbKeys.generate(null, seed), invite_key, { |
99 | - type: 'invite/accept', | |
99 … | + type: 'user-invite/accept', | |
100 | 100 … | receipt: '%'+ssbKeys.hash(JSON.stringify(invite_msg, null, 2)), |
101 | 101 … | id: bob.id, |
102 | 102 … | key: u.hash('not the key') //what the reveal key should be. |
103 | 103 … | }) |
@@ -140,9 +140,9 @@ | ||
140 | 140 … | |
141 | 141 … | var invite = v.create(null, alice, null, i.createInvite(seed, alice.id), new Date('2018-03-14T06:14:18.377Z')) |
142 | 142 … | var seed2 = hash('seed2') |
143 | 143 … | var accept_content = ssbKeys.signObj(ssbKeys.generate(null, seed2), invite_key, { |
144 | - type: 'invite/accept', | |
144 … | + type: 'user-invite/accept', | |
145 | 145 … | receipt: '%'+ssbKeys.hash(JSON.stringify(invite, null, 2)), |
146 | 146 … | id: bob.id, |
147 | 147 … | }) |
148 | 148 … | var accept2 = v.create(null, bob, null, accept_content, new Date('2018-03-14T06:32:18.377Z')) |
@@ -161,9 +161,9 @@ | ||
161 | 161 … | var seed = hash('seed1') |
162 | 162 … | |
163 | 163 … | var invite = v.create(null, alice, null, i.createInvite(seed, alice.id, 'REVEAL'), new Date('2018-03-14T06:14:18.377Z')) |
164 | 164 … | var accept_content = ssbKeys.signObj(ssbKeys.generate(null, seed), invite_key, { |
165 | - type: 'invite/accept', | |
165 … | + type: 'user-invite/accept', | |
166 | 166 … | receipt: '%'+ssbKeys.hash(JSON.stringify(invite, null, 2)), |
167 | 167 … | id: bob.id, |
168 | 168 … | //key is missing! |
169 | 169 … | }) |
Built with git-ssb-web