Skip to content

Commit 8830ed5

Browse files
committed
Don't panic on empty cert list or unsupported format.
1 parent b0840f8 commit 8830ed5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

authenticode/src/signature.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,14 @@ impl AuthenticodeSignature {
265265
self.signed_data
266266
.certificates
267267
.as_ref()
268-
.unwrap()
269-
.0
270-
.iter()
271-
.map(|cert| {
268+
.into_iter()
269+
.map(|v| v.0.iter())
270+
.flatten()
271+
.flat_map(|cert| {
272272
if let cms::cert::CertificateChoices::Certificate(cert) = cert {
273-
cert
273+
Some(cert)
274274
} else {
275-
panic!()
275+
None
276276
}
277277
})
278278
}

0 commit comments

Comments
 (0)