tmthecoder / xotp

An HOTP & TOTP implementation in Rust
MIT License
5 stars 3 forks source link

Compilation error in current rust version #9

Open BoostCookie opened 1 year ago

BoostCookie commented 1 year ago

Just doing git clone "https://github.com/tmthecoder/xotp.git"; cd xotp; cargo test gives me errors:

% cargo test
   Compiling xotp v0.4.0 (/home/geher/SonstigesSSD/Projects/xotp)
error[E0277]: the trait bound `D: InnerInit` is not satisfied
  --> src/util.rs:66:20
   |
66 |     let mut hmac = <D>::new_from_slice(secret).expect("Failed to initialize HMAC");
   |                    ^^^^^^^^^^^^^^^^^^^ the trait `InnerInit` is not implemented for `D`
   |
   = note: required because of the requirements on the impl of `KeyInit` for `D`
note: required by a bound in `hmac::Mac::new_from_slice`
  --> /home/geher/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/digest-0.10.5/src/mac.rs:35:15
   |
35 |         Self: KeyInit;
   |               ^^^^^^^ required by this bound in `hmac::Mac::new_from_slice`
help: consider further restricting this bound
   |
65 | fn hash_internal<D: Mac + hmac::digest::InnerInit>(msg: &[u8], secret: &[u8]) -> Vec<u8> {
   |                         +++++++++++++++++++++++++

For more information about this error, try `rustc --explain E0277`.
error: could not compile `xotp` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed

I'm using

% cargo version
cargo 1.60.0-nightly (95bb3c92b 2022-01-18)