diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile index fc1b72449fcf..60571666bc86 100644 --- a/lib/libarchive/Makefile +++ b/lib/libarchive/Makefile @@ -1,4 +1,5 @@ # $FreeBSD$ +.include 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 22e4c56d9fb9..377fa606f387 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 #include #include -#ifdef HAVE_OPENSSL_MD5_H -#include -#else /* HAVE_OPENSSL_MD5_H */ #ifdef HAVE_MD5_H #include -#endif +#else +#ifdef HAVE_OPENSSL_MD5_H +#include #endif /* HAVE_OPENSSL_MD5_H */ +#endif /* HAVE_MD5_H */ #ifdef HAVE_OPENSSL_RIPEMD_H #include #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 c427b4145cf8..484b8662ea23 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