Diff for /libraries/libldap/tls2.c between versions 1.4.2.1 and 1.4.2.2

version 1.4.2.1, 2009/01/26 23:29:53 version 1.4.2.2, 2009/02/04 12:53:38
Line 1 Line 1
 /* tls.c - Handle tls/ssl. */  /* tls.c - Handle tls/ssl. */
 /* $OpenLDAP: pkg/ldap/libraries/libldap/tls2.c,v 1.4 2009/01/26 01:16:46 hyc Exp $ */  /* $OpenLDAP: pkg/ldap/libraries/libldap/tls2.c,v 1.4.2.1 2009/01/26 23:29:53 quanah Exp $ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *   *
  * Copyright 1998-2009 The OpenLDAP Foundation.   * Copyright 1998-2009 The OpenLDAP Foundation.
Line 42 Line 42
 #endif  #endif
   
 static tls_impl *tls_imp = &ldap_int_tls_impl;  static tls_impl *tls_imp = &ldap_int_tls_impl;
   #define HAS_TLS( sb )   ber_sockbuf_ctrl( sb, LBER_SB_OPT_HAS_IO, \
                                   (void *)tls_imp->ti_sbio )
   
 #endif /* HAVE_TLS */  #endif /* HAVE_TLS */
   
Line 329  ldap_int_tls_connect( LDAP *ld, LDAPConn Line 331  ldap_int_tls_connect( LDAP *ld, LDAPConn
         int     err;          int     err;
         tls_session     *ssl = NULL;          tls_session     *ssl = NULL;
   
         ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_SSL, (void *)&ssl );          if ( HAS_TLS( sb )) {
         if ( !ssl ) {                  ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_SSL, (void *)&ssl );
           } else {
                 struct ldapoptions *lo;                  struct ldapoptions *lo;
                 tls_ctx *ctx;                  tls_ctx *ctx;
   
Line 410  ldap_pvt_tls_accept( Sockbuf *sb, void * Line 413  ldap_pvt_tls_accept( Sockbuf *sb, void *
         int     err;          int     err;
         tls_session     *ssl = NULL;          tls_session     *ssl = NULL;
   
         ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_SSL, (void *)&ssl );          if ( HAS_TLS( sb )) {
         if ( !ssl ) {                  ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_SSL, (void *)&ssl );
           } else {
                 ssl = alloc_handle( ctx_arg, 1 );                  ssl = alloc_handle( ctx_arg, 1 );
                 if ( ssl == NULL ) return -1;                  if ( ssl == NULL ) return -1;
   
Line 451  ldap_pvt_tls_accept( Sockbuf *sb, void * Line 455  ldap_pvt_tls_accept( Sockbuf *sb, void *
 int  int
 ldap_pvt_tls_inplace ( Sockbuf *sb )  ldap_pvt_tls_inplace ( Sockbuf *sb )
 {  {
         tls_session     *ssl = NULL;          return HAS_TLS( sb ) ? 1 : 0;
   
         ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_SSL, (void *)&ssl );  
         return ssl != NULL;  
 }  }
   
 int  int

Removed from v.1.4.2.1  
changed lines
  Added in v.1.4.2.2


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