From 84dac5a47e57c86df39ed7b07ee97332c71d1984 Mon Sep 17 00:00:00 2001 From: Ajinkya Kulkarni Date: Wed, 4 Dec 2024 20:32:56 +0100 Subject: [PATCH] WIP --- crates/utils/tcbinfo-updater/src/main.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/utils/tcbinfo-updater/src/main.rs b/crates/utils/tcbinfo-updater/src/main.rs index 9e19449..1a19362 100644 --- a/crates/utils/tcbinfo-updater/src/main.rs +++ b/crates/utils/tcbinfo-updater/src/main.rs @@ -98,12 +98,14 @@ async fn upsert_tcbinfo() -> Result<(), &'static str> { } fn verify_signature (tcbinfo: Value, key: VerifyingKey) { - let tcbinfo_json = tcbinfo.as_str(); - if let Err(e) = tcbinfo_json { - println!("{tcbinfo:?}"); - } - let signed_tcbinfo = SignedTcbInfo::try_from().expect("tcbinfo string parsing failed"); + let tcbinfo_str = tcbinfo.as_str(); + if let Some(st) = tcbinfo_str { + let signed_tcbinfo = SignedTcbInfo::try_from(st).expect("tcbinfo string parsing failed"); signed_tcbinfo.verify(Some(&key), None).expect("could not verify signature"); + } + else { + println!("{tcbinfo:?}"); + } }