From a9539965c2bad5dc79fd4f6cc72e7c6c3fd62c6ea6d9ff105a1fb0f601d50fe2 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 8 Mar 2024 19:03:04 +0000 Subject: [PATCH] Accepting request 1156446 from home:dziobian:gulgul-ultron:19 - New upstream release 2024.2.1 * Fix issues with clipboard under Wayland - Drop half of use-node-argon2.patch which was applied upstream and rename the rest as remove-argon2-browser.patch OBS-URL: https://build.opensuse.org/request/show/1156446 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/bitwarden?expand=0&rev=48 --- _service | 4 +- bitwarden-2024.2.0.obscpio | 3 - bitwarden-2024.2.1.obscpio | 3 + bitwarden.changes | 7 ++ bitwarden.obsinfo | 6 +- bitwarden.spec | 14 ++- no-sourcemaps.patch | 6 +- node-vendor.tar.zst | 4 +- prepare-node-vendor.sh | 2 +- remove-argon2-browser.patch | 65 +++++++++++ remove-esbuild-version-check.patch | 4 +- remove-unnecessary-deps.patch | 105 +++++++++--------- use-node-argon2.patch | 169 ----------------------------- vendor.tar.zst | 4 +- 14 files changed, 155 insertions(+), 241 deletions(-) delete mode 100644 bitwarden-2024.2.0.obscpio create mode 100644 bitwarden-2024.2.1.obscpio create mode 100644 remove-argon2-browser.patch delete mode 100644 use-node-argon2.patch diff --git a/_service b/_service index ea46725..eef3023 100644 --- a/_service +++ b/_service @@ -2,8 +2,8 @@ git https://github.com/bitwarden/clients.git - desktop-v2024.2.0 - 2024.2.0 + desktop-v2024.2.1 + 2024.2.1 bitwarden bitwarden_license/* diff --git a/bitwarden-2024.2.0.obscpio b/bitwarden-2024.2.0.obscpio deleted file mode 100644 index b5d55b7..0000000 --- a/bitwarden-2024.2.0.obscpio +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d005b75495d36831cb63857085b2d85326b083facdfbd00d0d5b5d28b04ac6eb -size 388199950 diff --git a/bitwarden-2024.2.1.obscpio b/bitwarden-2024.2.1.obscpio new file mode 100644 index 0000000..41f5a91 --- /dev/null +++ b/bitwarden-2024.2.1.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6729f1a209f8f6ea1fa473e9b0ba2921879e71dbae54d769e4a7fa41a2b1d7b +size 35164685 diff --git a/bitwarden.changes b/bitwarden.changes index 33f28a6..0c9e0fd 100644 --- a/bitwarden.changes +++ b/bitwarden.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Mar 8 19:00:48 UTC 2024 - Bruno Pitrus + +- New upstream release 2024.2.1 + * Fix issues with clipboard under Wayland +- Drop half of use-node-argon2.patch which was applied upstream and rename the rest as remove-argon2-browser.patch + ------------------------------------------------------------------- Wed Feb 7 20:35:34 UTC 2024 - Bruno Pitrus diff --git a/bitwarden.obsinfo b/bitwarden.obsinfo index 959a6b8..51f75ee 100644 --- a/bitwarden.obsinfo +++ b/bitwarden.obsinfo @@ -1,4 +1,4 @@ name: bitwarden -version: 2024.2.0 -mtime: 1707163990 -commit: f9f85dcb39f768bd516521ffba8b2ff74e4a70ed +version: 2024.2.1 +mtime: 1709757071 +commit: 82998d8e515b1dab0b3891170e56bf15ffc69446 diff --git a/bitwarden.spec b/bitwarden.spec index bb83010..6db4dd5 100644 --- a/bitwarden.spec +++ b/bitwarden.spec @@ -18,7 +18,7 @@ # Name: bitwarden -Version: 2024.2.0 +Version: 2024.2.1 Release: 0 Summary: A secure and free password manager for all of your devices Group: Productivity/Security @@ -55,7 +55,7 @@ Patch0: remove-unnecessary-deps.patch Patch1: fix-desktop-file.patch Patch3: do-not-install-font-privately.patch Patch4: desktop_native-rust-arch.patch -Patch5: use-node-argon2.patch +Patch5: remove-argon2-browser.patch Patch6: argon2-binary-path.patch Patch7: bug-reporting-url.patch Patch8: no-sourcemaps.patch @@ -91,6 +91,7 @@ BuildRequires: cargo-auditable BuildRequires: fdupes BuildRequires: fontpackages-devel BuildRequires: hicolor-icon-theme +BuildRequires: jq %if 0%{?suse_version} BuildRequires: nodejs-packaging %endif @@ -102,6 +103,7 @@ BuildRequires: zstd BuildRequires: gcc-c++ BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(libsecret-1) +BuildRequires: pkgconfig(wayland-protocols) Requires: (google-opensans-fonts or open-sans-fonts) Requires: nodejs-electron%{_isa} @@ -140,6 +142,14 @@ mkdir %{_builddir}/cargo #Rust config cd apps/desktop/desktop_native tar --zstd -xf %SOURCE4 +rm -rf vendor/wayland-protocols/protocols +ln -svT /usr/share/wayland-protocols vendor/wayland-protocols/protocols +# https://blogs.gnome.org/mcatanzaro/2020/05/18/patching-vendored-rust-dependencies/ +for i in wayland-protocols; do +pushd vendor/$i +jq -cj '.files={}' .cargo-checksum.json >tmp && mv tmp .cargo-checksum.json && popd +done + # Make `node` and `npm` binaries refer to Electron %if 0%{?suse_version} diff --git a/no-sourcemaps.patch b/no-sourcemaps.patch index 2c7e905..0c782c8 100644 --- a/no-sourcemaps.patch +++ b/no-sourcemaps.patch @@ -17,9 +17,9 @@ mode: NODE_ENV, - devtool: "source-map", + devtool: false, - // TODO: Replace this with web. - // target: "web", - target: "electron-renderer", + target: "web", + node: { + __dirname: false, @@ -138,7 +138,7 @@ new AngularWebpackPlugin({ tsConfigPath: "tsconfig.renderer.json", diff --git a/node-vendor.tar.zst b/node-vendor.tar.zst index 5581d8a..aa797ee 100644 --- a/node-vendor.tar.zst +++ b/node-vendor.tar.zst @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:39950e174fedf893cb2e8c71ef473d327ba8c656d35614d2327ce33a28ef2314 -size 37793725 +oid sha256:04d4668b2e7d9503b3464c1e27916ddb3175f09eddb50d64d378064784197a24 +size 35254045 diff --git a/prepare-node-vendor.sh b/prepare-node-vendor.sh index 0e899df..bc103ad 100644 --- a/prepare-node-vendor.sh +++ b/prepare-node-vendor.sh @@ -1,4 +1,4 @@ -#!/bin/sh -eu +#!/bin/sh -eux # dnf install curl gzip jq npm patch tar wget diff --git a/remove-argon2-browser.patch b/remove-argon2-browser.patch new file mode 100644 index 0000000..bdb57a4 --- /dev/null +++ b/remove-argon2-browser.patch @@ -0,0 +1,65 @@ +Remove dependency on argon-browser2 which should be dead code after https://github.com/bitwarden/clients/commit/996823169a5134da56c0e08f6e83a01e64164774 +We used to path this to use node_modules/argon2 but cannot anymore due to sandbox now being enabled; fortunately, upstream at the same time moved the crypto to main process. +Therefore the WASM implementation in web-crypto-function should be dead code now and can be removed because we do not want to compile WASM. + +--- bitwarden/apps/desktop/webpack.renderer.js.old 2023-02-15 19:02:44.000000000 +0100 ++++ bitwarden/apps/desktop/webpack.renderer.js 2023-02-18 18:41:53.074156675 +0100 +@@ -40,11 +40,6 @@ + }, + type: "asset/resource", + }, +- { +- test: /\.wasm$/, +- loader: "base64-loader", +- type: "javascript/auto", +- }, + ], + }, + plugins: [], +@@ -127,11 +122,6 @@ + test: /[\/\\]@angular[\/\\].+\.js$/, + parser: { system: true }, + }, +- { +- test: /\.wasm$/, +- loader: "base64-loader", +- type: "javascript/auto", +- }, + ], + }, + plugins: [ +--- a/libs/common/src/platform/services/web-crypto-function.service.ts ++++ b/libs/common/src/platform/services/web-crypto-function.service.ts +@@ -1,4 +1,3 @@ +-import * as argon2 from "argon2-browser"; + import * as forge from "node-forge"; + + import { Utils } from "../../platform/misc/utils"; +@@ -54,24 +53,9 @@ export class WebCryptoFunctionService implements CryptoFunctionService { + memory: number, + parallelism: number, + ): Promise { +- if (!this.wasmSupported) { +- throw "Webassembly support is required for the Argon2 KDF feature."; +- } +- +- const passwordArr = new Uint8Array(this.toBuf(password)); +- const saltArr = new Uint8Array(this.toBuf(salt)); +- +- const result = await argon2.hash({ +- pass: passwordArr, +- salt: saltArr, +- time: iterations, +- mem: memory, +- parallelism: parallelism, +- hashLen: 32, +- type: argon2.ArgonType.Argon2id, +- }); +- argon2.unloadRuntime(); +- return result.hash; ++ const err="This should be unreachable dead code. If you're seeing this message, please report a bug to openSUSE maintainers because we must have made a mistake when patching." ++ alert(err) ++ throw err + } + + async hkdf( diff --git a/remove-esbuild-version-check.patch b/remove-esbuild-version-check.patch index 8b4d29d..b861e04 100644 --- a/remove-esbuild-version-check.patch +++ b/remove-esbuild-version-check.patch @@ -4,8 +4,8 @@ } throw err; } -- if (stdout !== "0.17.8") { +- if (stdout !== versionFromPackageJSON) { + if (0) { - throw new Error(`Expected ${JSON.stringify("0.17.8")} but got ${JSON.stringify(stdout)}`); + throw new Error(`Expected ${JSON.stringify(versionFromPackageJSON)} but got ${JSON.stringify(stdout)}`); } } diff --git a/remove-unnecessary-deps.patch b/remove-unnecessary-deps.patch index b9facc5..57dbc4f 100644 --- a/remove-unnecessary-deps.patch +++ b/remove-unnecessary-deps.patch @@ -1,12 +1,12 @@ -@types/semver is normally included transitively by storybook which we delete, adding it here explicitely because it is needed for build +@types/semver and path-browserify is normally included transitively by storybook which we delete, adding it here explicitely because it is needed for build ---- clients/package.json.orig 2024-01-10 19:25:17.240793950 +0100 -+++ clients/package.json 2024-01-10 19:27:21.476208838 +0100 +--- clients/package.json.orig 2024-03-07 21:37:44.692428174 +0100 ++++ clients/package.json 2024-03-07 21:40:28.774422025 +0100 @@ -13,7 +13,6 @@ }, "homepage": "https://bitwarden.com", "scripts": { -- "prepare": "husky install", +- "prepare": "husky", "lint": "eslint . --cache --cache-strategy content && prettier --check .", "lint:fix": "eslint . --cache --cache-strategy content --fix", "lint:clear": "rimraf .eslintcache", @@ -19,27 +19,27 @@ }, "workspaces": [ "apps/*", -@@ -35,119 +34,44 @@ +@@ -35,118 +34,45 @@ ], "devDependencies": { - "@angular-devkit/build-angular": "15.2.10", -- "@angular-eslint/eslint-plugin": "15.2.1", -- "@angular-eslint/eslint-plugin-template": "15.2.1", -- "@angular-eslint/template-parser": "15.2.1", -- "@angular/cli": "15.2.10", - "@angular/compiler-cli": "15.2.10", -- "@angular/elements": "15.2.10", + "@angular-devkit/build-angular": "16.2.11", +- "@angular-eslint/eslint-plugin": "16.3.1", +- "@angular-eslint/eslint-plugin-template": "16.3.1", +- "@angular-eslint/template-parser": "16.3.1", +- "@angular/cli": "16.2.11", + "@angular/compiler-cli": "16.2.12", +- "@angular/elements": "16.2.12", - "@compodoc/compodoc": "1.1.23", -- "@electron/notarize": "2.2.0", -- "@electron/rebuild": "3.5.0", - "@ngtools/webpack": "15.2.10", -- "@storybook/addon-a11y": "7.6.4", -- "@storybook/addon-actions": "7.6.4", -- "@storybook/addon-designs": "7.0.7", -- "@storybook/addon-essentials": "7.6.4", -- "@storybook/addon-links": "7.6.4", -- "@storybook/angular": "7.6.4", -- "@storybook/addon-interactions": "7.6.4", +- "@electron/notarize": "2.3.0", +- "@electron/rebuild": "3.6.0", + "@ngtools/webpack": "16.2.11", +- "@storybook/addon-a11y": "7.6.17", +- "@storybook/addon-actions": "7.6.17", +- "@storybook/addon-designs": "7.0.9", +- "@storybook/addon-essentials": "7.6.17", +- "@storybook/addon-interactions": "7.6.17", +- "@storybook/addon-links": "7.6.17", +- "@storybook/angular": "7.6.17", - "@storybook/jest": "0.2.3", - "@storybook/testing-library": "0.2.2", - "@types/argon2-browser": "1.18.1", @@ -47,7 +47,7 @@ "@types/duo_web_sdk": "2.7.1", - "@types/firefox-webext-browser": "111.0.1", - "@types/inquirer": "8.2.6", - "@types/jest": "29.5.11", + "@types/jest": "29.5.12", - "@types/jquery": "3.5.29", - "@types/jsdom": "21.1.6", - "@types/koa": "2.14.0", @@ -57,34 +57,33 @@ - "@types/koa-json": "2.0.23", - "@types/lowdb": "1.0.11", "@types/lunr": "2.3.7", - "@types/node": "18.19.2", + "@types/node": "18.19.14", - "@types/node-fetch": "2.6.4", - "@types/node-forge": "1.3.10", + "@types/node-forge": "1.3.11", "@types/node-ipc": "9.2.0", "@types/papaparse": "5.3.14", - "@types/proper-lockfile": "4.1.2", - "@types/react": "16.14.54", -- "@types/retry": "0.12.2", +- "@types/retry": "0.12.5", + "@types/semver": "^7.3.4", "@types/zxcvbn": "4.4.4", -- "@typescript-eslint/eslint-plugin": "6.19.1", -- "@typescript-eslint/parser": "6.19.1", +- "@typescript-eslint/eslint-plugin": "6.21.0", +- "@typescript-eslint/parser": "6.21.0", - "@webcomponents/custom-elements": "1.6.0", "autoprefixer": "10.4.16", - "base64-loader": "1.0.0", - "buffer": "6.0.3", - "chromatic": "10.0.0", "clean-webpack-plugin": "4.0.0", "concurrently": "8.2.2", "copy-webpack-plugin": "11.0.0", "cross-env": "7.0.3", "css-loader": "6.8.1", - "electron": "28.1.3", -- "electron-builder": "23.6.0", + "electron": "28.2.4", +- "electron-builder": "24.9.1", "electron-log": "5.0.1", - "electron-reload": "2.0.0-alpha.1", "electron-store": "8.1.0", - "electron-updater": "6.1.7", + "electron-updater": "6.1.8", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-import-resolver-typescript": "3.6.1", @@ -102,13 +101,14 @@ "html-loader": "4.2.0", - "html-webpack-injector": "1.1.4", "html-webpack-plugin": "5.5.4", -- "husky": "8.0.3", +- "husky": "9.0.10", - "jest-junit": "16.0.0", "jest-mock-extended": "3.0.5", -- "jest-preset-angular": "14.0.0", -- "lint-staged": "15.2.0", +- "jest-preset-angular": "14.0.2", +- "lint-staged": "15.2.2", "mini-css-extract-plugin": "2.7.6", "node-ipc": "9.2.1", ++ "path-browserify": "^1.0.1", - "pkg": "5.8.1", "postcss": "8.4.32", "postcss-loader": "7.3.3", @@ -122,15 +122,15 @@ "rimraf": "5.0.5", "sass": "1.69.5", "sass-loader": "13.3.2", -- "storybook": "7.6.4", +- "storybook": "7.6.17", - "style-loader": "3.3.3", - "tailwindcss": "3.3.5", - "ts-jest": "29.1.2", "ts-loader": "9.5.1", "tsconfig-paths-webpack-plugin": "4.1.0", - "type-fest": "2.19.0", - "typescript": "4.9.5", -- "url": "0.11.3", + "typescript": "5.1.6", + "url": "0.11.3", - "util": "0.12.5", - "wait-on": "7.2.0", "webpack": "5.89.0", @@ -140,24 +140,25 @@ + "webpack-cli": "5.1.4" }, "dependencies": { - "@angular/animations": "15.2.10", -@@ -159,55 +82,28 @@ - "@angular/platform-browser": "15.2.10", - "@angular/platform-browser-dynamic": "15.2.10", - "@angular/router": "15.2.10", + "@angular/animations": "16.2.12", +@@ -158,56 +84,29 @@ + "@angular/platform-browser": "16.2.12", + "@angular/platform-browser-dynamic": "16.2.12", + "@angular/router": "16.2.12", - "@koa/multer": "3.0.2", - "@koa/router": "12.0.1", - "@microsoft/signalr": "6.0.25", - "@microsoft/signalr-protocol-msgpack": "6.0.25", - "@ng-select/ng-select": "10.0.4", + "@microsoft/signalr": "8.0.0", + "@microsoft/signalr-protocol-msgpack": "8.0.0", + "@ng-select/ng-select": "11.2.0", "argon2": "0.31.0", - "argon2-browser": "1.18.0", "big-integer": "1.6.51", - "bootstrap": "4.6.0", - "braintree-web-drop-in": "1.42.0", + "buffer": "6.0.3", - "bufferutil": "4.0.8", - "chalk": "4.1.2", - "commander": "7.2.0", + "commander": "11.1.0", - "core-js": "3.34.0", "duo_web_sdk": "github:duosecurity/duo_web_sdk", - "form-data": "4.0.0", @@ -172,8 +173,8 @@ - "lowdb": "1.0.0", "lunr": "2.3.9", - "multer": "1.4.5-lts.1", -- "ngx-infinite-scroll": "15.0.0", - "ngx-toastr": "16.2.0", +- "ngx-infinite-scroll": "16.0.0", + "ngx-toastr": "17.0.2", "node-fetch": "2.6.12", "node-forge": "1.3.1", "nord": "0.2.1", @@ -187,15 +188,15 @@ - "qrious": "4.0.2", "rxjs": "7.8.1", - "tabbable": "6.2.0", - "tldts": "6.1.2", + "tldts": "6.1.8", "utf-8-validate": "6.0.3", - "zone.js": "0.12.0", + "zone.js": "0.13.3", "zxcvbn": "4.4.2" }, "overrides": { - "tailwindcss": "$tailwindcss", "@storybook/angular": { - "zone.js": "0.12.0" + "zone.js": "$zone.js" }, --- a/apps/desktop/desktop_native/package.json +++ b/apps/desktop/desktop_native/package.json diff --git a/use-node-argon2.patch b/use-node-argon2.patch deleted file mode 100644 index 5277414..0000000 --- a/use-node-argon2.patch +++ /dev/null @@ -1,169 +0,0 @@ -Use node-argon2 instead of browser-argon2 as the second needs webassembly/emscripten to compile and does not have source included in the tarball, while the first allows use to use the already installed system libargon2 - ---- bitwarden/apps/desktop/webpack.main.js.old 2023-02-15 19:02:44.000000000 +0100 -+++ bitwarden/apps/desktop/webpack.main.js 2023-02-18 18:42:54.917063925 +0100 -@@ -73,8 +73,6 @@ - "./src/package.json", - { from: "./src/images", to: "images" }, - { from: "./src/locales", to: "locales" }, -- "../../node_modules/argon2-browser/dist/argon2.wasm", -- "../../node_modules/argon2-browser/dist/argon2-simd.wasm", - ], - }), - new EnvironmentPlugin({ -@@ -84,6 +83,8 @@ - externals: { - "electron-reload": "commonjs2 electron-reload", - "@bitwarden/desktop-native": "commonjs2 @bitwarden/desktop-native", -+ "argon2": "commonjs2 argon2", -+ "@phc/format": "commonjs2 @phc/format", - }, - }; - ---- bitwarden/apps/desktop/webpack.renderer.js.old 2023-02-15 19:02:44.000000000 +0100 -+++ bitwarden/apps/desktop/webpack.renderer.js 2023-02-18 18:41:53.074156675 +0100 -@@ -40,11 +40,6 @@ - }, - type: "asset/resource", - }, -- { -- test: /\.wasm$/, -- loader: "base64-loader", -- type: "javascript/auto", -- }, - ], - }, - plugins: [], -@@ -127,11 +122,6 @@ - test: /[\/\\]@angular[\/\\].+\.js$/, - parser: { system: true }, - }, -- { -- test: /\.wasm$/, -- loader: "base64-loader", -- type: "javascript/auto", -- }, - ], - }, - plugins: [ -@@ -162,6 +152,10 @@ - DEV_FLAGS: NODE_ENV === "development" ? envConfig.devFlags : {}, - }), - ], -+ externals: { -+ "argon2": "commonjs2 argon2", -+ "@phc/format": "commonjs2 @phc/format", -+ }, - }; - - module.exports = merge(common, renderer); ---- bitwarden/apps/desktop/src/package.json.old 2023-02-15 19:02:44.000000000 +0100 -+++ bitwarden/apps/desktop/src/package.json 2023-02-18 18:54:55.213046618 +0100 -@@ -12,6 +12,7 @@ - "url": "git+https://github.com/bitwarden/clients.git" - }, - "dependencies": { -+ "argon2": "^0.30.3", - "@bitwarden/desktop-native": "file:../desktop_native" - } - } ---- bitwarden/libs/common/src/platform/services/web-crypto-function.service.ts.old 2023-02-15 19:02:44.000000000 +0100 -+++ bitwarden/libs/common/src/platform/services/web-crypto-function.service.ts 2023-02-18 18:52:00.173567051 +0100 -@@ -1,4 +1,4 @@ --import * as argon2 from "argon2-browser"; -+import * as argon2 from "argon2"; - import * as forge from "node-forge"; - - import { Utils } from "../../platform/misc/utils"; -@@ -10,13 +10,11 @@ import { SymmetricCryptoKey } from "../m - export class WebCryptoFunctionService implements CryptoFunctionService { - private crypto: Crypto; - private subtle: SubtleCrypto; -- private wasmSupported: boolean; - - constructor(win: Window | typeof global) { - this.crypto = typeof win.crypto !== "undefined" ? win.crypto : null; - this.subtle = - !!this.crypto && typeof win.crypto.subtle !== "undefined" ? win.crypto.subtle : null; -- this.wasmSupported = this.checkIfWasmSupported(); - } - - async pbkdf2( -@@ -54,24 +52,19 @@ export class WebCryptoFunctionService im - memory: number, - parallelism: number, - ): Promise { -- if (!this.wasmSupported) { -- throw "Webassembly support is required for the Argon2 KDF feature."; -- } -- -- const passwordArr = new Uint8Array(this.toBuf(password)); -- const saltArr = new Uint8Array(this.toBuf(salt)); -+ const nodePassword = this.toNodeValue(password); -+ const nodeSalt = this.toNodeBuffer(this.toUint8Buffer(salt)); - -- const result = await argon2.hash({ -- pass: passwordArr, -- salt: saltArr, -- time: iterations, -- mem: memory, -+ const hash = await argon2.hash(nodePassword, { -+ salt: nodeSalt, -+ raw: true, -+ hashLength: 32, -+ timeCost: iterations, -+ memoryCost: memory, - parallelism: parallelism, -- hashLen: 32, -- type: argon2.ArgonType.Argon2id, -+ type: argon2.argon2id, - }); -- argon2.unloadRuntime(); -- return result.hash; -+ return this.toUint8Buffer(hash); - } - - async hkdf( -@@ -435,20 +428,28 @@ export class WebCryptoFunctionService im - return mode === "cbc" ? "AES-CBC" : "AES-ECB"; - } - -- // ref: https://stackoverflow.com/a/47880734/1090359 -- private checkIfWasmSupported(): boolean { -- try { -- if (typeof WebAssembly === "object" && typeof WebAssembly.instantiate === "function") { -- const module = new WebAssembly.Module( -- Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00), -- ); -- if (module instanceof WebAssembly.Module) { -- return new WebAssembly.Instance(module) instanceof WebAssembly.Instance; -- } -- } -- } catch { -- return false; -+// from libs/node/src/services/node-crypto-function.service.ts -+ private toNodeValue(value: string | Uint8Array): string | Buffer { -+ let nodeValue: string | Buffer; -+ if (typeof value === "string") { -+ nodeValue = value; -+ } else { -+ nodeValue = this.toNodeBuffer(value); - } -- return false; -+ return nodeValue; -+ } -+ -+ private toNodeBuffer(value: Uint8Array): Buffer { -+ return Buffer.from(value); -+ } -+ -+ private toUint8Buffer(value: Buffer | string | Uint8Array): Uint8Array { -+ let buf: Uint8Array; -+ if (typeof value === "string") { -+ buf = Utils.fromUtf8ToArray(value); -+ } else { -+ buf = value; -+ } -+ return buf; - } - } diff --git a/vendor.tar.zst b/vendor.tar.zst index 522a770..9e0c6cb 100644 --- a/vendor.tar.zst +++ b/vendor.tar.zst @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2a964f77f1449694a36ab766de7d0ae1dff7d4d169bcfc9509ab4d653f6dc4ab -size 25811826 +oid sha256:821d2b54e1051ddae3369829134c88ebb87dcb9845df51fc4316c637f42b963a +size 29023854