From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 06:06:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79733106564A; Sat, 18 Apr 2009 06:06:47 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67BC38FC0C; Sat, 18 Apr 2009 06:06:47 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I66l0J057640; Sat, 18 Apr 2009 06:06:47 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I66lmS057637; Sat, 18 Apr 2009 06:06:47 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200904180606.n3I66lmS057637@svn.freebsd.org> From: Tim Kientzle Date: Sat, 18 Apr 2009 06:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191241 - head/lib/libarchive X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2009 06:06:48 -0000 Author: kientzle Date: Sat Apr 18 06:06:47 2009 New Revision: 191241 URL: http://svn.freebsd.org/changeset/base/191241 Log: 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. Modified: head/lib/libarchive/Makefile head/lib/libarchive/archive_write_set_format_mtree.c head/lib/libarchive/config_freebsd.h Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Sat Apr 18 06:03:09 2009 (r191240) +++ head/lib/libarchive/Makefile Sat Apr 18 06:06:47 2009 (r191241) @@ -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 Modified: head/lib/libarchive/archive_write_set_format_mtree.c ============================================================================== --- head/lib/libarchive/archive_write_set_format_mtree.c Sat Apr 18 06:03:09 2009 (r191240) +++ head/lib/libarchive/archive_write_set_format_mtree.c Sat Apr 18 06:06:47 2009 (r191241) @@ -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 archiv 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 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_ } #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) Modified: head/lib/libarchive/config_freebsd.h ============================================================================== --- head/lib/libarchive/config_freebsd.h Sat Apr 18 06:03:09 2009 (r191240) +++ head/lib/libarchive/config_freebsd.h Sat Apr 18 06:06:47 2009 (r191241) @@ -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