diff options
author | kientzle <kientzle@FreeBSD.org> | 2009-04-18 06:06:47 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2009-04-18 06:06:47 +0000 |
commit | caeeb0725079bf7bdbd2e793b920ebec55085062 (patch) | |
tree | c132c8457298f0a508032b33c4131e1740617d6b /lib/libarchive | |
parent | 392ab3c6f70a50a4925ea71295af978a7e5a9181 (diff) | |
download | FreeBSD-src-caeeb0725079bf7bdbd2e793b920ebec55085062.zip FreeBSD-src-caeeb0725079bf7bdbd2e793b920ebec55085062.tar.gz |
Rely on OpenSSL bits only if we're building a system with OpenSSL.
Also, adjust the MD5 calls to rely on libmd instead of libcrypto,
so we keep MD5 support even in the !OpenSSL case.
Diffstat (limited to 'lib/libarchive')
-rw-r--r-- | lib/libarchive/Makefile | 6 | ||||
-rw-r--r-- | lib/libarchive/archive_write_set_format_mtree.c | 14 | ||||
-rw-r--r-- | lib/libarchive/config_freebsd.h | 22 |
3 files changed, 22 insertions, 20 deletions
diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile index fc1b724..6057166 100644 --- a/lib/libarchive/Makefile +++ b/lib/libarchive/Makefile @@ -1,4 +1,5 @@ # $FreeBSD$ +.include <bsd.own.mk> LIB= archive DPADD= ${LIBBZ2} ${LIBZ} @@ -11,6 +12,11 @@ SHLIB_MAJOR= 4 CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" CFLAGS+= -I${.OBJDIR} +.if ${MK_OPENSSL} != "no" +CFLAGS+= -DWITH_OPENSSL +.endif + + WARNS?= 6 # Headers to be installed in /usr/include diff --git a/lib/libarchive/archive_write_set_format_mtree.c b/lib/libarchive/archive_write_set_format_mtree.c index 22e4c56..377fa60 100644 --- a/lib/libarchive/archive_write_set_format_mtree.c +++ b/lib/libarchive/archive_write_set_format_mtree.c @@ -33,13 +33,13 @@ __FBSDID("$FreeBSD$"); #include <errno.h> #include <stdlib.h> #include <string.h> -#ifdef HAVE_OPENSSL_MD5_H -#include <openssl/md5.h> -#else /* HAVE_OPENSSL_MD5_H */ #ifdef HAVE_MD5_H #include <md5.h> -#endif +#else +#ifdef HAVE_OPENSSL_MD5_H +#include <openssl/md5.h> #endif /* HAVE_OPENSSL_MD5_H */ +#endif /* HAVE_MD5_H */ #ifdef HAVE_OPENSSL_RIPEMD_H #include <openssl/ripemd.h> #else /* HAVE_OPENSSL_RIPEMD_H */ @@ -618,7 +618,7 @@ archive_write_mtree_header(struct archive_write *a, if ((mtree->keys & F_MD5) != 0 && archive_entry_filetype(entry) == AE_IFREG) { mtree->compute_sum |= F_MD5; - MD5_Init(&mtree->md5ctx); + MD5Init(&mtree->md5ctx); } else mtree->compute_sum &= ~F_MD5; #endif @@ -803,7 +803,7 @@ archive_write_mtree_finish_entry(struct archive_write *a) if (mtree->compute_sum & F_MD5) { unsigned char buf[16]; - MD5_Final(buf, &mtree->md5ctx); + MD5Final(buf, &mtree->md5ctx); archive_strcat(str, " md5digest="); strappend_bin(str, buf, sizeof(buf)); } @@ -901,7 +901,7 @@ archive_write_mtree_data(struct archive_write *a, const void *buff, size_t n) } #ifdef HAVE_MD5 if (mtree->compute_sum & F_MD5) - MD5_Update(&mtree->md5ctx, buff, n); + MD5Update(&mtree->md5ctx, buff, n); #endif #ifdef HAVE_RMD160 if (mtree->compute_sum & F_RMD160) diff --git a/lib/libarchive/config_freebsd.h b/lib/libarchive/config_freebsd.h index c427b41..484b866 100644 --- a/lib/libarchive/config_freebsd.h +++ b/lib/libarchive/config_freebsd.h @@ -42,6 +42,14 @@ #define HAVE_SYS_EXTATTR_H 1 #endif +#ifdef WITH_OPENSSL +#define HAVE_OPENSSL_MD5_H 1 +#define HAVE_OPENSSL_RIPEMD_H 1 +#define HAVE_OPENSSL_SHA_H 1 +#define HAVE_SHA384 1 +#define HAVE_SHA512 1 +#endif + #define HAVE_BZLIB_H 1 #define HAVE_CHFLAGS 1 #define HAVE_CHOWN 1 @@ -75,38 +83,26 @@ #define HAVE_LIMITS_H 1 #define HAVE_LUTIMES 1 #define HAVE_MALLOC 1 -#if 0 #define HAVE_MD5 1 #define HAVE_MD5_H 1 -#endif #define HAVE_MEMMOVE 1 #define HAVE_MEMSET 1 #define HAVE_MKDIR 1 #define HAVE_MKFIFO 1 #define HAVE_MKNOD 1 -#if 0 -#define HAVE_OPENSSL_MD5_H 1 -#define HAVE_OPENSSL_RIPEMD_H 1 -#define HAVE_OPENSSL_SHA_H 1 -#endif #define HAVE_PIPE 1 #define HAVE_POLL 1 #define HAVE_POLL_H 1 #define HAVE_PWD_H 1 #define HAVE_READLINK 1 -#if 0 +#define HAVE_RIPEMD_H #define HAVE_RMD160 1 -#endif #define HAVE_SELECT 1 #define HAVE_SETENV 1 -#if 0 #define HAVE_SHA_H 1 #define HAVE_SHA1 1 #define HAVE_SHA256 1 #define HAVE_SHA256_H 1 -#define HAVE_SHA384 1 -#define HAVE_SHA512 1 -#endif #define HAVE_SIGNAL_H 1 #define HAVE_STDINT_H 1 #define HAVE_STDLIB_H 1 |