summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-01-07 17:32:00 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-01-07 17:32:00 (GMT)
commitbaf7c1e5466cb1be6378f6b9ed96f7288bef548d (patch)
tree7a13f4f6be576c35193be6f830b57a876b91f279 /Modules
parent5318c7aa59ed5fce0fcfdb775d030b9090cef39a (diff)
downloadcpython-baf7c1e5466cb1be6378f6b9ed96f7288bef548d.zip
cpython-baf7c1e5466cb1be6378f6b9ed96f7288bef548d.tar.gz
cpython-baf7c1e5466cb1be6378f6b9ed96f7288bef548d.tar.bz2
use SSL_get_session
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ssl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 55f04ed..5969663 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;