Update our own key on re-install

Previously we would delete our own key from the trust store when
re-linking, in case it changed. We can also immediately take one step
further and store the new key. Typically this happens in the course of
requesting sync info from the master device, except in the case of
standalone clients.

Closes #596

// FREEBIE
pull/749/head
lilia 9 years ago
parent ac43d40135
commit a9cba1471a

@ -36740,9 +36740,12 @@ var TextSecureServer = (function() {
textsecure.storage.remove('device_name');
textsecure.storage.remove('regionCode');
// remove our own identity key, which may have changed
// update our own identity key, which may have changed
// if we're relinking after a reinstall on the master device
textsecure.storage.axolotl.removeIdentityKey(number);
var putIdentity = textsecure.storage.axolotl.putIdentityKey.bind(
null, number, identityKeyPair.pubKey
);
textsecure.storage.axolotl.removeIdentityKey(number).then(putIdentity, putIdentity);
textsecure.storage.put('identityKey', identityKeyPair);
textsecure.storage.put('signaling_key', signalingKey);

@ -106,9 +106,12 @@
textsecure.storage.remove('device_name');
textsecure.storage.remove('regionCode');
// remove our own identity key, which may have changed
// update our own identity key, which may have changed
// if we're relinking after a reinstall on the master device
textsecure.storage.axolotl.removeIdentityKey(number);
var putIdentity = textsecure.storage.axolotl.putIdentityKey.bind(
null, number, identityKeyPair.pubKey
);
textsecure.storage.axolotl.removeIdentityKey(number).then(putIdentity, putIdentity);
textsecure.storage.put('identityKey', identityKeyPair);
textsecure.storage.put('signaling_key', signalingKey);

Loading…
Cancel
Save