Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Feb 2020 01:50:48 +0000 (UTC)
From:      Martin Matuska <mm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r358088 - in stable/11: contrib/libarchive contrib/libarchive/cat contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/...
Message-ID:  <202002190150.01J1om1L030786@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mm
Date: Wed Feb 19 01:50:47 2020
New Revision: 358088
URL: https://svnweb.freebsd.org/changeset/base/358088

Log:
  MFC r356212,r356366,r356416,r357785
  Update libarchive to version 3.4.2
  
  Relevant vendor changes (r356212):
    Issue #351: Refactor and implement private state logic for write filters
    PR #1252: RAR5 reader - verify window size for solid files (OSS-Fuzz 15482)
    PR #1255: zip writer - don't append unused NUL for directories
    PR #1260: Fix sparse file offset overflow on 32-bit systems
    PR #1263: UNICODE filename support for reading lha/lzh format
    Issue #1276: Bugfix and optimize archive_wstring_append_from_mbs()
    PR #1288: Add the "xattrhdr" option to pax write options
    PR #1295: 7z reader - fix reading archives with digests in PackInfo
    PR #1296: RAR5 reader - verify window size for multivolume archives
    PR #1297: ZIP reader - support LZMA_STREAM_END marker in 'lzma alone' files
    Issue #1298: Fix a heap-buffer-overflow in archive_string_append_from_wcs()
    OSS-Fuzz 19360, 19362: LHA reader - plug two memory leaks on error
    Fix possible off-by-one when dealing with readlink(2)
  
  Relevant vendor changes (r356366):
    Issue #1302: Plug memory leak on failure of archive_write_client_open()
  
  Relevant vendor changes (r356416):
    Issue #1302: Re-do fix for archive_write_client_open()
  
  Relevant vendor changes (r357785):
    PR #1289: atomic extraction support (bsdtar -x --safe-writes)
    PR #1308: big endian fix for UTF16 support in LHA reader
    PR #1326: reject RAR5 files that declare invalid header flags
    Issue #987: fix support 7z archive entries with Delta filter
    Issue #1317: fix compression output buffer handling in XAR writer
    Issue #1319: fix uname or gname longer than 32 characters in pax writer
    Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR
    Use localtime_r() and gmtime_r() instead of localtime() and gmtime()

Added:
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_private.h
     - copied unchanged from r357785, head/contrib/libarchive/libarchive/archive_write_set_format_private.h
  stable/11/contrib/libarchive/libarchive/test/test_pax_xattr_header.c
     - copied unchanged from r356212, head/contrib/libarchive/libarchive/test/test_pax_xattr_header.c
  stable/11/contrib/libarchive/libarchive/test/test_pax_xattr_header_all.tar.uu
     - copied unchanged from r356212, head/contrib/libarchive/libarchive/test/test_pax_xattr_header_all.tar.uu
  stable/11/contrib/libarchive/libarchive/test/test_pax_xattr_header_libarchive.tar.uu
     - copied unchanged from r356212, head/contrib/libarchive/libarchive/test/test_pax_xattr_header_libarchive.tar.uu
  stable/11/contrib/libarchive/libarchive/test/test_pax_xattr_header_schily.tar.uu
     - copied unchanged from r356212, head/contrib/libarchive/libarchive/test/test_pax_xattr_header_schily.tar.uu
  stable/11/contrib/libarchive/libarchive/test/test_read_format_7zip_delta4_lzma1.7z.uu
     - copied unchanged from r357785, head/contrib/libarchive/libarchive/test/test_read_format_7zip_delta4_lzma1.7z.uu
  stable/11/contrib/libarchive/libarchive/test/test_read_format_7zip_delta4_lzma2.7z.uu
     - copied unchanged from r357785, head/contrib/libarchive/libarchive/test/test_read_format_7zip_delta4_lzma2.7z.uu
  stable/11/contrib/libarchive/libarchive/test/test_read_format_7zip_packinfo_digests.7z.uu
     - copied unchanged from r356212, head/contrib/libarchive/libarchive/test/test_read_format_7zip_packinfo_digests.7z.uu
  stable/11/contrib/libarchive/libarchive/test/test_read_format_7zip_packinfo_digests.c
     - copied, changed from r356212, head/contrib/libarchive/libarchive/test/test_read_format_7zip_packinfo_digests.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_lha_filename_utf16.c
     - copied unchanged from r356212, head/contrib/libarchive/libarchive/test/test_read_format_lha_filename_utf16.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_lha_filename_utf16.lzh.uu
     - copied unchanged from r356212, head/contrib/libarchive/libarchive/test/test_read_format_lha_filename_utf16.lzh.uu
  stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_block_size_is_too_small.rar.uu
     - copied unchanged from r357785, head/contrib/libarchive/libarchive/test/test_read_format_rar5_block_size_is_too_small.rar.uu
  stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_different_solid_window_size.rar.uu
     - copied unchanged from r356212, head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_solid_window_size.rar.uu
  stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_different_winsize_on_merge.rar.uu
     - copied unchanged from r356212, head/contrib/libarchive/libarchive/test/test_read_format_rar5_different_winsize_on_merge.rar.uu
  stable/11/contrib/libarchive/tar/test/test_option_safe_writes.c
     - copied unchanged from r357785, head/contrib/libarchive/tar/test/test_option_safe_writes.c
Modified:
  stable/11/contrib/libarchive/NEWS
  stable/11/contrib/libarchive/cat/bsdcat.h
  stable/11/contrib/libarchive/cat/test/test_0.c
  stable/11/contrib/libarchive/cpio/cpio.c
  stable/11/contrib/libarchive/cpio/test/test_basic.c
  stable/11/contrib/libarchive/cpio/test/test_format_newc.c
  stable/11/contrib/libarchive/libarchive/archive.h
  stable/11/contrib/libarchive/libarchive/archive_acl_private.h
  stable/11/contrib/libarchive/libarchive/archive_blake2.h
  stable/11/contrib/libarchive/libarchive/archive_blake2_impl.h
  stable/11/contrib/libarchive/libarchive/archive_cmdline_private.h
  stable/11/contrib/libarchive/libarchive/archive_crc32.h
  stable/11/contrib/libarchive/libarchive/archive_cryptor.c
  stable/11/contrib/libarchive/libarchive/archive_cryptor_private.h
  stable/11/contrib/libarchive/libarchive/archive_digest.c
  stable/11/contrib/libarchive/libarchive/archive_digest_private.h
  stable/11/contrib/libarchive/libarchive/archive_endian.h
  stable/11/contrib/libarchive/libarchive/archive_entry.c
  stable/11/contrib/libarchive/libarchive/archive_entry.h
  stable/11/contrib/libarchive/libarchive/archive_entry_acl.3
  stable/11/contrib/libarchive/libarchive/archive_entry_locale.h
  stable/11/contrib/libarchive/libarchive/archive_entry_private.h
  stable/11/contrib/libarchive/libarchive/archive_getdate.c
  stable/11/contrib/libarchive/libarchive/archive_getdate.h
  stable/11/contrib/libarchive/libarchive/archive_hmac.c
  stable/11/contrib/libarchive/libarchive/archive_hmac_private.h
  stable/11/contrib/libarchive/libarchive/archive_openssl_evp_private.h
  stable/11/contrib/libarchive/libarchive/archive_openssl_hmac_private.h
  stable/11/contrib/libarchive/libarchive/archive_options_private.h
  stable/11/contrib/libarchive/libarchive/archive_pack_dev.c
  stable/11/contrib/libarchive/libarchive/archive_pack_dev.h
  stable/11/contrib/libarchive/libarchive/archive_pathmatch.h
  stable/11/contrib/libarchive/libarchive/archive_platform_acl.h
  stable/11/contrib/libarchive/libarchive/archive_platform_xattr.h
  stable/11/contrib/libarchive/libarchive/archive_ppmd7.c
  stable/11/contrib/libarchive/libarchive/archive_ppmd7_private.h
  stable/11/contrib/libarchive/libarchive/archive_ppmd8_private.h
  stable/11/contrib/libarchive/libarchive/archive_ppmd_private.h
  stable/11/contrib/libarchive/libarchive/archive_private.h
  stable/11/contrib/libarchive/libarchive/archive_random_private.h
  stable/11/contrib/libarchive/libarchive/archive_rb.h
  stable/11/contrib/libarchive/libarchive/archive_read.c
  stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
  stable/11/contrib/libarchive/libarchive/archive_read_disk_posix.c
  stable/11/contrib/libarchive/libarchive/archive_read_disk_private.h
  stable/11/contrib/libarchive/libarchive/archive_read_private.h
  stable/11/contrib/libarchive/libarchive/archive_read_set_options.3
  stable/11/contrib/libarchive/libarchive/archive_read_support_filter_uu.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_format_7zip.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_format_lha.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_format_warc.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_format_xar.c
  stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c
  stable/11/contrib/libarchive/libarchive/archive_string.c
  stable/11/contrib/libarchive/libarchive/archive_string.h
  stable/11/contrib/libarchive/libarchive/archive_string_composition.h
  stable/11/contrib/libarchive/libarchive/archive_util.c
  stable/11/contrib/libarchive/libarchive/archive_write.c
  stable/11/contrib/libarchive/libarchive/archive_write_add_filter_b64encode.c
  stable/11/contrib/libarchive/libarchive/archive_write_add_filter_bzip2.c
  stable/11/contrib/libarchive/libarchive/archive_write_add_filter_compress.c
  stable/11/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c
  stable/11/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c
  stable/11/contrib/libarchive/libarchive/archive_write_add_filter_lzop.c
  stable/11/contrib/libarchive/libarchive/archive_write_add_filter_program.c
  stable/11/contrib/libarchive/libarchive/archive_write_add_filter_uuencode.c
  stable/11/contrib/libarchive/libarchive/archive_write_add_filter_xz.c
  stable/11/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c
  stable/11/contrib/libarchive/libarchive/archive_write_disk.3
  stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c
  stable/11/contrib/libarchive/libarchive/archive_write_disk_private.h
  stable/11/contrib/libarchive/libarchive/archive_write_private.h
  stable/11/contrib/libarchive/libarchive/archive_write_set_format.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_7zip.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_ar.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_cpio.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_pax.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_shar.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_ustar.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_warc.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_xar.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_zip.c
  stable/11/contrib/libarchive/libarchive/archive_write_set_options.3
  stable/11/contrib/libarchive/libarchive/archive_xxhash.h
  stable/11/contrib/libarchive/libarchive/filter_fork.h
  stable/11/contrib/libarchive/libarchive/test/test_archive_write_set_format_filter_by_ext.c
  stable/11/contrib/libarchive/libarchive/test/test_compat_zip.c
  stable/11/contrib/libarchive/libarchive/test/test_fuzz.c
  stable/11/contrib/libarchive/libarchive/test/test_open_failure.c
  stable/11/contrib/libarchive/libarchive/test/test_open_fd.c
  stable/11/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c
  stable/11/contrib/libarchive/libarchive/test/test_read_extract.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_7zip.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_gtar_sparse.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_7075_utf8_paths.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_comment_stored.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_extra_padding.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_jar.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_mac_metadata.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_malformed.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_msdos.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_nested.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_nofiletype.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_padded.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_sfx.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c
  stable/11/contrib/libarchive/libarchive/test/test_read_format_zip_zip64.c
  stable/11/contrib/libarchive/libarchive/test/test_read_pax_truncated.c
  stable/11/contrib/libarchive/libarchive/test/test_read_truncated_filter.c
  stable/11/contrib/libarchive/libarchive/test/test_sparse_basic.c
  stable/11/contrib/libarchive/libarchive/test/test_write_disk.c
  stable/11/contrib/libarchive/libarchive/test/test_write_format_cpio_empty.c
  stable/11/contrib/libarchive/libarchive/test/test_write_format_pax.c
  stable/11/contrib/libarchive/libarchive/test/test_write_format_shar_empty.c
  stable/11/contrib/libarchive/libarchive/test/test_write_format_tar.c
  stable/11/contrib/libarchive/libarchive/test/test_write_format_tar_sparse.c
  stable/11/contrib/libarchive/libarchive/test/test_write_format_xar.c
  stable/11/contrib/libarchive/libarchive/test/test_write_format_zip_file.c
  stable/11/contrib/libarchive/libarchive/test/test_write_format_zip_file_zip64.c
  stable/11/contrib/libarchive/libarchive_fe/err.h
  stable/11/contrib/libarchive/tar/bsdtar.1
  stable/11/contrib/libarchive/tar/bsdtar.c
  stable/11/contrib/libarchive/tar/bsdtar.h
  stable/11/contrib/libarchive/tar/cmdline.c
  stable/11/contrib/libarchive/tar/test/test_basic.c
  stable/11/contrib/libarchive/tar/test/test_copy.c
  stable/11/contrib/libarchive/tar/test/test_option_C_upper.c
  stable/11/contrib/libarchive/tar/test/test_option_s.c
  stable/11/contrib/libarchive/tar/util.c
  stable/11/contrib/libarchive/test_utils/test_common.h
  stable/11/contrib/libarchive/test_utils/test_main.c
  stable/11/lib/libarchive/tests/Makefile
  stable/11/usr.bin/bsdcat/Makefile
  stable/11/usr.bin/cpio/Makefile
  stable/11/usr.bin/tar/Makefile
  stable/11/usr.bin/tar/tests/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/libarchive/NEWS
