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
This commit is contained in:
lilia 2016-01-21 19:25:55 -08:00
parent ac43d40135
commit a9cba1471a
2 changed files with 10 additions and 4 deletions

View File

@ -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);

View File

@ -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);