Harden first-release validation and dependency hygiene
This commit is contained in:
@@ -102,13 +102,14 @@ impl ResourceCertificate {
|
||||
return Err(ResourceCertificateProfileError::CertificatePoliciesTooManyQualifiers);
|
||||
}
|
||||
if let Some(qualifier_oid) = policies.qualifier_oids.first()
|
||||
&& qualifier_oid != OID_QT_CPS {
|
||||
return Err(
|
||||
ResourceCertificateProfileError::CertificatePoliciesInvalidQualifier(
|
||||
qualifier_oid.clone(),
|
||||
),
|
||||
);
|
||||
}
|
||||
&& qualifier_oid != OID_QT_CPS
|
||||
{
|
||||
return Err(
|
||||
ResourceCertificateProfileError::CertificatePoliciesInvalidQualifier(
|
||||
qualifier_oid.clone(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if self
|
||||
.tbs
|
||||
|
||||
@@ -115,9 +115,10 @@ impl RcExtensionsParsed {
|
||||
if is_self_signed {
|
||||
if let (Some(keyid), Some(ski)) =
|
||||
(keyid.as_ref(), subject_key_identifier.as_ref())
|
||||
&& keyid != ski {
|
||||
return Err(ResourceCertificateProfileError::AkiSelfSignedNotEqualSki);
|
||||
}
|
||||
&& keyid != ski
|
||||
{
|
||||
return Err(ResourceCertificateProfileError::AkiSelfSignedNotEqualSki);
|
||||
}
|
||||
} else if keyid.is_none() {
|
||||
return Err(ResourceCertificateProfileError::AkiMissing);
|
||||
}
|
||||
|
||||
@@ -53,11 +53,8 @@ impl RpkiSignedObject {
|
||||
/// Verify the CMS signature using the embedded EE certificate public key.
|
||||
pub fn verify_signature(&self) -> Result<(), SignedObjectVerifyError> {
|
||||
let ee = &self.signed_data.certificates[0];
|
||||
|
||||
self.verify_signature_with_rsa_components(
|
||||
&ee.rsa_public_modulus,
|
||||
&ee.rsa_public_exponent,
|
||||
)
|
||||
|
||||
self.verify_signature_with_rsa_components(&ee.rsa_public_modulus, &ee.rsa_public_exponent)
|
||||
}
|
||||
|
||||
/// Verify the CMS signature using a DER-encoded SubjectPublicKeyInfo.
|
||||
|
||||
Reference in New Issue
Block a user