~ubuntu-branches/ubuntu/natty/curl/natty

« back to all changes in this revision

Viewing changes to lib/ldap.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2009-04-29 11:10:29 UTC
  • mfrom: (3.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090429111029-2j5eiyokfw2bw049
Tags: 7.19.4-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop build dependencies: stunnel, libdb4.6-dev, libssh2-1-dev
  - Add build-dependency on openssh-server
  - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.
  - Call automake-1.9 with --add-missing --copy --force
* drop debian/patches/security_CVE-2009-0037.patch 
  - this patch is part of 7.19.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                | (__| |_| |  _ <| |___
6
6
 *                 \___|\___/|_| \_\_____|
7
7
 *
8
 
 * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
 * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
9
9
 *
10
10
 * This software is licensed as described in the file COPYING, which
11
11
 * you should have received as part of this distribution. The terms
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: ldap.c,v 1.90 2007-11-24 23:18:21 bagder Exp $
 
21
 * $Id: ldap.c,v 1.95 2008-12-19 21:14:52 bagder Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
#include "setup.h"
74
74
#include "strtok.h"
75
75
#include "curl_ldap.h"
76
76
#include "memory.h"
77
 
#include "base64.h"
 
77
#include "curl_base64.h"
 
78
#include "rawstr.h"
78
79
 
79
80
#define _MPRINTF_REPLACE /* use our functions only */
80
81
#include <curl/mprintf.h>
135
136
  ZERO_NULL,                            /* doing */
136
137
  ZERO_NULL,                            /* proto_getsock */
137
138
  ZERO_NULL,                            /* doing_getsock */
 
139
  ZERO_NULL,                            /* perform_getsock */
138
140
  ZERO_NULL,                            /* disconnect */
139
141
  PORT_LDAP,                            /* defport */
140
142
  PROT_LDAP                             /* protocol */
156
158
  ZERO_NULL,                            /* doing */
157
159
  ZERO_NULL,                            /* proto_getsock */
158
160
  ZERO_NULL,                            /* doing_getsock */
 
161
  ZERO_NULL,                            /* perform_getsock */
159
162
  ZERO_NULL,                            /* disconnect */
160
163
  PORT_LDAPS,                           /* defport */
161
164
  PROT_LDAP | PROT_SSL                  /* protocol */
198
201
  }
199
202
 
200
203
  /* Get the URL scheme ( either ldap or ldaps ) */
201
 
  if(strequal(conn->protostr, "LDAPS"))
 
204
  if(Curl_raw_equal(conn->protostr, "LDAPS"))
202
205
    ldap_ssl = 1;
203
206
  infof(data, "LDAP local: trying to establish %s connection\n",
204
207
          ldap_ssl ? "encrypted" : "cleartext");
228
231
      /* Novell SDK supports DER or BASE64 files. */
229
232
      int cert_type = LDAPSSL_CERT_FILETYPE_B64;
230
233
      if((data->set.str[STRING_CERT_TYPE]) &&
231
 
              (strequal(data->set.str[STRING_CERT_TYPE], "DER")))
 
234
         (Curl_raw_equal(data->set.str[STRING_CERT_TYPE], "DER")))
232
235
        cert_type = LDAPSSL_CERT_FILETYPE_DER;
233
236
      if(!ldap_ca) {
234
237
        failf(data, "LDAP local: ERROR %s CA cert not set!",
269
272
    if(data->set.ssl.verifypeer) {
270
273
      /* OpenLDAP SDK supports BASE64 files. */
271
274
      if((data->set.str[STRING_CERT_TYPE]) &&
272
 
              (!strequal(data->set.str[STRING_CERT_TYPE], "PEM"))) {
 
275
         (!Curl_raw_equal(data->set.str[STRING_CERT_TYPE], "PEM"))) {
273
276
        failf(data, "LDAP local: ERROR OpenLDAP does only support PEM cert-type!");
274
277
        status = CURLE_SSL_CERTPROBLEM;
275
278
        goto quit;