Skip to content

Commit

Permalink
Merge pull request #309 from matrix-org/rav/fix_olm_import
Browse files Browse the repository at this point in the history
Bump to Olm 2.0
  • Loading branch information
richvdh authored Dec 14, 2016
2 parents 7f4ff35 + b11bff5 commit 2e3c349
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
"watchify": "^3.2.1"
},
"optionalDependencies": {
"olm": "https://matrix.org/packages/npm/olm/olm-1.3.0.tgz"
"olm": "https://matrix.org/packages/npm/olm/olm-2.0.0.tgz"
}
}
18 changes: 12 additions & 6 deletions spec/integ/megolm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,11 @@ describe("megolm", function() {
'PUT', '/send/'
).respond(200, function(path, content) {
var ct = content.ciphertext;
var decrypted = JSON.parse(inboundGroupSession.decrypt(ct));
var r = inboundGroupSession.decrypt(ct);
console.log('Decrypted received megolm message', r);

console.log('Decrypted received megolm message', decrypted);
expect(r.message_index).toEqual(0);
var decrypted = JSON.parse(r.plaintext);
expect(decrypted.type).toEqual('m.room.message');
expect(decrypted.content.body).toEqual('test');

Expand Down Expand Up @@ -795,8 +797,10 @@ describe("megolm", function() {
'PUT', '/send/'
).respond(200, function(path, content) {
var ct = content.ciphertext;
decrypted = JSON.parse(inboundGroupSession.decrypt(ct));
console.log('Decrypted received megolm message', decrypted);
var r = inboundGroupSession.decrypt(ct);
console.log('Decrypted received megolm message', r);
decrypted = JSON.parse(r.plaintext);

return {
event_id: '$event_id',
};
Expand Down Expand Up @@ -838,9 +842,11 @@ describe("megolm", function() {
'PUT', '/send/'
).respond(200, function(path, content) {
var ct = content.ciphertext;
var decrypted = JSON.parse(inboundGroupSession.decrypt(ct));
var r = inboundGroupSession.decrypt(ct);
console.log('Decrypted received megolm message', r);

console.log('Decrypted received megolm message', decrypted);
expect(r.message_index).toEqual(0);
var decrypted = JSON.parse(r.plaintext);
expect(decrypted.type).toEqual('m.room.message');
expect(decrypted.content.body).toEqual('test');

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/crypto.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ describe("Crypto", function() {
}

it("Crypto exposes the correct olm library version", function() {
expect(Crypto.getOlmVersion()).toEqual([1, 3, 0]);
expect(Crypto.getOlmVersion()).toEqual([2, 0, 0]);
});
});

0 comments on commit 2e3c349

Please sign in to comment.