Commit 9af7faca authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

ldap: Return an error when the server doesn't respond to the SSL handshake.

parent c268e5c8
...@@ -221,8 +221,8 @@ tlsw_session_connect( LDAP *ld, tls_session *session, const char *name_in ) ...@@ -221,8 +221,8 @@ tlsw_session_connect( LDAP *ld, tls_session *session, const char *name_in )
while ( expected > 0 ) { while ( expected > 0 ) {
size = tlsw_recv( s->sbiod, (char *)in_bufs[0].pvBuffer + recv_offset, expected ); size = tlsw_recv( s->sbiod, (char *)in_bufs[0].pvBuffer + recv_offset, expected );
if ( size < 0 ) if ( size <= 0 )
break; goto done;
in_bufs[0].cbBuffer += size; in_bufs[0].cbBuffer += size;
recv_offset += size; recv_offset += size;
expected -= size; expected -= size;
...@@ -239,6 +239,7 @@ tlsw_session_connect( LDAP *ld, tls_session *session, const char *name_in ) ...@@ -239,6 +239,7 @@ tlsw_session_connect( LDAP *ld, tls_session *session, const char *name_in )
} }
} }
done:
ber_memfree( in_bufs[0].pvBuffer ); ber_memfree( in_bufs[0].pvBuffer );
FreeContextBuffer( out_bufs[0].pvBuffer ); FreeContextBuffer( out_bufs[0].pvBuffer );
return status == SEC_E_OK ? 0 : -1; return status == SEC_E_OK ? 0 : -1;
...@@ -247,7 +248,7 @@ tlsw_session_connect( LDAP *ld, tls_session *session, const char *name_in ) ...@@ -247,7 +248,7 @@ tlsw_session_connect( LDAP *ld, tls_session *session, const char *name_in )
static int static int
tlsw_session_upflags( Sockbuf *sb, tls_session *session, int rc ) tlsw_session_upflags( Sockbuf *sb, tls_session *session, int rc )
{ {
return -1; return 0;
} }
static char * static char *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment