Skip to content

Commit f28b4ef

Browse files
authored
Apply pkcs5 patch to all targets (#211)
## 🎟️ Tracking https://bitwarden.slack.com/archives/C054ZQSBS49/p1744512151239539 ## 📔 Objective The pkcs5 patch was leaking into the cargo.lock file. This PR makes the dependency override for all build targets instead of only for WASM. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes
1 parent ad572b2 commit f28b4ef

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ wasm-bindgen = { version = ">=0.2.91, <0.3", features = ["serde-serialize"] }
6464
js-sys = { version = ">=0.3.72, <0.4" }
6565
wasm-bindgen-futures = "0.4.41"
6666

67+
# There is an incompatibility when using pkcs5 and chacha20 on wasm builds. This can be removed once a new
68+
# rustcrypto-formats crate version is released since the fix has been upstreamed.
69+
# https://github.com/RustCrypto/formats/pull/1625
70+
[patch.crates-io]
71+
pkcs5 = { git = "https://github.com/bitwarden/rustcrypto-formats.git", rev = "2b27c63034217dd126bbf5ed874da51b84f8c705" }
72+
6773
[workspace.lints.clippy]
6874
unused_async = "deny"
6975
unwrap_used = "deny"

crates/bitwarden-wasm-internal/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fi
2525
# Note that this requirest build-std which is an unstable feature,
2626
# this normally requires a nightly build, but we can also use the
2727
# RUSTC_BOOTSTRAP hack to use the same stable version as the normal build
28-
RUSTFLAGS=-Ctarget-cpu=mvp RUSTC_BOOTSTRAP=1 cargo build -p bitwarden-wasm-internal -Zbuild-std=panic_abort,std --target wasm32-unknown-unknown ${RELEASE_FLAG} --config 'patch.crates-io.pkcs5.git="https://github.com/bitwarden/rustcrypto-formats.git"' --config 'patch.crates-io.pkcs5.rev="2b27c63034217dd126bbf5ed874da51b84f8c705"'
28+
RUSTFLAGS=-Ctarget-cpu=mvp RUSTC_BOOTSTRAP=1 cargo build -p bitwarden-wasm-internal -Zbuild-std=panic_abort,std --target wasm32-unknown-unknown ${RELEASE_FLAG}
2929
wasm-bindgen --target bundler --out-dir crates/bitwarden-wasm-internal/npm ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bitwarden_wasm_internal.wasm
3030
wasm-bindgen --target nodejs --out-dir crates/bitwarden-wasm-internal/npm/node ./target/wasm32-unknown-unknown/${BUILD_FOLDER}/bitwarden_wasm_internal.wasm
3131

0 commit comments

Comments
 (0)