2 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 #include "proto-slap.h"
17 char **supportedSASLMechanisms = NULL;
19 #ifdef HAVE_CYRUS_SASL
20 static sasl_callback_t callbacks[] = {
21 { SASL_CB_LIST_END, NULL, NULL }
28 sasl_conn_t *server = NULL;
30 rc = sasl_server_init( callbacks, "slapd" );
33 Debug( LDAP_DEBUG_ANY, "sasl_server_init failed\n",
38 rc = sasl_server_new( "ldap", NULL, NULL, NULL,
43 Debug( LDAP_DEBUG_ANY, "sasl_server_new failed\n",
50 sasl_security_properties_t secprops;
51 memset(&secprops, 0, sizeof(secprops));
52 secprops.security_flags = SASL_SEC_NOPLAINTEXT | SASL_SEC_NOANONYMOUS;
53 secprops.property_names = NULL;
54 secprops.property_values = NULL;
56 rc = sasl_setprop( server, SASL_SEC_PROPS, &secprops );
59 Debug( LDAP_DEBUG_ANY, "sasl_setprop failed\n",
66 rc = sasl_listmech( server, NULL, NULL, ",", NULL,
70 Debug( LDAP_DEBUG_ANY, "sasl_listmech failed: %d\n",
75 Debug( LDAP_DEBUG_TRACE, "SASL mechanisms: %s\n",
78 supportedSASLMechanisms = str2charray( mechs, "," );
79 sasl_dispose( &server );
84 int sasl_destroy( void )
86 charray_free( supportedSASLMechanisms );
92 int sasl_init( void ) { return 0; }
93 int sasl_destroy( void ) { return 0; }