Use staging server (ie update to server keys v2) and protocolv3
This commit is contained in:
parent
53f8ac9ad9
commit
66bf371aa7
2 changed files with 5 additions and 5 deletions
|
@ -31,7 +31,7 @@ window.textsecure.api = function() {
|
||||||
var URL_CALLS = {};
|
var URL_CALLS = {};
|
||||||
URL_CALLS['accounts'] = "/v1/accounts";
|
URL_CALLS['accounts'] = "/v1/accounts";
|
||||||
URL_CALLS['devices'] = "/v1/devices";
|
URL_CALLS['devices'] = "/v1/devices";
|
||||||
URL_CALLS['keys'] = "/v1/keys";
|
URL_CALLS['keys'] = "/v2/keys";
|
||||||
URL_CALLS['push'] = "/v1/websocket";
|
URL_CALLS['push'] = "/v1/websocket";
|
||||||
URL_CALLS['messages'] = "/v1/messages";
|
URL_CALLS['messages'] = "/v1/messages";
|
||||||
URL_CALLS['attachment'] = "/v1/attachments";
|
URL_CALLS['attachment'] = "/v1/attachments";
|
||||||
|
|
|
@ -779,15 +779,14 @@ window.textsecure.crypto = function() {
|
||||||
|
|
||||||
var signedKeyId = textsecure.storage.getEncrypted("signedKeyId", 0);
|
var signedKeyId = textsecure.storage.getEncrypted("signedKeyId", 0);
|
||||||
textsecure.storage.putEncrypted("signedKeyId", signedKeyId + 1);
|
textsecure.storage.putEncrypted("signedKeyId", signedKeyId + 1);
|
||||||
textsecure.storage.putEncrypted("lastSignedKeyUpdate", Date.now());
|
|
||||||
|
|
||||||
var keys = {};
|
var keys = {};
|
||||||
keys.identityKey = identityKeyPair.pubKey;
|
keys.identityKey = identityKeyPair.pubKey;
|
||||||
keys.keys = [];
|
keys.preKeys = [];
|
||||||
|
|
||||||
var generateKey = function(keyId) {
|
var generateKey = function(keyId) {
|
||||||
return crypto_storage.getNewStoredKeyPair("preKey" + keyId, false).then(function(keyPair) {
|
return crypto_storage.getNewStoredKeyPair("preKey" + keyId, false).then(function(keyPair) {
|
||||||
keys.keys[keyId] = {keyId: keyId, publicKey: keyPair.pubKey};
|
keys.preKeys[keyId] = {keyId: keyId, publicKey: keyPair.pubKey};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -797,7 +796,7 @@ window.textsecure.crypto = function() {
|
||||||
|
|
||||||
promises[firstPreKeyId + GENERATE_KEYS_KEYS_GENERATED] = crypto_storage.getNewStoredKeyPair("signedKey" + signedKeyId).then(function(keyPair) {
|
promises[firstPreKeyId + GENERATE_KEYS_KEYS_GENERATED] = crypto_storage.getNewStoredKeyPair("signedKey" + signedKeyId).then(function(keyPair) {
|
||||||
return Ed25519Sign(identityKeyPair.privKey, keyPair.pubKey).then(function(sig) {
|
return Ed25519Sign(identityKeyPair.privKey, keyPair.pubKey).then(function(sig) {
|
||||||
keys.signedKey = {keyId: signedKeyId, publicKey: keyPair.pubKey, signature: sig};
|
keys.signedPreKey = {keyId: signedKeyId, publicKey: keyPair.pubKey, signature: sig};
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -814,6 +813,7 @@ window.textsecure.crypto = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
window.textsecure.registerOnLoadFunction(function() {
|
window.textsecure.registerOnLoadFunction(function() {
|
||||||
|
//TODO: Dont always update prekeys here
|
||||||
if (textsecure.storage.getEncrypted("lastSignedKeyUpdate", Date.now()) < Date.now() - MESSAGE_LOST_THRESHOLD_MS)
|
if (textsecure.storage.getEncrypted("lastSignedKeyUpdate", Date.now()) < Date.now() - MESSAGE_LOST_THRESHOLD_MS)
|
||||||
self.generateKeys();
|
self.generateKeys();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue