Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Apr 2009 06:06:47 +0000 (UTC)
From:      Tim Kientzle <kientzle@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r191241 - head/lib/libarchive
Message-ID:  <200904180606.n3I66lmS057637@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <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

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 <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 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904180606.n3I66lmS057637>