[Python-checkins] cpython: use SSL_get_session

benjamin.peterson python-checkins at python.org
Wed Jan 7 18:32:25 CET 2015


https://hg.python.org/cpython/rev/dd41bc9c5f60
changeset: 94061:dd41bc9c5f60
user: Benjamin Peterson <benjamin at python.org>
date: Wed Jan 07 11:32:00 2015 -0600
summary:
 use SSL_get_session
files:
 Modules/_ssl.c | 5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -1404,13 +1404,14 @@
 
 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;
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /