Skip to content

Commit

Permalink
Don't use libmd and OpenSSL at the same time; they
Browse files Browse the repository at this point in the history
provide conflicting definitions for SHA512 symbols.

SVN-Revision: 3926
  • Loading branch information
kientzle committed Dec 17, 2011
1 parent cb8f70a commit 1110da4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libarchive/archive_crypto.c
Expand Up @@ -30,6 +30,12 @@
#include "archive.h" #include "archive.h"
#include "archive_crypto_private.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. * Message digest functions for Windows platform.
*/ */
Expand Down
9 changes: 9 additions & 0 deletions libarchive/archive_crypto_private.h
Expand Up @@ -79,6 +79,14 @@
#endif #endif


/* libmd crypto headers */ /* 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) #if defined(ARCHIVE_CRYPTO_MD5_LIBMD)
#include <md5.h> #include <md5.h>
#endif #endif
Expand Down Expand Up @@ -125,6 +133,7 @@
defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) ||\ defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) ||\
defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) ||\ defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) ||\
defined(ARCHIVE_CRYPTO_SHA512_OPENSSL) defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
#define ARCHIVE_CRYPTO_OPENSSL 1
#include <openssl/evp.h> #include <openssl/evp.h>
#endif #endif


Expand Down

0 comments on commit 1110da4

Please sign in to comment.