From 9e88ae19e26d6f7ab59909dcc0a36671814ff339 Mon Sep 17 00:00:00 2001 From: Voro Date: Tue, 14 Mar 2017 11:13:30 +0100 Subject: [PATCH] Upgrade default hash from sha1 to sha256 --- itsdangerous.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/itsdangerous.py b/itsdangerous.py index 87c6d73..a26a82a 100644 --- a/itsdangerous.py +++ b/itsdangerous.py @@ -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: @@ -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``