3 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
13 #include "proto-slap.h"
18 char **supportedSASLMechanisms = NULL;
20 #ifdef HAVE_CYRUS_SASL
21 static sasl_callback_t callbacks[] = {
22 { SASL_CB_LIST_END, NULL, NULL }
29 sasl_conn_t *server = NULL;
31 rc = sasl_server_init( callbacks, "slapd" );
34 Debug( LDAP_DEBUG_ANY, "sasl_server_init failed\n",
39 rc = sasl_server_new( "ldap", NULL, NULL, NULL,
44 Debug( LDAP_DEBUG_ANY, "sasl_server_new failed\n",
51 sasl_security_properties_t secprops;
52 memset(&secprops, 0, sizeof(secprops));
53 secprops.security_flags = SASL_SEC_NOPLAINTEXT | SASL_SEC_NOANONYMOUS;
54 secprops.property_names = NULL;
55 secprops.property_values = NULL;
57 rc = sasl_setprop( server, SASL_SEC_PROPS, &secprops );
60 Debug( LDAP_DEBUG_ANY, "sasl_setprop failed\n",
67 rc = sasl_listmech( server, NULL, NULL, ",", NULL,
71 Debug( LDAP_DEBUG_ANY, "sasl_listmech failed: %d\n",
76 Debug( LDAP_DEBUG_TRACE, "SASL mechanisms: %s\n",
79 supportedSASLMechanisms = str2charray( mechs, "," );
80 sasl_dispose( &server );
85 int sasl_destroy( void )
87 charray_free( supportedSASLMechanisms );
93 int sasl_init( void ) { return 0; }
94 int sasl_destroy( void ) { return 0; }