Пример #1
0
 def test_csr_signature_bad_algo(self):
     csr = x509_csr.X509Csr.from_buffer(self.csr_sample_bytes)
     with mock.patch.object(x509_csr.X509Csr, '_get_signing_algorithm',
                            return_value=rfc2459.id_dsa_with_sha1):
         with self.assertRaisesRegexp(errors.ValidationError,
                                      "Signature on the CSR is not valid"):
             custom.csr_signature(csr=csr)
Пример #2
0
 def test_csr_signature_bad_sig(self):
     csr = x509_csr.X509Csr.from_buffer(self.csr_sample_bytes)
     with mock.patch.object(x509_csr.X509Csr, '_get_signature',
                            return_value=(b'A'*49)):
         with self.assertRaisesRegexp(errors.ValidationError,
                                      "Signature on the CSR is not valid"):
             custom.csr_signature(csr=csr)
Пример #3
0
 def test_csr_signature_bad_algo(self):
     csr = x509_csr.X509Csr.from_buffer(self.csr_sample_bytes)
     with mock.patch.object(x509_csr.X509Csr,
                            '_get_signing_algorithm',
                            return_value=rfc2459.id_dsa_with_sha1):
         with self.assertRaisesRegexp(errors.ValidationError,
                                      "Signature on the CSR is not valid"):
             custom.csr_signature(csr=csr)
Пример #4
0
 def test_csr_signature_bad_sig(self):
     csr = x509_csr.X509Csr.from_buffer(self.csr_sample_bytes)
     with mock.patch.object(x509_csr.X509Csr,
                            '_get_signature',
                            return_value=(b'A' * 49)):
         with self.assertRaisesRegexp(errors.ValidationError,
                                      "Signature on the CSR is not valid"):
             custom.csr_signature(csr=csr)
Пример #5
0
 def test_csr_signature(self):
     csr = x509_csr.X509Csr.from_buffer(self.csr_sample_bytes)
     self.assertIsNone(custom.csr_signature(csr=csr))
Пример #6
0
 def test_csr_signature(self):
     csr = x509_csr.X509Csr.from_buffer(self.csr_sample_bytes)
     self.assertIsNone(custom.csr_signature(csr=csr))