OpenSSL: Remove extra BIO_write() call on TLS client

openssl_handshake() was checking only that in_data is not NULL and not
its length when determining whether to call BIO_write(). Extend that to
check the buffer length as well. In practice, this removes an
unnecessary BIO_write() call at the beginning of a TLS handshake on the
client side. This did not cause issues with OpenSSL versions up to
1.0.2, but that call seems to fail with the current OpenSSL 1.1.0
degvelopment snapshot. There is no need for that zero-length BIO_write()
call, so remove it.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-07-28 00:54:08 +03:00
parent d8aa603d53
commit e9690eb74e

View file

@ -2795,7 +2795,7 @@ openssl_handshake(struct tls_connection *conn, const struct wpabuf *in_data,
* Give TLS handshake data from the server (if available) to OpenSSL
* for processing.
*/
if (in_data &&
if (in_data && wpabuf_len(in_data) > 0 &&
BIO_write(conn->ssl_in, wpabuf_head(in_data), wpabuf_len(in_data))
< 0) {
tls_show_errors(MSG_INFO, __func__,