replaced cryptofill with webcrypto-liner

This commit is contained in:
Danny Coates 2019-02-21 15:20:28 -08:00
parent 9e919eddb5
commit de88885189
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
8 changed files with 33 additions and 10907 deletions

View file

@ -3,5 +3,4 @@ assets
firefox
coverage
app/locale.js
app/capabilities.js
app/cryptofill.js
app/capabilities.js

View file

@ -1,5 +1,4 @@
dist
android/app/src/main/assets
android/app/build
app/cryptofill.js
coverage

View file

@ -47,7 +47,7 @@ async function checkCrypto() {
} catch (err) {
try {
window.asmCrypto = await import('asmcrypto.js');
await import('./cryptofill');
await import('@dannycoates/webcrypto-liner/build/shim');
return true;
} catch (e) {
return false;

File diff suppressed because it is too large Load diff

View file

@ -28,7 +28,10 @@ if (process.env.NODE_ENV === 'production') {
(async function start() {
const capabilities = await getCapabilities();
if (!capabilities.crypto) {
if (
!capabilities.crypto &&
window.location.pathname !== '/unsupported/crypto'
) {
return window.location.assign('/unsupported/crypto');
}
if (capabilities.serviceWorker) {

19
package-lock.json generated
View file

@ -883,6 +883,17 @@
"integrity": "sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw==",
"dev": true
},
"@dannycoates/webcrypto-liner": {
"version": "0.1.34",
"resolved": "https://registry.npmjs.org/@dannycoates/webcrypto-liner/-/webcrypto-liner-0.1.34.tgz",
"integrity": "sha512-QTP7EIlNkcp3jA5XAHk3uU6q3ZOcXOHRZnmzt+yDPf9dhLa5QR99ooHC8JHrD/J4dwVKuMY995aMCGF+M0g5Cg==",
"dev": true,
"requires": {
"asmcrypto.js": "^0.22.0",
"elliptic": "^6.4.1",
"webcrypto-core": "github:dannycoates/webcrypto-core#8e0152a66d3ae6329cf080ccb3085eb06637070f"
}
},
"@dannycoates/webpack-dev-server": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/@dannycoates/webpack-dev-server/-/webpack-dev-server-3.1.4.tgz",
@ -16659,6 +16670,14 @@
"object.assign": "^4.0.3"
}
},
"webcrypto-core": {
"version": "github:dannycoates/webcrypto-core#8e0152a66d3ae6329cf080ccb3085eb06637070f",
"from": "github:dannycoates/webcrypto-core",
"dev": true,
"requires": {
"tslib": "^1.7.1"
}
},
"webdriverio": {
"version": "4.14.2",
"resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-4.14.2.tgz",

View file

@ -64,6 +64,7 @@
"@babel/plugin-proposal-class-properties": "^7.3.3",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/preset-env": "^7.3.1",
"@dannycoates/webcrypto-liner": "^0.1.34",
"@dannycoates/webpack-dev-server": "^3.1.4",
"@fullhuman/postcss-purgecss": "^1.1.0",
"@mattiasbuelens/web-streams-polyfill": "0.2.1",

View file

@ -97,6 +97,10 @@ const web = {
path.resolve(__dirname, 'common'),
// some dependencies need to get re-babeled because we
// have different targets than their default configs
path.resolve(
__dirname,
'node_modules/@dannycoates/webcrypto-liner'
),
path.resolve(__dirname, 'node_modules/fluent'),
path.resolve(__dirname, 'node_modules/fluent-intl-polyfill'),
path.resolve(__dirname, 'node_modules/intl-pluralrules')
@ -108,7 +112,9 @@ const web = {
include: [path.resolve(__dirname, 'node_modules')],
exclude: [
path.resolve(__dirname, 'node_modules/crc'),
path.resolve(__dirname, 'node_modules/fluent')
path.resolve(__dirname, 'node_modules/fluent'),
path.resolve(__dirname, 'node_modules/tslib'),
path.resolve(__dirname, 'node_modules/webcrypto-core')
],
loader: 'webpack-unassert-loader'
}