summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-11-23 10:24:32 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-11-23 10:24:32 (GMT)
commit2427b50fdda5eafa75a7b3345826ad805ba95d53 (patch)
treee33620a1a0f6c2ba4bccb6b9ac5f71aa1909ae77 /Modules/_ssl.c
parent4a281a12f1aa430a6d14db633cc808e50427adeb (diff)
downloadcpython-2427b50fdda5eafa75a7b3345826ad805ba95d53.zip
cpython-2427b50fdda5eafa75a7b3345826ad805ba95d53.tar.gz
cpython-2427b50fdda5eafa75a7b3345826ad805ba95d53.tar.bz2
Issue #8813: X509_VERIFY_PARAM is only available on OpenSSL 0.9.8+
The patch removes the verify_flags feature on Mac OS X 10.4 with OpenSSL 0.9.7l 28 Sep 2006.
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r--Modules/_ssl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 180355b..c255376 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -198,6 +198,11 @@ static unsigned int _ssl_locks_count = 0;
# define OPENSSL_NO_COMP
#endif
+/* X509_VERIFY_PARAM got added to OpenSSL in 0.9.8 */
+#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
+# define HAVE_OPENSSL_VERIFY_PARAM
+#endif
+
typedef struct {
PyObject_HEAD
@@ -2230,6 +2235,7 @@ set_verify_mode(PySSLContext *self, PyObject *arg, void *c)
return 0;
}
+#ifdef HAVE_OPENSSL_VERIFY_PARAM
static PyObject *
get_verify_flags(PySSLContext *self, void *c)
{
@@ -2267,6 +2273,7 @@ set_verify_flags(PySSLContext *self, PyObject *arg, void *c)
}
return 0;
}
+#endif
static PyObject *
get_options(PySSLContext *self, void *c)
@@ -3088,8 +3095,10 @@ get_ca_certs(PySSLContext *self, PyObject *args, PyObject *kwds)
static PyGetSetDef context_getsetlist[] = {
{"options", (getter) get_options,
(setter) set_options, NULL},
+#ifdef HAVE_OPENSSL_VERIFY_PARAM
{"verify_flags", (getter) get_verify_flags,
(setter) set_verify_flags, NULL},
+#endif
{"verify_mode", (getter) get_verify_mode,
(setter) set_verify_mode, NULL},
{NULL}, /* sentinel */