bpo-38137: Re-add OpenSSL 1.0.2 compat (GH-16051)
authorChristian Heimes <christian@python.org>
Thu, 12 Sep 2019 14:33:26 +0000 (16:33 +0200)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 12 Sep 2019 14:33:26 +0000 (07:33 -0700)
The defines are required for OpenSSL 1.0.2 and LibreSSL.

https://bugs.python.org/issue38134

Automerge-Triggered-By: @tiran
Modules/_hashopenssl.c

index bea7e5ed31232f29400457a6dbe2a1ee82b0366f..c685279c7a7be9b4c13ab0cf2e684fbba95ddec0 100644 (file)
 #include <openssl/objects.h>
 #include "openssl/err.h"
 
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
+/* OpenSSL < 1.1.0 */
+#define EVP_MD_CTX_new EVP_MD_CTX_create
+#define EVP_MD_CTX_free EVP_MD_CTX_destroy
+#endif
+
 #define MUNCH_SIZE INT_MAX
 
 typedef struct {