Implemented multiple U2f keys, key names, and compromised checks

This commit is contained in:
Daniel García
2019-02-14 02:03:37 +01:00
parent 6027b969f5
commit a744b9437a
3 changed files with 135 additions and 83 deletions
File diff suppressed because it is too large Load Diff
+6 -3
View File
@@ -47,10 +47,13 @@ impl NumberOrString {
}
}
fn into_i32(self) -> Option<i32> {
fn into_i32(self) -> ApiResult<i32> {
use std::num::ParseIntError as PIE;
match self {
NumberOrString::Number(n) => Some(n),
NumberOrString::String(s) => s.parse().ok(),
NumberOrString::Number(n) => Ok(n),
NumberOrString::String(s) => s
.parse()
.map_err(|e: PIE| crate::Error::new("Can't convert to number", e.to_string())),
}
}
}
+1
View File
@@ -38,6 +38,7 @@ mod mail;
mod util;
pub use config::CONFIG;
pub use error::{Error, MapResult};
fn launch_rocket() {
// Create Rocket object, this stores current log level and sets it's own