7 #include "proto-slap.h"
12 char **supportedSASLMechanisms = NULL;
14 #ifdef HAVE_CYRUS_SASL
15 static sasl_callback_t callbacks[] = {
16 { SASL_CB_LIST_END, NULL, NULL }
23 sasl_conn_t *server = NULL;
25 rc = sasl_server_init( callbacks, "slapd" );
28 Debug( LDAP_DEBUG_ANY, "sasl_server_init failed\n",
33 rc = sasl_server_new( "ldap", NULL, NULL, NULL,
38 Debug( LDAP_DEBUG_ANY, "sasl_server_new failed\n",
45 sasl_security_properties_t secprops;
46 memset(&secprops, 0, sizeof(secprops));
47 secprops.security_flags = SASL_SEC_NOPLAINTEXT | SASL_SEC_NOANONYMOUS;
48 secprops.property_names = NULL;
49 secprops.property_values = NULL;
51 rc = sasl_setprop( server, SASL_SEC_PROPS, &secprops );
54 Debug( LDAP_DEBUG_ANY, "sasl_setprop failed\n",
61 rc = sasl_listmech( server, NULL, NULL, ",", NULL,
65 Debug( LDAP_DEBUG_ANY, "sasl_listmech failed: %d\n",
70 Debug( LDAP_DEBUG_TRACE, "SASL mechanisms: %s\n",
73 supportedSASLMechanisms = str2charray( mechs, "," );
74 sasl_dispose( &server );
79 int sasl_destroy( void )
81 charray_free( supportedSASLMechanisms );
87 int sasl_init( void ) { return 0; }
88 int sasl_destroy( void ) { return 0; }