-
right now I'm trying to build a toy password manager in rust, and I'm using this crate for encrypting the file storing the credentials. I don't know much about rust or crypto so feel free to give additional pointers about making it more secure and stuff. The repo is here: https://github.com/is-ahmed/arustylock The error is happening here where I'm initialising the dir holding the credential data for the first time
and the main thread panics here in the encryption when I call
I've been looking at these possible errors here: https://docs.rs/orion/0.16.0/orion/aead/index.html#errors but I can't seem to figure out which one is happening. Any ideas? Let me know if there's more information you need and thanks in advance! EDIT (July 22. 2022) - Forgot, here's the backtrace I got
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm having a hard time reproducing the error on my machine. Could you provide a series of steps to get to the crypto error from a freshly cloned repo? That said, if I had to guess, I'd bet you're probably passing in an empty buffer to encrypt. EDIT: I got it to reproduce. The created
Also I confirmed that the buffer is empty, which is causing the error. I added dbg!(buffer.is_empty()); on line 10, just before the call to |
Beta Was this translation helpful? Give feedback.
I'm having a hard time reproducing the error on my machine. Could you provide a series of steps to get to the crypto error from a freshly cloned repo?
That said, if I had to guess, I'd bet you're probably passing in an empty buffer to encrypt.
EDIT: I got it to reproduce. The created
$HOME/.arustylock
has to be missing first, so the following command works on a fresh repo to reproduce:Also I confirmed that the buffer is empty, which is causing the error. I added
on line 10, just before the call to
aead::seal
, and it printedtrue
.