Closed Susurrus closed 3 years ago
Thanks for the report @Susurrus ! Testing the file with itself is a great suggestion for future bug reports actually 🙂
Do you think wrapping the call to the underlying keepass
library with std::panic::catch_unwind might help?
Posting an issue upstream would make sense anyways as it should fail and tell the error instead of failing with a panic.
Do you think wrapping the call to the underlying keepass library with std::panic::catch_unwind might help?
It might help in this situation, though it doesn't look like it should be used for this specific situation, where an underlying library may panic. It looks like it's more designed to prevent panics in Rust from causing issues in other languages that might be calling into it. I think the right answer here is to resolve this within keepass
. Maybe it'd be sufficient to document in the README that if the backtrace looks like it's in the keepass
library, to file a bug directly with them?
I'll file a bug with upstream and see what they say.
Opened sseemayer/keepass-rs#32
I just compared them and it didn't crash:
❯ cargo run -- ~/Downloads/test2.kdbx ~/Downloads/Test1.kdbx
Finished dev [unoptimized + debuginfo] target(s) in 0.18s
Running `target/debug/keepass-diff /home/susurrus/Downloads/test2.kdbx /home/susurrus/Downloads/Test1.kdbx`
Password for file /home/susurrus/Downloads/test2.kdbx:
Password for file /home/susurrus/Downloads/Test1.kdbx:
+ [Root, Test1]
- [Root, Test2]
On Sun, May 2, 2021, at 4:32 AM, Niels wrote:
I removed rust on my pc, so it's difficult to test again. But on mac I get a message that complains abut the format. Can you compare the both 2 files? test.zip https://github.com/Narigo/keepass-diff/files/6411217/test.zip The password is
geheim
.— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Narigo/keepass-diff/issues/32#issuecomment-830794860, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABSMG6S5IHVRPLONIKOTODTLUZ4XANCNFSM42NCY3CQ.
I just tried to reproduce this today using my own databased and everything worked fine. I wonder if this was an error introduced by KeepassDX that was fixed in an update and since I've opened and resaved the "corrupted" one, it was fixed automatically. Anyways, since I can't reproduce this, going ahead and closing it.
First off, love that this tool exists! I use syncthing and occassionally my databases get out of sync and I have to resolve them, but I'm uncertain what the difference is! However I ran into an issue when comparing my two databases:
If I compare
file1.kdbx
with itself, I don't run into any issues. However if I comparefile2.kdbx
, I do run into the same error. So I guess it's an issue with the second database. However, I can successfully open it with KeePassXC 2.6.4, so I guess it's a library parsing issue.As a user I wouldn't expect a panic message, but a nice error message would be useful: in this case probably one that would suggest I report a bug against
keepass
directly. However, it'd probably be good to have some debug script I could run that would provide a good error report to provide there. I'm not certain what to say in my report. However, since this is a panic in the underlying library (hmac_block_stream.rs:21
) I don't know if there's a way to catch that. Let me know if you'd like me to report this upstream instead or how I can help here. I do know some Rust (was really excited that this tool was in it!) so happy to help dig into this!