Skip to content

Commit 4d27657

Browse files
committed
fix lint errors
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
1 parent 2fb2161 commit 4d27657

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

crates/collaterals/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn p256_prvkey_to_pubkey_bytes(pkey: &PKeyRef<Private>) -> Result<[u8; 64],
5252
Ok(pubkey)
5353
}
5454

55-
pub fn parse_cert_der(cert_der: &[u8]) -> Result<X509Certificate, anyhow::Error> {
55+
pub fn parse_cert_der(cert_der: &[u8]) -> Result<X509Certificate<'_>, anyhow::Error> {
5656
let (_, c) = X509Certificate::from_der(cert_der)?;
5757
Ok(c)
5858
}

crates/quote-verifier/src/cert.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl BitAnd for KeyUsageFlags {
6161
}
6262

6363
/// Parse a PEM-encoded certificate chain into a vector of `X509Certificate`.
64-
pub fn parse_certchain(pem_certs: &[Pem]) -> crate::Result<Vec<X509Certificate>> {
64+
pub fn parse_certchain(pem_certs: &[Pem]) -> crate::Result<Vec<X509Certificate<'_>>> {
6565
Ok(pem_certs
6666
.iter()
6767
.map(|pem| pem.parse_x509())
@@ -204,6 +204,7 @@ pub fn get_sgx_tdx_tcb_status_v3(
204204
if match_tdxtcbcomp(&tee_tcb_svn.unwrap(), tdxtcbcomponents) {
205205
// Return advisory IDs associated with matched TDX TCB level
206206
return Ok((
207+
#[allow(clippy::unnecessary_unwrap)]
207208
sgx_tcb_status.unwrap(),
208209
Some(TcbInfoV3TcbStatus::from_str(tcb_level.tcb_status.as_str())?),
209210
tcb_level.advisory_ids.clone().unwrap_or_default(),

crates/quote-verifier/src/collateral.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,22 @@ impl QvCollateral {
145145
}
146146

147147
/// Returns the SGX Intel Root CA certificate
148-
pub fn get_sgx_intel_root_ca(&self) -> Result<X509Certificate> {
148+
pub fn get_sgx_intel_root_ca(&self) -> Result<X509Certificate<'_>> {
149149
parse_x509_der(&self.sgx_intel_root_ca_der)
150150
}
151151

152152
/// Returns the SGX TCB Signing certificate
153-
pub fn get_sgx_tcb_signing(&self) -> Result<X509Certificate> {
153+
pub fn get_sgx_tcb_signing(&self) -> Result<X509Certificate<'_>> {
154154
parse_x509_der(&self.sgx_tcb_signing_der)
155155
}
156156

157157
/// Returns the SGX Intel Root CA CRL
158-
pub fn get_sgx_intel_root_ca_crl(&self) -> Result<CertificateRevocationList> {
158+
pub fn get_sgx_intel_root_ca_crl(&self) -> Result<CertificateRevocationList<'_>> {
159159
parse_crl_der(&self.sgx_intel_root_ca_crl_der)
160160
}
161161

162162
/// Returns the SGX PCK Platform/Processor CA CRL
163-
pub fn get_sgx_pck_crl(&self) -> Result<CertificateRevocationList> {
163+
pub fn get_sgx_pck_crl(&self) -> Result<CertificateRevocationList<'_>> {
164164
parse_crl_der(&self.sgx_pck_crl_der)
165165
}
166166
}

crates/types/src/quotes/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ impl Certificates {
326326
}
327327

328328
/// Get the certificates as a vector of X509Certificate.
329-
pub fn get_certs(&self) -> Result<Vec<X509Certificate>> {
329+
pub fn get_certs(&self) -> Result<Vec<X509Certificate<'_>>> {
330330
parse_x509_der_multi(&self.certs_der)
331331
}
332332
}

crates/types/src/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ pub fn parse_pem(raw_bytes: &[u8]) -> Result<Vec<Pem>, PEMError> {
2020
Pem::iter_from_buffer(raw_bytes).collect()
2121
}
2222

23-
pub fn parse_crl_der(raw_bytes: &[u8]) -> crate::Result<CertificateRevocationList> {
23+
pub fn parse_crl_der(raw_bytes: &[u8]) -> crate::Result<CertificateRevocationList<'_>> {
2424
let (_, crl) = CertificateRevocationList::from_der(raw_bytes)?;
2525
Ok(crl)
2626
}
2727

28-
pub fn parse_x509_der(raw_bytes: &[u8]) -> crate::Result<X509Certificate> {
28+
pub fn parse_x509_der(raw_bytes: &[u8]) -> crate::Result<X509Certificate<'_>> {
2929
let (_, cert) = X509Certificate::from_der(raw_bytes)?;
3030
Ok(cert)
3131
}
3232

33-
pub fn parse_x509_der_multi(raw_bytes: &[u8]) -> crate::Result<Vec<X509Certificate>> {
33+
pub fn parse_x509_der_multi(raw_bytes: &[u8]) -> crate::Result<Vec<X509Certificate<'_>>> {
3434
let mut certs = Vec::new();
3535
let mut i = raw_bytes;
3636
while !i.is_empty() {
16 Bytes
Binary file not shown.

zkvm/risc0/src/methods.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

2-
pub const DCAP_QUOTE_VERIFIER_ID: [u32; 8] = [3939451603, 2448335849, 1018594593, 3057008457, 3459279292, 3884169757, 2924777480, 3966025118];
3-
pub const DCAP_QUOTE_VERIFIER_ID_STR: &str = "d342cfeae9a3ee912185b63c493f36b6bc6930ce1dba83e7089054ae9ebd64ec";
2+
pub const DCAP_QUOTE_VERIFIER_ID: [u32; 8] = [466790439, 2953891412, 2816213353, 1951355102, 3570061089, 3899240059, 2504277624, 899078425];
3+
pub const DCAP_QUOTE_VERIFIER_ID_STR: &str = "27a8d21b54ce10b06901dca7de504f7421cfcad47bae69e8783e449519d99635";
44
pub const DCAP_QUOTE_VERIFIER_ELF: &[u8] = include_bytes!("../artifacts/dcap-quote-verifier");

0 commit comments

Comments
 (0)