==============================================================================
--- stable/11/contrib/libarchive/NEWS	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/NEWS	Wed Feb 19 01:50:47 2020	(r358088)
@@ -1,3 +1,17 @@
+Feb 11, 2020: libarchive 3.4.2 released
+
+Jan 23, 2020: Important fixes for writing XAR archives
+
+Jan 20, 2020: New tar option: --safe-writes (atomical file extraction)
+
+Jan 03, 2020: Support mbed TLS (PolarSSL) as optional crypto provider
+
+Dec 30, 2019: libarchive 3.4.1 released
+
+Dec 11, 2019: New pax write option "xattrhdr"
+
+Nov 17, 2019: Unicode filename support for reading lha/lzh archives
+
 Jun 11, 2019: libarchive 3.4.0 released
 
 May 18, 2019: Fixes for reading Android APK and JAR archives

Modified: stable/11/contrib/libarchive/cat/bsdcat.h
==============================================================================
--- stable/11/contrib/libarchive/cat/bsdcat.h	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/cat/bsdcat.h	Wed Feb 19 01:50:47 2020	(r358088)
@@ -23,6 +23,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef BSDCAT_H_INCLUDED
+#define BSDCAT_H_INCLUDED
+
 #if defined(PLATFORM_CONFIG_H)
 /* Use hand-built config.h in environments that need it. */
 #include PLATFORM_CONFIG_H
@@ -54,3 +57,5 @@ void usage(FILE *stream, int eval);
 void bsdcat_next(void);
 void bsdcat_print_error(void);
 void bsdcat_read_to_stdout(const char* filename);
+
+#endif

Modified: stable/11/contrib/libarchive/cat/test/test_0.c
==============================================================================
--- stable/11/contrib/libarchive/cat/test/test_0.c	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/cat/test/test_0.c	Wed Feb 19 01:50:47 2020	(r358088)
@@ -59,7 +59,7 @@ DEFINE_TEST(test_0)
 	 * we know some option that will succeed.
 	 */
 	if (0 != systemf("%s --version >" DEV_NULL, testprog)) {
-		failure("Unable to successfully run: %s --version\n", testprog, testprog);
+		failure("Unable to successfully run: %s --version\n", testprog);
 		assert(0);
 	}
 

