From 29c642d64c2bd557e04c3b6039169d328036ffe0 Mon Sep 17 00:00:00 2001 From: Ajinkya Kulkarni <ajinkya@poeticte.ch> Date: Wed, 4 Dec 2024 22:00:18 +0100 Subject: [PATCH] WIP --- crates/utils/tcbinfo-updater/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/utils/tcbinfo-updater/src/main.rs b/crates/utils/tcbinfo-updater/src/main.rs index a68d566..91a7dd4 100644 --- a/crates/utils/tcbinfo-updater/src/main.rs +++ b/crates/utils/tcbinfo-updater/src/main.rs @@ -9,6 +9,7 @@ use serde_json::{json, Value}; use std::collections::HashMap; use std::{fs, path::Path}; use x509_cert::Certificate; + type TcbInfo = String; type Fmspc = String; type Update = String; @@ -122,9 +123,11 @@ async fn upsert_tcbinfo() -> Result<(), &'static str> { fn verify_signature(tcbinfo: String, key: VerifyingKey) -> bool { let signed_tcbinfo = SignedTcbInfo::try_from(tcbinfo.as_ref()).expect("tcbinfo string parsing failed"); - signed_tcbinfo + if let Err(_) = signed_tcbinfo .verify(Some(&key), None) - .expect("could not verify signature"); + { + return false + } true }