identity_key should be stored as base64, not array buffer

This commit is contained in:
JC Brand 2018-08-22 18:32:31 +02:00
parent fa0e7aeff5
commit 5ded22207b
2 changed files with 4 additions and 4 deletions

4
dist/converse.js vendored
View File

@ -74173,7 +74173,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
try {
return sessionBuilder.processPreKey({
'registrationId': parseInt(_converse.omemo_store.get('device_id'), 10),
'identityKey': _converse.omemo_store.get('identity_key'),
'identityKey': u.base64ToArrayBuffer(_converse.omemo_store.get('identity_key')),
'signedPreKey': {
'keyId': bundle.signed_prekey.id,
// <Number>
@ -74653,7 +74653,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
};
return libsignal.KeyHelper.generateIdentityKeyPair().then(identity_keypair => {
data['identity_keypair'] = identity_keypair;
data['identity_key'] = identity_keypair.pubKey;
data['identity_key'] = u.arrayBufferToBase64(identity_keypair.pubKey);
return libsignal.KeyHelper.generateSignedPreKey(identity_keypair, 1);
}).then(signed_prekey => {
_converse.omemo_store.storeSignedPreKey(signed_prekey.keyId, signed_prekey.keyPair);

View File

@ -177,7 +177,7 @@
try {
return sessionBuilder.processPreKey({
'registrationId': parseInt(_converse.omemo_store.get('device_id'), 10),
'identityKey': _converse.omemo_store.get('identity_key'),
'identityKey': u.base64ToArrayBuffer(_converse.omemo_store.get('identity_key')),
'signedPreKey': {
'keyId': bundle.signed_prekey.id, // <Number>
'publicKey': u.base64ToArrayBuffer(bundle.signed_prekey.public_key),
@ -631,7 +631,7 @@
return libsignal.KeyHelper.generateIdentityKeyPair()
.then(identity_keypair => {
data['identity_keypair'] = identity_keypair;
data['identity_key'] = identity_keypair.pubKey;
data['identity_key'] = u.arrayBufferToBase64(identity_keypair.pubKey);
return libsignal.KeyHelper.generateSignedPreKey(identity_keypair, 1);
}).then(signed_prekey => {
_converse.omemo_store.storeSignedPreKey(signed_prekey.keyId, signed_prekey.keyPair);