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 20, 2024
1 parent 56d7824 commit 675529b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
3 changes: 2 additions & 1 deletion 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
12 changes: 2 additions & 10 deletions attestation-service/src/token/ear_broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,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>>,
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,
init_data_claims.clone(),
Expand Down

0 comments on commit 675529b

Please sign in to comment.