From 55ea2a606900fb029c41227c9c91421d1eb9a1fb Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 8 Mar 2024 14:27:50 +0100 Subject: [PATCH] fix(verify-attestation): bail out, if no quote provided Signed-off-by: Harald Hoyer --- bin/verify-attestation/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/verify-attestation/src/main.rs b/bin/verify-attestation/src/main.rs index fba3c16..74e9b7c 100644 --- a/bin/verify-attestation/src/main.rs +++ b/bin/verify-attestation/src/main.rs @@ -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 { + if attestation_quote_bytes.is_empty() { + bail!("Empty quote provided!"); + } println!( "Verifying quote ({} bytes)...", attestation_quote_bytes.len()