Diff for /libraries/libldap/sasl.c between versions 1.20 and 1.22

version 1.20, 2000/05/12 17:41:18 version 1.22, 2000/05/16 02:52:37
Line 1 Line 1
 /* $OpenLDAP: pkg/ldap/libraries/libldap/sasl.c,v 1.19 2000/05/11 18:16:29 kurt Exp $ */  /* $OpenLDAP: pkg/ldap/libraries/libldap/sasl.c,v 1.21 2000/05/13 00:38:39 kurt Exp $ */
 /*  /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.   * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file   * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */   */
   
Line 496  static ber_slen_t sasl_write( Sockbuf *s Line 496  static ber_slen_t sasl_write( Sockbuf *s
   
 static int sasl_close( Sockbuf *sb )  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  static int
Line 545  ldap_pvt_sasl_getmechs ( LDAP *ld, char Line 545  ldap_pvt_sasl_getmechs ( LDAP *ld, char
         /* we need to query the server for supported mechs anyway */          /* we need to query the server for supported mechs anyway */
         LDAPMessage *res, *e;          LDAPMessage *res, *e;
         char *attrs[] = { "supportedSASLMechanisms", NULL };          char *attrs[] = { "supportedSASLMechanisms", NULL };
         char **values, *mechlist, **p;          char **values, *mechlist;
         int rc;          int rc;
   
         Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_getmech\n", 0, 0, 0 );          Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_getmech\n", 0, 0, 0 );
Line 598  ldap_pvt_sasl_bind( Line 598  ldap_pvt_sasl_bind(
         LDAPControl             **cctrls )          LDAPControl             **cctrls )
 {  {
         const char *mech;          const char *mech;
         int     saslrc, rc, msgid, ssf = 0;          int     saslrc, rc, ssf = 0;
           unsigned credlen;
         struct berval ccred, *scred;          struct berval ccred, *scred;
         char *host;          char *host;
         sasl_interact_t *client_interact = NULL;          sasl_interact_t *client_interact = NULL;
Line 648  ldap_pvt_sasl_bind( Line 649  ldap_pvt_sasl_bind(
                 NULL,                  NULL,
                 &client_interact,                  &client_interact,
                 &ccred.bv_val,                  &ccred.bv_val,
                 (unsigned int *)&ccred.bv_len,                  &credlen,
                 &mech );                  &mech );
   
           ccred.bv_len = credlen;
   
         if ( (saslrc != SASL_OK) && (saslrc != SASL_CONTINUE) ) {          if ( (saslrc != SASL_OK) && (saslrc != SASL_CONTINUE) ) {
                 ld->ld_errno = sasl_err2ldap( saslrc );                  ld->ld_errno = sasl_err2ldap( saslrc );
                 sasl_dispose( &ld->ld_sasl_context );                  sasl_dispose( &ld->ld_sasl_context );
Line 660  ldap_pvt_sasl_bind( Line 663  ldap_pvt_sasl_bind(
         scred = NULL;          scred = NULL;
   
         do {          do {
                   unsigned credlen;
                 sasl_interact_t *client_interact = NULL;                  sasl_interact_t *client_interact = NULL;
   
                 rc = ldap_sasl_bind_s( ld, dn, mech, &ccred, sctrls, cctrls, &scred );                  rc = ldap_sasl_bind_s( ld, dn, mech, &ccred, sctrls, cctrls, &scred );
Line 683  ldap_pvt_sasl_bind( Line 687  ldap_pvt_sasl_bind(
                         (scred == NULL) ? 0 : scred->bv_len,                          (scred == NULL) ? 0 : scred->bv_len,
                         &client_interact,                          &client_interact,
                         &ccred.bv_val,                          &ccred.bv_val,
                         (unsigned int *)&ccred.bv_len );                          &credlen );
   
                   ccred.bv_len = credlen;
                 ber_bvfree( scred );                  ber_bvfree( scred );
   
                 if ( (saslrc != SASL_OK) && (saslrc != SASL_CONTINUE) ) {                  if ( (saslrc != SASL_OK) && (saslrc != SASL_CONTINUE) ) {

Removed from v.1.20  
changed lines
  Added in v.1.22


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org