Update libsignal-protocol v0.10.0
* Changes policy for old session deletion * Renames putIdentityKey to saveIdentity * Remove device messages // FREEBIE
This commit is contained in:
parent
f783b11368
commit
148bd32671
9 changed files with 60 additions and 137 deletions
|
@ -49,7 +49,7 @@ SignalProtocolStore.prototype = {
|
|||
resolve(this.get('identityKey' + identifier));
|
||||
}.bind(this));
|
||||
},
|
||||
putIdentityKey: function(identifier, identityKey) {
|
||||
saveIdentity: function(identifier, identityKey) {
|
||||
if (identifier === null || identifier === undefined)
|
||||
throw new Error("Tried to put identity key for undefined/null key");
|
||||
return new Promise(function(resolve) {
|
||||
|
|
|
@ -13,7 +13,7 @@ describe('Protocol Wrapper', function() {
|
|||
before(function(done) {
|
||||
localStorage.clear();
|
||||
libsignal.KeyHelper.generateIdentityKeyPair().then(function(identityKey) {
|
||||
return textsecure.storage.protocol.putIdentityKey(identifier, identityKey);
|
||||
return textsecure.storage.protocol.saveIdentity(identifier, identityKey);
|
||||
}).then(done);
|
||||
});
|
||||
describe('processPreKey', function() {
|
||||
|
|
|
@ -31,7 +31,7 @@ describe("SignalProtocolStore", function() {
|
|||
}).then(done,done);
|
||||
});
|
||||
it('stores identity keys', function(done) {
|
||||
store.putIdentityKey(identifier, testKey.pubKey).then(function() {
|
||||
store.saveIdentity(identifier, testKey.pubKey).then(function() {
|
||||
return store.loadIdentityKey(identifier).then(function(key) {
|
||||
assertEqualArrayBuffers(key, testKey.pubKey);
|
||||
});
|
||||
|
@ -39,7 +39,7 @@ describe("SignalProtocolStore", function() {
|
|||
});
|
||||
it('returns whether a key is trusted', function(done) {
|
||||
var newIdentity = textsecure.crypto.getRandomBytes(33);
|
||||
store.putIdentityKey(identifier, testKey.pubKey).then(function() {
|
||||
store.saveIdentity(identifier, testKey.pubKey).then(function() {
|
||||
store.isTrustedIdentity(identifier, newIdentity).then(function(trusted) {
|
||||
if (trusted) {
|
||||
done(new Error('Allowed to overwrite identity key'));
|
||||
|
@ -51,7 +51,7 @@ describe("SignalProtocolStore", function() {
|
|||
});
|
||||
it('returns whether a key is untrusted', function(done) {
|
||||
var newIdentity = textsecure.crypto.getRandomBytes(33);
|
||||
store.putIdentityKey(identifier, testKey.pubKey).then(function() {
|
||||
store.saveIdentity(identifier, testKey.pubKey).then(function() {
|
||||
store.isTrustedIdentity(identifier, testKey.pubKey).then(function(trusted) {
|
||||
if (trusted) {
|
||||
done();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue