def test_csr_signature_bad_algo(self): csr = x509_csr.X509Csr.from_buffer(self.csr_data) with mock.patch.object(x509_csr.X509Csr, '_get_signing_algorithm', return_value=rfc2459.id_dsa_with_sha1): with self.assertRaisesRegexp(validators.ValidationError, "Signature on the CSR is not valid"): validators.csr_signature(csr=csr)
def test_csr_signature_bad_sig(self): csr = x509_csr.X509Csr.from_buffer(self.csr_data) with mock.patch.object(x509_csr.X509Csr, '_get_signature', return_value=(b'A'*49)): with self.assertRaisesRegexp(validators.ValidationError, "Signature on the CSR is not valid"): validators.csr_signature(csr=csr)
def test_csr_signature_bad_sig(self): csr = x509_csr.X509Csr.from_buffer(self.csr_data) with mock.patch.object(x509_csr.X509Csr, '_get_signature', return_value=(b'A' * 49)): with self.assertRaisesRegexp(validators.ValidationError, "Signature on the CSR is not valid"): validators.csr_signature(csr=csr)
def test_csr_signature(self): csr = x509_csr.X509Csr.from_buffer(self.csr_data) self.assertEqual(None, validators.csr_signature(csr=csr))