From 2ccbfe697b732626144b4d59dd75966a0e220e18 Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Tue, 24 May 2022 10:24:30 -0600 Subject: [PATCH] Update p7zip to 17.04 (#45435) Co-authored-by: KristofferC (cherry picked from commit 86f5501f248bb30304fc19a9abc8affee98e42f8) --- deps/Versions.make | 2 +- deps/checksums/p7zip | 68 ++-- deps/p7zip.mk | 34 +- deps/patches/p7zip-12-CVE-2016-9296.patch | 23 -- deps/patches/p7zip-13-CVE-2017-17969.patch | 35 -- ...7zip-15-Enhanced-encryption-strength.patch | 298 ------------------ deps/patches/p7zip-Windows_ErrorMsg.patch | 33 -- stdlib/p7zip_jll/Project.toml | 2 +- 8 files changed, 45 insertions(+), 450 deletions(-) delete mode 100644 deps/patches/p7zip-12-CVE-2016-9296.patch delete mode 100644 deps/patches/p7zip-13-CVE-2017-17969.patch delete mode 100644 deps/patches/p7zip-15-Enhanced-encryption-strength.patch delete mode 100644 deps/patches/p7zip-Windows_ErrorMsg.patch diff --git a/deps/Versions.make b/deps/Versions.make index 728d6bede11b1..a44bd004a0c4a 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -87,7 +87,7 @@ OSXUNWIND_JLL_VER := 0.0.6+1 PATCHELF_VER := 0.9 # p7zip -P7ZIP_VER := 16.2.0 +P7ZIP_VER := 17.04 P7ZIP_JLL_NAME := p7zip # PCRE diff --git a/deps/checksums/p7zip b/deps/checksums/p7zip index 8a997306349a3..b3c24a811a043 100644 --- a/deps/checksums/p7zip +++ b/deps/checksums/p7zip @@ -1,34 +1,34 @@ -p7zip-16.2.0.tar.bz2/md5/a0128d661cfe7cc8c121e73519c54fbf -p7zip-16.2.0.tar.bz2/sha512/d2c4d53817f96bb4c7683f42045198d4cd509cfc9c3e2cb85c8d9dc4ab6dfa7496449edeac4e300ecf986a9cbbc90bd8f8feef8156895d94617c04e507add55f -p7zip.v16.2.1+0.aarch64-apple-darwin.tar.gz/md5/0c91d306e3223f8f1eb56265da639a19 -p7zip.v16.2.1+0.aarch64-apple-darwin.tar.gz/sha512/7e2a9e1f6605336a2be550216c0649626f865d604dd769792bf887210f07dd691c0159e2dfedd333d41217a33504f74e78f42bae651c487ae09f696e4611bd50 -p7zip.v16.2.1+0.aarch64-linux-gnu.tar.gz/md5/e9c41ff134653bfcb296f6e8e1be72da -p7zip.v16.2.1+0.aarch64-linux-gnu.tar.gz/sha512/e90ebb352b1eb249bba26bfc3f621a9d6a65f1ba8b4d68bf3ff28a02573fbe37438b0c94c52a9c1cbcb6297e418d71a53c87067d7becf175af5fec8db020d3f7 -p7zip.v16.2.1+0.aarch64-linux-musl.tar.gz/md5/faa7fea160322ab3a9480f22277e7e42 -p7zip.v16.2.1+0.aarch64-linux-musl.tar.gz/sha512/617a7a5796e7cdcc7040073f5f27232ef32160591d5160aa8fc59d36cf51eb873884e7b417994b1626874ca3eed6af2e5e9dfd551724c1431489f233edeb8901 -p7zip.v16.2.1+0.armv6l-linux-gnueabihf.tar.gz/md5/c13fe2468bd4f14892a187bf1781d34a -p7zip.v16.2.1+0.armv6l-linux-gnueabihf.tar.gz/sha512/1d8c6b2f0efa10f104ed4a141a1719d596e341db6b646c01e5c5472bff637eb3bfe6c5742fa101bf344875cc3c7fbc2733eaca5bd69e14e771982173c0311cff -p7zip.v16.2.1+0.armv6l-linux-musleabihf.tar.gz/md5/e108a692f7003e260cfdbde2b480a3cf -p7zip.v16.2.1+0.armv6l-linux-musleabihf.tar.gz/sha512/2bdc37302c6a97f77fe154d68d18c29e842e3c31ea8eb858089c9e9ca391939e25a9ac309780c4d290853e7bb34307cbe50ba0868fafa455cb9a40b004d6bd2c -p7zip.v16.2.1+0.armv7l-linux-gnueabihf.tar.gz/md5/1f518b75b8eaaa07dbb7eb66b4d23e87 -p7zip.v16.2.1+0.armv7l-linux-gnueabihf.tar.gz/sha512/7478d036adaba001a844159050c7e34a27a1d8f2a15cb8143505100f24818431a5c47eacb721eb98c720b2b29c395095118cf15f04e8c914e111e16a529bcd1e -p7zip.v16.2.1+0.armv7l-linux-musleabihf.tar.gz/md5/1c075c36df1df55d899cc0e4dafe43c4 -p7zip.v16.2.1+0.armv7l-linux-musleabihf.tar.gz/sha512/0a2237cfb42ab5dbc144a9542693356321501b23dddc9f585aef3d544e6a6559cf4c2279400d8fc03d5f0c7093550709c544d11c82f3ded9b3bf3647f09592b9 -p7zip.v16.2.1+0.i686-linux-gnu.tar.gz/md5/31f0d322e45bed3782abff84e0713ee6 -p7zip.v16.2.1+0.i686-linux-gnu.tar.gz/sha512/e68a1130a4b4799907f7def729aecdac0bac038112d0579bf9d0accb21ef12c745bd3ca2470c7e6b26bc9008be99b5d35e472d2fc44f5b7bdf96fcf3c867b399 -p7zip.v16.2.1+0.i686-linux-musl.tar.gz/md5/2a9a26c0c87ff8b862d27d6589754dc7 -p7zip.v16.2.1+0.i686-linux-musl.tar.gz/sha512/91a48dd5e42b064f79d5be5cc2b2e57c7c8104cc8f889fb3440e235ff022152150b04f05eff91fa949bd071d2788cc44bbe37117c425e2d45d4194d6ee26a398 -p7zip.v16.2.1+0.i686-w64-mingw32.tar.gz/md5/b38c4c41127007c30e5ff545416601ae -p7zip.v16.2.1+0.i686-w64-mingw32.tar.gz/sha512/6525300d454023fbff9981620a9a77c343dd30982c3685c786c8e952bba13389f29de1c1790ad81914c48de70cd15ac4fdc2c7aca2dc6d9f36303cf0d520139f -p7zip.v16.2.1+0.powerpc64le-linux-gnu.tar.gz/md5/a2c5ee0149930648011db1739df40229 -p7zip.v16.2.1+0.powerpc64le-linux-gnu.tar.gz/sha512/a7f24669abfde913ef94d5fd04d0d34b155dd099939c522601ba48ec73ce27953f497c5d279aa7ef9d1bde94216e514d3bbc7e81803da0f6438b18631d0485e1 -p7zip.v16.2.1+0.x86_64-apple-darwin.tar.gz/md5/eea35b8d9ccb08a5d894d52afff274e0 -p7zip.v16.2.1+0.x86_64-apple-darwin.tar.gz/sha512/c15aa482ea1de5065266f9810ca27e9d3860c3ea5e847f4532c74c90fb5ba9820704acad41fd759ef030b08143404310e3973993da2d12413027cd9070d4a2a8 -p7zip.v16.2.1+0.x86_64-linux-gnu.tar.gz/md5/baf766508e5a5f832ffcad60ec23d56e -p7zip.v16.2.1+0.x86_64-linux-gnu.tar.gz/sha512/e7fe2b1ee150be1d7a23d960030364468a95c3186fe26b3fb10da4dc9a964a99b5f7dc7eeb47e8df0533bd86a61a072ddb3b6b4d0761e38fe3ca9e81f28752b2 -p7zip.v16.2.1+0.x86_64-linux-musl.tar.gz/md5/b333059a4129829cdd8b4aba47a47459 -p7zip.v16.2.1+0.x86_64-linux-musl.tar.gz/sha512/97648c0c1c7ed316271b6c15c1a3cc94bad51f5c294b49e93780ae46b3eb2ad6398c427beed973d2ca1c6da2142c8f858ba1ce0cc94d0710853cc92d5c5e5b4d -p7zip.v16.2.1+0.x86_64-unknown-freebsd.tar.gz/md5/343d1a7d0fd583cf1ba2b6cc2e8ac700 -p7zip.v16.2.1+0.x86_64-unknown-freebsd.tar.gz/sha512/6e35174e1f3c07599cecf028089325a84b7c0c43f626ab0b32fb734d7408e3954c0ee48cc566e27399b234b28b0a62693554316dc58a8d1c89e99422e9c31d16 -p7zip.v16.2.1+0.x86_64-w64-mingw32.tar.gz/md5/bcb1901fc5fd6ceb7e842cb5a5592e2f -p7zip.v16.2.1+0.x86_64-w64-mingw32.tar.gz/sha512/deb783b6e83a02485ad0eec513de6c8bafc99282938c5771e58ec683db711bb78454d9ef531a3ba6dd1042baf64e22e1de8e82eed3708f160fab986f97e5736d +p7zip.v17.4.0+0.aarch64-apple-darwin.tar.gz/md5/af8134ed9c24b99d69e4edb4d5226ca5 +p7zip.v17.4.0+0.aarch64-apple-darwin.tar.gz/sha512/b8bb6aee60a54cca37568af8b2d9baedd892ba0d4918b93bcb29d74189524af7115901f4fabafb1ca58ed17e97c59846fcdfbd460abc81059806802b0a7be840 +p7zip.v17.4.0+0.aarch64-linux-gnu.tar.gz/md5/20abac5ebb99f31742878013c02f96a3 +p7zip.v17.4.0+0.aarch64-linux-gnu.tar.gz/sha512/6d8ebf895b969b1f707d0c23a19db4cd0dee47957d076e6e389395e09404d55bfcb78bb14bb67bb35b93b6a0072f2b4f097d839503d1ccab62b4ce28939dc71d +p7zip.v17.4.0+0.aarch64-linux-musl.tar.gz/md5/185c979c7419b7ded3832c0f5cfd3b77 +p7zip.v17.4.0+0.aarch64-linux-musl.tar.gz/sha512/722e880c9f111738cb4cde84bf62c36892dbefdba625ae2b9e0fae76a7b1eabfa481a9838fbf9667223f19f62b6f09fcfd42b50c2bff7a65af0fae3616250fc7 +p7zip.v17.4.0+0.armv6l-linux-gnueabihf.tar.gz/md5/dceb37181763f86bf12f8ca473cf3403 +p7zip.v17.4.0+0.armv6l-linux-gnueabihf.tar.gz/sha512/51e409bbcd3c54838cb3219b2476c8b45c8340e0a2fd26cced0d8484ae7f51711723e06e9023fce9ae9a1b51b5fb94aba536428ce2a5c5902b38498a0b3c2b50 +p7zip.v17.4.0+0.armv6l-linux-musleabihf.tar.gz/md5/193ecd888787ea03a500d102a7e33afa +p7zip.v17.4.0+0.armv6l-linux-musleabihf.tar.gz/sha512/d525aad33f5ed27dc993f31c6db2996b830716bfac9bc7c49cb462ea3f0b412d0d3267765b9952c85e9c9be31d36d095d55ba89c0fa2c92823d9490372389c95 +p7zip.v17.4.0+0.armv7l-linux-gnueabihf.tar.gz/md5/096f11a7f1af5ff730bb8cfef22e335e +p7zip.v17.4.0+0.armv7l-linux-gnueabihf.tar.gz/sha512/1866ffd0169e0795594aaa70f1af8102ebbd79b3cafaadfb9c6a537dac0cdbb6eb7c31ad5165a975508c1b850744f94b60d9c530d658cdcc5536a474203cff21 +p7zip.v17.4.0+0.armv7l-linux-musleabihf.tar.gz/md5/fef1576982f45d1922582f6f7a7d6665 +p7zip.v17.4.0+0.armv7l-linux-musleabihf.tar.gz/sha512/71061585b32fa1a8e0a403a60c07e9f90586291a9799d7e2d6f7e6ec9f7b0ebf4b45ed080efd87cad82c45f71ec9a14cbcf9134a73bad4f5e3329f23bc6df01a +p7zip.v17.4.0+0.i686-linux-gnu.tar.gz/md5/8818389b3bf00f10c6a39fe0c4a331b4 +p7zip.v17.4.0+0.i686-linux-gnu.tar.gz/sha512/bec2051a258f7e8a762b7cd4324e7b8f00fe5d99d48f05fb3557c41604e8b08af9ab66ab830f4a48086656be41aaf011b2aae0fb530e0ffefec38689f85a3bb5 +p7zip.v17.4.0+0.i686-linux-musl.tar.gz/md5/4ed9c16a65ed1d656aa214013e46eb28 +p7zip.v17.4.0+0.i686-linux-musl.tar.gz/sha512/7a5b3e15d0038bea0de7fc28ce058d7f93b8e04f271e30953a6b52d2b5d71f59d10177033e888a50cf8dfeb4f44bcf3271c9b9d1b28d0122ab2b239decdad446 +p7zip.v17.4.0+0.i686-w64-mingw32.tar.gz/md5/d06cff2ec0b7c8415700587f931ce1ac +p7zip.v17.4.0+0.i686-w64-mingw32.tar.gz/sha512/ed72440f5306a57465a70b00bff33185a83c3e223844a79aa0b0d1fbe30dbd35da75e6188725aa621f5c4574a09527daf1e4893c7c6979ab91b2c09b4979dbcb +p7zip.v17.4.0+0.powerpc64le-linux-gnu.tar.gz/md5/949ca7d111e497b82c9c762e5ac63a6b +p7zip.v17.4.0+0.powerpc64le-linux-gnu.tar.gz/sha512/4842e0d44bf6380100723209596f526181fefe8a81d59c28658d03ea16600e71d010d5c7898b4c943efdd9caaa2301c3fdb0dccb343d631d1734acda1c559f65 +p7zip.v17.4.0+0.x86_64-apple-darwin.tar.gz/md5/2322c7a08f62592ca394a716949008bc +p7zip.v17.4.0+0.x86_64-apple-darwin.tar.gz/sha512/9549f3e1052730ce13414636b32f0d1a9a1ac944a2b622380eac0da144b11fd65d437afe877ba6797d651da9c4ec77f0ebd3e515146caceaa2524829419eda48 +p7zip.v17.4.0+0.x86_64-linux-gnu.tar.gz/md5/a21b12946a62ef3688d5fc965974e8f7 +p7zip.v17.4.0+0.x86_64-linux-gnu.tar.gz/sha512/d32faeac23acf8a023f65350ba1d62bb3d9f904e32570ae03b8fb0a5375758784dd95be8caeecd007cbde40e103854a077e2c817f62afa72491f3b8966deb738 +p7zip.v17.4.0+0.x86_64-linux-musl.tar.gz/md5/c448e872d4ad66beb2d46d9134952f2f +p7zip.v17.4.0+0.x86_64-linux-musl.tar.gz/sha512/92588f4817e145ef655c718dec049e7f43dd93644f43f19cd320643fac5f5b2312837c7a6c3e782e97fd08747311c58ed4657484f8bc778942fc5206ff8ea4e5 +p7zip.v17.4.0+0.x86_64-unknown-freebsd.tar.gz/md5/2cca6259a2eb1b0fea777d566267bf05 +p7zip.v17.4.0+0.x86_64-unknown-freebsd.tar.gz/sha512/92f90e2be4a8b8fcd80a4ceacac8bbab750913526b85f9279f8ee9ed91b77248b5de2d35d0c6241d0ad51fda185f4cb1ead1dcc9d23e2bef35e0b61efe3c3170 +p7zip.v17.4.0+0.x86_64-w64-mingw32.tar.gz/md5/5d272c78d7ffb40da0f333463f3cc098 +p7zip.v17.4.0+0.x86_64-w64-mingw32.tar.gz/sha512/2d999c6df4786cec1bba396b3a651a63740f4b799e9fc11754afd24438076e898daae74b4d3c7072450428e89881991e8884711cd4c349879a00c7aeeb4e1d3e +p7zip-17.04.tar.gz/md5/00acfd6be87848231722d2d53f89e4a5 +p7zip-17.04.tar.gz/sha512/ad176db5b657b1c39584f6792c47978d94f2f1ccb1cf5bdb0f52ab31a7356b3822f4a922152c4253f4aa7e79166ba052b6592530b7a38f548cd555fe9c008be3 diff --git a/deps/p7zip.mk b/deps/p7zip.mk index 20c85602f767a..8c0d11d74a061 100644 --- a/deps/p7zip.mk +++ b/deps/p7zip.mk @@ -1,36 +1,20 @@ ## p7zip ## ifneq ($(USE_BINARYBUILDER_P7ZIP),1) -# Force optimization for P7ZIP flags (Issue #11668) -$(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2: | $(SRCCACHE) - $(JLDOWNLOAD) $@ https://downloads.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2 -$(BUILDDIR)/p7zip-$(P7ZIP_VER)/source-extracted: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2 +$(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.gz: | $(SRCCACHE) + $(JLDOWNLOAD) $@ https://github.com/jinfeihan57/p7zip/archive/refs/tags/v$(P7ZIP_VER).tar.gz + +$(BUILDDIR)/p7zip-$(P7ZIP_VER)/source-extracted: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.gz $(JLCHECKSUM) $< mkdir -p $(dir $@) - cd $(dir $@) && $(TAR) --strip-components 1 -jxf $< + cd $(dir $@) && $(TAR) --strip-components 1 -zxf $< echo 1 > $@ -checksum-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2 +checksum-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.gz $(JLCHECKSUM) $< -$(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-12-CVE-2016-9296.patch-applied: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/source-extracted - cd $(dir $@) && patch -p1 -f < $(SRCDIR)/patches/p7zip-12-CVE-2016-9296.patch - echo 1 > $@ - -$(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-13-CVE-2017-17969.patch-applied: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-12-CVE-2016-9296.patch-applied - cd $(dir $@) && patch -p1 -f < $(SRCDIR)/patches/p7zip-13-CVE-2017-17969.patch - echo 1 > $@ - -$(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-15-Enhanced-encryption-strength.patch-applied: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-13-CVE-2017-17969.patch-applied - cd $(dir $@) && patch -p4 -f < $(SRCDIR)/patches/p7zip-15-Enhanced-encryption-strength.patch - echo 1 > $@ - -$(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-Windows_ErrorMsg.patch-applied: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-15-Enhanced-encryption-strength.patch-applied - cd $(dir $@) && patch -p0 -f < $(SRCDIR)/patches/p7zip-Windows_ErrorMsg.patch - echo 1 > $@ - -$(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-configured: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/p7zip-Windows_ErrorMsg.patch-applied +$(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-configured: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/source-extracted $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-compiled: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-configured $(MAKE) -C $(dir $<) $(MAKE_COMMON) CC="$(CC)" CXX="$(CXX)" 7za echo 1 > $@ @@ -49,10 +33,10 @@ clean-p7zip: -$(MAKE) -C $(BUILDDIR)/p7zip-$(P7ZIP_VER) clean distclean-p7zip: - -rm -rf $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2 $(SRCCACHE)/p7zip-$(P7ZIP_VER) $(BUILDDIR)/p7zip-$(P7ZIP_VER) + -rm -rf $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.gz $(SRCCACHE)/p7zip-$(P7ZIP_VER) $(BUILDDIR)/p7zip-$(P7ZIP_VER) -get-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.bz2 +get-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER).tar.gz extract-p7zip: $(SRCCACHE)/p7zip-$(P7ZIP_VER)/source-extracted configure-p7zip: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-configured compile-p7zip: $(BUILDDIR)/p7zip-$(P7ZIP_VER)/build-compiled diff --git a/deps/patches/p7zip-12-CVE-2016-9296.patch b/deps/patches/p7zip-12-CVE-2016-9296.patch deleted file mode 100644 index 42245c92c0aae..0000000000000 --- a/deps/patches/p7zip-12-CVE-2016-9296.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Robert Luberda -Date: Sat, 19 Nov 2016 08:48:08 +0100 -Subject: Fix nullptr dereference (CVE-2016-9296) - -Patch taken from https://sourceforge.net/p/p7zip/bugs/185/ ---- - CPP/7zip/Archive/7z/7zIn.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/CPP/7zip/Archive/7z/7zIn.cpp b/CPP/7zip/Archive/7z/7zIn.cpp -index b0c6b98..7c6dde2 100644 ---- a/CPP/7zip/Archive/7z/7zIn.cpp -+++ b/CPP/7zip/Archive/7z/7zIn.cpp -@@ -1097,7 +1097,8 @@ HRESULT CInArchive::ReadAndDecodePackedStreams( - if (CrcCalc(data, unpackSize) != folders.FolderCRCs.Vals[i]) - ThrowIncorrect(); - } -- HeadersSize += folders.PackPositions[folders.NumPackStreams]; -+ if (folders.PackPositions) -+ HeadersSize += folders.PackPositions[folders.NumPackStreams]; - return S_OK; - } - diff --git a/deps/patches/p7zip-13-CVE-2017-17969.patch b/deps/patches/p7zip-13-CVE-2017-17969.patch deleted file mode 100644 index a9787c4a90886..0000000000000 --- a/deps/patches/p7zip-13-CVE-2017-17969.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: =?utf-8?q?Antoine_Beaupr=C3=A9?= -Date: Fri, 2 Feb 2018 11:11:41 +0100 -Subject: Heap-based buffer overflow in 7zip/Compress/ShrinkDecoder.cpp - -Origin: vendor, https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/27d7/attachment/CVE-2017-17969.patch -Forwarded: https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/#27d7 -Bug: https://sourceforge.net/p/p7zip/bugs/204/ -Bug-Debian: https://bugs.debian.org/888297 -Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-17969 -Reviewed-by: Salvatore Bonaccorso -Last-Update: 2018-02-01 -Applied-Upstream: 18.00-beta ---- - CPP/7zip/Compress/ShrinkDecoder.cpp | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/CPP/7zip/Compress/ShrinkDecoder.cpp b/CPP/7zip/Compress/ShrinkDecoder.cpp -index 80b7e67..ca37764 100644 ---- a/CPP/7zip/Compress/ShrinkDecoder.cpp -+++ b/CPP/7zip/Compress/ShrinkDecoder.cpp -@@ -121,8 +121,13 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * - { - _stack[i++] = _suffixes[cur]; - cur = _parents[cur]; -+ if (cur >= kNumItems || i >= kNumItems) -+ break; - } -- -+ -+ if (cur >= kNumItems || i >= kNumItems) -+ break; -+ - _stack[i++] = (Byte)cur; - lastChar2 = (Byte)cur; - diff --git a/deps/patches/p7zip-15-Enhanced-encryption-strength.patch b/deps/patches/p7zip-15-Enhanced-encryption-strength.patch deleted file mode 100644 index ab1cfb9c743fb..0000000000000 --- a/deps/patches/p7zip-15-Enhanced-encryption-strength.patch +++ /dev/null @@ -1,298 +0,0 @@ -From ea31bbe661abef761e49983b56923e6523b9463a Mon Sep 17 00:00:00 2001 -From: aone -Date: Thu, 7 Mar 2019 10:06:16 +0100 -Subject: [PATCH] Enhanced encryption strength from 7-Zip 19.00 - -https://github.com/aonez/Keka/issues/379 -https://sourceforge.net/p/sevenzip/bugs/2176 ---- - .../CPP/7zip/Archive/Wim/WimHandlerOut.cpp | 2 +- - Bin/p7zip/source/CPP/7zip/Crypto/7zAes.cpp | 4 +- - Bin/p7zip/source/CPP/7zip/Crypto/RandGen.cpp | 135 ++++++++++++++++-- - Bin/p7zip/source/CPP/7zip/Crypto/RandGen.h | 19 +++ - Bin/p7zip/source/CPP/7zip/Crypto/WzAes.cpp | 2 +- - .../source/CPP/7zip/Crypto/ZipCrypto.cpp | 2 +- - 6 files changed, 146 insertions(+), 18 deletions(-) - -diff --git a/Bin/p7zip/source/CPP/7zip/Archive/Wim/WimHandlerOut.cpp b/Bin/p7zip/source/CPP/7zip/Archive/Wim/WimHandlerOut.cpp -index 1d198df0..39679883 100644 ---- a/Bin/p7zip/source/CPP/7zip/Archive/Wim/WimHandlerOut.cpp -+++ b/Bin/p7zip/source/CPP/7zip/Archive/Wim/WimHandlerOut.cpp -@@ -671,7 +671,7 @@ void CHeader::SetDefaultFields(bool useLZX) - ChunkSize = kChunkSize; - ChunkSizeBits = kChunkSizeBits; - } -- g_RandomGenerator.Generate(Guid, 16); -+ MY_RAND_GEN(Guid, 16); - PartNumber = 1; - NumParts = 1; - NumImages = 1; -diff --git a/Bin/p7zip/source/CPP/7zip/Crypto/7zAes.cpp b/Bin/p7zip/source/CPP/7zip/Crypto/7zAes.cpp -index d33b562a..2ed69bad 100644 ---- a/Bin/p7zip/source/CPP/7zip/Crypto/7zAes.cpp -+++ b/Bin/p7zip/source/CPP/7zip/Crypto/7zAes.cpp -@@ -164,8 +164,8 @@ STDMETHODIMP CEncoder::ResetInitVector() - { - for (unsigned i = 0; i < sizeof(_iv); i++) - _iv[i] = 0; -- _ivSize = 8; -- g_RandomGenerator.Generate(_iv, _ivSize); -+ _ivSize = 16; -+ MY_RAND_GEN(_iv, _ivSize); - return S_OK; - } - -diff --git a/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.cpp b/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.cpp -index f5ea31f0..a70f4ec8 100644 ---- a/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.cpp -+++ b/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.cpp -@@ -2,14 +2,44 @@ - - #include "StdAfx.h" - -+#include "RandGen.h" -+ -+#ifndef USE_STATIC_SYSTEM_RAND -+ - #ifndef _7ZIP_ST - #include "../../Windows/Synchronization.h" - #endif - --#include "RandGen.h" - --#ifndef _WIN32 -+#ifdef _WIN32 -+ -+#ifdef _WIN64 -+#define USE_STATIC_RtlGenRandom -+#endif -+ -+#ifdef USE_STATIC_RtlGenRandom -+ -+#include -+ -+EXTERN_C_BEGIN -+#ifndef RtlGenRandom -+ #define RtlGenRandom SystemFunction036 -+ BOOLEAN WINAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength); -+#endif -+EXTERN_C_END -+ -+#else -+EXTERN_C_BEGIN -+typedef BOOLEAN (WINAPI * Func_RtlGenRandom)(PVOID RandomBuffer, ULONG RandomBufferLength); -+EXTERN_C_END -+#endif -+ -+ -+#else - #include -+#include -+#include -+#include - #define USE_POSIX_TIME - #define USE_POSIX_TIME2 - #endif -@@ -21,11 +51,9 @@ - #endif - #endif - --// This is not very good random number generator. --// Please use it only for salt. --// First generated data block depends from timer and processID. -+// The seed and first generated data block depend from processID, -+// theadID, timer and system random generator, if available. - // Other generated data blocks depend from previous state --// Maybe it's possible to restore original timer value from generated value. - - #define HASH_UPD(x) Sha256_Update(&hash, (const Byte *)&x, sizeof(x)); - -@@ -34,25 +62,102 @@ void CRandomGenerator::Init() - CSha256 hash; - Sha256_Init(&hash); - -+ unsigned numIterations = 1000; -+ -+ { -+ #ifndef UNDER_CE -+ const unsigned kNumIterations_Small = 100; -+ const unsigned kBufSize = 32; -+ Byte buf[kBufSize]; -+ #endif -+ - #ifdef _WIN32 -+ - DWORD w = ::GetCurrentProcessId(); - HASH_UPD(w); - w = ::GetCurrentThreadId(); - HASH_UPD(w); -+ -+ #ifdef UNDER_CE -+ /* -+ if (CeGenRandom(kBufSize, buf)) -+ { -+ numIterations = kNumIterations_Small; -+ Sha256_Update(&hash, buf, kBufSize); -+ } -+ */ -+ #elif defined(USE_STATIC_RtlGenRandom) -+ if (RtlGenRandom(buf, kBufSize)) -+ { -+ numIterations = kNumIterations_Small; -+ Sha256_Update(&hash, buf, kBufSize); -+ } - #else -+ { -+ HMODULE hModule = ::LoadLibrary(TEXT("Advapi32.dll")); -+ if (hModule) -+ { -+ // SystemFunction036() is real name of RtlGenRandom() function -+ Func_RtlGenRandom my_RtlGenRandom = (Func_RtlGenRandom)GetProcAddress(hModule, "SystemFunction036"); -+ if (my_RtlGenRandom) -+ { -+ if (my_RtlGenRandom(buf, kBufSize)) -+ { -+ numIterations = kNumIterations_Small; -+ Sha256_Update(&hash, buf, kBufSize); -+ } -+ } -+ ::FreeLibrary(hModule); -+ } -+ } -+ #endif -+ -+ #else -+ - pid_t pid = getpid(); - HASH_UPD(pid); - pid = getppid(); - HASH_UPD(pid); -+ -+ { -+ int f = open("/dev/urandom", O_RDONLY); -+ unsigned numBytes = kBufSize; -+ if (f >= 0) -+ { -+ do -+ { -+ int n = read(f, buf, numBytes); -+ if (n <= 0) -+ break; -+ Sha256_Update(&hash, buf, n); -+ numBytes -= n; -+ } -+ while (numBytes); -+ close(f); -+ if (numBytes == 0) -+ numIterations = kNumIterations_Small; -+ } -+ } -+ /* -+ { -+ int n = getrandom(buf, kBufSize, 0); -+ if (n > 0) -+ { -+ Sha256_Update(&hash, buf, n); -+ if (n == kBufSize) -+ numIterations = kNumIterations_Small; -+ } -+ } -+ */ -+ -+ #endif -+ } -+ -+ #ifdef _DEBUG -+ numIterations = 2; - #endif - -- for (unsigned i = 0; i < -- #ifdef _DEBUG -- 2; -- #else -- 1000; -- #endif -- i++) -+ do - { - #ifdef _WIN32 - LARGE_INTEGER v; -@@ -83,6 +188,8 @@ void CRandomGenerator::Init() - Sha256_Update(&hash, _buff, SHA256_DIGEST_SIZE); - } - } -+ while (--numIterations); -+ - Sha256_Final(&hash, _buff); - _needInit = false; - } -@@ -120,3 +227,5 @@ void CRandomGenerator::Generate(Byte *data, unsigned size) - } - - CRandomGenerator g_RandomGenerator; -+ -+#endif -diff --git a/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.h b/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.h -index cfdcd60d..5122ec4b 100644 ---- a/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.h -+++ b/Bin/p7zip/source/CPP/7zip/Crypto/RandGen.h -@@ -5,6 +5,21 @@ - - #include "../../../C/Sha256.h" - -+#ifdef _WIN64 -+// #define USE_STATIC_SYSTEM_RAND -+#endif -+ -+#ifdef USE_STATIC_SYSTEM_RAND -+ -+#ifdef _WIN32 -+#include -+#define MY_RAND_GEN(data, size) RtlGenRandom(data, size) -+#else -+#define MY_RAND_GEN(data, size) getrandom(data, size, 0) -+#endif -+ -+#else -+ - class CRandomGenerator - { - Byte _buff[SHA256_DIGEST_SIZE]; -@@ -18,4 +33,8 @@ public: - - extern CRandomGenerator g_RandomGenerator; - -+#define MY_RAND_GEN(data, size) g_RandomGenerator.Generate(data, size) -+ -+#endif -+ - #endif -diff --git a/Bin/p7zip/source/CPP/7zip/Crypto/WzAes.cpp b/Bin/p7zip/source/CPP/7zip/Crypto/WzAes.cpp -index 4572f06e..d415ab84 100644 ---- a/Bin/p7zip/source/CPP/7zip/Crypto/WzAes.cpp -+++ b/Bin/p7zip/source/CPP/7zip/Crypto/WzAes.cpp -@@ -96,7 +96,7 @@ STDMETHODIMP CBaseCoder::Init() - HRESULT CEncoder::WriteHeader(ISequentialOutStream *outStream) - { - unsigned saltSize = _key.GetSaltSize(); -- g_RandomGenerator.Generate(_key.Salt, saltSize); -+ MY_RAND_GEN(_key.Salt, saltSize); - Init2(); - RINOK(WriteStream(outStream, _key.Salt, saltSize)); - return WriteStream(outStream, _key.PwdVerifComputed, kPwdVerifSize); -diff --git a/Bin/p7zip/source/CPP/7zip/Crypto/ZipCrypto.cpp b/Bin/p7zip/source/CPP/7zip/Crypto/ZipCrypto.cpp -index ae715063..8610297a 100644 ---- a/Bin/p7zip/source/CPP/7zip/Crypto/ZipCrypto.cpp -+++ b/Bin/p7zip/source/CPP/7zip/Crypto/ZipCrypto.cpp -@@ -49,7 +49,7 @@ HRESULT CEncoder::WriteHeader_Check16(ISequentialOutStream *outStream, UInt16 cr - PKZIP 2.0+ used 1 byte CRC check. It's more secure. - We also use 1 byte CRC. */ - -- g_RandomGenerator.Generate(h, kHeaderSize - 1); -+ MY_RAND_GEN(h, kHeaderSize - 1); - // h[kHeaderSize - 2] = (Byte)(crc); - h[kHeaderSize - 1] = (Byte)(crc >> 8); - --- -2.17.1 - diff --git a/deps/patches/p7zip-Windows_ErrorMsg.patch b/deps/patches/p7zip-Windows_ErrorMsg.patch deleted file mode 100644 index 71de3e9f59c86..0000000000000 --- a/deps/patches/p7zip-Windows_ErrorMsg.patch +++ /dev/null @@ -1,33 +0,0 @@ -This fixes the build with Clang 6.0: - - ../../../../CPP/Windows/ErrorMsg.cpp:24:10: error: case value evaluates to -2147024809, which cannot be narrowed to type 'DWORD' (aka 'unsigned int') [-Wc++11-narrowing] - case E_INVALIDARG : txt = "E_INVALIDARG"; break ; - ^ - ../../../../CPP/Common/MyWindows.h:89:22: note: expanded from macro 'E_INVALIDARG' - #define E_INVALIDARG ((HRESULT)0x80070057L) - ^ - -The HRESULT cast in the macro causes the value to be read as signed int. ---- CPP/Windows/ErrorMsg.cpp.orig 2015-01-18 18:20:28 UTC -+++ CPP/Windows/ErrorMsg.cpp -@@ -15,13 +15,13 @@ UString MyFormatMessage(DWORD errorCode) - - switch(errorCode) { - case ERROR_NO_MORE_FILES : txt = "No more files"; break ; -- case E_NOTIMPL : txt = "E_NOTIMPL"; break ; -- case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; -- case E_ABORT : txt = "E_ABORT"; break ; -- case E_FAIL : txt = "E_FAIL"; break ; -- case STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ; -- case E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ; -- case E_INVALIDARG : txt = "E_INVALIDARG"; break ; -+ case (DWORD)(E_NOTIMPL) : txt = "E_NOTIMPL"; break ; -+ case (DWORD)(E_NOINTERFACE) : txt = "E_NOINTERFACE"; break ; -+ case (DWORD)(E_ABORT) : txt = "E_ABORT"; break ; -+ case (DWORD)(E_FAIL) : txt = "E_FAIL"; break ; -+ case (DWORD)(STG_E_INVALIDFUNCTION) : txt = "STG_E_INVALIDFUNCTION"; break ; -+ case (DWORD)(E_OUTOFMEMORY) : txt = "E_OUTOFMEMORY"; break ; -+ case (DWORD)(E_INVALIDARG) : txt = "E_INVALIDARG"; break ; - case ERROR_DIRECTORY : txt = "Error Directory"; break ; - default: - txt = strerror(errorCode); diff --git a/stdlib/p7zip_jll/Project.toml b/stdlib/p7zip_jll/Project.toml index 69330b7e80539..76f8c85ab0d25 100644 --- a/stdlib/p7zip_jll/Project.toml +++ b/stdlib/p7zip_jll/Project.toml @@ -1,6 +1,6 @@ name = "p7zip_jll" uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" -version = "16.2.1+0" +version = "17.4.0+0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"