Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f36631

Browse files
committed
Issue #13885: CVE-2011-3389: the _ssl module would always disable the CBC IV attack countermeasure.
2 parents 722db7b + f2bf8a6 commit 3f36631

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ Core and Builtins
111111
Library
112112
-------
113113

114+
- Issue #13885: CVE-2011-3389: the _ssl module would always disable the CBC
115+
IV attack countermeasure.
116+
114117
- Issue #13772: In os.symlink() under Windows, do not try to guess the link
115118
target's type (file or directory). The detection was buggy and made the
116119
call non-atomic (therefore prone to race conditions).

Modules/_ssl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,8 @@ context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
14811481
self->ctx = ctx;
14821482
/* Defaults */
14831483
SSL_CTX_set_verify(self->ctx, SSL_VERIFY_NONE, NULL);
1484-
SSL_CTX_set_options(self->ctx, SSL_OP_ALL);
1484+
SSL_CTX_set_options(self->ctx,
1485+
SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
14851486

14861487
#define SID_CTX "Python"
14871488
SSL_CTX_set_session_id_context(self->ctx, (const unsigned char *) SID_CTX,
@@ -2143,7 +2144,8 @@ PyInit__ssl(void)
21432144
PY_SSL_VERSION_TLS1);
21442145

21452146
/* protocol options */
2146-
PyModule_AddIntConstant(m, "OP_ALL", SSL_OP_ALL);
2147+
PyModule_AddIntConstant(m, "OP_ALL",
2148+
SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
21472149
PyModule_AddIntConstant(m, "OP_NO_SSLv2", SSL_OP_NO_SSLv2);
21482150
PyModule_AddIntConstant(m, "OP_NO_SSLv3", SSL_OP_NO_SSLv3);
21492151
PyModule_AddIntConstant(m, "OP_NO_TLSv1", SSL_OP_NO_TLSv1);

0 commit comments

Comments
 (0)