Adjust usage of conditional definition of USE_OPENSSL

This commit is contained in:
Yang Tse 2008-08-17 01:57:10 +00:00
parent ac18b471d2
commit 3e61c90dbe
3 changed files with 38 additions and 17 deletions

View File

@ -70,11 +70,23 @@
#ifndef USE_WINDOWS_SSPI #ifndef USE_WINDOWS_SSPI
#include <openssl/des.h> # ifdef USE_SSLEAY
#include <openssl/md4.h> # ifdef USE_OPENSSL
#include <openssl/md5.h> # include <openssl/des.h>
#include <openssl/ssl.h> # include <openssl/md4.h>
#include <openssl/rand.h> # include <openssl/md5.h>
# include <openssl/ssl.h>
# include <openssl/rand.h>
# else
# include <des.h>
# include <md4.h>
# include <md5.h>
# include <ssl.h>
# include <rand.h>
# endif
# else
# error "Can't compile NTLM support without OpenSSL."
# endif
#if OPENSSL_VERSION_NUMBER < 0x00907001L #if OPENSSL_VERSION_NUMBER < 0x00907001L
#define DES_key_schedule des_key_schedule #define DES_key_schedule des_key_schedule

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -25,10 +25,19 @@
#ifndef CURL_DISABLE_CRYPTO_AUTH #ifndef CURL_DISABLE_CRYPTO_AUTH
#if !defined(USE_SSLEAY) || !defined(USE_OPENSSL) #include <string.h>
/* This code segment is only used if OpenSSL is not provided, as if it is
we use the MD5-function provided there instead. No good duplicating #ifdef USE_SSLEAY
code! */ /* When OpenSSL is available we use the MD5-function from OpenSSL */
# ifdef USE_OPENSSL
# include <openssl/md5.h>
# else
# include <md5.h>
# endif
#else /* USE_SSLEAY */
/* When OpenSSL is not available we use this code segment */
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved. rights reserved.
@ -52,8 +61,6 @@ These notices must be retained in any copies of any part of this
documentation and/or software. documentation and/or software.
*/ */
#include <string.h>
/* UINT4 defines a four byte word */ /* UINT4 defines a four byte word */
typedef unsigned int UINT4; typedef unsigned int UINT4;
@ -332,11 +339,7 @@ static void Decode (UINT4 *output,
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
} }
#else #endif /* USE_SSLEAY */
/* If OpenSSL is present */
#include <openssl/md5.h>
#include <string.h>
#endif
#include "curl_md5.h" #include "curl_md5.h"

View File

@ -74,6 +74,12 @@
#include "pem.h" #include "pem.h"
#include "ssl.h" #include "ssl.h"
#include "err.h" #include "err.h"
#ifdef HAVE_OPENSSL_ENGINE_H
#include <engine.h>
#endif
#ifdef HAVE_OPENSSL_PKCS12_H
#include <pkcs12.h>
#endif
#endif /* USE_OPENSSL */ #endif /* USE_OPENSSL */
#ifdef USE_GNUTLS #ifdef USE_GNUTLS
#error Configuration error; cannot use GnuTLS *and* OpenSSL. #error Configuration error; cannot use GnuTLS *and* OpenSSL.