Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed the deprecated md5 default on CRL.export() #652

Merged
merged 6 commits into from
Jun 30, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
py3k!!!!!
  • Loading branch information
alex committed Jun 30, 2017
commit d9964118b8bcd3dd23dc66f609d342fbfded755b
14 changes: 8 additions & 6 deletions tests/test_crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -3181,7 +3181,9 @@ def test_export_pem(self):
"""
crl = self._get_crl()
# PEM format
dumped_crl = crl.export(self.cert, self.pkey, days=20, digest="sha256")
dumped_crl = crl.export(
self.cert, self.pkey, days=20, digest=b"sha256"
)
text = _runopenssl(dumped_crl, b"crl", b"-noout", b"-text")

# These magic values are based on the way the CRL above was constructed
Expand All @@ -3202,7 +3204,7 @@ def test_export_der(self):

# DER format
dumped_crl = crl.export(
self.cert, self.pkey, FILETYPE_ASN1, digest="md5"
self.cert, self.pkey, FILETYPE_ASN1, digest=b"md5"
)
text = _runopenssl(
dumped_crl, b"crl", b"-noout", b"-text", b"-inform", b"DER"
Expand All @@ -3222,15 +3224,15 @@ def test_export_text(self):
crl = self._get_crl()

dumped_crl = crl.export(
self.cert, self.pkey, FILETYPE_ASN1, digest="md5"
self.cert, self.pkey, FILETYPE_ASN1, digest=b"md5"
)
text = _runopenssl(
dumped_crl, b"crl", b"-noout", b"-text", b"-inform", b"DER"
)

# text format
dumped_text = crl.export(
self.cert, self.pkey, type=FILETYPE_TEXT, digest="md5"
self.cert, self.pkey, type=FILETYPE_TEXT, digest=b"md5"
)
assert text == dumped_text

Expand Down Expand Up @@ -3273,7 +3275,7 @@ def test_export_invalid(self):
"""
crl = CRL()
with pytest.raises(Error):
crl.export(X509(), PKey(), digest="sha256")
crl.export(X509(), PKey(), digest=b"sha256")

def test_add_revoked_keyword(self):
"""
Expand Down Expand Up @@ -3311,7 +3313,7 @@ def test_export_unknown_filetype(self):
"""
crl = CRL()
with pytest.raises(ValueError):
crl.export(self.cert, self.pkey, 100, 10, digest="sha256")
crl.export(self.cert, self.pkey, 100, 10, digest=b"sha256")

def test_export_unknown_digest(self):
"""
Expand Down