Skip to content

Commit 281e5f8

Browse files
committed
Issue #26470: Use short name rather than name for compression name to fix #27958.
1 parent f4a7381 commit 281e5f8

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Modules/_ssl.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,6 @@ static int COMP_get_type(const COMP_METHOD *meth)
151151
{
152152
return meth->type;
153153
}
154-
155-
static const char *COMP_get_name(const COMP_METHOD *meth)
156-
{
157-
return meth->name;
158-
}
159154
#endif
160155

161156
static pem_password_cb *SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx)
@@ -1644,7 +1639,7 @@ _ssl__SSLSocket_compression_impl(PySSLSocket *self)
16441639
comp_method = SSL_get_current_compression(self->ssl);
16451640
if (comp_method == NULL || COMP_get_type(comp_method) == NID_undef)
16461641
Py_RETURN_NONE;
1647-
short_name = COMP_get_name(comp_method);
1642+
short_name = OBJ_nid2sn(COMP_get_type(comp_method));
16481643
if (short_name == NULL)
16491644
Py_RETURN_NONE;
16501645
return PyUnicode_DecodeFSDefault(short_name);

0 commit comments

Comments
 (0)