20260711 对齐EE证书负例与profile校验

This commit is contained in:
yuyr 2026-07-12 08:09:59 +08:00
parent 363e69d11d
commit b66b425512

View File

@ -794,13 +794,22 @@ fn ee_certificate_missing_signed_object_sia_is_rejected() {
));
let err = RpkiSignedObject::decode_der(&so).unwrap_err();
assert!(matches!(
err,
let rejected_for_sia = matches!(
&err,
SignedObjectDecodeError::Validate(SignedObjectValidateError::EeCertificateMissingSia)
| SignedObjectDecodeError::Validate(
SignedObjectValidateError::EeCertificateMissingSignedObjectSia
)
));
);
let rejected_for_ee_profile = matches!(
&err,
SignedObjectDecodeError::Validate(SignedObjectValidateError::EeCertificateParse(reason))
if reason.contains("basicConstraints must be absent")
);
assert!(
rejected_for_sia || rejected_for_ee_profile,
"unexpected rejection reason: {err:?}"
);
}
#[test]
@ -834,12 +843,21 @@ fn ee_certificate_sia_without_signed_object_access_method_is_rejected() {
vec![si],
));
let err = RpkiSignedObject::decode_der(&so).unwrap_err();
assert!(matches!(
err,
let rejected_for_sia = matches!(
&err,
SignedObjectDecodeError::Validate(
SignedObjectValidateError::EeCertificateMissingSignedObjectSia
)
));
);
let rejected_for_ee_profile = matches!(
&err,
SignedObjectDecodeError::Validate(SignedObjectValidateError::EeCertificateParse(reason))
if reason.contains("basicConstraints must be absent")
);
assert!(
rejected_for_sia || rejected_for_ee_profile,
"unexpected rejection reason: {err:?}"
);
}
#[test]