]> granicus.if.org Git - python/commitdiff
bpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ (GH-16140)
authorChristian Heimes <christian@python.org>
Mon, 16 Sep 2019 19:10:05 +0000 (21:10 +0200)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 16 Sep 2019 19:10:05 +0000 (12:10 -0700)
``OPENSSL_VERSION_1_1`` was never defined in ``_hashopenssl.c``.

https://bugs.python.org/issue33936

Misc/NEWS.d/next/Library/2019-09-14-10-34-00.bpo-33936.8wCI_n.rst [new file with mode: 0644]
Modules/_hashopenssl.c

diff --git a/Misc/NEWS.d/next/Library/2019-09-14-10-34-00.bpo-33936.8wCI_n.rst b/Misc/NEWS.d/next/Library/2019-09-14-10-34-00.bpo-33936.8wCI_n.rst
new file mode 100644 (file)
index 0000000..7bc7fed
--- /dev/null
@@ -0,0 +1,2 @@
+_hashlib no longer calls obsolete OpenSSL initialization function with
+OpenSSL 1.1.0+.
index b86cbd09743ec220033bbcddd15e7f08e06c8432..d963c7a57221bce8dc9764ea6fe55fab57851010 100644 (file)
@@ -1138,7 +1138,7 @@ PyInit__hashlib(void)
 {
     PyObject *m, *openssl_md_meth_names;
 
-#ifndef OPENSSL_VERSION_1_1
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
     /* Load all digest algorithms and initialize cpuid */
     OPENSSL_add_all_algorithms_noconf();
     ERR_load_crypto_strings();