def test_ocsp_extension_corrupt(self):
     certificate = mock.MagicMock()
     certificate.ocsp_responders = mock.Mock(
         side_effect=cert.CertificateError("Corrupt or unrecognized..."))
     check = ocsp_pointers.CheckCorruptOrMultipleAiaExtension()
     result = check.check(certificate)
     self.assertObservationIn(ocsp_pointers.CorruptAiaExtension(), result)
 def test_ocsp_extension_multiple(self):
     certificate = mock.MagicMock()
     certificate.ocsp_responders = mock.Mock(
         side_effect=cert.CertificateError("Multiple extension values"))
     check = ocsp_pointers.CheckCorruptOrMultipleAiaExtension()
     result = check.check(certificate)
     self.assertObservationIn(ocsp_pointers.MultipleOcspExtensions(),
                              result)
Example #3
0
from ct.cert_analysis import common_name
from ct.cert_analysis import crl_pointers
from ct.cert_analysis import dnsnames
from ct.cert_analysis import extensions
from ct.cert_analysis import ip_addresses
from ct.cert_analysis import ocsp_pointers
from ct.cert_analysis import serial_number
from ct.cert_analysis import validity

ALL_CHECKS = [serial_number.CheckNegativeSerialNumber(),
              validity.CheckValidityNotBeforeFuture(),
              validity.CheckValidityCorrupt(),
              validity.CheckIsExpirationDateWellDefined(),
              dnsnames.CheckValidityOfDnsnames(),
              dnsnames.CheckCorruptSANExtension(),
              dnsnames.CheckTldMatches(),
              common_name.CheckSCNTldMatches(),
              common_name.CheckLackOfSubjectCommonName(),
              common_name.CheckCorruptSubjectCommonName(),
              extensions.CheckCorrectExtensions(),
              ip_addresses.CheckPrivateIpAddresses(),
              ip_addresses.CheckCorruptIpAddresses(),
              algorithm.CheckSignatureAlgorithmsMismatch(),
              algorithm.CheckCertificateAlgorithmSHA1After2017(),
              algorithm.CheckTbsCertificateAlgorithmSHA1Ater2017(),
              ca_field.CheckCATrue(),
              ocsp_pointers.CheckOcspExistence(),
              ocsp_pointers.CheckCorruptOrMultipleAiaExtension(),
              crl_pointers.CheckCrlExistence(),
              crl_pointers.CheckCorruptOrMultipleCrlExtension(),]