Commit da1f62a6 authored by ale's avatar ale

switch the digest default to SHA2

parent 537b055e
......@@ -28,7 +28,7 @@ class CA(object):
self.basedir = basedir
self.config = {'basedir': basedir, 'default_days': '365', 'ou': 'CA',
'days': '3650', 'country': 'XX', 'crl_url': '',
'signature_algorithm': 'sha1', 'bits': '2048'}
'signature_algorithm': 'sha256', 'bits': '2048'}
self.config.update(config)
self.files = _CAFiles(basedir,
conf='conf/ca.conf',
......
......@@ -53,15 +53,15 @@ class CATest(unittest.TestCase):
self.assertTrue(os.path.exists(cert.public_key_file))
self.assertTrue(os.path.exists(cert.private_key_file))
def test_create_cert_with_sha2_signature(self):
self.ca.config['signature_algorithm'] = 'sha256'
def test_create_cert_with_digest_override(self):
self.ca.config['signature_algorithm'] = 'md5'
self.ca.create()
cert = CertStub('test', 'www.test.com', self.tmpdir)
self.ca.generate(cert)
self.assertTrue(os.path.exists(cert.public_key_file))
self.assertTrue(os.path.exists(cert.private_key_file))
self.assertTrue(
'Signature Algorithm: sha256WithRSAEncryption' in subprocess.check_output(
'Signature Algorithm: md5WithRSAEncryption' in subprocess.check_output(
['openssl', 'x509', '-text', '-noout', '-in', cert.public_key_file]))
def test_revoke(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment