This commit is contained in:
parent
d4094b8a6a
commit
985f6f664b
21
src/lib.rs
21
src/lib.rs
@ -79,13 +79,16 @@ impl PamFido2Luks {
|
||||
.collect();
|
||||
let credentials: Vec<&FidoCredential> = credentials.iter().collect();
|
||||
if !credentials.is_empty() {
|
||||
let secret = util::sha256(&[&perform_challenge(
|
||||
&credentials[..],
|
||||
&util::sha256(&[password.as_bytes()]),
|
||||
Duration::from_secs(15),
|
||||
pin.map(AsRef::as_ref),
|
||||
)?
|
||||
.0[..]]);
|
||||
let secret = util::sha256(&[
|
||||
password.as_bytes(),
|
||||
&perform_challenge(
|
||||
&credentials[..],
|
||||
&util::sha256(&[password.as_bytes()]),
|
||||
Duration::from_secs(15),
|
||||
pin.map(AsRef::as_ref),
|
||||
)?
|
||||
.0[..],
|
||||
]);
|
||||
device.activate(name.as_str(), &secret[..], None)?;
|
||||
} else {
|
||||
unimplemented!("custom error")
|
||||
@ -112,11 +115,11 @@ impl PamServiceModule for PamFido2Luks {
|
||||
Ok(_) => PamError::SUCCESS,
|
||||
Err(e) => match e {
|
||||
//TODO: output more detailed error
|
||||
_ => dbg!(PamError::AUTH_ERR),
|
||||
_ => PamError::AUTH_ERR,
|
||||
},
|
||||
}
|
||||
} else {
|
||||
dbg!(PamError::AUTH_ERR)
|
||||
PamError::AUTH_ERR
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user