3 * Copyright 1999-2000 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 #include <ac/socket.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 Sockbuf_Buf sec_buf_in;
91 sb_sasl_setup( Sockbuf_IO_Desc *sbiod, void *arg )
93 struct sb_sasl_data *p;
95 assert( sbiod != NULL );
97 p = LBER_MALLOC( sizeof( *p ) );
100 p->sasl_context = (sasl_conn_t *)arg;
101 ber_pvt_sb_buf_init( &p->sec_buf_in );
102 ber_pvt_sb_buf_init( &p->buf_in );
103 ber_pvt_sb_buf_init( &p->buf_out );
104 if ( ber_pvt_sb_grow_buffer( &p->sec_buf_in, SASL_MIN_BUFF_SIZE ) < 0 ) {
109 sbiod->sbiod_pvt = p;
115 sb_sasl_remove( Sockbuf_IO_Desc *sbiod )
117 struct sb_sasl_data *p;
119 assert( sbiod != NULL );
121 p = (struct sb_sasl_data *)sbiod->sbiod_pvt;
122 ber_pvt_sb_buf_destroy( &p->sec_buf_in );
123 ber_pvt_sb_buf_destroy( &p->buf_in );
124 ber_pvt_sb_buf_destroy( &p->buf_out );
126 sbiod->sbiod_pvt = NULL;
131 sb_sasl_pkt_length( const unsigned char *buf, int debuglevel )
135 assert( buf != NULL );
142 /* we really should check against actual buffer size set
145 if ( size > SASL_MAX_BUFF_SIZE ) {
146 /* somebody is trying to mess me up. */
147 ber_log_printf( LDAP_DEBUG_ANY, debuglevel,
148 "sb_sasl_pkt_length: received illegal packet length "
149 "of %lu bytes\n", (unsigned long)size );
150 size = 16; /* this should lead to an error. */
153 return size + 4; /* include the size !!! */
156 /* Drop a processed packet from the input buffer */
158 sb_sasl_drop_packet ( Sockbuf_Buf *sec_buf_in, int debuglevel )
162 len = sec_buf_in->buf_ptr - sec_buf_in->buf_end;
164 memmove( sec_buf_in->buf_base, sec_buf_in->buf_base +
165 sec_buf_in->buf_end, len );
168 sec_buf_in->buf_end = sb_sasl_pkt_length( sec_buf_in->buf_base,
172 sec_buf_in->buf_end = 0;
174 sec_buf_in->buf_ptr = len;
178 sb_sasl_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
180 struct sb_sasl_data *p;
181 ber_slen_t ret, bufptr;
183 assert( sbiod != NULL );
184 assert( SOCKBUF_VALID( sbiod->sbiod_sb ) );
186 p = (struct sb_sasl_data *)sbiod->sbiod_pvt;
188 /* Are there anything left in the buffer? */
189 ret = ber_pvt_sb_copy_out( &p->buf_in, buf, len );
196 ber_pvt_sb_buf_destroy( &p->buf_in );
198 /* Read the length of the packet */
199 while ( p->sec_buf_in.buf_ptr < 4 ) {
200 ret = LBER_SBIOD_READ_NEXT( sbiod, p->sec_buf_in.buf_base,
201 4 - p->sec_buf_in.buf_ptr );
203 if ( ( ret < 0 ) && ( errno == EINTR ) )
209 p->sec_buf_in.buf_ptr += ret;
212 /* The new packet always starts at p->sec_buf_in.buf_base */
213 ret = sb_sasl_pkt_length( p->sec_buf_in.buf_base,
214 sbiod->sbiod_sb->sb_debug );
216 /* Grow the packet buffer if neccessary */
217 if ( ( p->sec_buf_in.buf_size < ret ) &&
218 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 );
246 if ( ret != SASL_OK ) {
247 ber_log_printf( LDAP_DEBUG_ANY, sbiod->sbiod_sb->sb_debug,
248 "sb_sasl_read: failed to decode packet: %s\n",
249 sasl_errstring( ret, NULL, NULL ) );
250 sb_sasl_drop_packet( &p->sec_buf_in,
251 sbiod->sbiod_sb->sb_debug );
256 /* Drop the packet from the input buffer */
257 sb_sasl_drop_packet( &p->sec_buf_in, sbiod->sbiod_sb->sb_debug );
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 );
286 ret = sasl_encode( p->sasl_context, buf, len, &p->buf_out.buf_base,
287 (unsigned *)&p->buf_out.buf_size );
288 if ( ret != SASL_OK ) {
289 ber_log_printf( LDAP_DEBUG_ANY, sbiod->sbiod_sb->sb_debug,
290 "sb_sasl_write: failed to encode packet: %s\n",
291 sasl_errstring( ret, NULL, NULL ) );
294 p->buf_out.buf_end = p->buf_out.buf_size;
296 ret = ber_pvt_sb_do_write( sbiod, &p->buf_out );
303 sb_sasl_ctrl( Sockbuf_IO_Desc *sbiod, int opt, void *arg )
305 struct sb_sasl_data *p;
307 p = (struct sb_sasl_data *)sbiod->sbiod_pvt;
309 if ( opt == LBER_SB_OPT_DATA_READY ) {
310 if ( p->buf_in.buf_ptr != p->buf_in.buf_end )
314 return LBER_SBIOD_CTRL_NEXT( sbiod, opt, arg );
317 Sockbuf_IO ldap_pvt_sockbuf_io_sasl = {
318 sb_sasl_setup, /* sbi_setup */
319 sb_sasl_remove, /* sbi_remove */
320 sb_sasl_ctrl, /* sbi_ctrl */
321 sb_sasl_read, /* sbi_read */
322 sb_sasl_write, /* sbi_write */
326 int ldap_pvt_sasl_install( Sockbuf *sb, void *ctx_arg )
328 Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_install\n",
331 /* don't install the stuff unless security has been negotiated */
333 if ( !ber_sockbuf_ctrl( sb, LBER_SB_OPT_HAS_IO,
334 &ldap_pvt_sockbuf_io_sasl ) )
337 ber_sockbuf_add_io( sb, &ber_sockbuf_io_debug,
338 LBER_SBIOD_LEVEL_APPLICATION, (void *)"sasl_" );
340 ber_sockbuf_add_io( sb, &ldap_pvt_sockbuf_io_sasl,
341 LBER_SBIOD_LEVEL_APPLICATION, ctx_arg );
348 sasl_err2ldap( int saslerr )
354 rc = LDAP_MORE_RESULTS_TO_RETURN;
357 rc = LDAP_LOCAL_ERROR;
363 rc = LDAP_LOCAL_ERROR;
369 rc = LDAP_AUTH_UNKNOWN;
372 rc = LDAP_AUTH_UNKNOWN;
375 rc = LDAP_PARAM_ERROR;
379 rc = LDAP_AUTH_UNKNOWN;
382 rc = LDAP_LOCAL_ERROR;
386 assert( rc == LDAP_SUCCESS || LDAP_API_ERROR( rc ) );
400 sasl_callback_t *session_callbacks =
401 ber_memcalloc( 2, sizeof( sasl_callback_t ) );
403 if( session_callbacks == NULL ) return LDAP_NO_MEMORY;
405 session_callbacks[0].id = SASL_CB_USER;
406 session_callbacks[0].proc = NULL;
407 session_callbacks[0].context = ld;
409 session_callbacks[1].id = SASL_CB_LIST_END;
410 session_callbacks[1].proc = NULL;
411 session_callbacks[1].context = NULL;
413 assert( lc->lconn_sasl_ctx == NULL );
415 if ( host == NULL ) {
416 ld->ld_errno = LDAP_LOCAL_ERROR;
420 rc = sasl_client_new( "ldap", host, session_callbacks,
421 SASL_SECURITY_LAYER, &ctx );
423 if ( rc != SASL_OK ) {
424 ld->ld_errno = sasl_err2ldap( rc );
428 Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: host=%s\n",
431 lc->lconn_sasl_ctx = ctx;
434 sasl_external_properties_t extprops;
435 memset(&extprops, 0L, sizeof(extprops));
438 (void) sasl_setprop( ctx, SASL_SSF_EXTERNAL,
439 (void *) &extprops );
441 Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: ssf=%ld\n",
448 int ldap_int_sasl_close( LDAP *ld, LDAPConn *lc )
450 sasl_conn_t *ctx = lc->lconn_sasl_ctx;
453 sasl_dispose( &ctx );
454 lc->lconn_sasl_ctx = NULL;
465 LDAPControl **sctrls,
466 LDAPControl **cctrls,
468 LDAP_SASL_INTERACT_PROC *interact,
472 const char *mech = NULL;
473 const char *pmech = NULL;
475 sasl_ssf_t *ssf = NULL;
477 sasl_interact_t *prompts = NULL;
482 Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: %s\n",
483 mechs ? mechs : "<null>", 0, 0 );
485 /* do a quick !LDAPv3 check... ldap_sasl_bind will do the rest. */
486 if (ld->ld_version < LDAP_VERSION3) {
487 ld->ld_errno = LDAP_NOT_SUPPORTED;
491 ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_GET_FD, &sd );
493 if ( sd == AC_SOCKET_INVALID ) {
494 /* not connected yet */
497 rc = ldap_open_defconn( ld );
498 if( rc < 0 ) return ld->ld_errno;
500 ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_GET_FD, &sd );
502 if( sd == AC_SOCKET_INVALID ) {
503 ld->ld_errno = LDAP_LOCAL_ERROR;
508 ctx = ld->ld_defconn->lconn_sasl_ctx;
511 ld->ld_errno = LDAP_LOCAL_ERROR;
515 /* (re)set security properties */
516 sasl_setprop( ctx, SASL_SEC_PROPS,
517 &ld->ld_options.ldo_sasl_secprops );
523 saslrc = sasl_client_start( ctx,
531 if( pmech == NULL && mech != NULL ) {
534 if( flags != LDAP_SASL_QUIET ) {
536 "SASL/%s authentication started\n",
541 if( saslrc == SASL_INTERACT ) {
543 if( !interact ) break;
544 res = (interact)( ld, flags, defaults, prompts );
545 if( res != LDAP_SUCCESS ) {
549 } while ( saslrc == SASL_INTERACT );
551 ccred.bv_len = credlen;
553 if ( (saslrc != SASL_OK) && (saslrc != SASL_CONTINUE) ) {
554 ld->ld_errno = sasl_err2ldap( saslrc );
559 struct berval *scred;
564 rc = ldap_sasl_bind_s( ld, dn, mech, &ccred, sctrls, cctrls, &scred );
566 if ( ccred.bv_val != NULL ) {
567 LDAP_FREE( ccred.bv_val );
571 if ( rc != LDAP_SUCCESS && rc != LDAP_SASL_BIND_IN_PROGRESS ) {
572 if( scred && scred->bv_len ) {
573 /* and server provided us with data? */
574 Debug( LDAP_DEBUG_TRACE,
575 "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
576 rc, saslrc, scred->bv_len );
582 if( rc == LDAP_SUCCESS && saslrc == SASL_OK ) {
583 /* we're done, no need to step */
584 if( scred && scred->bv_len ) {
585 /* but server provided us with data! */
586 Debug( LDAP_DEBUG_TRACE,
587 "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
588 rc, saslrc, scred->bv_len );
590 return ld->ld_errno = LDAP_LOCAL_ERROR;
596 saslrc = sasl_client_step( ctx,
597 (scred == NULL) ? NULL : scred->bv_val,
598 (scred == NULL) ? 0 : scred->bv_len,
603 Debug( LDAP_DEBUG_TRACE, "sasl_client_start: %d\n",
606 if( saslrc == SASL_INTERACT ) {
608 if( !interact ) break;
609 res = (interact)( ld, flags, defaults, prompts );
610 if( res != LDAP_SUCCESS ) {
614 } while ( saslrc == SASL_INTERACT );
616 ccred.bv_len = credlen;
619 if ( (saslrc != SASL_OK) && (saslrc != SASL_CONTINUE) ) {
620 ld->ld_errno = sasl_err2ldap( saslrc );
623 } while ( rc == LDAP_SASL_BIND_IN_PROGRESS );
625 if ( rc != LDAP_SUCCESS ) {
629 if ( saslrc != SASL_OK ) {
630 return ld->ld_errno = sasl_err2ldap( saslrc );
633 if( flags != LDAP_SASL_QUIET ) {
634 saslrc = sasl_getprop( ctx, SASL_USERNAME, (void **) &data );
635 if( saslrc == SASL_OK && data && *data ) {
636 fprintf( stderr, "SASL username: %s\n", data );
639 saslrc = sasl_getprop( ctx, SASL_REALM, (void **) &data );
640 if( saslrc == SASL_OK && data && *data ) {
641 fprintf( stderr, "SASL realm: %s\n", data );
645 saslrc = sasl_getprop( ctx, SASL_SSF, (void **) &ssf );
646 if( saslrc == SASL_OK ) {
647 if( flags != LDAP_SASL_QUIET ) {
648 fprintf( stderr, "SASL SSF: %lu\n",
649 (unsigned long) *ssf );
653 if( flags != LDAP_SASL_QUIET ) {
654 fprintf( stderr, "SASL installing layers\n" );
656 ldap_pvt_sasl_install( ld->ld_conns->lconn_sb, ctx );
664 ldap_int_sasl_external(
671 sasl_external_properties_t extprops;
673 if( ld->ld_defconn == NULL ) {
674 return LDAP_LOCAL_ERROR;
677 ctx = ld->ld_defconn->lconn_sasl_ctx;
680 return LDAP_LOCAL_ERROR;
683 memset( &extprops, '\0', sizeof(extprops) );
685 extprops.auth_id = (char *) authid;
687 sc = sasl_setprop( ctx, SASL_SSF_EXTERNAL,
688 (void *) &extprops );
690 if ( sc != SASL_OK ) {
691 return LDAP_LOCAL_ERROR;
698 int ldap_pvt_sasl_secprops(
700 sasl_security_properties_t *secprops )
703 char **props = ldap_str2charray( in, "," );
706 sasl_ssf_t max_ssf = 0;
708 sasl_ssf_t min_ssf = 0;
710 unsigned maxbufsize = 0;
711 int got_maxbufsize = 0;
713 if( props == NULL || secprops == NULL ) {
714 return LDAP_PARAM_ERROR;
717 for( i=0; props[i]; i++ ) {
718 if( !strcasecmp(props[i], "none") ) {
721 } else if( !strcasecmp(props[i], "noplain") ) {
723 sflags |= SASL_SEC_NOPLAINTEXT;
725 } else if( !strcasecmp(props[i], "noactive") ) {
727 sflags |= SASL_SEC_NOACTIVE;
729 } else if( !strcasecmp(props[i], "nodict") ) {
731 sflags |= SASL_SEC_NODICTIONARY;
733 } else if( !strcasecmp(props[i], "forwardsec") ) {
735 sflags |= SASL_SEC_FORWARD_SECRECY;
737 } else if( !strcasecmp(props[i], "noanonymous")) {
739 sflags |= SASL_SEC_NOANONYMOUS;
741 } else if( !strcasecmp(props[i], "passcred") ) {
743 sflags |= SASL_SEC_PASS_CREDENTIALS;
745 } else if( !strncasecmp(props[i],
746 "minssf=", sizeof("minssf")) )
748 if( isdigit( props[i][sizeof("minssf")] ) ) {
750 min_ssf = atoi( &props[i][sizeof("minssf")] );
752 return LDAP_NOT_SUPPORTED;
755 } else if( !strncasecmp(props[i],
756 "maxssf=", sizeof("maxssf")) )
758 if( isdigit( props[i][sizeof("maxssf")] ) ) {
760 max_ssf = atoi( &props[i][sizeof("maxssf")] );
762 return LDAP_NOT_SUPPORTED;
765 } else if( !strncasecmp(props[i],
766 "maxbufsize=", sizeof("maxbufsize")) )
768 if( isdigit( props[i][sizeof("maxbufsize")] ) ) {
770 maxbufsize = atoi( &props[i][sizeof("maxbufsize")] );
772 return LDAP_NOT_SUPPORTED;
775 if( maxbufsize && (( maxbufsize < SASL_MIN_BUFF_SIZE )
776 || (maxbufsize > SASL_MAX_BUFF_SIZE )))
779 return LDAP_PARAM_ERROR;
783 return LDAP_NOT_SUPPORTED;
788 secprops->security_flags = sflags;
791 secprops->min_ssf = min_ssf;
794 secprops->max_ssf = max_ssf;
797 secprops->maxbufsize = maxbufsize;
800 ldap_charray_free( props );
805 ldap_int_sasl_config( struct ldapoptions *lo, int option, const char *arg )
810 case LDAP_OPT_X_SASL_SECPROPS:
811 rc = ldap_pvt_sasl_secprops( arg, &lo->ldo_sasl_secprops );
812 if( rc == LDAP_SUCCESS ) return 0;
819 ldap_int_sasl_get_option( LDAP *ld, int option, void *arg )
825 case LDAP_OPT_X_SASL_MECH: {
826 *(char **)arg = ld->ld_options.ldo_def_sasl_mech
827 ? LDAP_STRDUP( ld->ld_options.ldo_def_sasl_mech ) : NULL;
829 case LDAP_OPT_X_SASL_REALM: {
830 *(char **)arg = ld->ld_options.ldo_def_sasl_realm
831 ? LDAP_STRDUP( ld->ld_options.ldo_def_sasl_realm ) : NULL;
833 case LDAP_OPT_X_SASL_AUTHCID: {
834 *(char **)arg = ld->ld_options.ldo_def_sasl_authcid
835 ? LDAP_STRDUP( ld->ld_options.ldo_def_sasl_authcid ) : NULL;
837 case LDAP_OPT_X_SASL_AUTHZID: {
838 *(char **)arg = ld->ld_options.ldo_def_sasl_authzid
839 ? LDAP_STRDUP( ld->ld_options.ldo_def_sasl_authzid ) : NULL;
842 case LDAP_OPT_X_SASL_SSF: {
847 if( ld->ld_defconn == NULL ) {
851 ctx = ld->ld_defconn->lconn_sasl_ctx;
857 sc = sasl_getprop( ctx, SASL_SSF,
860 if ( sc != SASL_OK ) {
864 *(ber_len_t *)arg = *ssf;
867 case LDAP_OPT_X_SASL_SSF_EXTERNAL:
868 /* this option is write only */
871 case LDAP_OPT_X_SASL_SSF_MIN:
872 *(ber_len_t *)arg = ld->ld_options.ldo_sasl_secprops.min_ssf;
874 case LDAP_OPT_X_SASL_SSF_MAX:
875 *(ber_len_t *)arg = ld->ld_options.ldo_sasl_secprops.max_ssf;
877 case LDAP_OPT_X_SASL_MAXBUFSIZE:
878 *(ber_len_t *)arg = ld->ld_options.ldo_sasl_secprops.maxbufsize;
881 case LDAP_OPT_X_SASL_SECPROPS:
882 /* this option is write only */
892 ldap_int_sasl_set_option( LDAP *ld, int option, void *arg )
898 case LDAP_OPT_X_SASL_SSF:
899 /* This option is read-only */
902 case LDAP_OPT_X_SASL_SSF_EXTERNAL: {
904 sasl_external_properties_t extprops;
907 if( ld->ld_defconn == NULL ) {
911 ctx = ld->ld_defconn->lconn_sasl_ctx;
917 memset(&extprops, 0L, sizeof(extprops));
919 extprops.ssf = * (ber_len_t *) arg;
921 sc = sasl_setprop( ctx, SASL_SSF_EXTERNAL,
922 (void *) &extprops );
924 if ( sc != SASL_OK ) {
929 case LDAP_OPT_X_SASL_SSF_MIN:
930 ld->ld_options.ldo_sasl_secprops.min_ssf = *(ber_len_t *)arg;
932 case LDAP_OPT_X_SASL_SSF_MAX:
933 ld->ld_options.ldo_sasl_secprops.max_ssf = *(ber_len_t *)arg;
935 case LDAP_OPT_X_SASL_MAXBUFSIZE:
936 ld->ld_options.ldo_sasl_secprops.maxbufsize = *(ber_len_t *)arg;
939 case LDAP_OPT_X_SASL_SECPROPS: {
941 sc = ldap_pvt_sasl_secprops( (char *) arg,
942 &ld->ld_options.ldo_sasl_secprops );
944 return sc == LDAP_SUCCESS ? 0 : -1;
953 #ifdef LDAP_R_COMPILE
954 void *ldap_pvt_sasl_mutex_new(void)
956 ldap_pvt_thread_mutex_t *mutex;
958 mutex = (ldap_pvt_thread_mutex_t *) LDAP_MALLOC(
959 sizeof(ldap_pvt_thread_mutex_t) );
961 if ( ldap_pvt_thread_mutex_init( mutex ) == 0 ) {
967 int ldap_pvt_sasl_mutex_lock(void *mutex)
969 return ldap_pvt_thread_mutex_lock( (ldap_pvt_thread_mutex_t *)mutex )
970 ? SASL_FAIL : SASL_OK;
973 int ldap_pvt_sasl_mutex_unlock(void *mutex)
975 return ldap_pvt_thread_mutex_unlock( (ldap_pvt_thread_mutex_t *)mutex )
976 ? SASL_FAIL : SASL_OK;
979 void ldap_pvt_sasl_mutex_dispose(void *mutex)
981 (void) ldap_pvt_thread_mutex_destroy( (ldap_pvt_thread_mutex_t *)mutex );
987 int ldap_int_sasl_init( void )
988 { return LDAP_SUCCESS; }
990 int ldap_int_sasl_close( LDAP *ld, LDAPConn *lc )
991 { return LDAP_SUCCESS; }
998 LDAPControl **sctrls,
999 LDAPControl **cctrls,
1001 LDAP_SASL_INTERACT_PROC *interact,
1003 { return LDAP_NOT_SUPPORTED; }
1006 ldap_int_sasl_external(
1008 const char * authid,
1010 { return LDAP_SUCCESS; }
1012 #endif /* HAVE_CYRUS_SASL */