Skip to content

Commit 63c16b1

Browse files
authored
Merge pull request #291 from matter-labs/no_quote
fix(verify-attestation): bail out, if no quote provided
2 parents 51dc68b + 7cb3af4 commit 63c16b1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bin/verify-attestation/src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// SPDX-License-Identifier: Apache-2.0
2-
// Copyright (c) 2023-2024 Matter Labs
2+
// Copyright (c) 2023-2025 Matter Labs
33

44
//! Tool for SGX attestation and batch signature verification
55
6-
use anyhow::{anyhow, Context, Result};
6+
use anyhow::{anyhow, bail, Context, Result};
77
use clap::{Args, Parser, Subcommand};
88
use core::convert::TryInto;
99
use hex::encode;
@@ -113,6 +113,9 @@ fn verify_signature(
113113
}
114114

115115
fn verify_attestation_quote(attestation_quote_bytes: &[u8]) -> Result<QuoteVerificationResult> {
116+
if attestation_quote_bytes.is_empty() {
117+
bail!("Empty quote provided!");
118+
}
116119
println!(
117120
"Verifying quote ({} bytes)...",
118121
attestation_quote_bytes.len()

0 commit comments

Comments
 (0)