bryant/argon2rs

panics if k.len() > 32

vitiral opened this issue · 0 comments

It would be better if it returned an Err

        thread 'secure::test_hash' panicked at 'assertion failed: k.len() <= 32', /home/garrett/.cargo/registry/src/github.com-1ecc6299db9ec823/argon2rs-0.2.5/src/argon2.rs:195:8
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:391
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:611
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:572
   6: argon2rs::argon2::Argon2::hash_impl
             at /home/garrett/.cargo/registry/src/github.com-1ecc6299db9ec823/argon2rs-0.2.5/src/argon2.rs:195
   7: argon2rs::argon2::Argon2::hash
             at /home/garrett/.cargo/registry/src/github.com-1ecc6299db9ec823/argon2rs-0.2.5/src/argon2.rs:183
   8: novault::secure::hash
             at src/secure.rs:47
   9: novault::secure::test_hash
             at src/secure.rs:216
  10: <F as test::FnBox<T>>::call_box
             at /checkout/src/libtest/lib.rs:1480
             at /checkout/src/libcore/ops/function.rs:223
             at /checkout/src/libtest/lib.rs:141
  11: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:99