Skip to content

Commit

Permalink
ear: remove workaround for null values
Browse files Browse the repository at this point in the history
The rust-ear crate now supports null json value so we can remove the
workaround we had to make sure null value didn't cause an exception.

Signed-off-by: Tobin Feldman-Fitzthum <[email protected]>
  • Loading branch information
fitzthum committed Nov 19, 2024
1 parent 315f3f8 commit 43116d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
11 changes: 6 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ cfg-if = "1.0.0"
chrono = "0.4.19"
clap = { version = "4", features = ["derive"] }
config = "0.13.3"
#ear = "0.2.0"
ear = { git = "https://github.com/veraison/rust-ear.git" }
ear = "0.3.0"
env_logger = "0.10.0"
hex = "0.4.3"
jwt-simple = "0.11"
Expand Down
11 changes: 2 additions & 9 deletions attestation-service/src/token/ear_broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,11 @@ impl AttestationTokenBroker for EarAttestationTokenBroker {
&self,
tcb_claims: TeeEvidenceParsedClaim,
policy_ids: Vec<String>,
mut init_data_claims: serde_json::Value,
mut runtime_data_claims: serde_json::Value,
init_data_claims: serde_json::Value,
runtime_data_claims: serde_json::Value,
reference_data_map: HashMap<String, Vec<String>>,

Check warning on line 175 in attestation-service/src/token/ear_broker.rs

View workflow job for this annotation

GitHub Actions / Check

Diff in /home/runner/work/trustee/trustee/attestation-service/src/token/ear_broker.rs
tee: Tee,
) -> Result<String> {
// Temporary workaround until EAR supports null values
if let serde_json::Value::Null = init_data_claims {
init_data_claims = serde_json::Value::String("".to_string());
}
if let serde_json::Value::Null = runtime_data_claims {
runtime_data_claims = serde_json::Value::String("".to_string());
}

let tcb_claims = transform_claims(
tcb_claims,
Expand Down

0 comments on commit 43116d6

Please sign in to comment.