]> granicus.if.org Git - python/commitdiff
Issue #26470: Use short name rather than name for compression name to fix #27958.
authorChristian Heimes <christian@python.org>
Mon, 5 Sep 2016 23:10:39 +0000 (01:10 +0200)
committerChristian Heimes <christian@python.org>
Mon, 5 Sep 2016 23:10:39 +0000 (01:10 +0200)
Modules/_ssl.c

index d1f790032801ba9b9d730bd45d27ad2e45d471cd..589ea70a513fc7815727a470804d4a83265a85cf 100644 (file)
@@ -148,11 +148,6 @@ static int COMP_get_type(const COMP_METHOD *meth)
 {
     return meth->type;
 }
-
-static const char *COMP_get_name(const COMP_METHOD *meth)
-{
-    return meth->name;
-}
 #endif
 
 static pem_password_cb *SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx)
@@ -1519,7 +1514,7 @@ static PyObject *PySSL_compression(PySSLSocket *self) {
     comp_method = SSL_get_current_compression(self->ssl);
     if (comp_method == NULL || COMP_get_type(comp_method) == NID_undef)
         Py_RETURN_NONE;
-    short_name = COMP_get_name(comp_method);
+    short_name = OBJ_nid2sn(COMP_get_type(comp_method));
     if (short_name == NULL)
         Py_RETURN_NONE;
     return PyBytes_FromString(short_name);