Skip to content

Commit

Permalink
Update deprecated method use for base64 crate
Browse files Browse the repository at this point in the history
Change-Id: Ic8a145734fddfe8dda4c99051c62af11286c9a7a
  • Loading branch information
jul-sh committed May 21, 2024
1 parent eb3f42f commit 8530a42
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion Cargo.lock

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

6 changes: 4 additions & 2 deletions oak_attestation_explain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ extern crate std;
use alloc::{format, string::String};

use anyhow::{Context, Result};
use base64::{prelude::BASE64_STANDARD, Engine as _};
use oak_proto_rust::oak::{
attestation::v1::{
root_layer_data::Report, ApplicationLayerData, ApplicationLayerReferenceValues,
Expand Down Expand Up @@ -85,8 +86,9 @@ fn make_reference_values_human_readable(value: &mut serde_yaml::Value) {
// The proto3 JSON mapping spec uses base64 encoding.
let base64_encoded_hash =
hash_value.as_str().expect("validated as string in prior conditional");
let hash =
base64::decode(base64_encoded_hash).expect("invalid base64 digest hash");
let hash = BASE64_STANDARD
.decode(base64_encoded_hash)
.expect("invalid base64 digest hash");
*hash_value = serde_yaml::Value::String(hex::encode(hash));
})
};
Expand Down

0 comments on commit 8530a42

Please sign in to comment.