Update libsignal-protocol / Update prekey format

Integrates change in prekey object formatting, which now matches more
conveniently with the representation rendered by the server.

// FREEBIE
This commit is contained in:
lilia 2016-04-27 15:21:44 -07:00
parent 6589ec544a
commit 9f871db48a
6 changed files with 49 additions and 105 deletions

View file

@ -15,24 +15,8 @@
window.textsecure.storage.devices = {
saveKeysToDeviceObject: function(deviceObject) {
var number = textsecure.utils.unencodeNumber(deviceObject.encodedNumber)[0];
return textsecure.storage.protocol.loadIdentityKey(number).then(function(identityKey) {
if (identityKey !== undefined && deviceObject.identityKey !== undefined && getString(identityKey) != getString(deviceObject.identityKey)) {
var error = new Error("Identity key changed");
error.identityKey = deviceObject.identityKey;
throw error;
}
return textsecure.storage.protocol.putIdentityKey(number, deviceObject.identityKey).then(function() {
tempKeys[deviceObject.encodedNumber] = {
preKey: deviceObject.preKey,
preKeyId: deviceObject.preKeyId,
signedKey: deviceObject.signedKey,
signedKeyId: deviceObject.signedKeyId,
signedKeySignature: deviceObject.signedKeySignature,
registrationId: deviceObject.registrationId
};
});
return textsecure.protocol_wrapper.processPreKey(deviceObject).then(function() {
tempKeys[deviceObject.encodedNumber] = deviceObject;
});
},