ellerh / softfido

A software FIDO2/U2F authenticator
37 stars 7 forks source link

Compile error - mismatched types #2

Closed tomm87 closed 1 year ago

tomm87 commented 1 year ago

Hello,

Thanks so much for creating softfido! It's just what I need to dip my toe into this new technology.

When I try to build it with cargo build, I get the following error:

tom@debian-vbox:~/Desktop/softfido-master$ cargo build
   Compiling softfido v0.1.0 (/home/tom/Desktop/softfido-master)
warning: unnecessary parentheses around assigned value
  --> src/ctaphid.rs:49:34
   |
49 | const CTAPHID_VENDOR_FIRST: u8 = (0x40);
   |                                  ^^^^^^ help: remove these parentheses
   |
   = note: `#[warn(unused_parens)]` on by default

error[E0308]: mismatched types
  --> src/prompt.rs:31:5
   |
30 |   pub fn read_pin(prompt: &str) -> Result<secstr::SecStr, pinentry_rs::Error> {
   |                                    ------------------------------------------ expected `std::result::Result<SecVec<u8>, pinentry_rs::Error>` because of return type
31 | /     pinentry_rs::pinentry()
32 | |         .description(escape_string(prompt))
33 | |         .pin("".to_string())
   | |____________________________^ expected struct `SecVec`, found struct `secstr::SecVec`
   |
   = note: expected enum `std::result::Result<SecVec<u8>, _>`
              found enum `std::result::Result<secstr::SecVec<u8>, _>`
   = note: perhaps two different versions of crate `secstr` are being used?

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0308`.
error: could not compile `softfido`.

To learn more, run the command again with --verbose.
tom@debian-vbox:~/Desktop/softfido-master$ 

This was on a 64-bit PC (amd64 architecture), Debian 11 (Bullseye), with Python 3.9.2 and Rust 1.48. Sorry I'm not much of a programmer, but I'm happy to try to answer any questions.

ellerh commented 1 year ago

This should be fixed now. I can compile it now with rustc 1.65; allthough with some warnings. It seems to work as it should.

tomm87 commented 1 year ago

Thank you! That now builds successfully for me also.