always check timeout condition
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Shimun 2020-04-04 15:33:18 +02:00
parent 70d66f6a74
commit 96f64fff11
Signed by: shimun
GPG Key ID: E81D8382DC2F971B

View File

@ -136,6 +136,10 @@ impl PamFido2 {
.compat()? .compat()?
.filter_map(|handle| FidoDevice::new(&handle).ok()) .filter_map(|handle| FidoDevice::new(&handle).ok())
.collect::<Vec<_>>(); .collect::<Vec<_>>();
if begin.elapsed().unwrap() > settings.device_timeout {
debug(&|| format!("Exceeded {:?} timeout", settings.device_timeout));
return Ok(PamError::AUTH_ERR);
}
if devices.is_empty() { if devices.is_empty() {
debug(&|| "Please connect your authenicator!".into()); debug(&|| "Please connect your authenicator!".into());
std::thread::sleep(Duration::from_secs(1)); std::thread::sleep(Duration::from_secs(1));