Skip to content
Browse files

Don't use libmd and OpenSSL at the same time; they

provide conflicting definitions for SHA512 symbols.

SVN-Revision: 3926
  • Loading branch information...
1 parent cb8f70a commit 1110da4ee7640eee7cf7b4841d336bd3dcf92dc1 @kientzle kientzle committed Dec 17, 2011
Showing with 15 additions and 0 deletions.
  1. +6 −0 libarchive/archive_crypto.c
  2. +9 −0 libarchive/archive_crypto_private.h
View
6 libarchive/archive_crypto.c
@@ -30,6 +30,12 @@
#include "archive.h"
#include "archive_crypto_private.h"
+/* In particular, force the configure probe to break if it tries
+ * to test a combination of OpenSSL and libmd. */
+#if defined(ARCHIVE_CRYPTO_OPENSSL) && defined(ARCHIVE_CRYPTO_LIBMD)
+#error Cannot use both OpenSSL and libmd.
+#endif
+
/*
* Message digest functions for Windows platform.
*/
View
9 libarchive/archive_crypto_private.h
@@ -79,6 +79,14 @@
#endif
/* libmd crypto headers */
+#if defined(ARCHIVE_CRYPTO_MD5_LIBMD) ||\
+ defined(ARCHIVE_CRYPTO_RMD160_LIBMD) ||\
+ defined(ARCHIVE_CRYPTO_SHA1_LIBMD) ||\
+ defined(ARCHIVE_CRYPTO_SHA256_LIBMD) ||\
+ defined(ARCHIVE_CRYPTO_SHA512_LIBMD)
+#define ARCHIVE_CRYPTO_LIBMD 1
+#endif
+
#if defined(ARCHIVE_CRYPTO_MD5_LIBMD)
#include <md5.h>
#endif
@@ -125,6 +133,7 @@
defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) ||\
defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) ||\
defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
+#define ARCHIVE_CRYPTO_OPENSSL 1
#include <openssl/evp.h>
#endif

0 comments on commit 1110da4

Please sign in to comment.
Something went wrong with that request. Please try again.