Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 May 2011 01:16:06 +0000 (UTC)
From:      "David E. O'Brien" <obrien@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221472 - head/lib/libarchive
Message-ID:  <201105050116.p451G6LV075205@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: obrien
Date: Thu May  5 01:16:06 2011
New Revision: 221472
URL: http://svn.freebsd.org/changeset/base/221472

Log:
  libarchive is mixing libmd and libcrypto -- correct to use one or the other.
  [mixing the two can be quite bad -- they define the same context structures,
   but with differing structure members (and sizes)]
  
  Update the hash function support comments, and update config_freebsd.h
  to match.
  
  Approved by:	kientzle

Modified:
  head/lib/libarchive/Makefile
  head/lib/libarchive/archive_hash.h
  head/lib/libarchive/config_freebsd.h

Modified: head/lib/libarchive/Makefile
==============================================================================
--- head/lib/libarchive/Makefile	Thu May  5 01:09:42 2011	(r221471)
+++ head/lib/libarchive/Makefile	Thu May  5 01:16:06 2011	(r221472)
@@ -2,8 +2,8 @@
 .include <bsd.own.mk>
 
 LIB=	archive
-DPADD=	${LIBZ} ${LIBMD}
-LDADD=	-lz -lmd
+DPADD=	${LIBZ}
+LDADD=	-lz
 
 DPADD+= ${LIBBZ2}
 LDADD+= -lbz2
@@ -24,6 +24,9 @@ CFLAGS+=	-I${.OBJDIR}
 CFLAGS+=	-DWITH_OPENSSL
 DPADD+=	${LIBCRYPTO}
 LDADD+=	-lcrypto
+.else
+DPADD+=	${LIBMD}
+LDADD+=	-lmd
 .endif
 
 # Headers to be installed in /usr/include

Modified: head/lib/libarchive/archive_hash.h
==============================================================================
--- head/lib/libarchive/archive_hash.h	Thu May  5 01:09:42 2011	(r221471)
+++ head/lib/libarchive/archive_hash.h	Thu May  5 01:16:06 2011	(r221472)
@@ -41,11 +41,11 @@
  * - OpenBSD 4.4 and earlier have SHA2 in libc with _ after algorithm name
  *
  * DragonFly and FreeBSD (XXX not used yet):
- * - MD5 and SHA1 in libmd: without _ after algorithm name
- * - SHA256: with _ after algorithm name
+ * - MD5 in libmd: without _ after algorithm name
+ * - SHA{1,256,512} in libmd: with _ after algorithm name (conflicts w/OpenSSL!)
  *
  * OpenSSL:
- * - MD5, SHA1 and SHA2 in libcrypto: with _ after algorithm name
+ * - MD5, SHA1, SHA2, SHA{256,384,512} in libcrypto: with _ after algorithm name
  */
 
 #if defined(HAVE_MD5_H) && defined(HAVE_MD5INIT)

Modified: head/lib/libarchive/config_freebsd.h
==============================================================================
--- head/lib/libarchive/config_freebsd.h	Thu May  5 01:09:42 2011	(r221471)
+++ head/lib/libarchive/config_freebsd.h	Thu May  5 01:16:06 2011	(r221472)
@@ -47,8 +47,24 @@
 #define	HAVE_OPENSSL_MD5_H 1
 #define	HAVE_OPENSSL_RIPEMD_H 1
 #define	HAVE_OPENSSL_SHA_H 1
+#define	HAVE_OPENSSL_SHA256_INIT 1
+#define	HAVE_OPENSSL_SHA384_INIT 1
+#define	HAVE_OPENSSL_SHA512_INIT 1
+#define	HAVE_SHA256 1
 #define	HAVE_SHA384 1
 #define	HAVE_SHA512 1
+#else
+#define	HAVE_MD5_H 1
+#define	HAVE_MD5INIT 1
+#define	HAVE_SHA_H 1
+#define	HAVE_SHA1 1
+#define	HAVE_SHA1_INIT 1
+#define	HAVE_SHA256 1
+#define	HAVE_SHA256_H 1
+#define	HAVE_SHA256_INIT 1
+#define	HAVE_SHA512 1
+#define	HAVE_SHA512_H 1
+#define	HAVE_SHA512_INIT 1
 #endif
 
 #define	HAVE_BSDXML_H 1
@@ -88,7 +104,6 @@
 #define	HAVE_LUTIMES 1
 #define	HAVE_MALLOC 1
 #define	HAVE_MD5 1
-#define	HAVE_MD5_H 1
 #define	HAVE_MEMMOVE 1
 #define	HAVE_MKDIR 1
 #define	HAVE_MKFIFO 1
@@ -101,10 +116,6 @@
 #define	HAVE_RMD160 1
 #define	HAVE_SELECT 1
 #define	HAVE_SETENV 1
-#define	HAVE_SHA_H 1
-#define	HAVE_SHA1 1
-#define	HAVE_SHA256 1
-#define	HAVE_SHA256_H 1
 #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?201105050116.p451G6LV075205>