From ad62d9da1b50b55f616f54b45f11a6e7165d1f77 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 11 Aug 2005 12:14:24 +0000 Subject: [PATCH] expose ldap_tls_inplace() --- include/ldap.h | 4 ++++ libraries/libldap/tls.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/ldap.h b/include/ldap.h index e5efc52c20..4678bf57c7 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -1337,6 +1337,10 @@ ldap_initialize LDAP_P(( * in tls.c */ +LDAP_F( int ) +ldap_tls_inplace LDAP_P(( + LDAP *ld )); + LDAP_F( int ) ldap_start_tls LDAP_P(( LDAP *ld, diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 6775238aa9..4f7a08b9e6 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -827,6 +827,20 @@ ldap_pvt_tls_inplace ( Sockbuf *sb ) return HAS_TLS( sb ) ? 1 : 0; } +int +ldap_tls_inplace( LDAP *ld ) +{ + Sockbuf *sb = NULL; + int rc; + + rc = ldap_get_option( ld, LDAP_OPT_SOCKBUF, (void *)&sb ); + if ( rc != LDAP_SUCCESS || sb == NULL ) { + return 0; + } + + return ldap_pvt_tls_inplace( sb ); +} + static X509 * tls_get_cert( SSL *s ) { -- 2.39.5