Skip to content

Commit

Permalink
Try updating windows in memsec
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-garcia committed Sep 24, 2024
1 parent dd37d1d commit 45f3d32
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 81 deletions.
71 changes: 2 additions & 69 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions crates/bitwarden-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ uniffi = { version = "=0.28.1", optional = true }
uuid = { version = ">=1.3.3, <2.0", features = ["serde"] }
zeroize = { version = ">=1.7.0, <2.0", features = ["derive", "aarch64"] }

[target.'cfg(all(not(target_arch = "wasm32"), not(windows)))'.dependencies]
memsec = { version = "0.7.0", features = ["alloc_ext"] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
memsec = { version = "0.7.0", features = [
"alloc_ext",
], git = "https://github.com/dani-garcia/memsec", rev = "3d2e272d284442637bac0a7d94f76883960db7e2" }

[dev-dependencies]
criterion = { version = "0.5.1", features = ["html_reports"] }
Expand Down
12 changes: 2 additions & 10 deletions crates/bitwarden-crypto/src/service/key_store/rust_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ pub(crate) struct RustImplKeyData<Key: KeyRef> {

impl<Key: KeyRef> Drop for RustImplKeyData<Key> {
fn drop(&mut self) {
#[cfg(all(
not(target_arch = "wasm32"),
not(feature = "no-memory-hardening"),
not(windows)
))]
#[cfg(all(not(target_arch = "wasm32"), not(feature = "no-memory-hardening")))]
{
use std::mem::MaybeUninit;

Expand Down Expand Up @@ -54,11 +50,7 @@ impl<Key: KeyRef> KeyData<Key> for RustImplKeyData<Key> {
#[allow(unused_mut)]
let mut data: Box<_> = std::iter::repeat_with(|| None).take(capacity).collect();

#[cfg(all(
not(target_arch = "wasm32"),
not(feature = "no-memory-hardening"),
not(windows)
))]
#[cfg(all(not(target_arch = "wasm32"), not(feature = "no-memory-hardening")))]
{
let entry_size = std::mem::size_of::<Option<(Key, Key::KeyValue)>>();
unsafe {
Expand Down

0 comments on commit 45f3d32

Please sign in to comment.