From: Benjamin Peterson Date: Wed, 7 Jan 2015 17:32:00 +0000 (-0600) Subject: use SSL_get_session X-Git-Tag: v3.5.0a1~227 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=baf7c1e5466cb1be6378f6b9ed96f7288bef548d;p=thirdparty%2FPython%2Fcpython.git use SSL_get_session --- diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 55f04ed38a70..596966323e38 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1404,13 +1404,14 @@ cipher_to_tuple(const SSL_CIPHER *cipher) static PyObject *PySSL_shared_ciphers(PySSLSocket *self) { + SSL_SESSION *sess = SSL_get_session(self->ssl); STACK_OF(SSL_CIPHER) *ciphers; int i; PyObject *res; - if (!self->ssl->session || !self->ssl->session->ciphers) + if (!sess || !sess->ciphers) Py_RETURN_NONE; - ciphers = self->ssl->session->ciphers; + ciphers = sess->ciphers; res = PyList_New(sk_SSL_CIPHER_num(ciphers)); if (!res) return NULL;