[openssl-dev] [openssl.org #4513] [PATCH]

Davide Galassi via RT rt at openssl.org
Mon Apr 18 13:05:27 UTC 2016


Hello,

Given that BIO_connect never returns a value less than 0

crypto/bio/b_sock2.c

 * Returns 1 on success or 0 on failure.  On failure errno is set
 * and an error status is added to the OpenSSL error stack.
 */
int BIO_connect(int sock, const BIO_ADDR *addr, int options);

This call always produces a wrong result

openssl/crypto/bio/bss_conn.c

case BIO_CONN_S_CONNECT:
BIO_clear_retry_flags(b);
ret = BIO_connect(b->num, BIO_ADDRINFO_address(c->addr_iter),
 BIO_SOCK_KEEPALIVE | c->connect_mode);
b->retry_reason = 0;
if (ret < 0) {

I attach a patch with the fix.

Best Regards,

Davide Galassi

-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4513
Please log in as guest with password guest if prompted

-------------- next part --------------
A non-text attachment was scrubbed...
Name: connectfix.patch
Type: application/octet-stream
Size: 971 bytes
Desc: not available
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20160418/4078a657/attachment.obj>


More information about the openssl-dev mailing list