Check registration ID on prekeymsg
This commit is contained in:
parent
76e7dcb77d
commit
e3097746c0
2 changed files with 4 additions and 0 deletions
|
@ -359,6 +359,9 @@ window.crypto = (function() {
|
|||
|
||||
var initSessionFromPreKeyWhisperMessage = function(encodedNumber, message) {
|
||||
var preKeyPair = crypto_storage.getAndRemovePreKeyPair(message.preKeyId);
|
||||
if (message.registrationId != storage.getUnencrypted("registrationId))
|
||||
throw new Error("Got a message encrypted for a different registration");
|
||||
|
||||
var session = crypto_storage.getSessionOrIdentityKeyByBaseKey(encodedNumber, toArrayBuffer(message.baseKey));
|
||||
var open_session = crypto_storage.getOpenSession(encodedNumber);
|
||||
if (preKeyPair === undefined) {
|
||||
|
|
|
@ -84,6 +84,7 @@ $('#init-go').click(function() {
|
|||
storage.putEncrypted("password", password);
|
||||
storage.putEncrypted('signaling_key', signaling_key);
|
||||
storage.putUnencrypted("number_id", number_id);
|
||||
storage.putUnencrypted("registrationId", registrationId);
|
||||
$('#verify1done').html('done');
|
||||
|
||||
var register_keys_func = function() {
|
||||
|
|
Loading…
Reference in a new issue