Skip to content

Commit

Permalink
Test for self-keyshare
Browse files Browse the repository at this point in the history
Make sure that we share keys with our own devices.
  • Loading branch information
richvdh committed Dec 7, 2016
1 parent 89ced19 commit ec12484
Show file tree
Hide file tree
Showing 2 changed files with 365 additions and 231 deletions.
3 changes: 2 additions & 1 deletion lib/crypto/olmlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ module.exports.ensureOlmSessionsForDevices = function(
return baseApis.claimOneTimeKeys(
devicesWithoutSession, oneTimeKeyAlgorithm
).then(function(res) {
var otk_res = res.one_time_keys || {};
for (var userId in devicesByUser) {
if (!devicesByUser.hasOwnProperty(userId)) { continue; }
var userRes = res.one_time_keys[userId] || {};
var userRes = otk_res[userId] || {};
var devices = devicesByUser[userId];
for (var j = 0; j < devices.length; j++) {
var deviceInfo = devices[j];
Expand Down
Loading

0 comments on commit ec12484

Please sign in to comment.