Пример #1
0
 def test_check_certificate_algorithm_sha1_before_2017(self):
     certificate = mock.MagicMock()
     certificate.signature = FAKE_SHA1_IDENTIFIER
     certificate.not_after = FAKE_NOT_AFTER_06141992
     check = algorithm.CheckCertificateAlgorithmSHA1After2017()
     result = check.check(certificate)
     self.assertIsNone(result)
Пример #2
0
 def test_check_certificate_algorithm_sha1_after_2017(self):
     certificate = mock.MagicMock()
     certificate.signature = FAKE_SHA1_IDENTIFIER
     certificate.not_after = FAKE_NOT_AFTER_12122017
     check = algorithm.CheckCertificateAlgorithmSHA1After2017()
     result = check.check(certificate)
     self.assertEqual(len(result), 1)
     self.assertIn("SHA1", result[0].description)
Пример #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(),]