Update libaxolotl, remove one string conversion

Previously we would convert a bytebuffer to a string, pass it to
libaxolotl where it would be parsed back into a bytebuffer.

Ideally we would just pass the bytebuffer, but it turns out that
libaxolotl's bytebyffer class is identical but separate from
libtextsecure's bytebuffer class. ¯\_(ツ)_/¯

So instead we pass the underlying array buffer, which is handled
more or less the same way as a bytebuffer, and most importantly,
does not involve any copying.

// FREEBIE
This commit is contained in:
lilia
2015-07-20 12:22:33 -07:00
parent 1ab5af338a
commit af48ca9e4b
3 changed files with 20 additions and 30 deletions

View File

@@ -37365,7 +37365,7 @@ window.axolotl.protocol = function(storage_interface) {
// Inits a session (maybe) and then decrypts the message
self.handlePreKeyWhisperMessage = function(from, encodedMessage) {
var preKeyProto = axolotlInternal.protobuf.PreKeyWhisperMessage.decode(encodedMessage, 'binary');
var preKeyProto = axolotlInternal.protobuf.PreKeyWhisperMessage.decode(encodedMessage);
return initSessionFromPreKeyWhisperMessage(from, preKeyProto).then(function(sessions) {
return doDecryptWhisperMessage(from, axolotlInternal.utils.convertToString(preKeyProto.message), sessions[0], preKeyProto.registrationId).then(function(result) {
if (sessions[1] !== undefined)