Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Commit dd4e837

Browse files
committed
Include remote registrationId in encryption result
The signal service requires this field to accompany outgoing ciphertexts. With this change we can likely remove the correspinding getter from SessionCipher.
1 parent fbc6554 commit dd4e837

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

dist/libsignal-protocol.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -36124,9 +36124,18 @@ SessionCipher.prototype = {
3612436124

3612536125
preKeyMsg.message = message;
3612636126
var result = String.fromCharCode((3 << 4) | 3) + util.toString(preKeyMsg.encode());
36127-
return {type: 3, body: result};
36127+
return {
36128+
type : 3,
36129+
body : result,
36130+
registrationId : record.registrationId
36131+
};
36132+
3612836133
} else {
36129-
return {type: 1, body: util.toString(message)};
36134+
return {
36135+
type : 1,
36136+
body : util.toString(message),
36137+
registrationId : record.registrationId
36138+
};
3613036139
}
3613136140
});
3613236141
}.bind(this));

src/SessionCipher.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,18 @@ SessionCipher.prototype = {
9494

9595
preKeyMsg.message = message;
9696
var result = String.fromCharCode((3 << 4) | 3) + util.toString(preKeyMsg.encode());
97-
return {type: 3, body: result};
97+
return {
98+
type : 3,
99+
body : result,
100+
registrationId : record.registrationId
101+
};
102+
98103
} else {
99-
return {type: 1, body: util.toString(message)};
104+
return {
105+
type : 1,
106+
body : util.toString(message),
107+
registrationId : record.registrationId
108+
};
100109
}
101110
});
102111
}.bind(this));

0 commit comments

Comments
 (0)