Commit 9e829b6e authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#5920

parent 095cf801
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
#endif #endif
static tls_impl *tls_imp = &ldap_int_tls_impl; static tls_impl *tls_imp = &ldap_int_tls_impl;
#define HAS_TLS( sb ) ber_sockbuf_ctrl( sb, LBER_SB_OPT_HAS_IO, \
(void *)tls_imp->ti_sbio )
#endif /* HAVE_TLS */ #endif /* HAVE_TLS */
...@@ -329,8 +331,9 @@ ldap_int_tls_connect( LDAP *ld, LDAPConn *conn ) ...@@ -329,8 +331,9 @@ ldap_int_tls_connect( LDAP *ld, LDAPConn *conn )
int err; int err;
tls_session *ssl = NULL; tls_session *ssl = NULL;
if ( HAS_TLS( sb )) {
ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_SSL, (void *)&ssl ); ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_SSL, (void *)&ssl );
if ( !ssl ) { } else {
struct ldapoptions *lo; struct ldapoptions *lo;
tls_ctx *ctx; tls_ctx *ctx;
...@@ -410,8 +413,9 @@ ldap_pvt_tls_accept( Sockbuf *sb, void *ctx_arg ) ...@@ -410,8 +413,9 @@ ldap_pvt_tls_accept( Sockbuf *sb, void *ctx_arg )
int err; int err;
tls_session *ssl = NULL; tls_session *ssl = NULL;
if ( HAS_TLS( sb )) {
ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_SSL, (void *)&ssl ); ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_SSL, (void *)&ssl );
if ( !ssl ) { } else {
ssl = alloc_handle( ctx_arg, 1 ); ssl = alloc_handle( ctx_arg, 1 );
if ( ssl == NULL ) return -1; if ( ssl == NULL ) return -1;
...@@ -451,10 +455,7 @@ ldap_pvt_tls_accept( Sockbuf *sb, void *ctx_arg ) ...@@ -451,10 +455,7 @@ ldap_pvt_tls_accept( Sockbuf *sb, void *ctx_arg )
int int
ldap_pvt_tls_inplace ( Sockbuf *sb ) ldap_pvt_tls_inplace ( Sockbuf *sb )
{ {
tls_session *ssl = NULL; return HAS_TLS( sb ) ? 1 : 0;
ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_SSL, (void *)&ssl );
return ssl != NULL;
} }
int int
......
Supports Markdown
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