diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-01-07 17:32:00 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-01-07 17:32:00 (GMT) |
commit | baf7c1e5466cb1be6378f6b9ed96f7288bef548d (patch) | |
tree | 7a13f4f6be576c35193be6f830b57a876b91f279 /Modules | |
parent | 5318c7aa59ed5fce0fcfdb775d030b9090cef39a (diff) | |
download | cpython-baf7c1e5466cb1be6378f6b9ed96f7288bef548d.zip cpython-baf7c1e5466cb1be6378f6b9ed96f7288bef548d.tar.gz cpython-baf7c1e5466cb1be6378f6b9ed96f7288bef548d.tar.bz2 |
use SSL_get_session
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ssl.c | 5 |
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; |