mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-22 23:44:48 +02:00
Merge pull request #291 from matter-labs/no_quote
fix(verify-attestation): bail out, if no quote provided
This commit is contained in:
commit
63c16b1177
1 changed files with 5 additions and 2 deletions
|
@ -1,9 +1,9 @@
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// 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
|
//! 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 clap::{Args, Parser, Subcommand};
|
||||||
use core::convert::TryInto;
|
use core::convert::TryInto;
|
||||||
use hex::encode;
|
use hex::encode;
|
||||||
|
@ -113,6 +113,9 @@ fn verify_signature(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn verify_attestation_quote(attestation_quote_bytes: &[u8]) -> Result<QuoteVerificationResult> {
|
fn verify_attestation_quote(attestation_quote_bytes: &[u8]) -> Result<QuoteVerificationResult> {
|
||||||
|
if attestation_quote_bytes.is_empty() {
|
||||||
|
bail!("Empty quote provided!");
|
||||||
|
}
|
||||||
println!(
|
println!(
|
||||||
"Verifying quote ({} bytes)...",
|
"Verifying quote ({} bytes)...",
|
||||||
attestation_quote_bytes.len()
|
attestation_quote_bytes.len()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue