pike.git / lib / modules / Protocols.pmod / LDAP.pmod / client.pike

version» Context lines:

pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1:   #pike __REAL_VERSION__      // LDAP client protocol implementation for Pike.   // - // $Id: client.pike,v 1.52 2004/02/02 23:00:50 nilsson Exp $ + // $Id: client.pike,v 1.53 2004/02/29 02:58:12 nilsson Exp $   //   // Honza Petrous, hop@unibase.cz   //   // ----------------------------------------------------------------------   //   // History:   //   // v0.0 1998-05-25 Starting up!   // v1.0 1998-06-21 Core functions (open, bind, unbind, delete, add,   // compare, search), only V2 operations,
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:67:   // Interesting, applicable   // RFC 2307 (LDAP as network information services; draft?)         #if constant(.ldap_privates.ldap_der_decode)      #include "ldap_globals.h"      #include "ldap_errors.h"    - #if constant(SSL.sslfile) + #if constant(SSL.Cipher.CipherAlgorithm)   import SSL.Constants;   #endif      #ifdef LDAP_PROTOCOL_PROFILE   int _prof_gtim;   #endif      // ------------------------      // ASN.1 decode macros
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:353:    //! @expr{"ldap://hostname/basedn?attrlist?scope?ext"@}    //!    //! @param context    //! TLS context of connection    //!    //! @seealso    //! @[LDAP.client.bind], @[LDAP.client.search]    void create(string|void url, object|void context)    {    -  info = ([ "code_revision" : ("$Revision: 1.52 $"/" ")[1] ]); +  info = ([ "code_revision" : ("$Revision: 1.53 $"/" ")[1] ]);       if(!url || !sizeof(url))    url = LDAP_DEFAULT_URL;       lauth = parse_url(url);       if(!stringp(lauth->scheme) ||    ((lauth->scheme != "ldap") - #if constant(SSL.sslfile) + #if constant(SSL.Cipher.CipherAlgorithm)    && (lauth->scheme != "ldaps")   #endif    )) {    THROW(({"Unknown scheme in server URL.\n",backtrace()}));    }       if(!lauth->host)    lauth += ([ "host" : LDAP_DEFAULT_HOST ]);    if(!lauth->port)    lauth += ([ "port" : lauth->scheme == "ldap" ? LDAP_DEFAULT_PORT : LDAPS_DEFAULT_PORT ]);    - #if constant(SSL.sslfile) + #if constant(SSL.Cipher.CipherAlgorithm)    if(lauth->scheme == "ldaps" && !context) {    context = SSL.context();    // Allow only strong crypto    context->preferred_suites = ({    SSL_rsa_with_idea_cbc_sha,    SSL_rsa_with_rc4_128_sha,    SSL_rsa_with_rc4_128_md5,    SSL_rsa_with_3des_ede_cbc_sha,    });    }
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:399:    seterr (LDAP_SERVER_DOWN);    DWRITE("client.create: ERROR: can't open socket.\n");    //ldapfd->destroy();    //ldap=0;    //ok = 0;    //if(con_fail)    // con_fail(this, @extra_args);    THROW(({"Failed to connect to LDAP server.\n",backtrace()}));    }    - #if constant(SSL.sslfile) + #if constant(SSL.Cipher.CipherAlgorithm)    if(lauth->scheme == "ldaps") {    context->random = Crypto.Random.random_string;    ::create(SSL.sslfile(::_fd, context, 1,1));    info->tls_version = ldapfd->version;    } else    ::create(::_fd);   #else    if(lauth->scheme == "ldaps") {    THROW(({"LDAP: LDAPS is not available without SSL support.\n",backtrace()}));    }