summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2019-06-03 18:40:15 (GMT)
committerGitHub <noreply@github.com>2019-06-03 18:40:15 (GMT)
commite35d1ba9eab07a59b98b700c5e18ceb13b2561a6 (patch)
tree0da0371df248afc4d45c4976c6213f44e000eda5 /Modules/_ssl
parent06651ee418b5e4e013195d6b702763a1220706a7 (diff)
downloadcpython-e35d1ba9eab07a59b98b700c5e18ceb13b2561a6.zip
cpython-e35d1ba9eab07a59b98b700c5e18ceb13b2561a6.tar.gz
cpython-e35d1ba9eab07a59b98b700c5e18ceb13b2561a6.tar.bz2
bpo-34271: Fix compatibility with 1.0.2 (GH-13728)
Fix various compatibility issues with LibreSSL and OpenSSL 1.0.2 introduced by bpo-34271. Signed-off-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Modules/_ssl')
-rw-r--r--Modules/_ssl/debughelpers.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Modules/_ssl/debughelpers.c b/Modules/_ssl/debughelpers.c
index 53b9667..858b3d7 100644
--- a/Modules/_ssl/debughelpers.c
+++ b/Modules/_ssl/debughelpers.c
@@ -1,5 +1,12 @@
/* Debug helpers */
+#ifndef SSL3_MT_CHANGE_CIPHER_SPEC
+/* Dummy message type for handling CCS like a normal handshake message
+ * not defined in OpenSSL 1.0.2
+ */
+#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
+#endif
+
static void
_PySSL_msg_callback(int write_p, int version, int content_type,
const void *buf, size_t len, SSL *ssl, void *arg)
@@ -41,11 +48,13 @@ _PySSL_msg_callback(int write_p, int version, int content_type,
case SSL3_RT_HANDSHAKE:
msg_type = (int)cbuf[0];
break;
+#ifdef SSL3_RT_HEADER
case SSL3_RT_HEADER:
/* frame header encodes version in bytes 1..2 */
version = cbuf[1] << 8 | cbuf[2];
msg_type = (int)cbuf[0];
break;
+#endif
#ifdef SSL3_RT_INNER_CONTENT_TYPE
case SSL3_RT_INNER_CONTENT_TYPE:
msg_type = (int)cbuf[0];
@@ -210,4 +219,4 @@ _PySSLContext_set_keylog_filename(PySSLContext *self, PyObject *arg, void *c) {
return 0;
}
-#endif \ No newline at end of file
+#endif