From: Howard Chu Date: Sun, 8 Feb 2009 03:25:48 +0000 (+0000) Subject: ITS#5928 hide all ldap_pvt_tls APIs when !HAVE_TLS X-Git-Tag: ACLCHECK_0~864 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4bc8cb6336384920cd0154cc03e6c6b8c101bd91;p=openldap ITS#5928 hide all ldap_pvt_tls APIs when !HAVE_TLS --- diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index fe12efae82..57d0304313 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -467,6 +467,7 @@ ldap_int_sasl_bind( ctx = ld->ld_defconn->lconn_sasl_authctx; +#ifdef HAVE_TLS /* Check for TLS */ ssl = ldap_pvt_tls_sb_ctx( ld->ld_defconn->lconn_sb ); if ( ssl ) { @@ -480,6 +481,7 @@ ldap_int_sasl_bind( (void) ldap_int_sasl_external( ld, ld->ld_defconn, authid.bv_val, fac ); LDAP_FREE( authid.bv_val ); } +#endif #if !defined(_WIN32) /* Check for local */ diff --git a/libraries/libldap/tls2.c b/libraries/libldap/tls2.c index 10ffe27941..baadb1375d 100644 --- a/libraries/libldap/tls2.c +++ b/libraries/libldap/tls2.c @@ -74,6 +74,8 @@ static oid_name oids[] = { { BER_BVNULL, BER_BVNULL } }; +#ifdef HAVE_TLS + void ldap_pvt_tls_ctx_free ( void *c ) { @@ -848,13 +850,10 @@ ldap_int_tls_start ( LDAP *ld, LDAPConn *conn, LDAPURLDesc *srv ) void * ldap_pvt_tls_sb_ctx( Sockbuf *sb ) { -#ifdef HAVE_TLS void *p = NULL; ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_SSL, (void *)&p ); return p; -#endif - return NULL; } int @@ -865,11 +864,9 @@ ldap_pvt_tls_get_strength( void *s ) return tls_imp->ti_session_strength( session ); } - int ldap_pvt_tls_get_my_dn( void *s, struct berval *dn, LDAPDN_rewrite_dummy *func, unsigned flags ) { -#ifdef HAVE_TLS tls_session *session = s; struct berval der_dn; int rc; @@ -877,10 +874,8 @@ ldap_pvt_tls_get_my_dn( void *s, struct berval *dn, LDAPDN_rewrite_dummy *func, tls_imp->ti_session_my_dn( session, &der_dn ); rc = ldap_X509dn2bv(&der_dn, dn, (LDAPDN_rewrite_func *)func, flags ); return rc; -#else /* !HAVE_TLS */ - return LDAP_NOT_SUPPORTED; -#endif } +#endif /* HAVE_TLS */ int ldap_start_tls( LDAP *ld,