Modified: stable/11/contrib/libarchive/cpio/cpio.c
==============================================================================
--- stable/11/contrib/libarchive/cpio/cpio.c	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/cpio/cpio.c	Wed Feb 19 01:50:47 2020	(r358088)
@@ -1139,6 +1139,14 @@ list_item_verbose(struct cpio *cpio, struct archive_en
 	const char		*fmt;
 	time_t			 mtime;
 	static time_t		 now;
+	struct tm		*ltime;
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+	struct tm		tmbuf;
+#endif
+#if defined(HAVE__LOCALTIME64_S)
+	errno_t			terr;
+	__time64_t		tmptime;
+#endif
 
 	if (!now)
 		time(&now);
@@ -1186,7 +1194,19 @@ list_item_verbose(struct cpio *cpio, struct archive_en
 	else
 		fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M";
 #endif
-	strftime(date, sizeof(date), fmt, localtime(&mtime));
+#if defined(HAVE_LOCALTIME_R)
+	ltime = localtime_r(&mtime, &tmbuf);
+#elif defined(HAVE__LOCALTIME64_S)
+	tmptime = mtime;
+	terr = _localtime64_s(&tmbuf, &tmptime);
+	if (terr)
+		ltime = NULL;
+	else
+		ltime = &tmbuf;
+#else
+	ltime = localtime(&mtime);
+#endif
+	strftime(date, sizeof(date), fmt, ltime);
 
 	fprintf(out, "%s%3d %-8s %-8s %8s %12s %s",
 	    archive_entry_strmode(entry),

Modified: stable/11/contrib/libarchive/cpio/test/test_basic.c
==============================================================================
--- stable/11/contrib/libarchive/cpio/test/test_basic.c	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/cpio/test/test_basic.c	Wed Feb 19 01:50:47 2020	(r358088)
@@ -33,15 +33,15 @@ verify_files(const char *msg)
 	 */
 
 	/* Regular file with 2 links. */
-	failure(msg);
+	failure("%s", msg);
 	assertIsReg("file", 0644);
-	failure(msg);
+	failure("%s", msg);
 	assertFileSize("file", 10);
-	failure(msg);
+	failure("%s", msg);
 	assertFileNLinks("file", 2);
 
 	/* Another name for the same file. */
-	failure(msg);
+	failure("%s", msg);
 	assertIsHardlink("linkfile", "file");
 
 	/* Symlink */
@@ -49,11 +49,11 @@ verify_files(const char *msg)
 		assertIsSymlink("symlink", "file", 0);
 
 	/* Another file with 1 link and different permissions. */
-	failure(msg);
+	failure("%s", msg);
 	assertIsReg("file2", 0777);
-	failure(msg);
+	failure("%s", msg);
 	assertFileSize("file2", 10);
-	failure(msg);
+	failure("%s", msg);
 	assertFileNLinks("file2", 1);
 
 	/* dir */

Modified: stable/11/contrib/libarchive/cpio/test/test_format_newc.c
==============================================================================
--- stable/11/contrib/libarchive/cpio/test/test_format_newc.c	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/cpio/test/test_format_newc.c	Wed Feb 19 01:50:47 2020	(r358088)
@@ -205,9 +205,11 @@ DEFINE_TEST(test_format_newc)
 	gid = from_hex(e + 30, 8); /* gid */
 	assertEqualMem(e + 38, "00000003", 8); /* nlink */
 	t = from_hex(e + 46, 8); /* mtime */
-	failure("t=0x%08x now=0x%08x=%d", t, now, now);
+	failure("t=%#08jx now=%#08jx=%jd", (intmax_t)t, (intmax_t)now,
+	    (intmax_t)now);
 	assert(t <= now); /* File wasn't created in future. */
-	failure("t=0x%08x now - 2=0x%08x = %d", t, now - 2, now - 2);
+	failure("t=%#08jx now - 2=%#08jx=%jd", (intmax_t)t, (intmax_t)now - 2,
+	    (intmax_t)now - 2);
 	assert(t >= now - 2); /* File was created w/in last 2 secs. */
 	failure("newc format stores body only with last appearance of a link\n"
 	    "       first appearance should be empty, so this file size\n"
@@ -243,7 +245,8 @@ DEFINE_TEST(test_format_newc)
 		assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */
 		assertEqualMem(e + 38, "00000001", 8); /* nlink */
 		t2 = from_hex(e + 46, 8); /* mtime */
-		failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2);
+		failure("First entry created at t=%#08jx this entry created"
+		    " at t2=%#08jx", (intmax_t)t, (intmax_t)t2);
 		assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */
 		assertEqualMem(e + 54, "00000005", 8); /* File size */
 		fs = from_hex(e + 54, 8);
@@ -278,7 +281,8 @@ DEFINE_TEST(test_format_newc)
 	assertEqualInt(nlinks("dir"), from_hex(e + 38, 8)); /* nlinks */
 #endif
 	t2 = from_hex(e + 46, 8); /* mtime */
-	failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2);
+	failure("First entry created at t=%#08jx this entry created at"
+	    "t2=%#08jx", (intmax_t)t, (intmax_t)t2);
 	assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */
 	assertEqualMem(e + 54, "00000000", 8); /* File size */
 	fs = from_hex(e + 54, 8);
@@ -311,7 +315,8 @@ DEFINE_TEST(test_format_newc)
 	assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */
 	assertEqualMem(e + 38, "00000003", 8); /* nlink */
 	t2 = from_hex(e + 46, 8); /* mtime */
-	failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2);
+	failure("First entry created at t=%#08jx this entry created at"
+	    "t2=%#08jx", (intmax_t)t, (intmax_t)t2);
 	assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */
 	assertEqualInt(10, from_hex(e + 54, 8)); /* File size */
 	fs = from_hex(e + 54, 8);

Modified: stable/11/contrib/libarchive/libarchive/archive.h
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive.h	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive.h	Wed Feb 19 01:50:47 2020	(r358088)
@@ -36,7 +36,7 @@
  * assert that ARCHIVE_VERSION_NUMBER >= 2012108.
  */
 /* Note: Compiler will complain if this does not match archive_entry.h! */
-#define	ARCHIVE_VERSION_NUMBER 3004000
+#define	ARCHIVE_VERSION_NUMBER 3004002
 
 #include <sys/stat.h>
 #include <stddef.h>  /* for wchar_t */
@@ -155,7 +155,7 @@ __LA_DECL int		archive_version_number(void);
 /*
  * Textual name/version of the library, useful for version displays.
  */
-#define	ARCHIVE_VERSION_ONLY_STRING "3.4.0"
+#define	ARCHIVE_VERSION_ONLY_STRING "3.4.2"
 #define	ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
 __LA_DECL const char *	archive_version_string(void);
 
@@ -693,6 +693,8 @@ __LA_DECL int archive_read_set_passphrase_callback(str
 #define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000)
 /* Default: Do not clear no-change flags when unlinking object */
 #define	ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS	(0x20000)
+/* Default: Do not extract atomically (using rename) */
+#define	ARCHIVE_EXTRACT_SAFE_WRITES		(0x40000)
 
 __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *,
 		     int flags);

Modified: stable/11/contrib/libarchive/libarchive/archive_acl_private.h
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_acl_private.h	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_acl_private.h	Wed Feb 19 01:50:47 2020	(r358088)
@@ -25,12 +25,12 @@
  * $FreeBSD$
  */
 
+#ifndef ARCHIVE_ACL_PRIVATE_H_INCLUDED
+#define ARCHIVE_ACL_PRIVATE_H_INCLUDED
+
 #ifndef __LIBARCHIVE_BUILD
 #error This header is only to be used internally to libarchive.
 #endif
-
-#ifndef ARCHIVE_ACL_PRIVATE_H_INCLUDED
-#define	ARCHIVE_ACL_PRIVATE_H_INCLUDED
 
 #include "archive_string.h"
 

Modified: stable/11/contrib/libarchive/libarchive/archive_blake2.h
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_blake2.h	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_blake2.h	Wed Feb 19 01:50:47 2020	(r358088)
@@ -12,8 +12,9 @@
    More information about the BLAKE2 hash function can be found at
    https://blake2.net.
 */
-#ifndef BLAKE2_H
-#define BLAKE2_H
+
+#ifndef ARCHIVE_BLAKE2_H
+#define ARCHIVE_BLAKE2_H
 
 #include <stddef.h>
 #include <stdint.h>

Modified: stable/11/contrib/libarchive/libarchive/archive_blake2_impl.h
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_blake2_impl.h	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_blake2_impl.h	Wed Feb 19 01:50:47 2020	(r358088)
@@ -12,8 +12,9 @@
    More information about the BLAKE2 hash function can be found at
    https://blake2.net.
 */
-#ifndef BLAKE2_IMPL_H
-#define BLAKE2_IMPL_H
+
+#ifndef ARCHIVE_BLAKE2_IMPL_H
+#define ARCHIVE_BLAKE2_IMPL_H
 
 #include <stdint.h>
 #include <string.h>

Modified: stable/11/contrib/libarchive/libarchive/archive_cmdline_private.h
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_cmdline_private.h	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_cmdline_private.h	Wed Feb 19 01:50:47 2020	(r358088)
@@ -25,14 +25,14 @@
  * $FreeBSD$
  */
 
+#ifndef ARCHIVE_CMDLINE_PRIVATE_H
+#define ARCHIVE_CMDLINE_PRIVATE_H
+
 #ifndef __LIBARCHIVE_BUILD
 #ifndef __LIBARCHIVE_TEST
 #error This header is only to be used internally to libarchive.
 #endif
 #endif
-
-#ifndef ARCHIVE_CMDLINE_PRIVATE_H
-#define ARCHIVE_CMDLINE_PRIVATE_H
 
 struct archive_cmdline {
         char            *path;

Modified: stable/11/contrib/libarchive/libarchive/archive_crc32.h
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_crc32.h	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_crc32.h	Wed Feb 19 01:50:47 2020	(r358088)
@@ -25,6 +25,9 @@
  * $FreeBSD$
  */
 
+#ifndef ARCHIVE_CRC32_H
+#define ARCHIVE_CRC32_H
+
 #ifndef __LIBARCHIVE_BUILD
 #error This header is only to be used internally to libarchive.
 #endif
@@ -76,3 +79,5 @@ crc32(unsigned long crc, const void *_p, size_t len)
 		crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8);
 	return (crc ^ 0xffffffffUL);
 }
+
+#endif

Modified: stable/11/contrib/libarchive/libarchive/archive_cryptor.c
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_cryptor.c	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_cryptor.c	Wed Feb 19 01:50:47 2020	(r358088)
@@ -85,6 +85,35 @@ pbkdf2_sha1(const char *pw, size_t pw_len, const uint8
 	return (BCRYPT_SUCCESS(status)) ? 0: -1;
 }
 
+#elif defined(HAVE_LIBMBEDCRYPTO) && defined(HAVE_MBEDTLS_PKCS5_H)
+
+static int
+pbkdf2_sha1(const char *pw, size_t pw_len, const uint8_t *salt,
+    size_t salt_len, unsigned rounds, uint8_t *derived_key,
+    size_t derived_key_len)
+{
+	mbedtls_md_context_t ctx;
+	const mbedtls_md_info_t *info;
+	int ret;
+
+	mbedtls_md_init(&ctx);
+	info = mbedtls_md_info_from_type(MBEDTLS_MD_SHA1);
+	if (info == NULL) {
+		mbedtls_md_free(&ctx);
+		return (-1);
+	}
+	ret = mbedtls_md_setup(&ctx, info, 1);
+	if (ret != 0) {
+		mbedtls_md_free(&ctx);
+		return (-1);
+	}
+	ret = mbedtls_pkcs5_pbkdf2_hmac(&ctx, (const unsigned char *)pw,
+	    pw_len, salt, salt_len, rounds, derived_key_len, derived_key);
+
+	mbedtls_md_free(&ctx);
+	return (ret);
+}
+
 #elif defined(HAVE_LIBNETTLE) && defined(HAVE_NETTLE_PBKDF2_H)
 
 static int
