Skip to content

Commit

Permalink
FIDO MDS Again? (#460)
Browse files Browse the repository at this point in the history
It would be lovely if FIDO stopped changing their MDS formaT on days ending in 'y'.
  • Loading branch information
Firstyear authored Dec 20, 2024
1 parent 6f585aa commit 22d8fdd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
24 changes: 12 additions & 12 deletions fido-mds-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ fn main() {

let s = match fs::read_to_string(path) {
Ok(s) => s,
Err(e) => {
tracing::error!(?e);
Err(err) => {
tracing::error!(?err, "read_to_string");
return;
}
};
Expand All @@ -195,8 +195,8 @@ fn main() {
eprintln!("{fd}");
}
}
Err(e) => {
tracing::error!(?e);
Err(err) => {
tracing::error!(?err, "mds from str");
}
}
}
Expand All @@ -208,8 +208,8 @@ fn main() {

let s = match fs::read_to_string(path) {
Ok(s) => s,
Err(e) => {
tracing::error!(?e);
Err(err) => {
tracing::error!(?err, "read_to_string");
return;
}
};
Expand All @@ -219,8 +219,8 @@ fn main() {
debug!("{} fido metadata avaliable", mds.fido2.len());
mds
}
Err(e) => {
tracing::error!(?e);
Err(err) => {
tracing::error!(?err, "mds from str");
return;
}
};
Expand All @@ -245,8 +245,8 @@ fn main() {

let s = match fs::read_to_string(path) {
Ok(s) => s,
Err(e) => {
tracing::error!(?e);
Err(err) => {
tracing::error!(?err, "read_to_string");
return;
}
};
Expand Down Expand Up @@ -283,8 +283,8 @@ fn main() {
None => warn!("No metadata matched query"),
}
}
Err(e) => {
tracing::error!(?e);
Err(err) => {
tracing::error!(?err, "mds from str");
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion fido-mds/src/mds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ pub enum AuthenticationAlgorithm {
/// rsassa_pkcsv15_sha1_raw
#[serde(rename = "rsassa_pkcsv15_sha1_raw")]
RsassaPkcsv15Sha1Raw,
/// rsassa_pss_sha256_raw
#[serde(rename = "rsassa_pss_sha256_raw")]
RsassaPssSha256Raw,
}

impl fmt::Display for AuthenticationAlgorithm {
Expand Down Expand Up @@ -359,6 +362,9 @@ impl fmt::Display for AuthenticationAlgorithm {
AuthenticationAlgorithm::RsassaPkcsv15Sha1Raw => {
write!(f, "rsassa_pkcsv15_sha1_raw")
}
AuthenticationAlgorithm::RsassaPssSha256Raw => {
write!(f, "rsassa_pss_sha256_raw")
}
}
}
}
Expand Down Expand Up @@ -1101,7 +1107,10 @@ impl FromStr for FidoMds {
// that has signed this metadata.
let released = verifier.verify(&jws)?;

let metadata: FidoMds = released.from_json().map_err(|_| JwtError::Serde)?;
let metadata: FidoMds = released.from_json().map_err(|serde_err| {
tracing::error!(?serde_err);
JwtError::Serde
})?;

// trace!(?metadata);

Expand Down

0 comments on commit 22d8fdd

Please sign in to comment.