WIP
This commit is contained in:
parent
64c0fc43de
commit
29c642d64c
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue