Merge pull request #291 from matter-labs/no_quote

fix(verify-attestation): bail out, if no quote provided
This commit is contained in:
Harald Hoyer 2025-03-06 09:44:32 +01:00 committed by GitHub
commit 63c16b1177
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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()