Skip to content

Commit

Permalink
relax hardware identity OID check in device cert mode.
Browse files Browse the repository at this point in the history
fix #12.

Signed-off-by: Yang, Longlong <[email protected]>
  • Loading branch information
longlongyang authored and jyao1 committed Jan 11, 2024
1 parent cbdd3bb commit cb06559
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spdmlib/src/crypto/x509v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,8 @@ pub fn check_leaf_certificate(cert: &[u8], is_alias_cert_model: bool) -> SpdmRes
} else if !is_alias_cert_model
&& !find_target_object_identifiers(extension_data, OID_DMTF_SPDM_HARDWARE_IDENTITY)?
{
info!("Hardware identity OID shall be present in device cert!\n");
Err(SPDM_STATUS_VERIF_FAIL)
info!("Hardware identity OID should be present in device cert!\n");
Ok(())
} else {
Ok(())
}
Expand Down Expand Up @@ -1221,7 +1221,7 @@ mod tests {
let ct1_wrong = [0x30, 0x82, 0x01, 0xA8, 0xA0];

assert!(check_leaf_certificate(&end1, true).is_ok());
assert!(check_leaf_certificate(&end1, false).is_err());
assert!(check_leaf_certificate(&end1, false).is_ok());
assert!(check_leaf_certificate(&end2, false).is_ok());
assert!(check_leaf_certificate(&end2, true).is_err());
assert!(check_leaf_certificate(&ct1_wrong, true).is_err());
Expand Down

0 comments on commit cb06559

Please sign in to comment.