From: Christian Heimes Date: Wed, 7 Sep 2016 00:35:13 +0000 (+0200) Subject: Bypass __get_openssl_constructor() and always use our own blake2 implementation X-Git-Tag: v3.6.0b1~376 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=32a2ceead7ad86c1641f24b710c4d4683c1e98f3;p=thirdparty%2FPython%2Fcpython.git Bypass __get_openssl_constructor() and always use our own blake2 implementation --- diff --git a/Lib/hashlib.py b/Lib/hashlib.py index 40ccdec351e2..2d5e92ea3387 100644 --- a/Lib/hashlib.py +++ b/Lib/hashlib.py @@ -101,6 +101,9 @@ def __get_builtin_constructor(name): def __get_openssl_constructor(name): + if name in {'blake2b', 'blake2s'}: + # Prefer our blake2 implementation. + return __get_builtin_constructor(name) try: f = getattr(_hashlib, 'openssl_' + name) # Allow the C module to raise ValueError. The function will be