switching to client side libraries for key generation, remove legacy browser support

This commit is contained in:
El RIDO 2018-08-04 22:30:01 +02:00
parent c9a3bb08ee
commit 6f25d651b7
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
17 changed files with 67 additions and 146 deletions

View file

@ -161,28 +161,14 @@ describe('CryptTool', function () {
);
});
describe('isEntropyReady & addEntropySeedListener', function () {
it(
'lets us know that enough entropy is collected or make us wait for it',
function(done) {
if ($.PrivateBin.CryptTool.isEntropyReady()) {
done();
} else {
$.PrivateBin.CryptTool.addEntropySeedListener(function() {
done();
});
}
}
);
});
describe('getSymmetricKey', function () {
var keys = [];
// the parameter is used to ensure the test is run more then one time
jsc.property(
'returns random, non-empty keys',
function() {
'integer',
function(counter) {
var key = $.PrivateBin.CryptTool.getSymmetricKey(),
result = (key !== '' && keys.indexOf(key) === -1);
keys.push(key);
@ -198,8 +184,11 @@ describe('CryptTool', function () {
function(string) {
var base64 = Base64.toBase64(string),
sjcl = global.sjcl.codec.base64.fromBits(global.sjcl.codec.utf8String.toBits(string)),
abab = window.btoa(Base64.utob(string));
return base64 === sjcl && sjcl === abab;
abab = window.btoa(Base64.utob(string)),
esab46 = Base64.fromBase64(sjcl),
lcjs = global.sjcl.codec.utf8String.fromBits(global.sjcl.codec.base64.toBits(abab)),
baba = Base64.btou(window.atob(base64));
return base64 === sjcl && sjcl === abab && string === esab46 && esab46 === lcjs && lcjs === baba;
}
);
});