From 1ecc75ad1cdf458c2aa7192844e83c4665a5f9b5 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 16 Sep 2019 12:48:03 -0700 Subject: [PATCH] bpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ (GH-16140) ``OPENSSL_VERSION_1_1`` was never defined in ``_hashopenssl.c``. https://bugs.python.org/issue33936 (cherry picked from commit 724f1a57231f9287c37255adf0e4364d12cf693d) Co-authored-by: Christian Heimes --- .../next/Library/2019-09-14-10-34-00.bpo-33936.8wCI_n.rst | 2 ++ Modules/_hashopenssl.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2019-09-14-10-34-00.bpo-33936.8wCI_n.rst 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 index 0000000000..7bc7fed483 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-09-14-10-34-00.bpo-33936.8wCI_n.rst @@ -0,0 +1,2 @@ +_hashlib no longer calls obsolete OpenSSL initialization function with +OpenSSL 1.1.0+. diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index 0e29fe1d33..84906a4da4 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -1105,7 +1105,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(); -- 2.50.1