You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/10/06 17:44:22 UTC

[jira] [Commented] (THRIFT-3944) TSSLSocket has dead code in checkHandshake

    [ https://issues.apache.org/jira/browse/THRIFT-3944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15552630#comment-15552630 ] 

ASF GitHub Bot commented on THRIFT-3944:
----------------------------------------

GitHub user tpcwang opened a pull request:

    https://github.com/apache/thrift/pull/1110

    THRIFT-3944 TSSLSocket has dead code in checkHandshake

    See https://issues.apache.org/jira/browse/THRIFT-3944 for why I think this can be safely removed without changing functionality.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tpcwang/thrift THRIFT-3944

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/1110.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1110
    
----
commit fe26d8ad37f82a5a8231e8ab3f0b794912b1eb99
Author: tpcwang <tp...@gmail.com>
Date:   2016-10-06T17:41:44Z

    THRIFT-3944 TSSLSocket has dead code in checkHandshake

----


> TSSLSocket has dead code in checkHandshake
> ------------------------------------------
>
>                 Key: THRIFT-3944
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3944
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9.3
>            Reporter: Ted Wang
>            Assignee: Ted Wang
>            Priority: Minor
>
> There is a block of code in checkHandshake that attempts to set read/write memory bios to be nonblocking. This code doesn't do anything:
> https://github.com/apache/thrift/blob/master/lib/cpp/src/thrift/transport/TSSLSocket.cpp#L441
> Here's what this code looks like, and the problems:
> - BIO_new(BIO_s_mem()) creates a new memory BIO. Not sure why.
> - BIO_set_nbio() executes BIO_ctrl(..., BIO_C_SET_NBIO, ...). This errors out and return 0 because mem_ctrl does not have a case for BIO_C_SET_NBIO. See: https://github.com/openssl/openssl/blob/6f0ac0e2f27d9240516edb9a23b7863e7ad02898/crypto/bio/bss_mem.c#L226
> - SSL_set_bio() sets the SSL* to use the memory BIOs.
> - SSL_set_fd() creates a socket BIO, sets the FD on it, and uses SSL_set_bio() to replace the memory BIOs.
> As far as I can tell, this block of code does nothing and will not change functionality. If there's a reason that it's there, it needs to be re-implemented.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)