[Python-checkins] cpython: Bypass __get_openssl_constructor() and always use our own blake2 implementation

christian.heimes python-checkins at python.org
Tue Sep 6 20:35:19 EDT 2016


https://hg.python.org/cpython/rev/caad55506549
changeset: 103186:caad55506549
user: Christian Heimes <christian at python.org>
date: Wed Sep 07 02:35:13 2016 +0200
summary:
 Bypass __get_openssl_constructor() and always use our own blake2 implementation
files:
 Lib/hashlib.py | 3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/Lib/hashlib.py b/Lib/hashlib.py
--- a/Lib/hashlib.py
+++ b/Lib/hashlib.py
@@ -101,6 +101,9 @@
 
 
 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
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /