From 3e61c90dbec53e06fb30b0dc706768b675e665f4 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 17 Aug 2008 01:57:10 +0000 Subject: Adjust usage of conditional definition of USE_OPENSSL --- lib/http_ntlm.c | 22 +++++++++++++++++----- lib/md5.c | 27 +++++++++++++++------------ lib/urldata.h | 6 ++++++ 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/lib/http_ntlm.c b/lib/http_ntlm.c index ebc8e73f2..8db10301d 100644 --- a/lib/http_ntlm.c +++ b/lib/http_ntlm.c @@ -70,11 +70,23 @@ #ifndef USE_WINDOWS_SSPI -#include -#include -#include -#include -#include +# ifdef USE_SSLEAY +# ifdef USE_OPENSSL +# include +# include +# include +# include +# include +# else +# include +# include +# include +# include +# include +# endif +# else +# error "Can't compile NTLM support without OpenSSL." +# endif #if OPENSSL_VERSION_NUMBER < 0x00907001L #define DES_key_schedule des_key_schedule diff --git a/lib/md5.c b/lib/md5.c index 3d54f650d..965578004 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -25,10 +25,19 @@ #ifndef CURL_DISABLE_CRYPTO_AUTH -#if !defined(USE_SSLEAY) || !defined(USE_OPENSSL) -/* 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 - code! */ +#include + +#ifdef USE_SSLEAY +/* When OpenSSL is available we use the MD5-function from OpenSSL */ + +# ifdef USE_OPENSSL +# include +# else +# include +# 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 rights reserved. @@ -52,8 +61,6 @@ These notices must be retained in any copies of any part of this documentation and/or software. */ -#include - /* UINT4 defines a four byte word */ typedef unsigned int UINT4; @@ -332,11 +339,7 @@ static void Decode (UINT4 *output, (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); } -#else -/* If OpenSSL is present */ -#include -#include -#endif +#endif /* USE_SSLEAY */ #include "curl_md5.h" diff --git a/lib/urldata.h b/lib/urldata.h index c2fd36825..1be126ef0 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -74,6 +74,12 @@ #include "pem.h" #include "ssl.h" #include "err.h" +#ifdef HAVE_OPENSSL_ENGINE_H +#include +#endif +#ifdef HAVE_OPENSSL_PKCS12_H +#include +#endif #endif /* USE_OPENSSL */ #ifdef USE_GNUTLS #error Configuration error; cannot use GnuTLS *and* OpenSSL. -- cgit v1.2.3