From: Antoine Pitrou Date: Sun, 29 Sep 2013 17:53:45 +0000 (+0200) Subject: Properly initialize all fields of a SSL object after allocation. X-Git-Tag: v3.4.0a4~311^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2201e1aa639fe990f8c0cd79b52a7033d84b32d;p=python Properly initialize all fields of a SSL object after allocation. --- b2201e1aa639fe990f8c0cd79b52a7033d84b32d diff --cc Misc/NEWS index 48851db01f,63601d8f11..8974c4b89f --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -15,9 -18,61 +15,11 @@@ Core and Builtin Library ------- + - Properly initialize all fields of a SSL object after allocation. + +- Issue #19095: SSLSocket.getpeercert() now raises ValueError when the + SSL handshake hasn't been done. + - Issue #4366: Fix building extensions on all platforms when --enable-shared is used. diff --cc Modules/_ssl.c index 3afe89308e,448114bd73..20d02123dd --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@@ -485,9 -455,7 +485,10 @@@ newPySSLSocket(PySSLContext *sslctx, Py self->peer_cert = NULL; self->ssl = NULL; self->Socket = NULL; + self->ctx = sslctx; + self->shutdown_seen_zero = 0; + self->handshake_done = 0; + Py_INCREF(sslctx); /* Make sure the SSL error state is initialized */ (void) ERR_get_state();