static int sasl_close( Sockbuf *sb )
{
- (ber_pvt_sb_io_tcp.sbi_close)( sb );
+ return (ber_pvt_sb_io_tcp.sbi_close)( sb );
}
static int
/* we need to query the server for supported mechs anyway */
LDAPMessage *res, *e;
char *attrs[] = { "supportedSASLMechanisms", NULL };
- char **values, *mechlist, **p;
+ char **values, *mechlist;
int rc;
Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_getmech\n", 0, 0, 0 );
LDAPControl **cctrls )
{
const char *mech;
- int saslrc, rc, msgid, ssf = 0;
+ int saslrc, rc, ssf = 0;
+ unsigned credlen;
struct berval ccred, *scred;
char *host;
sasl_interact_t *client_interact = NULL;
NULL,
&client_interact,
&ccred.bv_val,
- (unsigned int *)&ccred.bv_len,
+ &credlen,
&mech );
+ ccred.bv_len = credlen;
+
if ( (saslrc != SASL_OK) && (saslrc != SASL_CONTINUE) ) {
ld->ld_errno = sasl_err2ldap( saslrc );
sasl_dispose( &ld->ld_sasl_context );
scred = NULL;
do {
+ unsigned credlen;
sasl_interact_t *client_interact = NULL;
rc = ldap_sasl_bind_s( ld, dn, mech, &ccred, sctrls, cctrls, &scred );
(scred == NULL) ? 0 : scred->bv_len,
&client_interact,
&ccred.bv_val,
- (unsigned int *)&ccred.bv_len );
+ &credlen );
+ ccred.bv_len = credlen;
ber_bvfree( scred );
if ( (saslrc != SASL_OK) && (saslrc != SASL_CONTINUE) ) {
send_ldap_result( conn, op, rc = LDAP_AUTH_METHOD_NOT_SUPPORTED,
NULL, NULL, NULL, NULL );
} else {
+ unsigned reslen;
conn->c_authmech = ch_strdup( mech );
+
sc = sasl_server_start( conn->c_sasl_bind_context, conn->c_authmech,
- cred->bv_val, cred->bv_len, (char **)&response.bv_val,
- (unsigned *)&response.bv_len, &errstr );
+ cred->bv_val, cred->bv_len,
+ (char **)&response.bv_val, &reslen, &errstr );
+
+ response.bv_len = reslen;
+
if ( (sc != SASL_OK) && (sc != SASL_CONTINUE) ) {
send_ldap_result( conn, op, rc = slap_sasl_err2ldap( sc ),
NULL, errstr, NULL, NULL );
}
}
} else {
+ unsigned reslen;
sc = sasl_server_step( conn->c_sasl_bind_context, cred->bv_val, cred->bv_len,
- (char **)&response.bv_val, (unsigned *)&response.bv_len, &errstr );
+ (char **)&response.bv_val, &reslen, &errstr );
+
+ response.bv_len = reslen;
+
if ( (sc != SASL_OK) && (sc != SASL_CONTINUE) ) {
send_ldap_result( conn, op, rc = slap_sasl_err2ldap( sc ),
NULL, errstr, NULL, NULL );