[stronghold] v1 - Illegal non-contiguous size
I'm trying to use the stronghold plugin but for some reason an error shows up in the console when trying to initialize it. I'm using SvelteKit.
main.rs
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use argon2::{
password_hash::{rand_core::OsRng, SaltString},
Argon2, PasswordHasher,
};
fn main() {
tauri::Builder::default()
.plugin(
tauri_plugin_stronghold::Builder::new(|password| {
let salt = SaltString::generate(&mut OsRng);
let argon2 = Argon2::default();
argon2
.hash_password(password.as_bytes(), &salt)
.unwrap()
.to_string()
.as_bytes()
.to_vec()
})
.build(),
)
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
+page.svelte
<script lang="ts">
import { Stronghold } from 'tauri-plugin-stronghold-api';
let strongholdPath = '~/data.stronghold';
let password = 'Password123';
Stronghold.load(strongholdPath, password)
.then((r) => console.log(r))
.catch((e) => console.error(e));
</script>
When run I get Illegal non-contiguous size error in the console.
I'm using:
tauri = { version = "1.5.2", features = [] }
tauri-plugin-stronghold = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
argon2 = "0.5.2"
"@sveltejs/kit": "^1.20.4",
"tauri-plugin-stronghold-api": "https://github.com/tauri-apps/tauri-plugin-stronghold#v1"
I get the same thing.. Tried using Argon2, Bcrypt and plain strings.. Always the same error.. Think there's an incompatibility between the plugin and the underlying Stronghold package.
Same here. Anyone got a solution to this?
Same thing here, is someone looking into this?
Using tauri_plugin_stronghold::Builder::with_argon2 fixed it for me.
This fixed it https://v2.tauri.app/plugin/stronghold/#initialize-with-argon2-password-hash-function
Using
tauri_plugin_stronghold::Builder::with_argon2fixed it for me.
this worked for me
https://github.com/tauri-apps/plugins-workspace/issues/3494