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)
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)
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)
def test_csr_signature(self): csr = x509_csr.X509Csr.from_buffer(self.csr_sample_bytes) self.assertIsNone(custom.csr_signature(csr=csr))