Narigo / keepass-diff

A CLI-tool to diff Keepass (.kdbx) files. Useful, if syncing with Dropbox or NextCloud and getting multiple files due to conflicts.
https://keepass-diff.narigo.dev/
MIT License
306 stars 28 forks source link

Error opening DB when using key(s) #73

Open durdin85 opened 10 months ago

durdin85 commented 10 months ago

thread 'main' panicked at 'Error opening database A: Key(IncorrectKey)

I've tried diffing two keepass files which are using keys as additional secret. Please note, that keepassxc reports the key used in this case as "legacy key format" ( more info could be found on keepassxc git: https://github.com/keepassxreboot/keepassxc/blob/a8cfefe6c8a4c10f4a215a003a98148b56840474/src/keys/FileKey.cpp#L110-L127 ). As official keepass does not mention anything about keys, I suppose all above legacy options shall work also with keepass-diff.

thread 'main' panicked at 'Error opening database A: Key(IncorrectKey)', /../.cargo/registry/src/github.com-1ecc6299db9ec823/keepass-diff-1.2.0/src/main.rs:122:18
stack backtrace:
   0:     0x55c2d7e44d8a - std::backtrace_rs::backtrace::libunwind::trace::hd844a4d5c3c3cb8e
                               at /usr/src/rustc-1.70.0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x55c2d7e44d8a - std::backtrace_rs::backtrace::trace_unsynchronized::hdad5e3fece9c44f1
                               at /usr/src/rustc-1.70.0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55c2d7e44d8a - std::sys_common::backtrace::_print_fmt::h352bdfc1d4345658
                               at /usr/src/rustc-1.70.0/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x55c2d7e44d8a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hba0ef6b8374da3f9
                               at /usr/src/rustc-1.70.0/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55c2d7e77a1f - core::fmt::write::h21828da268c821ef
                               at /usr/src/rustc-1.70.0/library/core/src/fmt/mod.rs:1254:17
   5:     0x55c2d7e4e555 - std::io::Write::write_fmt::hafa6cbfccca582a4
                               at /usr/src/rustc-1.70.0/library/std/src/io/mod.rs:1698:15
   6:     0x55c2d7e44b45 - std::sys_common::backtrace::_print::h9c7ba1ff43ab146a
                               at /usr/src/rustc-1.70.0/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x55c2d7e44b45 - std::sys_common::backtrace::print::h9057b6109bcf19ab
                               at /usr/src/rustc-1.70.0/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x55c2d7e4c12e - std::panicking::default_hook::{{closure}}::heae9e1697c80a831
                               at /usr/src/rustc-1.70.0/library/std/src/panicking.rs:269:22
   9:     0x55c2d7e4bde9 - std::panicking::default_hook::hfeead1bd01552fd9
                               at /usr/src/rustc-1.70.0/library/std/src/panicking.rs:288:9
  10:     0x55c2d7e4c681 - std::panicking::rust_panic_with_hook::h6bdfddfeef678658
                               at /usr/src/rustc-1.70.0/library/std/src/panicking.rs:691:13
  11:     0x55c2d7e450b9 - std::panicking::begin_panic_handler::{{closure}}::h1c99fdd48fc25129
                               at /usr/src/rustc-1.70.0/library/std/src/panicking.rs:582:13
  12:     0x55c2d7e44e96 - std::sys_common::backtrace::__rust_end_short_backtrace::h7d1a5f1f6a04f33c
                               at /usr/src/rustc-1.70.0/library/std/src/sys_common/backtrace.rs:150:18
  13:     0x55c2d7e4c382 - rust_begin_unwind
                               at /usr/src/rustc-1.70.0/library/std/src/panicking.rs:578:5
  14:     0x55c2d7d624a3 - core::panicking::panic_fmt::h8a7952a49fde5ae6
                               at /usr/src/rustc-1.70.0/library/core/src/panicking.rs:67:14
  15:     0x55c2d7d623d3 - core::result::unwrap_failed::h5fa4abcaa6de1d82
                               at /usr/src/rustc-1.70.0/library/core/src/result.rs:1687:5
  16:     0x55c2d7d7434f - keepass_diff::main::h31918d67de57f635
  17:     0x55c2d7d68513 - std::sys_common::backtrace::__rust_begin_short_backtrace::hdd9ba9854aebd367
  18:     0x55c2d7d6b00c - std::rt::lang_start::{{closure}}::h14afc92ebc48e40b
  19:     0x55c2d7e4c281 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hb750ee64ae25c479
                               at /usr/src/rustc-1.70.0/library/core/src/ops/function.rs:287:13
  20:     0x55c2d7e4c281 - std::panicking::try::do_call::ha78a302b65e87504
                               at /usr/src/rustc-1.70.0/library/std/src/panicking.rs:485:40
  21:     0x55c2d7e4c281 - std::panicking::try::hdf4e541730c802ba
                               at /usr/src/rustc-1.70.0/library/std/src/panicking.rs:449:19
  22:     0x55c2d7e4c281 - std::panic::catch_unwind::h33d4f0cbefaa80cf
                               at /usr/src/rustc-1.70.0/library/std/src/panic.rs:140:14
  23:     0x55c2d7e4c281 - std::rt::lang_start_internal::{{closure}}::h0c8f5e4dfe417e3e
                               at /usr/src/rustc-1.70.0/library/std/src/rt.rs:148:48
  24:     0x55c2d7e4c281 - std::panicking::try::do_call::h4864c775f7a06351
                               at /usr/src/rustc-1.70.0/library/std/src/panicking.rs:485:40
  25:     0x55c2d7e4c281 - std::panicking::try::h808548465e0aeb03
                               at /usr/src/rustc-1.70.0/library/std/src/panicking.rs:449:19
  26:     0x55c2d7e5b23b - std::panic::catch_unwind::hd57b9faaf1b37734
                               at /usr/src/rustc-1.70.0/library/std/src/panic.rs:140:14
  27:     0x55c2d7e5b23b - std::rt::lang_start_internal::h7ab69382b07e2921
                               at /usr/src/rustc-1.70.0/library/std/src/rt.rs:148:20
  28:     0x55c2d7d79f65 - main
  29:     0x7f87d73f96ca - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  30:     0x7f87d73f9785 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:360:3
  31:     0x55c2d7d628b1 - _start
  32:                0x0 - <unknown>

This might be actually similar problem as posted by @th0masKode in https://github.com/Narigo/keepass-diff/issues/57#issuecomment-1822903142