Update libsignal-protocol v1.1.2
// FREEBIE
This commit is contained in:
parent
f670061669
commit
005444d09a
2 changed files with 28 additions and 8 deletions
|
@ -35332,7 +35332,9 @@ Curve25519Worker.prototype = {
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
/* vim: ts=4:sw=4 */
|
/*
|
||||||
|
* vim: ts=4:sw=4
|
||||||
|
*/
|
||||||
|
|
||||||
var Internal = Internal || {};
|
var Internal = Internal || {};
|
||||||
|
|
||||||
|
@ -35429,6 +35431,8 @@ var Internal = Internal || {};
|
||||||
result = result | (a[i] ^ b[i]);
|
result = result | (a[i] ^ b[i]);
|
||||||
}
|
}
|
||||||
if (result !== 0) {
|
if (result !== 0) {
|
||||||
|
console.log('Our MAC ', dcodeIO.ByteBuffer.wrap(calculated_mac).toHex());
|
||||||
|
console.log('Their MAC', dcodeIO.ByteBuffer.wrap(mac).toHex());
|
||||||
throw new Error("Bad MAC");
|
throw new Error("Bad MAC");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -35613,7 +35617,9 @@ Internal.protobuf = function() {
|
||||||
};
|
};
|
||||||
}();
|
}();
|
||||||
|
|
||||||
/* vim: ts=4:sw=4 */
|
/*
|
||||||
|
* vim: ts=4:sw=4
|
||||||
|
*/
|
||||||
|
|
||||||
var Internal = Internal || {};
|
var Internal = Internal || {};
|
||||||
|
|
||||||
|
@ -35626,6 +35632,8 @@ Internal.ChainType = {
|
||||||
RECEIVING: 2
|
RECEIVING: 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var ARCHIVED_STATES_MAX_LENGTH = 40;
|
||||||
|
|
||||||
Internal.SessionRecord = function() {
|
Internal.SessionRecord = function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
var MESSAGE_LOST_THRESHOLD_MS = 1000*60*60*24*7;
|
var MESSAGE_LOST_THRESHOLD_MS = 1000*60*60*24*7;
|
||||||
|
@ -35840,6 +35848,7 @@ Internal.SessionRecord = function() {
|
||||||
index = i;
|
index = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log("Deleting chain closed at", oldest.added);
|
||||||
delete session[util.toString(oldest.ephemeralKey)];
|
delete session[util.toString(oldest.ephemeralKey)];
|
||||||
session.oldRatchetList.splice(index, 1);
|
session.oldRatchetList.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
@ -35848,7 +35857,7 @@ Internal.SessionRecord = function() {
|
||||||
// Retain only the last 20 sessions
|
// Retain only the last 20 sessions
|
||||||
var sessions = this._sessions;
|
var sessions = this._sessions;
|
||||||
var oldestBaseKey, oldestSession;
|
var oldestBaseKey, oldestSession;
|
||||||
while (Object.keys(sessions).length > 20) {
|
while (Object.keys(sessions).length > ARCHIVED_STATES_MAX_LENGTH) {
|
||||||
for (var key in sessions) {
|
for (var key in sessions) {
|
||||||
var session = sessions[key];
|
var session = sessions[key];
|
||||||
if (session.indexInfo.closed > -1 && // session is closed
|
if (session.indexInfo.closed > -1 && // session is closed
|
||||||
|
@ -35998,7 +36007,7 @@ SessionBuilder.prototype = {
|
||||||
record.archiveCurrentState();
|
record.archiveCurrentState();
|
||||||
}
|
}
|
||||||
if (message.preKeyId && !preKeyPair) {
|
if (message.preKeyId && !preKeyPair) {
|
||||||
console.log('Invalid prekey id');
|
console.log('Invalid prekey id', message.preKeyId);
|
||||||
}
|
}
|
||||||
return this.initSession(false, preKeyPair, signedPreKeyPair,
|
return this.initSession(false, preKeyPair, signedPreKeyPair,
|
||||||
message.identityKey.toArrayBuffer(),
|
message.identityKey.toArrayBuffer(),
|
||||||
|
@ -36374,6 +36383,7 @@ SessionCipher.prototype = {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('New remote ephemeral key');
|
||||||
var ratchet = session.currentRatchet;
|
var ratchet = session.currentRatchet;
|
||||||
|
|
||||||
return Promise.resolve().then(function() {
|
return Promise.resolve().then(function() {
|
||||||
|
|
|
@ -35208,7 +35208,9 @@ Curve25519Worker.prototype = {
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
/* vim: ts=4:sw=4 */
|
/*
|
||||||
|
* vim: ts=4:sw=4
|
||||||
|
*/
|
||||||
|
|
||||||
var Internal = Internal || {};
|
var Internal = Internal || {};
|
||||||
|
|
||||||
|
@ -35305,6 +35307,8 @@ var Internal = Internal || {};
|
||||||
result = result | (a[i] ^ b[i]);
|
result = result | (a[i] ^ b[i]);
|
||||||
}
|
}
|
||||||
if (result !== 0) {
|
if (result !== 0) {
|
||||||
|
console.log('Our MAC ', dcodeIO.ByteBuffer.wrap(calculated_mac).toHex());
|
||||||
|
console.log('Their MAC', dcodeIO.ByteBuffer.wrap(mac).toHex());
|
||||||
throw new Error("Bad MAC");
|
throw new Error("Bad MAC");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -35489,7 +35493,9 @@ Internal.protobuf = function() {
|
||||||
};
|
};
|
||||||
}();
|
}();
|
||||||
|
|
||||||
/* vim: ts=4:sw=4 */
|
/*
|
||||||
|
* vim: ts=4:sw=4
|
||||||
|
*/
|
||||||
|
|
||||||
var Internal = Internal || {};
|
var Internal = Internal || {};
|
||||||
|
|
||||||
|
@ -35502,6 +35508,8 @@ Internal.ChainType = {
|
||||||
RECEIVING: 2
|
RECEIVING: 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var ARCHIVED_STATES_MAX_LENGTH = 40;
|
||||||
|
|
||||||
Internal.SessionRecord = function() {
|
Internal.SessionRecord = function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
var MESSAGE_LOST_THRESHOLD_MS = 1000*60*60*24*7;
|
var MESSAGE_LOST_THRESHOLD_MS = 1000*60*60*24*7;
|
||||||
|
@ -35716,6 +35724,7 @@ Internal.SessionRecord = function() {
|
||||||
index = i;
|
index = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log("Deleting chain closed at", oldest.added);
|
||||||
delete session[util.toString(oldest.ephemeralKey)];
|
delete session[util.toString(oldest.ephemeralKey)];
|
||||||
session.oldRatchetList.splice(index, 1);
|
session.oldRatchetList.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
@ -35724,7 +35733,7 @@ Internal.SessionRecord = function() {
|
||||||
// Retain only the last 20 sessions
|
// Retain only the last 20 sessions
|
||||||
var sessions = this._sessions;
|
var sessions = this._sessions;
|
||||||
var oldestBaseKey, oldestSession;
|
var oldestBaseKey, oldestSession;
|
||||||
while (Object.keys(sessions).length > 20) {
|
while (Object.keys(sessions).length > ARCHIVED_STATES_MAX_LENGTH) {
|
||||||
for (var key in sessions) {
|
for (var key in sessions) {
|
||||||
var session = sessions[key];
|
var session = sessions[key];
|
||||||
if (session.indexInfo.closed > -1 && // session is closed
|
if (session.indexInfo.closed > -1 && // session is closed
|
||||||
|
@ -35874,7 +35883,7 @@ SessionBuilder.prototype = {
|
||||||
record.archiveCurrentState();
|
record.archiveCurrentState();
|
||||||
}
|
}
|
||||||
if (message.preKeyId && !preKeyPair) {
|
if (message.preKeyId && !preKeyPair) {
|
||||||
console.log('Invalid prekey id');
|
console.log('Invalid prekey id', message.preKeyId);
|
||||||
}
|
}
|
||||||
return this.initSession(false, preKeyPair, signedPreKeyPair,
|
return this.initSession(false, preKeyPair, signedPreKeyPair,
|
||||||
message.identityKey.toArrayBuffer(),
|
message.identityKey.toArrayBuffer(),
|
||||||
|
@ -36250,6 +36259,7 @@ SessionCipher.prototype = {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('New remote ephemeral key');
|
||||||
var ratchet = session.currentRatchet;
|
var ratchet = session.currentRatchet;
|
||||||
|
|
||||||
return Promise.resolve().then(function() {
|
return Promise.resolve().then(function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue