Handle provisioning messages with no profile key (#1470)

This can happen while linking to an older mobile client.

// FREEBIE
This commit is contained in:
Lilia 2017-09-13 20:26:26 +02:00 committed by Scott Nonnenberg
parent c832324cb9
commit fc952fbaf6
No known key found for this signature in database
GPG key ID: A4931C09644C654B
3 changed files with 16 additions and 6 deletions

View file

@ -31,13 +31,16 @@ ProvisioningCipher.prototype = {
var privKey = provisionMessage.identityKeyPrivate.toArrayBuffer();
return libsignal.Curve.async.createKeyPair(privKey).then(function(keyPair) {
return {
var ret = {
identityKeyPair : keyPair,
number : provisionMessage.number,
provisioningCode : provisionMessage.provisioningCode,
userAgent : provisionMessage.userAgent,
profileKey : provisionMessage.profileKey.toArrayBuffer()
};
if (provisionMessage.profileKey) {
ret.profileKey = provisionMessage.profileKey.toArrayBuffer();
}
return ret;
});
});
},