|
6 | 6 |
|
7 | 7 | use std::{borrow::Cow, time::SystemTime}; |
8 | 8 |
|
9 | | -use anyhow::{Context, Result, anyhow, bail}; |
| 9 | +use anyhow::{anyhow, bail, Context, Result}; |
10 | 10 | use cc_eventlog::{RuntimeEvent, TdxEvent}; |
11 | 11 | use dcap_qvl::{ |
12 | 12 | quote::{EnclaveReport, Quote, Report, TDReport10, TDReport15}, |
13 | 13 | verify::VerifiedReport as TdxVerifiedReport, |
14 | 14 | }; |
15 | 15 | use dstack_types::{Platform, VmConfig}; |
16 | | -use ez_hash::{Hasher, Sha384, sha256}; |
| 16 | +use ez_hash::{sha256, Hasher, Sha384}; |
17 | 17 | use or_panic::ResultOrPanic; |
18 | 18 | use scale::{Decode, Encode}; |
19 | 19 | use serde::{Deserialize, Serialize}; |
@@ -173,6 +173,7 @@ impl QuoteContentType<'_> { |
173 | 173 | } |
174 | 174 | } |
175 | 175 |
|
| 176 | +#[allow(clippy::large_enum_variant)] |
176 | 177 | /// Represents a verified attestation |
177 | 178 | #[derive(Clone)] |
178 | 179 | pub enum DstackVerifiedReport { |
@@ -264,8 +265,8 @@ impl AttestationQuote { |
264 | 265 | pub fn mode(&self) -> AttestationMode { |
265 | 266 | match self { |
266 | 267 | AttestationQuote::DstackTdx { .. } => AttestationMode::DstackTdx, |
267 | | - AttestationQuote::DstackGcpTdx { .. } => AttestationMode::DstackGcpTdx, |
268 | | - AttestationQuote::DstackNitroEnclave { .. } => AttestationMode::DstackNitroEnclave, |
| 268 | + AttestationQuote::DstackGcpTdx => AttestationMode::DstackGcpTdx, |
| 269 | + AttestationQuote::DstackNitroEnclave => AttestationMode::DstackNitroEnclave, |
269 | 270 | } |
270 | 271 | } |
271 | 272 | } |
@@ -780,17 +781,13 @@ mod tests { |
780 | 781 |
|
781 | 782 | // Test invalid raw content length |
782 | 783 | let invalid_content = [42u8; 65]; |
783 | | - assert!( |
784 | | - content_type |
785 | | - .to_report_data_with_hash(&invalid_content, "raw") |
786 | | - .is_err() |
787 | | - ); |
| 784 | + assert!(content_type |
| 785 | + .to_report_data_with_hash(&invalid_content, "raw") |
| 786 | + .is_err()); |
788 | 787 |
|
789 | 788 | // Test invalid hash algorithm |
790 | | - assert!( |
791 | | - content_type |
792 | | - .to_report_data_with_hash(content, "invalid") |
793 | | - .is_err() |
794 | | - ); |
| 789 | + assert!(content_type |
| 790 | + .to_report_data_with_hash(content, "invalid") |
| 791 | + .is_err()); |
795 | 792 | } |
796 | 793 | } |
0 commit comments