Skip to content

Commit

Permalink
handle NHR deserialisation too
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Fossati <[email protected]>
  • Loading branch information
thomas-fossati committed Jan 11, 2024
1 parent 89d494d commit 20722b0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/appraisal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ impl<'de> Visitor<'de> for AppraisalVisitor {
loop {
if self.is_human_readable {
match map.next_key::<&str>()? {
Some("ear.veraison.key-attestation") => {
appraisal.key_attestation = Some(map.next_value::<KeyAttestation>()?)
}
Some("ear.status") => appraisal.status = map.next_value::<TrustTier>()?,
Some("ear.trustworthiness-vector") => {
appraisal.trust_vector = map.next_value::<TrustVector>()?
Expand All @@ -163,6 +160,9 @@ impl<'de> Visitor<'de> for AppraisalVisitor {
Some("ear.veraison.policy-claims") => {
appraisal.policy_claims = map.next_value::<BTreeMap<String, RawValue>>()?
}
Some("ear.veraison.key-attestation") => {
appraisal.key_attestation = Some(map.next_value::<KeyAttestation>()?)
}
Some(_) => (), // unknown extensions are ignored
None => break,
}
Expand All @@ -179,6 +179,9 @@ impl<'de> Visitor<'de> for AppraisalVisitor {
Some(-70001) => {
appraisal.policy_claims = map.next_value::<BTreeMap<String, RawValue>>()?
}
Some(-70002) => {
appraisal.key_attestation = Some(map.next_value::<KeyAttestation>()?)
}
Some(_) => (), // unknown extensions are ignored
None => break,
}
Expand Down

0 comments on commit 20722b0

Please sign in to comment.