From 28848368a0072ef7401171f7307848bbc477b7ae Mon Sep 17 00:00:00 2001 From: peg Date: Thu, 12 Dec 2024 13:25:55 +0100 Subject: [PATCH] Fix error handling in entropy-tss --- crates/threshold-signature-server/src/attestation/api.rs | 2 +- crates/threshold-signature-server/src/attestation/errors.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/threshold-signature-server/src/attestation/api.rs b/crates/threshold-signature-server/src/attestation/api.rs index e2c7ef2b9..90bc302a8 100644 --- a/crates/threshold-signature-server/src/attestation/api.rs +++ b/crates/threshold-signature-server/src/attestation/api.rs @@ -136,7 +136,7 @@ pub async fn create_quote( let mut pck_seeder = StdRng::from_seed(signer.signer().public().0); let pck = tdx_quote::SigningKey::random(&mut pck_seeder); - let pck_encoded = tdx_quote::encode_verifying_key(pck.verifying_key()).to_vec(); + let pck_encoded = tdx_quote::encode_verifying_key(pck.verifying_key())?.to_vec(); let quote = tdx_quote::Quote::mock(signing_key.clone(), pck, input_data.0, pck_encoded) .as_bytes() .to_vec(); diff --git a/crates/threshold-signature-server/src/attestation/errors.rs b/crates/threshold-signature-server/src/attestation/errors.rs index 7daad52fb..0905ceb27 100644 --- a/crates/threshold-signature-server/src/attestation/errors.rs +++ b/crates/threshold-signature-server/src/attestation/errors.rs @@ -40,6 +40,9 @@ pub enum AttestationErr { #[cfg(feature = "production")] #[error("Quote generation: {0}")] QuoteGeneration(String), + #[cfg(not(feature = "production"))] + #[error("Cannot encode verifying key: {0}")] + EncodeVerifyingKey(#[from] tdx_quote::VerifyingKeyError), #[error("Vec Conversion Error: {0}")] Conversion(&'static str), #[error("Data is repeated")]