@@ -265,6 +294,39 @@ aes_ctr_release(archive_crypto_ctx *ctx)
 		HeapFree(GetProcessHeap(), 0, ctx->keyObj);
 		ctx->keyObj = NULL;
 	}
+	memset(ctx, 0, sizeof(*ctx));
+	return 0;
+}
+
+#elif defined(HAVE_LIBMBEDCRYPTO) && defined(HAVE_MBEDTLS_AES_H)
+
+static int
+aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *key, size_t key_len)
+{
+	mbedtls_aes_init(&ctx->ctx);
+	ctx->key_len = key_len;
+	memcpy(ctx->key, key, key_len);
+	memset(ctx->nonce, 0, sizeof(ctx->nonce));
+	ctx->encr_pos = AES_BLOCK_SIZE;
+	return 0;
+}
+
+static int
+aes_ctr_encrypt_counter(archive_crypto_ctx *ctx)
+{
+	if (mbedtls_aes_setkey_enc(&ctx->ctx, ctx->key,
+	    ctx->key_len * 8) != 0)
+		return (-1);
+	if (mbedtls_aes_crypt_ecb(&ctx->ctx, MBEDTLS_AES_ENCRYPT, ctx->nonce,
+	    ctx->encr_buf) != 0)
+		return (-1);
+	return 0;
+}
+
+static int
+aes_ctr_release(archive_crypto_ctx *ctx)
+{
+	mbedtls_aes_free(&ctx->ctx);
 	memset(ctx, 0, sizeof(*ctx));
 	return 0;
 }

Modified: stable/11/contrib/libarchive/libarchive/archive_cryptor_private.h
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_cryptor_private.h	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_cryptor_private.h	Wed Feb 19 01:50:47 2020	(r358088)
@@ -23,13 +23,12 @@
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#ifndef __LIBARCHIVE_BUILD
-#error This header is only to be used internally to libarchive.
-#endif
-
 #ifndef ARCHIVE_CRYPTOR_PRIVATE_H_INCLUDED
 #define ARCHIVE_CRYPTOR_PRIVATE_H_INCLUDED
 
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
 /*
  * On systems that do not support any recognized crypto libraries,
  * the archive_cryptor.c file will normally define no usable symbols.
@@ -78,6 +77,23 @@ typedef struct {
 	BCRYPT_KEY_HANDLE hKey;
 	PBYTE		keyObj;
 	DWORD		keyObj_len;
+	uint8_t		nonce[AES_BLOCK_SIZE];
+	uint8_t		encr_buf[AES_BLOCK_SIZE];
+	unsigned	encr_pos;
+} archive_crypto_ctx;
+
+#elif defined(HAVE_LIBMBEDCRYPTO) && defined(HAVE_MBEDTLS_AES_H)
+#include <mbedtls/aes.h>
+#include <mbedtls/md.h>
+#include <mbedtls/pkcs5.h>
+
+#define AES_MAX_KEY_SIZE 32
+#define AES_BLOCK_SIZE 16
+
+typedef struct {
+	mbedtls_aes_context	ctx;
+	uint8_t		key[AES_MAX_KEY_SIZE];
+	unsigned	key_len;
 	uint8_t		nonce[AES_BLOCK_SIZE];
 	uint8_t		encr_buf[AES_BLOCK_SIZE];
 	unsigned	encr_pos;

Modified: stable/11/contrib/libarchive/libarchive/archive_digest.c
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_digest.c	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_digest.c	Wed Feb 19 01:50:47 2020	(r358088)
@@ -178,6 +178,40 @@ __archive_libsystem_md5final(archive_md5_ctx *ctx, voi
   return (ARCHIVE_OK);
 }
 
+#elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS)
+
+static int
+__archive_mbedtls_md5init(archive_md5_ctx *ctx)
+{
+  mbedtls_md5_init(ctx);
+  if (mbedtls_md5_starts_ret(ctx) == 0)
+    return (ARCHIVE_OK);
+  else
+    return (ARCHIVE_FATAL);
+}
+
+static int
+__archive_mbedtls_md5update(archive_md5_ctx *ctx, const void *indata,
+    size_t insize)
+{
+  if (mbedtls_md5_update_ret(ctx, indata, insize) == 0)
+    return (ARCHIVE_OK);
+  else
+    return (ARCHIVE_FATAL);
+}
+
+static int
+__archive_mbedtls_md5final(archive_md5_ctx *ctx, void *md)
+{
+  if (mbedtls_md5_finish_ret(ctx, md) == 0) {
+    mbedtls_md5_free(ctx);
+    return (ARCHIVE_OK);
+  } else {
+    mbedtls_md5_free(ctx);
+    return (ARCHIVE_FATAL);
+  }
+}
+
 #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE)
 
 static int
@@ -335,6 +369,40 @@ __archive_libmd_ripemd160final(archive_rmd160_ctx *ctx
   return (ARCHIVE_OK);
 }
 
+#elif defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS)
+
+static int
+__archive_mbedtls_ripemd160init(archive_rmd160_ctx *ctx)
+{
+  mbedtls_ripemd160_init(ctx);
+  if (mbedtls_ripemd160_starts_ret(ctx) == 0)
+    return (ARCHIVE_OK);
+  else
+    return (ARCHIVE_FATAL);
+}
+
+static int
+__archive_mbedtls_ripemd160update(archive_rmd160_ctx *ctx, const void *indata,
+    size_t insize)
+{
+  if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0)
+    return (ARCHIVE_OK);
+  else
+    return (ARCHIVE_FATAL);
+}
+
+static int
+__archive_mbedtls_ripemd160final(archive_rmd160_ctx *ctx, void *md)
+{
+  if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) {
+    mbedtls_ripemd160_free(ctx);
+    return (ARCHIVE_OK);
+  } else {
+    mbedtls_ripemd160_free(ctx);
+    return (ARCHIVE_FATAL);
+  }
+}
+
 #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE)
 
 static int
@@ -491,6 +559,40 @@ __archive_libsystem_sha1final(archive_sha1_ctx *ctx, v
   return (ARCHIVE_OK);
 }
 
+#elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS)
+
+static int
+__archive_mbedtls_sha1init(archive_sha1_ctx *ctx)
+{
+  mbedtls_sha1_init(ctx);
+  if (mbedtls_sha1_starts_ret(ctx) == 0)
+    return (ARCHIVE_OK);
+  else
+    return (ARCHIVE_FATAL);
+}
+
+static int
+__archive_mbedtls_sha1update(archive_sha1_ctx *ctx, const void *indata,
+    size_t insize)
+{
+  if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0)
+    return (ARCHIVE_OK);
+  else
+    return (ARCHIVE_FATAL);
+}
+
+static int
+__archive_mbedtls_sha1final(archive_sha1_ctx *ctx, void *md)
+{
+  if (mbedtls_sha1_finish_ret(ctx, md) == 0) {
+    mbedtls_sha1_free(ctx);
+    return (ARCHIVE_OK);
+  } else {
+    mbedtls_sha1_free(ctx);
+    return (ARCHIVE_FATAL);
+  }
+}
+
 #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE)
 
 static int
@@ -720,6 +822,40 @@ __archive_libsystem_sha256final(archive_sha256_ctx *ct
   return (ARCHIVE_OK);
 }
 
+#elif defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS)
+
+static int
+__archive_mbedtls_sha256init(archive_sha256_ctx *ctx)
+{
+  mbedtls_sha256_init(ctx);
+  if (mbedtls_sha256_starts_ret(ctx, 0) == 0)
+    return (ARCHIVE_OK);
+  else
+    return (ARCHIVE_FATAL);
+}
+
+static int
+__archive_mbedtls_sha256update(archive_sha256_ctx *ctx, const void *indata,
+    size_t insize)
+{
+  if (mbedtls_sha256_update_ret(ctx, indata, insize) == 0)
+    return (ARCHIVE_OK);
+  else
+    return (ARCHIVE_FATAL);
+}
+
+static int
+__archive_mbedtls_sha256final(archive_sha256_ctx *ctx, void *md)
+{
+  if (mbedtls_sha256_finish_ret(ctx, md) == 0) {
+    mbedtls_sha256_free(ctx);
+    return (ARCHIVE_OK);
+  } else {
+    mbedtls_sha256_free(ctx);
+    return (ARCHIVE_FATAL);
+  }
+}
+
 #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE)
 
 static int
@@ -921,6 +1057,40 @@ __archive_libsystem_sha384final(archive_sha384_ctx *ct
   return (ARCHIVE_OK);
 }
 
+#elif defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS)
+
+static int
+__archive_mbedtls_sha384init(archive_sha384_ctx *ctx)
+{
+  mbedtls_sha512_init(ctx);
+  if (mbedtls_sha512_starts_ret(ctx, 1) == 0)
+    return (ARCHIVE_OK);
+  else
+    return (ARCHIVE_FATAL);
+}
+
+static int
+__archive_mbedtls_sha384update(archive_sha384_ctx *ctx, const void *indata,
+    size_t insize)
+{
+  if (mbedtls_sha512_update_ret(ctx, indata, insize) == 0)
+    return (ARCHIVE_OK);
+  else
+    return (ARCHIVE_FATAL);
+}
+
+static int
+__archive_mbedtls_sha384final(archive_sha384_ctx *ctx, void *md)
+{
+  if (mbedtls_sha512_finish_ret(ctx, md) == 0) {
+    mbedtls_sha512_free(ctx);
+    return (ARCHIVE_OK);
+  } else {
+    mbedtls_sha512_free(ctx);
+    return (ARCHIVE_FATAL);
+  }
+}
+
 #elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE)
 
 static int
@@ -1146,6 +1316,40 @@ __archive_libsystem_sha512final(archive_sha512_ctx *ct
   return (ARCHIVE_OK);
 }
 
+#elif defined(ARCHIVE_CRYPTO_SHA512_MBEDTLS)
+
+static int
+__archive_mbedtls_sha512init(archive_sha512_ctx *ctx)
+{
+  mbedtls_sha512_init(ctx);
+  if (mbedtls_sha512_starts_ret(ctx, 0) == 0)
+    return (ARCHIVE_OK);
+  else
+    return (ARCHIVE_FATAL);
+}
+
+static int
+__archive_mbedtls_sha512update(archive_sha512_ctx *ctx, const void *indata,
+    size_t insize)
+{
+  if (mbedtls_sha512_update_ret(ctx, indata, insize) == 0)
+    return (ARCHIVE_OK);
+  else
+    return (ARCHIVE_FATAL);
+}
+
+static int
+__archive_mbedtls_sha512final(archive_sha512_ctx *ctx, void *md)
+{
+  if (mbedtls_sha512_finish_ret(ctx, md) == 0) {
+    mbedtls_sha512_free(ctx);
+    return (ARCHIVE_OK);
+  } else {
+    mbedtls_sha512_free(ctx);
+    return (ARCHIVE_FATAL);
+  }
+}
+
 #elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE)
 
 static int
@@ -1276,6 +1480,10 @@ const struct archive_digest __archive_digest =
   &__archive_libsystem_md5init,
   &__archive_libsystem_md5update,
   &__archive_libsystem_md5final,
+#elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS)
+  &__archive_mbedtls_md5init,
+  &__archive_mbedtls_md5update,
+  &__archive_mbedtls_md5final,
 #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE)
   &__archive_nettle_md5init,
   &__archive_nettle_md5update,
@@ -1303,6 +1511,10 @@ const struct archive_digest __archive_digest =
   &__archive_libmd_ripemd160init,
   &__archive_libmd_ripemd160update,
   &__archive_libmd_ripemd160final,
+#elif defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS)
+  &__archive_mbedtls_ripemd160init,
+  &__archive_mbedtls_ripemd160update,
+  &__archive_mbedtls_ripemd160final,
 #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE)
   &__archive_nettle_ripemd160init,
   &__archive_nettle_ripemd160update,
@@ -1330,6 +1542,10 @@ const struct archive_digest __archive_digest =
   &__archive_libsystem_sha1init,
   &__archive_libsystem_sha1update,
   &__archive_libsystem_sha1final,
+#elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS)
+  &__archive_mbedtls_sha1init,
+  &__archive_mbedtls_sha1update,
+  &__archive_mbedtls_sha1final,
 #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE)
   &__archive_nettle_sha1init,
   &__archive_nettle_sha1update,
@@ -1369,6 +1585,10 @@ const struct archive_digest __archive_digest =
   &__archive_libsystem_sha256init,
   &__archive_libsystem_sha256update,
   &__archive_libsystem_sha256final,
+#elif defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS)
+  &__archive_mbedtls_sha256init,
+  &__archive_mbedtls_sha256update,
+  &__archive_mbedtls_sha256final,
 #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE)
   &__archive_nettle_sha256init,
   &__archive_nettle_sha256update,
@@ -1404,6 +1624,10 @@ const struct archive_digest __archive_digest =
   &__archive_libsystem_sha384init,
   &__archive_libsystem_sha384update,
   &__archive_libsystem_sha384final,
+#elif defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS)
+  &__archive_mbedtls_sha384init,
+  &__archive_mbedtls_sha384update,
+  &__archive_mbedtls_sha384final,
 #elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE)
   &__archive_nettle_sha384init,
   &__archive_nettle_sha384update,
@@ -1443,6 +1667,10 @@ const struct archive_digest __archive_digest =
   &__archive_libsystem_sha512init,
   &__archive_libsystem_sha512update,
   &__archive_libsystem_sha512final
+#elif defined(ARCHIVE_CRYPTO_SHA512_MBEDTLS)
+  &__archive_mbedtls_sha512init,
+  &__archive_mbedtls_sha512update,
+  &__archive_mbedtls_sha512final
 #elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE)
   &__archive_nettle_sha512init,
   &__archive_nettle_sha512update,

Modified: stable/11/contrib/libarchive/libarchive/archive_digest_private.h
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_digest_private.h	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_digest_private.h	Wed Feb 19 01:50:47 2020	(r358088)
@@ -24,13 +24,12 @@
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#ifndef ARCHIVE_DIGEST_PRIVATE_H_INCLUDED
+#define ARCHIVE_DIGEST_PRIVATE_H_INCLUDED
+
 #ifndef __LIBARCHIVE_BUILD
 #error This header is only to be used internally to libarchive.
 #endif
-
-#ifndef ARCHIVE_CRYPTO_PRIVATE_H_INCLUDED
-#define ARCHIVE_CRYPTO_PRIVATE_H_INCLUDED
-
 /*
  * Crypto support in various Operating Systems:
  *
@@ -112,6 +111,24 @@
 #include <CommonCrypto/CommonDigest.h>
 #endif
 
+/* mbed TLS crypto headers */
+#if defined(ARCHIVE_CRYPTO_MD5_MBEDTLS)
+#include <mbedtls/md5.h>
+#endif
+#if defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS)
+#include <mbedtls/ripemd160.h>
+#endif
+#if defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS)
+#include <mbedtls/sha1.h>
+#endif
+#if defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS)
+#include <mbedtls/sha256.h>
+#endif
+#if defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS) ||\
+  defined(ARCHIVE_CRYPTO_SHA512_MBEDTLS)
+#include <mbedtls/sha512.h>
+#endif
+
 /* Nettle crypto headers */
 #if defined(ARCHIVE_CRYPTO_MD5_NETTLE)
 #include <nettle/md5.h>
