Move Base64 functions to their own file

Remove Base64 string functions from helpers.js

Rename Base64 string functions

Removed unused functions from stringview.js
This commit is contained in:
Daniel Reichert
2014-11-22 20:36:57 -08:00
committed by lilia
parent ee0d7edc0b
commit db5683a69d
4 changed files with 84 additions and 80 deletions

View File

@@ -192,12 +192,12 @@ window.textsecure.api = function () {
urlParameters : "/" + number + "/" + deviceId,
}).then(function(res) {
var promises = [];
res.identityKey = base64DecToArr(res.identityKey);
res.identityKey = StringView.base64ToBytes(res.identityKey);
for (var i = 0; i < res.devices.length; i++) {
res.devices[i].signedPreKey.publicKey = base64DecToArr(res.devices[i].signedPreKey.publicKey);
res.devices[i].signedPreKey.signature = base64DecToArr(res.devices[i].signedPreKey.signature);
res.devices[i].signedPreKey.publicKey = StringView.base64ToBytes(res.devices[i].signedPreKey.publicKey);
res.devices[i].signedPreKey.signature = StringView.base64ToBytes(res.devices[i].signedPreKey.signature);
promises[i] = window.textsecure.crypto.Ed25519Verify(res.identityKey, res.devices[i].signedPreKey.publicKey, res.devices[i].signedPreKey.signature);
res.devices[i].preKey.publicKey = base64DecToArr(res.devices[i].preKey.publicKey);
res.devices[i].preKey.publicKey = StringView.base64ToBytes(res.devices[i].preKey.publicKey);
//TODO: Is this still needed?
//if (res.devices[i].keyId === undefined)
// res.devices[i].keyId = 0;