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

Upgrade default hash from sha1 to sha256 #78

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
8 changes: 4 additions & 4 deletions itsdangerous.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ def get_signature(self, key, value):
class HMACAlgorithm(SigningAlgorithm):
"""This class provides signature generation using HMACs."""

#: The digest method to use with the MAC algorithm. This defaults to sha1
#: The digest method to use with the MAC algorithm. This defaults to sha256
#: but can be changed for any other function in the hashlib module.
default_digest_method = staticmethod(hashlib.sha1)
default_digest_method = staticmethod(hashlib.sha256)

def __init__(self, digest_method=None):
if digest_method is None:
Expand Down Expand Up @@ -295,11 +295,11 @@ class constructor.
`algorithm` was added as an argument to the class constructor.
"""

#: The digest method to use for the signer. This defaults to sha1 but can
#: The digest method to use for the signer. This defaults to sha256 but can
#: be changed for any other function in the hashlib module.
#:
#: .. versionchanged:: 0.14
default_digest_method = staticmethod(hashlib.sha1)
default_digest_method = staticmethod(hashlib.sha256)

#: Controls how the key is derived. The default is Django style
#: concatenation. Possible values are ``concat``, ``django-concat``
Expand Down