Skip to content

Commit 6d34255

Browse files
committed
chore: fix breaking changes from getrandom
1 parent 0ddb5e5 commit 6d34255

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/crypto/cryptography.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn argon_derive_key(password_bytes: &[u8], salt: &[u8]) -> color_eyre::Resul
2626

2727
pub fn gen_salt() -> color_eyre::Result<[u8; ARGON2ID_SALT_LENGTH]> {
2828
let mut salt: [u8; ARGON2ID_SALT_LENGTH] = [0; ARGON2ID_SALT_LENGTH];
29-
getrandom::fill(&mut salt).map_err(ErrReport::from)?;
29+
getrandom::fill(&mut salt).map_err(|e| eyre!(e))?;
3030
Ok(salt)
3131
}
3232

@@ -41,7 +41,7 @@ pub fn encrypt_string_with_key(
4141
let mut nonce_bytes: [u8; XCHACHA20_POLY1305_NONCE_LENGTH] =
4242
[0; XCHACHA20_POLY1305_NONCE_LENGTH];
4343

44-
getrandom::fill(&mut nonce_bytes).map_err(ErrReport::from)?;
44+
getrandom::fill(&mut nonce_bytes).map_err(|e| eyre!(e))?;
4545

4646
let nonce = XNonce::from_slice(&nonce_bytes);
4747
let cipher_text = aead

0 commit comments

Comments
 (0)