]> git.sur5r.net Git - openldap/commitdiff
ITS#5928 hide all ldap_pvt_tls APIs when !HAVE_TLS
authorHoward Chu <hyc@openldap.org>
Sun, 8 Feb 2009 03:25:48 +0000 (03:25 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 8 Feb 2009 03:25:48 +0000 (03:25 +0000)
libraries/libldap/cyrus.c
libraries/libldap/tls2.c

index fe12efae82b3fd625d273cde0f82c0bda44d63dd..57d0304313c6da5b1f41ba10a476713e628e7108 100644 (file)
@@ -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 */
index 10ffe2794177b28c7f5816247156790fa9d49d60..baadb1375d3901a2f7753a576ddd4924f4605eff 100644 (file)
@@ -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,