Skip to content

Commit

Permalink
let's deprecate some hashes we should never have exposed (#3584)
Browse files Browse the repository at this point in the history
  • Loading branch information
reaperhulk authored and alex committed May 23, 2017
1 parent 51ef0eb commit 70e8f90
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions docs/hazmat/primitives/cryptographic-hashes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~

Expand Down
16 changes: 16 additions & 0 deletions src/cryptography/hazmat/primitives/hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,29 @@ 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"
digest_size = 64
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"
Expand Down

0 comments on commit 70e8f90

Please sign in to comment.