diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-07-08 16:00:08 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-07-08 16:04:18 +0100 |
commit | 0e988237f6fcb826afc42719adc335dcc7ca0e2e (patch) | |
tree | 004312c4b121b2278a5327847db28f0c20639323 /javascript/demo.html | |
parent | 532dc0d4e79192a0c7fd1758322f6cae06959859 (diff) |
Don't pass a key id when creating a new outbound session
Diffstat (limited to 'javascript/demo.html')
-rw-r--r-- | javascript/demo.html | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/javascript/demo.html b/javascript/demo.html index 5a32e96..c9cad8b 100644 --- a/javascript/demo.html +++ b/javascript/demo.html @@ -30,16 +30,20 @@ document.addEventListener("DOMContentLoaded", function (event) { tasks.push(["bob", "Creating account", function() { bob.create() }]); tasks.push(["alice", "Create outbound session", function() { var bobs_id_keys = JSON.parse(bob.identity_keys("bob", "bob_device", 0, 0)); - var bobs_curve25519_key; + var bobs_id_key; for (key in bobs_id_keys.keys) { if (key.startsWith("curve25519:")) { - bobs_curve25519_key = bobs_id_keys.keys[key]; + bobs_id_key = bobs_id_keys.keys[key]; } } - var bobs_keys_2 = JSON.parse(bob.one_time_keys())[1]; - a_session.create_outbound( - alice, bobs_curve25519_key, bobs_keys_2[0], bobs_keys_2[1] - ); + var bobs_ot_keys = JSON.parse(bob.one_time_keys()); + var bobs_ot_key; + for (key in bobs_ot_keys) { + if (key.startsWith("curve25519:")) { + bobs_ot_key = bobs_ot_keys[key]; + } + } + a_session.create_outbound(alice, bobs_id_key, bobs_ot_key); }]); tasks.push(["alice", "Encrypt first message", function() { message_1 = a_session.encrypt(""); @@ -96,7 +100,7 @@ document.addEventListener("DOMContentLoaded", function (event) { window.setTimeout(function() { task[2](); p.done(); - window.setTimeout(do_tasks, 0, next); + window.setTimeout(do_tasks, 50, next); }, 0) } else { next(); |