@@ -159,6 +176,8 @@ typedef MD5_CTX archive_md5_ctx;
 typedef MD5_CTX archive_md5_ctx;
 #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM)
 typedef CC_MD5_CTX archive_md5_ctx;
+#elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS)
+typedef mbedtls_md5_context archive_md5_ctx;
 #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE)
 typedef struct md5_ctx archive_md5_ctx;
 #elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL)
@@ -173,6 +192,8 @@ typedef unsigned char archive_md5_ctx;
 typedef RMD160_CTX archive_rmd160_ctx;
 #elif defined(ARCHIVE_CRYPTO_RMD160_LIBMD)
 typedef RIPEMD160_CTX archive_rmd160_ctx;
+#elif defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS)
+typedef mbedtls_ripemd160_context archive_rmd160_ctx;
 #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE)
 typedef struct ripemd160_ctx archive_rmd160_ctx;
 #elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL)
@@ -187,6 +208,8 @@ typedef SHA1_CTX archive_sha1_ctx;
 typedef SHA1_CTX archive_sha1_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM)
 typedef CC_SHA1_CTX archive_sha1_ctx;
+#elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS)
+typedef mbedtls_sha1_context archive_sha1_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE)
 typedef struct sha1_ctx archive_sha1_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL)
@@ -207,6 +230,8 @@ typedef SHA2_CTX archive_sha256_ctx;
 typedef SHA256_CTX archive_sha256_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM)
 typedef CC_SHA256_CTX archive_sha256_ctx;
+#elif defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS)
+typedef mbedtls_sha256_context archive_sha256_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE)
 typedef struct sha256_ctx archive_sha256_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL)
@@ -225,6 +250,8 @@ typedef SHA384_CTX archive_sha384_ctx;
 typedef SHA2_CTX archive_sha384_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM)
 typedef CC_SHA512_CTX archive_sha384_ctx;
+#elif defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS)
+typedef mbedtls_sha512_context archive_sha384_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE)
 typedef struct sha384_ctx archive_sha384_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA384_OPENSSL)
@@ -245,6 +272,8 @@ typedef SHA2_CTX archive_sha512_ctx;
 typedef SHA512_CTX archive_sha512_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA512_LIBSYSTEM)
 typedef CC_SHA512_CTX archive_sha512_ctx;
+#elif defined(ARCHIVE_CRYPTO_SHA512_MBEDTLS)
+typedef mbedtls_sha512_context archive_sha512_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE)
 typedef struct sha512_ctx archive_sha512_ctx;
 #elif defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
@@ -259,6 +288,7 @@ typedef unsigned char archive_sha512_ctx;
 #if defined(ARCHIVE_CRYPTO_MD5_LIBC) ||\
   defined(ARCHIVE_CRYPTO_MD5_LIBMD) ||	\
   defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) ||\
+  defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) ||\
   defined(ARCHIVE_CRYPTO_MD5_NETTLE) ||\
   defined(ARCHIVE_CRYPTO_MD5_OPENSSL) ||\
   defined(ARCHIVE_CRYPTO_MD5_WIN)
@@ -272,6 +302,7 @@ typedef unsigned char archive_sha512_ctx;
   __archive_digest.md5update(ctx, buf, n)
 
 #if defined(ARCHIVE_CRYPTO_RMD160_LIBC) ||\
+  defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS) ||\
   defined(ARCHIVE_CRYPTO_RMD160_NETTLE) ||\
   defined(ARCHIVE_CRYPTO_RMD160_OPENSSL)
 #define ARCHIVE_HAS_RMD160
@@ -286,6 +317,7 @@ typedef unsigned char archive_sha512_ctx;
 #if defined(ARCHIVE_CRYPTO_SHA1_LIBC) ||\
   defined(ARCHIVE_CRYPTO_SHA1_LIBMD) ||	\
   defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM) ||\
+  defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) ||\
   defined(ARCHIVE_CRYPTO_SHA1_NETTLE) ||\
   defined(ARCHIVE_CRYPTO_SHA1_OPENSSL) ||\
   defined(ARCHIVE_CRYPTO_SHA1_WIN)
@@ -303,6 +335,7 @@ typedef unsigned char archive_sha512_ctx;
   defined(ARCHIVE_CRYPTO_SHA256_LIBC3) ||\
   defined(ARCHIVE_CRYPTO_SHA256_LIBMD) ||\
   defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM) ||\
+  defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS) ||\
   defined(ARCHIVE_CRYPTO_SHA256_NETTLE) ||\
   defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) ||\
   defined(ARCHIVE_CRYPTO_SHA256_WIN)
@@ -319,6 +352,7 @@ typedef unsigned char archive_sha512_ctx;
   defined(ARCHIVE_CRYPTO_SHA384_LIBC2) ||\
   defined(ARCHIVE_CRYPTO_SHA384_LIBC3) ||\
   defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM) ||\
+  defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS) ||\
   defined(ARCHIVE_CRYPTO_SHA384_NETTLE) ||\
   defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) ||\
   defined(ARCHIVE_CRYPTO_SHA384_WIN)
@@ -336,6 +370,7 @@ typedef unsigned char archive_sha512_ctx;
   defined(ARCHIVE_CRYPTO_SHA512_LIBC3) ||\
   defined(ARCHIVE_CRYPTO_SHA512_LIBMD) ||\
   defined(ARCHIVE_CRYPTO_SHA512_LIBSYSTEM) ||\
