fix(verify-attestation): bail out, if no quote provided

Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
Harald Hoyer 2024-03-08 14:27:50 +01:00
parent 89145514b0
commit 55ea2a6069
Signed by: harald
GPG key ID: F519A1143B3FBE32

View file

@ -1,9 +1,9 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2023-2024 Matter Labs
// Copyright (c) 2023-2025 Matter Labs
//! Tool for SGX attestation and batch signature verification
use anyhow::{anyhow, Context, Result};
use anyhow::{anyhow, bail, Context, Result};
use clap::{Args, Parser, Subcommand};
use core::convert::TryInto;
use hex::encode;
@ -113,6 +113,9 @@ fn verify_signature(
}
fn verify_attestation_quote(attestation_quote_bytes: &[u8]) -> Result<QuoteVerificationResult> {
if attestation_quote_bytes.is_empty() {
bail!("Empty quote provided!");
}
println!(
"Verifying quote ({} bytes)...",
attestation_quote_bytes.len()