Skip to content

Commit eccfdbe

Browse files
committed
Fix oversight in example cert chain verification
The CA cert was skipped by mistake. This would allow an attacker to supply a forged chain, where the CA certs signature is still the expected.
1 parent f280e3e commit eccfdbe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

examples/spdm_requester.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ fn verify_cert_chain(chain: &[Certificate]) -> bool {
589589
.unwrap(),
590590
)
591591
.unwrap();
592-
for cert in chain.iter().skip(1) {
592+
for cert in chain.iter() {
593593
let sig = Signature::from_der(cert.signature().as_bytes().unwrap()).unwrap();
594594
if !pub_key
595595
.verify(&cert.tbs_certificate().to_der().unwrap(), &sig)

0 commit comments

Comments
 (0)