aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-05-23 16:55:19 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2017-05-23 16:55:19 -0700
commit70e8f90b250ba65167943f67cb851495bc7b8add (patch)
treebd5beb5b58f938049ff5478a17459d6ea0b89e62
parent51ef0eb1020327ddf626ee5c8504b0dfe218b2ba (diff)
downloadcryptography-70e8f90b250ba65167943f67cb851495bc7b8add.tar.gz
cryptography-70e8f90b250ba65167943f67cb851495bc7b8add.tar.bz2
cryptography-70e8f90b250ba65167943f67cb851495bc7b8add.zip
let's deprecate some hashes we should never have exposed (#3584)
-rw-r--r--CHANGELOG.rst1
-rw-r--r--docs/hazmat/primitives/cryptographic-hashes.rst16
-rw-r--r--src/cryptography/hazmat/primitives/hashes.py16
3 files changed, 17 insertions, 16 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index a1fdea7e..822a8c8a 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -27,6 +27,7 @@ Changelog
extensions only need to be rejected on certificate verification.
* The CommonCrypto backend has been removed.
* MultiBackend has been removed.
+* ``Whirlpool`` and ``RIPEMD160`` have been deprecated.
1.8.1 - 2017-03-10
diff --git a/docs/hazmat/primitives/cryptographic-hashes.rst b/docs/hazmat/primitives/cryptographic-hashes.rst
index d3e9eb4d..55af21ac 100644
--- a/docs/hazmat/primitives/cryptographic-hashes.rst
+++ b/docs/hazmat/primitives/cryptographic-hashes.rst
@@ -150,22 +150,6 @@ SHA-1
vulnerable to practical collision attacks, and collisions have been
demonstrated.
-RIPEMD160
-~~~~~~~~~
-
-.. class:: RIPEMD160()
-
- RIPEMD160 is a cryptographic hash function that is part of ISO/IEC
- 10118-3:2004. It produces a 160-bit message digest.
-
-Whirlpool
-~~~~~~~~~
-
-.. class:: Whirlpool()
-
- Whirlpool is a cryptographic hash function that is part of ISO/IEC
- 10118-3:2004. It produces a 512-bit message digest.
-
MD5
~~~
diff --git a/src/cryptography/hazmat/primitives/hashes.py b/src/cryptography/hazmat/primitives/hashes.py
index 0714c118..e1172d9d 100644
--- a/src/cryptography/hazmat/primitives/hashes.py
+++ b/src/cryptography/hazmat/primitives/hashes.py
@@ -149,6 +149,14 @@ class RIPEMD160(object):
block_size = 64
+RIPEMD160 = utils.deprecated(
+ RIPEMD160,
+ __name__,
+ "The RIPEMD160 hash was deprecated in version 1.9.",
+ utils.DeprecatedIn19
+)
+
+
@utils.register_interface(HashAlgorithm)
class Whirlpool(object):
name = "whirlpool"
@@ -156,6 +164,14 @@ class Whirlpool(object):
block_size = 64
+Whirlpool = utils.deprecated(
+ Whirlpool,
+ __name__,
+ "The Whirlpool hash was deprecated in version 1.9.",
+ utils.DeprecatedIn19
+)
+
+
@utils.register_interface(HashAlgorithm)
class MD5(object):
name = "md5"