]> granicus.if.org Git - curl/commitdiff
Adjust usage of conditional definition of USE_OPENSSL
authorYang Tse <yangsita@gmail.com>
Sun, 17 Aug 2008 01:57:10 +0000 (01:57 +0000)
committerYang Tse <yangsita@gmail.com>
Sun, 17 Aug 2008 01:57:10 +0000 (01:57 +0000)
lib/http_ntlm.c
lib/md5.c
lib/urldata.h

index ebc8e73f22541923302addddb3a6174de288ea34..8db10301df14ae90c13b258aa24c864fc7f21871 100644 (file)
 
 #ifndef USE_WINDOWS_SSPI
 
-#include <openssl/des.h>
-#include <openssl/md4.h>
-#include <openssl/md5.h>
-#include <openssl/ssl.h>
-#include <openssl/rand.h>
+#  ifdef USE_SSLEAY
+#    ifdef USE_OPENSSL
+#      include <openssl/des.h>
+#      include <openssl/md4.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
 #define DES_key_schedule des_key_schedule
index 3d54f650d06569d94e1fc89d0a9c1d8951a12548..965578004fc2cc159852ab96c47f2a58e50706ea 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -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
  * you should have received as part of this distribution. The terms
 
 #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 <string.h>
+
+#ifdef USE_SSLEAY
+/* 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
 rights reserved.
@@ -52,8 +61,6 @@ These notices must be retained in any copies of any part of this
 documentation and/or software.
  */
 
-#include <string.h>
-
 /* 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 <openssl/md5.h>
-#include <string.h>
-#endif
+#endif /* USE_SSLEAY */
 
 #include "curl_md5.h"
 
index c2fd36825a70cd2ccf7364993aa85c3357c52557..1be126ef0ccca70fd44ed105e2b6e02a1f36cdc6 100644 (file)
 #include "pem.h"
 #include "ssl.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 */
 #ifdef USE_GNUTLS
 #error Configuration error; cannot use GnuTLS *and* OpenSSL.