3 * Copyright 1999-2002 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <ac/socket.h>
12 #include <ac/stdlib.h>
13 #include <ac/string.h>
20 #ifdef HAVE_CYRUS_SASL
23 ldap_pvt_thread_mutex_t ldap_int_sasl_mutex;
29 * Various Cyrus SASL related stuff.
32 int ldap_int_sasl_init( void )
34 /* XXX not threadsafe */
35 static int sasl_initialized = 0;
37 static sasl_callback_t client_callbacks[] = {
38 #ifdef SASL_CB_GETREALM
39 { SASL_CB_GETREALM, NULL, NULL },
41 { SASL_CB_USER, NULL, NULL },
42 { SASL_CB_AUTHNAME, NULL, NULL },
43 { SASL_CB_PASS, NULL, NULL },
44 { SASL_CB_ECHOPROMPT, NULL, NULL },
45 { SASL_CB_NOECHOPROMPT, NULL, NULL },
46 { SASL_CB_LIST_END, NULL, NULL }
49 if ( sasl_initialized ) {
59 #endif /* CSRIMALLOC */
63 ldap_pvt_sasl_mutex_new,
64 ldap_pvt_sasl_mutex_lock,
65 ldap_pvt_sasl_mutex_unlock,
66 ldap_pvt_sasl_mutex_dispose );
68 ldap_pvt_thread_mutex_init( &ldap_int_sasl_mutex );
71 if ( sasl_client_init( client_callbacks ) == SASL_OK ) {
80 * SASL encryption support for LBER Sockbufs
84 sasl_conn_t *sasl_context;
85 unsigned *sasl_maxbuf;
86 Sockbuf_Buf sec_buf_in;
92 sb_sasl_setup( Sockbuf_IO_Desc *sbiod, void *arg )
94 struct sb_sasl_data *p;
96 assert( sbiod != NULL );
98 p = LBER_MALLOC( sizeof( *p ) );
101 p->sasl_context = (sasl_conn_t *)arg;
102 ber_pvt_sb_buf_init( &p->sec_buf_in );
103 ber_pvt_sb_buf_init( &p->buf_in );
104 ber_pvt_sb_buf_init( &p->buf_out );
105 if ( ber_pvt_sb_grow_buffer( &p->sec_buf_in, SASL_MIN_BUFF_SIZE ) < 0 ) {
110 sasl_getprop( p->sasl_context, SASL_MAXOUTBUF,
111 (void **) &p->sasl_maxbuf );
113 sbiod->sbiod_pvt = p;
119 sb_sasl_remove( Sockbuf_IO_Desc *sbiod )
121 struct sb_sasl_data *p;
123 assert( sbiod != NULL );
125 p = (struct sb_sasl_data *)sbiod->sbiod_pvt;
126 ber_pvt_sb_buf_destroy( &p->sec_buf_in );
127 ber_pvt_sb_buf_destroy( &p->buf_in );
128 ber_pvt_sb_buf_destroy( &p->buf_out );
130 sbiod->sbiod_pvt = NULL;
135 sb_sasl_pkt_length( const unsigned char *buf, unsigned max, int debuglevel )
139 assert( buf != NULL );
147 /* somebody is trying to mess me up. */
148 ber_log_printf( LDAP_DEBUG_ANY, debuglevel,
149 "sb_sasl_pkt_length: received illegal packet length "
150 "of %lu bytes\n", (unsigned long)size );
151 size = 16; /* this should lead to an error. */
154 return size + 4; /* include the size !!! */
157 /* Drop a processed packet from the input buffer */
159 sb_sasl_drop_packet ( Sockbuf_Buf *sec_buf_in, unsigned max, int debuglevel )
163 len = sec_buf_in->buf_ptr - sec_buf_in->buf_end;
165 AC_MEMCPY( sec_buf_in->buf_base, sec_buf_in->buf_base +
166 sec_buf_in->buf_end, len );
169 sec_buf_in->buf_end = sb_sasl_pkt_length( sec_buf_in->buf_base,
173 sec_buf_in->buf_end = 0;
175 sec_buf_in->buf_ptr = len;
179 sb_sasl_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
181 struct sb_sasl_data *p;
182 ber_slen_t ret, bufptr;
184 assert( sbiod != NULL );
185 assert( SOCKBUF_VALID( sbiod->sbiod_sb ) );
187 p = (struct sb_sasl_data *)sbiod->sbiod_pvt;
189 /* Are there anything left in the buffer? */
190 ret = ber_pvt_sb_copy_out( &p->buf_in, buf, len );
197 ber_pvt_sb_buf_destroy( &p->buf_in );
199 /* Read the length of the packet */
200 while ( p->sec_buf_in.buf_ptr < 4 ) {
201 ret = LBER_SBIOD_READ_NEXT( sbiod, p->sec_buf_in.buf_base,
202 4 - p->sec_buf_in.buf_ptr );
204 if ( ( ret < 0 ) && ( errno == EINTR ) )
210 p->sec_buf_in.buf_ptr += ret;
213 /* The new packet always starts at p->sec_buf_in.buf_base */
214 ret = sb_sasl_pkt_length( p->sec_buf_in.buf_base,
215 *p->sasl_maxbuf, sbiod->sbiod_sb->sb_debug );
217 /* Grow the packet buffer if neccessary */
218 if ( ( p->sec_buf_in.buf_size < (ber_len_t) ret ) &&
219 ber_pvt_sb_grow_buffer( &p->sec_buf_in, ret ) < 0 ) {
223 p->sec_buf_in.buf_end = ret;
225 /* Did we read the whole encrypted packet? */
226 while ( p->sec_buf_in.buf_ptr < p->sec_buf_in.buf_end ) {
227 /* No, we have got only a part of it */
228 ret = p->sec_buf_in.buf_end - p->sec_buf_in.buf_ptr;
230 ret = LBER_SBIOD_READ_NEXT( sbiod, p->sec_buf_in.buf_base +
231 p->sec_buf_in.buf_ptr, ret );
233 if ( ( ret < 0 ) && ( errno == EINTR ) )
239 p->sec_buf_in.buf_ptr += ret;
242 /* Decode the packet */
243 ret = sasl_decode( p->sasl_context, p->sec_buf_in.buf_base,
244 p->sec_buf_in.buf_end, &p->buf_in.buf_base,
245 (unsigned *)&p->buf_in.buf_end );
247 /* Drop the packet from the input buffer */
248 sb_sasl_drop_packet( &p->sec_buf_in,
249 *p->sasl_maxbuf, sbiod->sbiod_sb->sb_debug );
251 if ( ret != SASL_OK ) {
252 ber_log_printf( LDAP_DEBUG_ANY, sbiod->sbiod_sb->sb_debug,
253 "sb_sasl_read: failed to decode packet: %s\n",
254 sasl_errstring( ret, NULL, NULL ) );
259 p->buf_in.buf_size = p->buf_in.buf_end;
261 bufptr += ber_pvt_sb_copy_out( &p->buf_in, (char*) buf + bufptr, len );
267 sb_sasl_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
269 struct sb_sasl_data *p;
272 assert( sbiod != NULL );
273 assert( SOCKBUF_VALID( sbiod->sbiod_sb ) );
275 p = (struct sb_sasl_data *)sbiod->sbiod_pvt;
277 /* Are there anything left in the buffer? */
278 if ( p->buf_out.buf_ptr != p->buf_out.buf_end ) {
279 ret = ber_pvt_sb_do_write( sbiod, &p->buf_out );
284 /* now encode the next packet. */
285 ber_pvt_sb_buf_destroy( &p->buf_out );
287 if ( len > *p->sasl_maxbuf - 100 )
288 len = *p->sasl_maxbuf - 100; /* For safety margin */
289 ret = sasl_encode( p->sasl_context, buf, len, &p->buf_out.buf_base,
290 (unsigned *)&p->buf_out.buf_size );
291 if ( ret != SASL_OK ) {
292 ber_log_printf( LDAP_DEBUG_ANY, sbiod->sbiod_sb->sb_debug,
293 "sb_sasl_write: failed to encode packet: %s\n",
294 sasl_errstring( ret, NULL, NULL ) );
297 p->buf_out.buf_end = p->buf_out.buf_size;
299 ret = ber_pvt_sb_do_write( sbiod, &p->buf_out );
306 sb_sasl_ctrl( Sockbuf_IO_Desc *sbiod, int opt, void *arg )
308 struct sb_sasl_data *p;
310 p = (struct sb_sasl_data *)sbiod->sbiod_pvt;
312 if ( opt == LBER_SB_OPT_DATA_READY ) {
313 if ( p->buf_in.buf_ptr != p->buf_in.buf_end )
317 return LBER_SBIOD_CTRL_NEXT( sbiod, opt, arg );
320 Sockbuf_IO ldap_pvt_sockbuf_io_sasl = {
321 sb_sasl_setup, /* sbi_setup */
322 sb_sasl_remove, /* sbi_remove */
323 sb_sasl_ctrl, /* sbi_ctrl */
324 sb_sasl_read, /* sbi_read */
325 sb_sasl_write, /* sbi_write */
329 int ldap_pvt_sasl_install( Sockbuf *sb, void *ctx_arg )
331 Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_install\n",
334 /* don't install the stuff unless security has been negotiated */
336 if ( !ber_sockbuf_ctrl( sb, LBER_SB_OPT_HAS_IO,
337 &ldap_pvt_sockbuf_io_sasl ) )
340 ber_sockbuf_add_io( sb, &ber_sockbuf_io_debug,
341 LBER_SBIOD_LEVEL_APPLICATION, (void *)"sasl_" );
343 ber_sockbuf_add_io( sb, &ldap_pvt_sockbuf_io_sasl,
344 LBER_SBIOD_LEVEL_APPLICATION, ctx_arg );
351 sasl_err2ldap( int saslerr )
357 rc = LDAP_MORE_RESULTS_TO_RETURN;
360 rc = LDAP_LOCAL_ERROR;
366 rc = LDAP_LOCAL_ERROR;
372 rc = LDAP_AUTH_UNKNOWN;
375 rc = LDAP_AUTH_UNKNOWN;
378 rc = LDAP_PARAM_ERROR;
382 rc = LDAP_AUTH_UNKNOWN;
385 rc = LDAP_LOCAL_ERROR;
389 assert( rc == LDAP_SUCCESS || LDAP_API_ERROR( rc ) );
403 assert( lc->lconn_sasl_ctx == NULL );
405 if ( host == NULL ) {
406 ld->ld_errno = LDAP_LOCAL_ERROR;
410 rc = sasl_client_new( "ldap", host, NULL,
411 SASL_SECURITY_LAYER, &ctx );
413 if ( rc != SASL_OK ) {
414 ld->ld_errno = sasl_err2ldap( rc );
418 Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: host=%s\n",
421 lc->lconn_sasl_ctx = ctx;
424 sasl_external_properties_t extprops;
425 memset(&extprops, 0L, sizeof(extprops));
428 (void) sasl_setprop( ctx, SASL_SSF_EXTERNAL,
429 (void *) &extprops );
431 Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: ssf=%ld\n",
438 int ldap_int_sasl_close( LDAP *ld, LDAPConn *lc )
440 sasl_conn_t *ctx = lc->lconn_sasl_ctx;
443 sasl_dispose( &ctx );
444 lc->lconn_sasl_ctx = NULL;
455 LDAPControl **sctrls,
456 LDAPControl **cctrls,
458 LDAP_SASL_INTERACT_PROC *interact,
462 const char *mech = NULL;
463 const char *pmech = NULL;
465 sasl_ssf_t *ssf = NULL;
467 sasl_interact_t *prompts = NULL;
472 Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: %s\n",
473 mechs ? mechs : "<null>", 0, 0 );
475 /* do a quick !LDAPv3 check... ldap_sasl_bind will do the rest. */
476 if (ld->ld_version < LDAP_VERSION3) {
477 ld->ld_errno = LDAP_NOT_SUPPORTED;
481 ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_GET_FD, &sd );
483 if ( sd == AC_SOCKET_INVALID ) {
484 /* not connected yet */
487 rc = ldap_open_defconn( ld );
488 if( rc < 0 ) return ld->ld_errno;
490 ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_GET_FD, &sd );
492 if( sd == AC_SOCKET_INVALID ) {
493 ld->ld_errno = LDAP_LOCAL_ERROR;
498 ctx = ld->ld_defconn->lconn_sasl_ctx;
501 ld->ld_errno = LDAP_LOCAL_ERROR;
505 /* (re)set security properties */
506 sasl_setprop( ctx, SASL_SEC_PROPS,
507 &ld->ld_options.ldo_sasl_secprops );
513 saslrc = sasl_client_start( ctx,
521 if( pmech == NULL && mech != NULL ) {
524 if( flags != LDAP_SASL_QUIET ) {
526 "SASL/%s authentication started\n",
531 if( saslrc == SASL_INTERACT ) {
533 if( !interact ) break;
534 res = (interact)( ld, flags, defaults, prompts );
535 if( res != LDAP_SUCCESS ) {
539 } while ( saslrc == SASL_INTERACT );
541 ccred.bv_len = credlen;
543 if ( (saslrc != SASL_OK) && (saslrc != SASL_CONTINUE) ) {
544 ld->ld_errno = sasl_err2ldap( saslrc );
549 struct berval *scred;
554 rc = ldap_sasl_bind_s( ld, dn, mech, &ccred, sctrls, cctrls, &scred );
556 if ( ccred.bv_val != NULL ) {
557 LDAP_FREE( ccred.bv_val );
561 if ( rc != LDAP_SUCCESS && rc != LDAP_SASL_BIND_IN_PROGRESS ) {
562 if( scred && scred->bv_len ) {
563 /* and server provided us with data? */
564 Debug( LDAP_DEBUG_TRACE,
565 "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
566 rc, saslrc, scred->bv_len );
572 if( rc == LDAP_SUCCESS && saslrc == SASL_OK ) {
573 /* we're done, no need to step */
574 if( scred && scred->bv_len ) {
575 /* but server provided us with data! */
576 Debug( LDAP_DEBUG_TRACE,
577 "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
578 rc, saslrc, scred->bv_len );
580 return ld->ld_errno = LDAP_LOCAL_ERROR;
586 saslrc = sasl_client_step( ctx,
587 (scred == NULL) ? NULL : scred->bv_val,
588 (scred == NULL) ? 0 : scred->bv_len,
593 Debug( LDAP_DEBUG_TRACE, "sasl_client_step: %d\n",
596 if( saslrc == SASL_INTERACT ) {
598 if( !interact ) break;
599 res = (interact)( ld, flags, defaults, prompts );
600 if( res != LDAP_SUCCESS ) {
604 } while ( saslrc == SASL_INTERACT );
606 ccred.bv_len = credlen;
609 if ( (saslrc != SASL_OK) && (saslrc != SASL_CONTINUE) ) {
610 ld->ld_errno = sasl_err2ldap( saslrc );
613 } while ( rc == LDAP_SASL_BIND_IN_PROGRESS );
615 if ( rc != LDAP_SUCCESS ) {
619 if ( saslrc != SASL_OK ) {
620 return ld->ld_errno = sasl_err2ldap( saslrc );
623 if( flags != LDAP_SASL_QUIET ) {
624 saslrc = sasl_getprop( ctx, SASL_USERNAME, (void **) &data );
625 if( saslrc == SASL_OK && data && *data ) {
626 fprintf( stderr, "SASL username: %s\n", data );
629 saslrc = sasl_getprop( ctx, SASL_REALM, (void **) &data );
630 if( saslrc == SASL_OK && data && *data ) {
631 fprintf( stderr, "SASL realm: %s\n", data );
635 saslrc = sasl_getprop( ctx, SASL_SSF, (void **) &ssf );
636 if( saslrc == SASL_OK ) {
637 if( flags != LDAP_SASL_QUIET ) {
638 fprintf( stderr, "SASL SSF: %lu\n",
639 (unsigned long) *ssf );
643 if( flags != LDAP_SASL_QUIET ) {
644 fprintf( stderr, "SASL installing layers\n" );
646 ldap_pvt_sasl_install( ld->ld_conns->lconn_sb, ctx );
654 ldap_int_sasl_external(
662 sasl_external_properties_t extprops;
664 ctx = conn->lconn_sasl_ctx;
667 return LDAP_LOCAL_ERROR;
670 memset( &extprops, '\0', sizeof(extprops) );
672 extprops.auth_id = (char *) authid;
674 sc = sasl_setprop( ctx, SASL_SSF_EXTERNAL,
675 (void *) &extprops );
677 if ( sc != SASL_OK ) {
678 return LDAP_LOCAL_ERROR;
685 int ldap_pvt_sasl_secprops(
687 sasl_security_properties_t *secprops )
690 char **props = ldap_str2charray( in, "," );
693 sasl_ssf_t max_ssf = 0;
695 sasl_ssf_t min_ssf = 0;
697 unsigned maxbufsize = 0;
698 int got_maxbufsize = 0;
700 if( props == NULL || secprops == NULL ) {
701 return LDAP_PARAM_ERROR;
704 for( i=0; props[i]; i++ ) {
705 if( !strcasecmp(props[i], "none") ) {
708 } else if( !strcasecmp(props[i], "noplain") ) {
710 sflags |= SASL_SEC_NOPLAINTEXT;
712 } else if( !strcasecmp(props[i], "noactive") ) {
714 sflags |= SASL_SEC_NOACTIVE;
716 } else if( !strcasecmp(props[i], "nodict") ) {
718 sflags |= SASL_SEC_NODICTIONARY;
720 } else if( !strcasecmp(props[i], "forwardsec") ) {
722 sflags |= SASL_SEC_FORWARD_SECRECY;
724 } else if( !strcasecmp(props[i], "noanonymous")) {
726 sflags |= SASL_SEC_NOANONYMOUS;
728 } else if( !strcasecmp(props[i], "passcred") ) {
730 sflags |= SASL_SEC_PASS_CREDENTIALS;
732 } else if( !strncasecmp(props[i],
733 "minssf=", sizeof("minssf")) )
735 if( isdigit( (unsigned char) props[i][sizeof("minssf")] ) ) {
737 min_ssf = atoi( &props[i][sizeof("minssf")] );
739 return LDAP_NOT_SUPPORTED;
742 } else if( !strncasecmp(props[i],
743 "maxssf=", sizeof("maxssf")) )
745 if( isdigit( (unsigned char) props[i][sizeof("maxssf")] ) ) {
747 max_ssf = atoi( &props[i][sizeof("maxssf")] );
749 return LDAP_NOT_SUPPORTED;
752 } else if( !strncasecmp(props[i],
753 "maxbufsize=", sizeof("maxbufsize")) )
755 if( isdigit( (unsigned char) props[i][sizeof("maxbufsize")] ) ) {
757 maxbufsize = atoi( &props[i][sizeof("maxbufsize")] );
759 return LDAP_NOT_SUPPORTED;
762 if( maxbufsize && (( maxbufsize < SASL_MIN_BUFF_SIZE )
763 || (maxbufsize > SASL_MAX_BUFF_SIZE )))
766 return LDAP_PARAM_ERROR;
770 return LDAP_NOT_SUPPORTED;
775 secprops->security_flags = sflags;
778 secprops->min_ssf = min_ssf;
781 secprops->max_ssf = max_ssf;
784 secprops->maxbufsize = maxbufsize;
787 ldap_charray_free( props );
792 ldap_int_sasl_config( struct ldapoptions *lo, int option, const char *arg )
797 case LDAP_OPT_X_SASL_SECPROPS:
798 rc = ldap_pvt_sasl_secprops( arg, &lo->ldo_sasl_secprops );
799 if( rc == LDAP_SUCCESS ) return 0;
806 ldap_int_sasl_get_option( LDAP *ld, int option, void *arg )
812 case LDAP_OPT_X_SASL_MECH: {
813 *(char **)arg = ld->ld_options.ldo_def_sasl_mech
814 ? LDAP_STRDUP( ld->ld_options.ldo_def_sasl_mech ) : NULL;
816 case LDAP_OPT_X_SASL_REALM: {
817 *(char **)arg = ld->ld_options.ldo_def_sasl_realm
818 ? LDAP_STRDUP( ld->ld_options.ldo_def_sasl_realm ) : NULL;
820 case LDAP_OPT_X_SASL_AUTHCID: {
821 *(char **)arg = ld->ld_options.ldo_def_sasl_authcid
822 ? LDAP_STRDUP( ld->ld_options.ldo_def_sasl_authcid ) : NULL;
824 case LDAP_OPT_X_SASL_AUTHZID: {
825 *(char **)arg = ld->ld_options.ldo_def_sasl_authzid
826 ? LDAP_STRDUP( ld->ld_options.ldo_def_sasl_authzid ) : NULL;
829 case LDAP_OPT_X_SASL_SSF: {
834 if( ld->ld_defconn == NULL ) {
838 ctx = ld->ld_defconn->lconn_sasl_ctx;
844 sc = sasl_getprop( ctx, SASL_SSF,
847 if ( sc != SASL_OK ) {
851 *(ber_len_t *)arg = *ssf;
854 case LDAP_OPT_X_SASL_SSF_EXTERNAL:
855 /* this option is write only */
858 case LDAP_OPT_X_SASL_SSF_MIN:
859 *(ber_len_t *)arg = ld->ld_options.ldo_sasl_secprops.min_ssf;
861 case LDAP_OPT_X_SASL_SSF_MAX:
862 *(ber_len_t *)arg = ld->ld_options.ldo_sasl_secprops.max_ssf;
864 case LDAP_OPT_X_SASL_MAXBUFSIZE:
865 *(ber_len_t *)arg = ld->ld_options.ldo_sasl_secprops.maxbufsize;
868 case LDAP_OPT_X_SASL_SECPROPS:
869 /* this option is write only */
879 ldap_int_sasl_set_option( LDAP *ld, int option, void *arg )
885 case LDAP_OPT_X_SASL_SSF:
886 /* This option is read-only */
889 case LDAP_OPT_X_SASL_SSF_EXTERNAL: {
891 sasl_external_properties_t extprops;
894 if( ld->ld_defconn == NULL ) {
898 ctx = ld->ld_defconn->lconn_sasl_ctx;
904 memset(&extprops, 0L, sizeof(extprops));
906 extprops.ssf = * (ber_len_t *) arg;
908 sc = sasl_setprop( ctx, SASL_SSF_EXTERNAL,
909 (void *) &extprops );
911 if ( sc != SASL_OK ) {
916 case LDAP_OPT_X_SASL_SSF_MIN:
917 ld->ld_options.ldo_sasl_secprops.min_ssf = *(ber_len_t *)arg;
919 case LDAP_OPT_X_SASL_SSF_MAX:
920 ld->ld_options.ldo_sasl_secprops.max_ssf = *(ber_len_t *)arg;
922 case LDAP_OPT_X_SASL_MAXBUFSIZE:
923 ld->ld_options.ldo_sasl_secprops.maxbufsize = *(ber_len_t *)arg;
926 case LDAP_OPT_X_SASL_SECPROPS: {
928 sc = ldap_pvt_sasl_secprops( (char *) arg,
929 &ld->ld_options.ldo_sasl_secprops );
931 return sc == LDAP_SUCCESS ? 0 : -1;
940 #ifdef LDAP_R_COMPILE
941 void *ldap_pvt_sasl_mutex_new(void)
943 ldap_pvt_thread_mutex_t *mutex;
945 mutex = (ldap_pvt_thread_mutex_t *) LDAP_MALLOC(
946 sizeof(ldap_pvt_thread_mutex_t) );
948 if ( ldap_pvt_thread_mutex_init( mutex ) == 0 ) {
954 int ldap_pvt_sasl_mutex_lock(void *mutex)
956 return ldap_pvt_thread_mutex_lock( (ldap_pvt_thread_mutex_t *)mutex )
957 ? SASL_FAIL : SASL_OK;
960 int ldap_pvt_sasl_mutex_unlock(void *mutex)
962 return ldap_pvt_thread_mutex_unlock( (ldap_pvt_thread_mutex_t *)mutex )
963 ? SASL_FAIL : SASL_OK;
966 void ldap_pvt_sasl_mutex_dispose(void *mutex)
968 (void) ldap_pvt_thread_mutex_destroy( (ldap_pvt_thread_mutex_t *)mutex );
974 int ldap_int_sasl_init( void )
975 { return LDAP_SUCCESS; }
977 int ldap_int_sasl_close( LDAP *ld, LDAPConn *lc )
978 { return LDAP_SUCCESS; }
985 LDAPControl **sctrls,
986 LDAPControl **cctrls,
988 LDAP_SASL_INTERACT_PROC *interact,
990 { return LDAP_NOT_SUPPORTED; }
993 ldap_int_sasl_external(
998 { return LDAP_SUCCESS; }
1000 #endif /* HAVE_CYRUS_SASL */