git ssb

0+

Dominic / ssb-peer-invites



Commit faa577025470b36627e359489a115c27c490a730

update message type in invalid message tests

Dominic Tarr committed on 12/14/2018, 9:52:17 PM
Parent: 01848051f7ae17dff5c454e94d433a5c61d76dfa

Files changed

test/invalid.jschanged
test/invalid.jsView
@@ -30,9 +30,9 @@
3030 //construct a message where host does not match
3131 var seed = hash('seed2')
3232 var keys = ssbKeys.generate(null, seed)
3333 var invalid = ssbKeys.signObj(keys, invite_key, {
34- type: 'invite',
34 + type: 'user-invite',
3535 invite: ssbKeys.generate(null, hash('seed3')),
3636 host: alice.id
3737 })
3838
@@ -56,9 +56,9 @@
5656 var seed = hash('seed2')
5757 var keys = ssbKeys.generate(null, seed)
5858 var wrong_seed = hash('wrong_seed')
5959 var invalid = ssbKeys.signObj(keys, invite_key, {
60- type: 'invite',
60 + type: 'user-invite',
6161 invite: keys.id, //correct key
6262 reveal: u.box({hidden: true}, u.hash(u.hash(wrong_seed))),
6363 host: alice.id
6464 })
@@ -81,9 +81,9 @@
8181 i.createAccept(invite_msg, seed, bob.id)
8282 }, 'user-invites:decrypt-reveal-failed')
8383
8484 var accept = ssbKeys.signObj(ssbKeys.generate(null, seed), invite_key, {
85- type: 'invite/accept',
85 + type: 'user-invite/accept',
8686 receipt: '%'+ssbKeys.hash(JSON.stringify(invite_msg, null, 2)),
8787 id: bob.id,
8888 key: u.hash(u.hash(seed)) //what the reveal key should be.
8989 })
@@ -95,9 +95,9 @@
9595 i.verifyAccept(accept_msg, invite_msg)
9696 }, 'user-invites:decrypt-accept-reveal-failed')
9797
9898 var accept2 = ssbKeys.signObj(ssbKeys.generate(null, seed), invite_key, {
99- type: 'invite/accept',
99 + type: 'user-invite/accept',
100100 receipt: '%'+ssbKeys.hash(JSON.stringify(invite_msg, null, 2)),
101101 id: bob.id,
102102 key: u.hash('not the key') //what the reveal key should be.
103103 })
@@ -140,9 +140,9 @@
140140
141141 var invite = v.create(null, alice, null, i.createInvite(seed, alice.id), new Date('2018-03-14T06:14:18.377Z'))
142142 var seed2 = hash('seed2')
143143 var accept_content = ssbKeys.signObj(ssbKeys.generate(null, seed2), invite_key, {
144- type: 'invite/accept',
144 + type: 'user-invite/accept',
145145 receipt: '%'+ssbKeys.hash(JSON.stringify(invite, null, 2)),
146146 id: bob.id,
147147 })
148148 var accept2 = v.create(null, bob, null, accept_content, new Date('2018-03-14T06:32:18.377Z'))
@@ -161,9 +161,9 @@
161161 var seed = hash('seed1')
162162
163163 var invite = v.create(null, alice, null, i.createInvite(seed, alice.id, 'REVEAL'), new Date('2018-03-14T06:14:18.377Z'))
164164 var accept_content = ssbKeys.signObj(ssbKeys.generate(null, seed), invite_key, {
165- type: 'invite/accept',
165 + type: 'user-invite/accept',
166166 receipt: '%'+ssbKeys.hash(JSON.stringify(invite, null, 2)),
167167 id: bob.id,
168168 //key is missing!
169169 })

Built with git-ssb-web