+  defined(ARCHIVE_CRYPTO_SHA512_MBEDTLS) ||\
   defined(ARCHIVE_CRYPTO_SHA512_NETTLE) ||\
   defined(ARCHIVE_CRYPTO_SHA512_OPENSSL) ||\
   defined(ARCHIVE_CRYPTO_SHA512_WIN)

Modified: stable/11/contrib/libarchive/libarchive/archive_endian.h
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_endian.h	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_endian.h	Wed Feb 19 01:50:47 2020	(r358088)
@@ -28,16 +28,15 @@
  * Borrowed from FreeBSD's <sys/endian.h>
  */
 
-#ifndef __LIBARCHIVE_BUILD
-#error This header is only to be used internally to libarchive.
-#endif
+#ifndef ARCHIVE_ENDIAN_H_INCLUDED
+#define ARCHIVE_ENDIAN_H_INCLUDED
 
 /* Note:  This is a purely internal header! */
 /* Do not use this outside of libarchive internal code! */
 
-#ifndef ARCHIVE_ENDIAN_H_INCLUDED
-#define ARCHIVE_ENDIAN_H_INCLUDED
-
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
 
 /*
  * Disabling inline keyword for compilers known to choke on it:

Modified: stable/11/contrib/libarchive/libarchive/archive_entry.c
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_entry.c	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_entry.c	Wed Feb 19 01:50:47 2020	(r358088)
@@ -1699,7 +1699,7 @@ static const struct flag {
 	const wchar_t	*wname;
 	unsigned long	 set;
 	unsigned long	 clear;
-} flags[] = {
+} fileflags[] = {
 	/* Preferred (shorter) names per flag first, all prefixed by "no" */
 #ifdef SF_APPEND
 	{ "nosappnd",	L"nosappnd",		SF_APPEND,	0},
@@ -1876,7 +1876,7 @@ ae_fflagstostr(unsigned long bitset, unsigned long bit
 
 	bits = bitset | bitclear;
 	length = 0;
-	for (flag = flags; flag->name != NULL; flag++)
+	for (flag = fileflags; flag->name != NULL; flag++)
 		if (bits & (flag->set | flag->clear)) {
 			length += strlen(flag->name) + 1;
 			bits &= ~(flag->set | flag->clear);
@@ -1889,7 +1889,7 @@ ae_fflagstostr(unsigned long bitset, unsigned long bit
 		return (NULL);
 
 	dp = string;
-	for (flag = flags; flag->name != NULL; flag++) {
+	for (flag = fileflags; flag->name != NULL; flag++) {
 		if (bitset & flag->set || bitclear & flag->clear) {
 			sp = flag->name + 2;
 		} else if (bitset & flag->clear  ||  bitclear & flag->set) {
@@ -1941,7 +1941,7 @@ ae_strtofflags(const char *s, unsigned long *setp, uns
 		    *end != ' '  &&  *end != ',')
 			end++;
 		length = end - start;
-		for (flag = flags; flag->name != NULL; flag++) {
+		for (flag = fileflags; flag->name != NULL; flag++) {
 			size_t flag_length = strlen(flag->name);
 			if (length == flag_length
 			    && memcmp(start, flag->name, length) == 0) {
@@ -2009,7 +2009,7 @@ ae_wcstofflags(const wchar_t *s, unsigned long *setp, 
 		    *end != L' '  &&  *end != L',')
 			end++;
 		length = end - start;
-		for (flag = flags; flag->wname != NULL; flag++) {
+		for (flag = fileflags; flag->wname != NULL; flag++) {
 			size_t flag_length = wcslen(flag->wname);
 			if (length == flag_length
 			    && wmemcmp(start, flag->wname, length) == 0) {

Modified: stable/11/contrib/libarchive/libarchive/archive_entry.h
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_entry.h	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_entry.h	Wed Feb 19 01:50:47 2020	(r358088)
@@ -30,7 +30,7 @@
 #define	ARCHIVE_ENTRY_H_INCLUDED
 
 /* Note: Compiler will complain if this does not match archive.h! */
-#define	ARCHIVE_VERSION_NUMBER 3004000
+#define	ARCHIVE_VERSION_NUMBER 3004002
 
 /*
  * Note: archive_entry.h is for use outside of libarchive; the
@@ -524,9 +524,6 @@ __LA_DECL int	 archive_entry_acl_reset(struct archive_
 __LA_DECL int	 archive_entry_acl_next(struct archive_entry *, int /* want_type */,
 	    int * /* type */, int * /* permset */, int * /* tag */,
 	    int * /* qual */, const char ** /* name */);
-__LA_DECL int	 archive_entry_acl_next_w(struct archive_entry *, int /* want_type */,
-	    int * /* type */, int * /* permset */, int * /* tag */,
-	    int * /* qual */, const wchar_t ** /* name */);
 
 /*
  * Construct a text-format ACL.  The flags argument is a bitmask that

Modified: stable/11/contrib/libarchive/libarchive/archive_entry_acl.3
==============================================================================
--- stable/11/contrib/libarchive/libarchive/archive_entry_acl.3	Wed Feb 19 01:46:43 2020	(r358087)
+++ stable/11/contrib/libarchive/libarchive/archive_entry_acl.3	Wed Feb 19 01:50:47 2020	(r358088)
@@ -34,7 +34,6 @@
 .Nm archive_entry_acl_from_text ,
 .Nm archive_entry_acl_from_text_w ,
 .Nm archive_entry_acl_next ,
-.Nm archive_entry_acl_next_w ,
 .Nm archive_entry_acl_reset ,
 .Nm archive_entry_acl_to_text ,
 .Nm archive_entry_acl_to_text_w ,
@@ -89,16 +88,6 @@ Streaming Archive Library (libarchive, -larchive)
 .Fa "const char **ret_name"
 .Fc
 .Ft int
-.Fo archive_entry_acl_next_w
-.Fa "struct archive_entry *a"
-.Fa "int type"
-.Fa "int *ret_type"
-.Fa "int *ret_permset"
-.Fa "int *ret_tag"
-.Fa "int *ret_qual"
-.Fa "const wchar_t **ret_name"
-.Fc
-.Ft int
 .Fn archive_entry_acl_reset "struct archive_entry *a" "int type"
 .Ft char *
 .Fo archive_entry_acl_to_text
@@ -349,8 +338,6 @@ character
 are skipped.
 .Pp
 .Fn archive_entry_acl_next
-and
-.Fn archive_entry_acl_next_w
 return the next entry of the ACL list.
 This functions may only be called after
 .Fn archive_entry_acl_reset
@@ -358,9 +345,7 @@ has indicated the presence of extended ACL entries.
 .Pp
 .Fn archive_entry_acl_reset
 prepare reading the list of ACL entries with
-.Fn archive_entry_acl_next
-or
-.Fn archive_entry_acl_next_w .
+.Fn archive_entry_acl_next .

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



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