Date: Sat, 27 Oct 2018 14:44:40 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r339813 - in projects/clang700-import: . bin/setfacl contrib/libarchive contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar c... Message-ID: <201810271444.w9REieTE045670@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sat Oct 27 14:44:39 2018 New Revision: 339813 URL: https://svnweb.freebsd.org/changeset/base/339813 Log: Merge ^/head r339670 through r339812. Added: projects/clang700-import/contrib/libarchive/libarchive/archive_blake2.h - copied unchanged from r339812, head/contrib/libarchive/libarchive/archive_blake2.h projects/clang700-import/contrib/libarchive/libarchive/archive_blake2_impl.h - copied unchanged from r339812, head/contrib/libarchive/libarchive/archive_blake2_impl.h projects/clang700-import/contrib/libarchive/libarchive/archive_blake2s_ref.c - copied unchanged from r339812, head/contrib/libarchive/libarchive/archive_blake2s_ref.c projects/clang700-import/contrib/libarchive/libarchive/archive_blake2sp_ref.c - copied unchanged from r339812, head/contrib/libarchive/libarchive/archive_blake2sp_ref.c projects/clang700-import/contrib/libarchive/libarchive/archive_read_support_format_rar5.c - copied unchanged from r339812, head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5.c - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5.c projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_arm.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_blake2.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_blake2.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_compressed.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_compressed.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part01.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part01.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part02.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part02.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part03.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part03.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part04.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part04.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_solid.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_solid.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_stored.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_stored.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu - copied unchanged from r339812, head/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu projects/clang700-import/lib/csu/aarch64/crt.h - copied unchanged from r339812, head/lib/csu/aarch64/crt.h projects/clang700-import/lib/csu/amd64/crt.h - copied unchanged from r339812, head/lib/csu/amd64/crt.h projects/clang700-import/lib/csu/common/crtbegin.c - copied unchanged from r339812, head/lib/csu/common/crtbegin.c projects/clang700-import/lib/csu/common/crtend.c - copied unchanged from r339812, head/lib/csu/common/crtend.c projects/clang700-import/lib/csu/i386/crt.h - copied unchanged from r339812, head/lib/csu/i386/crt.h projects/clang700-import/lib/csu/powerpc64/crt.h - copied unchanged from r339812, head/lib/csu/powerpc64/crt.h projects/clang700-import/lib/csu/tests/ - copied from r339812, head/lib/csu/tests/ projects/clang700-import/stand/libsa/crc32_libkern.c - copied unchanged from r339812, head/stand/libsa/crc32_libkern.c projects/clang700-import/sys/sys/joystick.h - copied unchanged from r339812, head/sys/sys/joystick.h projects/clang700-import/tools/build/options/WITHOUT_BSD_CRTBEGIN - copied unchanged from r339812, head/tools/build/options/WITHOUT_BSD_CRTBEGIN projects/clang700-import/tools/build/options/WITH_BSD_CRTBEGIN - copied unchanged from r339812, head/tools/build/options/WITH_BSD_CRTBEGIN projects/clang700-import/tools/tools/netmap/vale-ctl.4 - copied unchanged from r339812, head/tools/tools/netmap/vale-ctl.4 Modified: projects/clang700-import/Makefile.inc1 projects/clang700-import/ObsoleteFiles.inc projects/clang700-import/bin/setfacl/setfacl.1 projects/clang700-import/bin/setfacl/setfacl.c projects/clang700-import/contrib/libarchive/COPYING projects/clang700-import/contrib/libarchive/NEWS projects/clang700-import/contrib/libarchive/README.md projects/clang700-import/contrib/libarchive/cpio/cpio.c projects/clang700-import/contrib/libarchive/libarchive/archive.h projects/clang700-import/contrib/libarchive/libarchive/archive_read_support_format_all.c projects/clang700-import/contrib/libarchive/libarchive/archive_read_support_format_by_code.c projects/clang700-import/contrib/libarchive/libarchive/archive_read_support_format_xar.c projects/clang700-import/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c projects/clang700-import/contrib/libarchive/libarchive/archive_write_set_format_pax.c projects/clang700-import/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c projects/clang700-import/contrib/libarchive/libarchive/test/test_read_format_xar.c projects/clang700-import/contrib/libarchive/tar/bsdtar.c projects/clang700-import/contrib/libarchive/test_utils/test_main.c projects/clang700-import/crypto/openssl/include/openssl/opensslv.h projects/clang700-import/gnu/lib/Makefile projects/clang700-import/lib/csu/Makefile projects/clang700-import/lib/csu/Makefile.inc projects/clang700-import/lib/libarchive/Makefile projects/clang700-import/lib/libarchive/tests/Makefile projects/clang700-import/lib/libc/sys/access.2 projects/clang700-import/lib/libc/sys/chflags.2 projects/clang700-import/lib/libc/sys/chmod.2 projects/clang700-import/lib/libc/sys/chown.2 projects/clang700-import/lib/libc/sys/link.2 projects/clang700-import/lib/libc/sys/open.2 projects/clang700-import/lib/libc/sys/stat.2 projects/clang700-import/lib/libc/sys/unlink.2 projects/clang700-import/lib/libc/sys/utimensat.2 projects/clang700-import/lib/libc/sys/wait.2 projects/clang700-import/lib/libcasper/libcasper/libcasper.c projects/clang700-import/lib/libefivar/efivar-dp-format.c projects/clang700-import/lib/libefivar/efivar.3 projects/clang700-import/libexec/rc/network.subr projects/clang700-import/libexec/rc/rc.conf projects/clang700-import/release/tools/gce.conf projects/clang700-import/sbin/dumpon/dumpon.8 projects/clang700-import/sbin/dumpon/dumpon.c projects/clang700-import/sbin/fdisk/fdisk.c projects/clang700-import/sbin/fsck_ffs/main.c projects/clang700-import/sbin/ipfw/ipfw2.c projects/clang700-import/sbin/newfs/mkfs.c projects/clang700-import/sbin/route/route.c projects/clang700-import/secure/lib/libcrypto/Makefile projects/clang700-import/secure/lib/libssl/Makefile projects/clang700-import/share/man/man4/ae.4 projects/clang700-import/share/man/man4/de.4 projects/clang700-import/share/man/man4/ed.4 projects/clang700-import/share/man/man4/man4.i386/cs.4 projects/clang700-import/share/man/man4/man4.i386/ep.4 projects/clang700-import/share/man/man4/man4.i386/ex.4 projects/clang700-import/share/man/man4/man4.i386/fe.4 projects/clang700-import/share/man/man4/man4.i386/vx.4 projects/clang700-import/share/man/man4/man4.powerpc/bm.4 projects/clang700-import/share/man/man4/pcn.4 projects/clang700-import/share/man/man4/sctp.4 projects/clang700-import/share/man/man4/sf.4 projects/clang700-import/share/man/man4/sn.4 projects/clang700-import/share/man/man4/tl.4 projects/clang700-import/share/man/man4/tx.4 projects/clang700-import/share/man/man4/txp.4 projects/clang700-import/share/man/man4/wb.4 projects/clang700-import/share/man/man4/xe.4 projects/clang700-import/share/man/man5/src.conf.5 projects/clang700-import/share/mk/src.opts.mk projects/clang700-import/stand/efi/libefi/delay.c projects/clang700-import/stand/efi/loader/main.c projects/clang700-import/stand/liblua/lutils.c projects/clang700-import/stand/libsa/Makefile projects/clang700-import/stand/lua/config.lua projects/clang700-import/stand/lua/menu.lua projects/clang700-import/sys/cam/ata/ata_da.c projects/clang700-import/sys/cam/nvme/nvme_da.c projects/clang700-import/sys/cam/scsi/scsi_da.c projects/clang700-import/sys/cddl/compat/opensolaris/sys/vnode.h projects/clang700-import/sys/compat/cloudabi/cloudabi_file.c projects/clang700-import/sys/compat/freebsd32/freebsd32_ioctl.c projects/clang700-import/sys/compat/freebsd32/freebsd32_ioctl.h projects/clang700-import/sys/compat/linux/linux_file.c projects/clang700-import/sys/crypto/rijndael/rijndael-api-fst.c projects/clang700-import/sys/dev/acpi_support/acpi_asus.c projects/clang700-import/sys/dev/acpi_support/acpi_fujitsu.c projects/clang700-import/sys/dev/acpi_support/acpi_ibm.c projects/clang700-import/sys/dev/acpi_support/acpi_panasonic.c projects/clang700-import/sys/dev/acpi_support/acpi_rapidstart.c projects/clang700-import/sys/dev/acpi_support/acpi_sony.c projects/clang700-import/sys/dev/acpi_support/acpi_toshiba.c projects/clang700-import/sys/dev/acpi_support/acpi_wmi.c projects/clang700-import/sys/dev/acpi_support/atk0110.c projects/clang700-import/sys/dev/acpica/acpi.c projects/clang700-import/sys/dev/acpica/acpi_acad.c projects/clang700-import/sys/dev/acpica/acpi_button.c projects/clang700-import/sys/dev/acpica/acpi_cmbat.c projects/clang700-import/sys/dev/acpica/acpi_container.c projects/clang700-import/sys/dev/acpica/acpi_cpu.c projects/clang700-import/sys/dev/acpica/acpi_ec.c projects/clang700-import/sys/dev/acpica/acpi_hpet.c projects/clang700-import/sys/dev/acpica/acpi_if.m projects/clang700-import/sys/dev/acpica/acpi_isab.c projects/clang700-import/sys/dev/acpica/acpi_lid.c projects/clang700-import/sys/dev/acpica/acpi_pci_link.c projects/clang700-import/sys/dev/acpica/acpi_resource.c projects/clang700-import/sys/dev/acpica/acpi_smbat.c projects/clang700-import/sys/dev/acpica/acpivar.h projects/clang700-import/sys/dev/ae/if_ae.c projects/clang700-import/sys/dev/amdgpio/amdgpio.c projects/clang700-import/sys/dev/asmc/asmc.c projects/clang700-import/sys/dev/bm/if_bm.c projects/clang700-import/sys/dev/cs/if_cs.c projects/clang700-import/sys/dev/cxgbe/adapter.h projects/clang700-import/sys/dev/cxgbe/t4_filter.c projects/clang700-import/sys/dev/cxgbe/t4_ioctl.h projects/clang700-import/sys/dev/cxgbe/t4_main.c projects/clang700-import/sys/dev/cxgbe/t4_netmap.c projects/clang700-import/sys/dev/de/if_de.c projects/clang700-import/sys/dev/dme/if_dme.c projects/clang700-import/sys/dev/ed/if_ed.c projects/clang700-import/sys/dev/ep/if_ep.c projects/clang700-import/sys/dev/ex/if_ex.c projects/clang700-import/sys/dev/fdc/fdc_acpi.c projects/clang700-import/sys/dev/fe/if_fe.c projects/clang700-import/sys/dev/gpio/bytgpio.c projects/clang700-import/sys/dev/gpio/chvgpio.c projects/clang700-import/sys/dev/hyperv/vmbus/vmbus_res.c projects/clang700-import/sys/dev/ichiic/ig4_acpi.c projects/clang700-import/sys/dev/intel/spi.c projects/clang700-import/sys/dev/ipmi/ipmi_acpi.c projects/clang700-import/sys/dev/netmap/netmap_bdg.h projects/clang700-import/sys/dev/nvme/nvme.c projects/clang700-import/sys/dev/nvme/nvme_private.h projects/clang700-import/sys/dev/pcn/if_pcn.c projects/clang700-import/sys/dev/random/fortuna.c projects/clang700-import/sys/dev/sdhci/sdhci_acpi.c projects/clang700-import/sys/dev/sf/if_sf.c projects/clang700-import/sys/dev/sn/if_sn.c projects/clang700-import/sys/dev/tl/if_tl.c projects/clang700-import/sys/dev/tpm/tpm_acpi.c projects/clang700-import/sys/dev/tx/if_tx.c projects/clang700-import/sys/dev/txp/if_txp.c projects/clang700-import/sys/dev/vx/if_vx.c projects/clang700-import/sys/dev/wb/if_wb.c projects/clang700-import/sys/dev/xe/if_xe.c projects/clang700-import/sys/fs/devfs/devfs_vnops.c projects/clang700-import/sys/fs/nfsclient/nfs_clvnops.c projects/clang700-import/sys/geom/eli/g_eli_ctl.c projects/clang700-import/sys/kern/kern_environment.c projects/clang700-import/sys/kern/subr_vmem.c projects/clang700-import/sys/kern/sys_generic.c projects/clang700-import/sys/kern/tty_pts.c projects/clang700-import/sys/kern/vfs_default.c projects/clang700-import/sys/kern/vfs_init.c projects/clang700-import/sys/kern/vfs_lookup.c projects/clang700-import/sys/kern/vfs_mount.c projects/clang700-import/sys/kern/vfs_mountroot.c projects/clang700-import/sys/kern/vfs_syscalls.c projects/clang700-import/sys/kern/vfs_vnops.c projects/clang700-import/sys/net/if_stf.c projects/clang700-import/sys/netinet/in_mcast.c projects/clang700-import/sys/netinet/ip_input.c projects/clang700-import/sys/netinet/sctp_sysctl.h projects/clang700-import/sys/netinet6/raw_ip6.c projects/clang700-import/sys/netpfil/ipfw/ip_fw_pfil.c projects/clang700-import/sys/netpfil/pf/pf.c projects/clang700-import/sys/netpfil/pf/pf_if.c projects/clang700-import/sys/riscv/riscv/pmap.c projects/clang700-import/sys/sys/fcntl.h projects/clang700-import/sys/sys/filio.h projects/clang700-import/sys/sys/mount.h projects/clang700-import/sys/sys/namei.h projects/clang700-import/sys/sys/param.h projects/clang700-import/sys/sys/syscallsubr.h projects/clang700-import/sys/sys/systm.h projects/clang700-import/sys/sys/vnode.h projects/clang700-import/sys/tools/vnode_if.awk projects/clang700-import/sys/ufs/ffs/ffs_alloc.c projects/clang700-import/sys/ufs/ffs/ffs_subr.c projects/clang700-import/sys/ufs/ffs/ffs_vfsops.c projects/clang700-import/sys/ufs/ffs/fs.h projects/clang700-import/sys/vm/uma_core.c projects/clang700-import/sys/vm/uma_int.h projects/clang700-import/sys/vm/vm_domainset.c projects/clang700-import/tests/sys/acl/Makefile projects/clang700-import/tests/sys/acl/tools-nfs4-psarc.test projects/clang700-import/tests/sys/acl/tools-nfs4.test projects/clang700-import/tests/sys/acl/tools-posix.test projects/clang700-import/tools/boot/lua-test.sh projects/clang700-import/tools/tools/netmap/vale-ctl.c projects/clang700-import/usr.sbin/bhyve/Makefile projects/clang700-import/usr.sbin/bhyve/bhyve.8 projects/clang700-import/usr.sbin/bhyve/pci_fbuf.c (contents, props changed) projects/clang700-import/usr.sbin/bhyve/rfb.c (contents, props changed) projects/clang700-import/usr.sbin/bsdconfig/share/dialog.subr projects/clang700-import/usr.sbin/bsdinstall/scripts/auto projects/clang700-import/usr.sbin/bsdinstall/scripts/hostname projects/clang700-import/usr.sbin/bsdinstall/scripts/zfsboot projects/clang700-import/usr.sbin/ctm/README projects/clang700-import/usr.sbin/cxgbetool/cxgbetool.c projects/clang700-import/usr.sbin/efivar/efiutil.c projects/clang700-import/usr.sbin/efivar/efivar.8 projects/clang700-import/usr.sbin/efivar/efivar.c projects/clang700-import/usr.sbin/ngctl/list.c projects/clang700-import/usr.sbin/portsnap/portsnap/portsnap.conf projects/clang700-import/usr.sbin/rtsold/rtsol.c projects/clang700-import/usr.sbin/rtsold/rtsold.8 projects/clang700-import/usr.sbin/rtsold/rtsold.c Directory Properties: projects/clang700-import/ (props changed) projects/clang700-import/contrib/libarchive/ (props changed) projects/clang700-import/crypto/openssl/ (props changed) projects/clang700-import/gnu/lib/ (props changed) Modified: projects/clang700-import/Makefile.inc1 ============================================================================== --- projects/clang700-import/Makefile.inc1 Sat Oct 27 09:34:33 2018 (r339812) +++ projects/clang700-import/Makefile.inc1 Sat Oct 27 14:44:39 2018 (r339813) @@ -1934,7 +1934,8 @@ update: .PHONY # r310724 fixed PR 215350, a crash in libdwarf with objects built by GCC 6.2. # r334881 added libdwarf constants used by ctfconvert. # r338478 fixed a crash in objcopy for mips64el objects -.if ${BOOTSTRAPPING} < 1200084 +# r339083 libelf: correct mips64el test to use ELF header +.if ${BOOTSTRAPPING} < 1200085 _elftoolchain_libs= lib/libelf lib/libdwarf .endif Modified: projects/clang700-import/ObsoleteFiles.inc ============================================================================== --- projects/clang700-import/ObsoleteFiles.inc Sat Oct 27 09:34:33 2018 (r339812) +++ projects/clang700-import/ObsoleteFiles.inc Sat Oct 27 14:44:39 2018 (r339813) @@ -174,11 +174,15 @@ OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt OLD_DIRS+=usr/lib/clang/6.0.1/lib/freebsd OLD_DIRS+=usr/lib/clang/6.0.1/lib OLD_DIRS+=usr/lib/clang/6.0.1 +# 20181026: joy(4) removal +OLD_FILES+=usr/share/man/man4/joy.4.gz +# 20181025: OpenSSL libraries version bump to avoid conflict with ports +OLD_LIBS+=lib/libcrypto.so.9 +OLD_LIBS+=usr/lib/libssl.so.9 +OLD_LIBS+=usr/lib32/libcrypto.so.9 +OLD_LIBS+=usr/lib32/libssl.so.9 # 20181021: mse(4) removal OLD_FILES+=usr/share/man/man4/mse.4.gz -# 20181021: joy(4) removal -OLD_FILES+=usr/share/man/man4/joy.4.gz -OLD_FILES+=usr/include/sys/joystick.h # 20181015: Stale libcasper(3) files following r329452 OLD_LIBS+=lib/casper/libcap_sysctl.so.0 OLD_LIBS+=lib/casper/libcap_grp.so.0 Modified: projects/clang700-import/bin/setfacl/setfacl.1 ============================================================================== --- projects/clang700-import/bin/setfacl/setfacl.1 Sat Oct 27 09:34:33 2018 (r339812) +++ projects/clang700-import/bin/setfacl/setfacl.1 Sat Oct 27 14:44:39 2018 (r339813) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2018 +.Dd October 26, 2018 .Dt SETFACL 1 .Os .Sh NAME @@ -136,6 +136,8 @@ option is specified, no symbolic links are followed. This is the default. .It Fl R Perform the action recursively on any specified directories. +When modifying or adding NFSv4 ACL entries, inheritance flags +are applied only to directories. .It Fl x Ar entries | position If .Ar entries Modified: projects/clang700-import/bin/setfacl/setfacl.c ============================================================================== --- projects/clang700-import/bin/setfacl/setfacl.c Sat Oct 27 09:34:33 2018 (r339812) +++ projects/clang700-import/bin/setfacl/setfacl.c Sat Oct 27 14:44:39 2018 (r339813) @@ -27,9 +27,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <sys/types.h> #include <sys/param.h> -#include <sys/stat.h> #include <sys/acl.h> #include <sys/queue.h> @@ -73,6 +71,7 @@ static bool need_mask; static acl_type_t acl_type = ACL_TYPE_ACCESS; static int handle_file(FTS *ftsp, FTSENT *file); +static acl_t clear_inheritance_flags(acl_t acl); static char **stdin_files(void); static void usage(void); @@ -124,10 +123,57 @@ stdin_files(void) return (files_list); } +/* + * Remove any inheritance flags from NFSv4 ACLs when running in recursive + * mode. This is to avoid files being assigned identical ACLs to their + * parent directory while also being set to inherit them. + * + * The acl argument is assumed to be valid. + */ +static acl_t +clear_inheritance_flags(acl_t acl) +{ + acl_t nacl; + acl_entry_t acl_entry; + acl_flagset_t acl_flagset; + int acl_brand, entry_id; + + (void)acl_get_brand_np(acl, &acl_brand); + if (acl_brand != ACL_BRAND_NFS4) + return (acl); + + nacl = acl_dup(acl); + if (nacl == NULL) { + warn("acl_dup() failed"); + return (acl); + } + + entry_id = ACL_FIRST_ENTRY; + while (acl_get_entry(nacl, entry_id, &acl_entry) == 1) { + entry_id = ACL_NEXT_ENTRY; + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + warn("acl_get_flagset_np() failed"); + continue; + } + if (acl_get_flag_np(acl_flagset, ACL_ENTRY_INHERIT_ONLY) == 1) { + if (acl_delete_entry(nacl, acl_entry) != 0) + warn("acl_delete_entry() failed"); + continue; + } + if (acl_delete_flag_np(acl_flagset, + ACL_ENTRY_FILE_INHERIT | + ACL_ENTRY_DIRECTORY_INHERIT | + ACL_ENTRY_NO_PROPAGATE_INHERIT) != 0) + warn("acl_delete_flag_np() failed"); + } + + return (nacl); +} + static int handle_file(FTS *ftsp, FTSENT *file) { - acl_t acl; + acl_t acl, nacl; acl_entry_t unused_entry; int local_error, ret; struct sf_entry *entry; @@ -174,8 +220,8 @@ handle_file(FTS *ftsp, FTSENT *file) } else if (ret == 0) { if (acl_type == ACL_TYPE_NFS4) acl_type = ACL_TYPE_ACCESS; - } else if (ret < 0 && errno != EINVAL) { - warn("%s: pathconf(..., _PC_ACL_NFS4) failed", + } else if (ret < 0 && errno != EINVAL && errno != ENOENT) { + warn("%s: pathconf(_PC_ACL_NFS4) failed", file->fts_path); } @@ -193,17 +239,20 @@ handle_file(FTS *ftsp, FTSENT *file) /* Cycle through each option. */ TAILQ_FOREACH(entry, &entrylist, next) { - if (local_error) - continue; - - switch(entry->op) { + nacl = entry->acl; + switch (entry->op) { case OP_ADD_ACL: - local_error += add_acl(entry->acl, entry->entry_number, - &acl, file->fts_path); + if (R_flag && file->fts_info != FTS_D && + acl_type == ACL_TYPE_NFS4) + nacl = clear_inheritance_flags(nacl); + local_error += add_acl(nacl, entry->entry_number, &acl, + file->fts_path); break; case OP_MERGE_ACL: - local_error += merge_acl(entry->acl, &acl, - file->fts_path); + if (R_flag && file->fts_info != FTS_D && + acl_type == ACL_TYPE_NFS4) + nacl = clear_inheritance_flags(nacl); + local_error += merge_acl(nacl, &acl, file->fts_path); need_mask = true; break; case OP_REMOVE_EXT: @@ -240,8 +289,7 @@ handle_file(FTS *ftsp, FTSENT *file) need_mask = false; break; case OP_REMOVE_ACL: - local_error += remove_acl(entry->acl, &acl, - file->fts_path); + local_error += remove_acl(nacl, &acl, file->fts_path); need_mask = true; break; case OP_REMOVE_BY_NUMBER: @@ -250,8 +298,17 @@ handle_file(FTS *ftsp, FTSENT *file) need_mask = true; break; } + + if (nacl != entry->acl) { + acl_free(nacl); + nacl = NULL; + } + if (local_error) + break; } + ret = 0; + /* * Don't try to set an empty default ACL; it will always fail. * Use acl_delete_def_file(3) instead. @@ -261,34 +318,33 @@ handle_file(FTS *ftsp, FTSENT *file) if (acl_delete_def_file(file->fts_accpath) == -1) { warn("%s: acl_delete_def_file() failed", file->fts_path); - return (1); + ret = 1; } - return (0); + goto out; } /* Don't bother setting the ACL if something is broken. */ if (local_error) { - return (1); - } - - if (acl_type != ACL_TYPE_NFS4 && need_mask && + ret = 1; + } else if (acl_type != ACL_TYPE_NFS4 && need_mask && set_acl_mask(&acl, file->fts_path) == -1) { warnx("%s: failed to set ACL mask", file->fts_path); - return (1); + ret = 1; } else if (follow_symlink) { if (acl_set_file(file->fts_accpath, acl_type, acl) == -1) { warn("%s: acl_set_file() failed", file->fts_path); - return (1); + ret = 1; } } else { if (acl_set_link_np(file->fts_accpath, acl_type, acl) == -1) { warn("%s: acl_set_link_np() failed", file->fts_path); - return (1); + ret = 1; } } +out: acl_free(acl); - return (0); + return (ret); } int Modified: projects/clang700-import/contrib/libarchive/COPYING ============================================================================== --- projects/clang700-import/contrib/libarchive/COPYING Sat Oct 27 09:34:33 2018 (r339812) +++ projects/clang700-import/contrib/libarchive/COPYING Sat Oct 27 14:44:39 2018 (r339813) @@ -23,6 +23,13 @@ the actual statements in the files are controlling. * The following source files are in the public domain: libarchive/archive_getdate.c +* The following source files are triple-licensed with the ability to choose + from CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses: + libarchive/archive_blake2.h + libarchive/archive_blake2_impl.h + libarchive/archive_blake2s_ref.c + libarchive/archive_blake2sp_ref.c + * The build files---including Makefiles, configure scripts, and auxiliary scripts used as part of the compile process---have widely varying licensing terms. Please check individual files before @@ -34,7 +41,7 @@ do use the license below. The varying licensing of th seems to be an unavoidable mess. -Copyright (c) 2003-2009 <author(s)> +Copyright (c) 2003-2018 <author(s)> All rights reserved. Redistribution and use in source and binary forms, with or without Modified: projects/clang700-import/contrib/libarchive/NEWS ============================================================================== --- projects/clang700-import/contrib/libarchive/NEWS Sat Oct 27 09:34:33 2018 (r339812) +++ projects/clang700-import/contrib/libarchive/NEWS Sat Oct 27 14:44:39 2018 (r339813) @@ -1,3 +1,5 @@ +Oct 06, 2018: RAR 5.0 reader + Sep 03, 2018: libarchive 3.3.3 released Jul 19, 2018: Avoid super-linear slowdown on malformed mtree files Modified: projects/clang700-import/contrib/libarchive/README.md ============================================================================== --- projects/clang700-import/contrib/libarchive/README.md Sat Oct 27 09:34:33 2018 (r339812) +++ projects/clang700-import/contrib/libarchive/README.md Sat Oct 27 14:44:39 2018 (r339813) @@ -86,7 +86,7 @@ Currently, the library automatically detects and reads * 7-Zip archives * Microsoft CAB format * LHA and LZH archives - * RAR archives (with some limitations due to RAR's proprietary status) + * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) * XAR archives The library also detects and handles any of the following before evaluating the archive: Modified: projects/clang700-import/contrib/libarchive/cpio/cpio.c ============================================================================== --- projects/clang700-import/contrib/libarchive/cpio/cpio.c Sat Oct 27 09:34:33 2018 (r339812) +++ projects/clang700-import/contrib/libarchive/cpio/cpio.c Sat Oct 27 14:44:39 2018 (r339813) @@ -134,8 +134,9 @@ main(int argc, char *argv[]) struct cpio _cpio; /* Allocated on stack. */ struct cpio *cpio; const char *errmsg; + char *tptr; int uid, gid; - int opt; + int opt, t; cpio = &_cpio; memset(cpio, 0, sizeof(*cpio)); @@ -204,9 +205,15 @@ main(int argc, char *argv[]) cpio->add_filter = opt; break; case 'C': /* NetBSD/OpenBSD */ - cpio->bytes_per_block = atoi(cpio->argument); - if (cpio->bytes_per_block <= 0) - lafe_errc(1, 0, "Invalid blocksize %s", cpio->argument); + errno = 0; + tptr = NULL; + t = (int)strtol(cpio->argument, &tptr, 10); + if (errno || t <= 0 || *(cpio->argument) == '\0' || + tptr == NULL || *tptr != '\0') { + lafe_errc(1, 0, "Invalid blocksize: %s", + cpio->argument); + } + cpio->bytes_per_block = t; break; case 'c': /* POSIX 1997 */ cpio->format = "odc"; Modified: projects/clang700-import/contrib/libarchive/libarchive/archive.h ============================================================================== --- projects/clang700-import/contrib/libarchive/libarchive/archive.h Sat Oct 27 09:34:33 2018 (r339812) +++ projects/clang700-import/contrib/libarchive/libarchive/archive.h Sat Oct 27 14:44:39 2018 (r339813) @@ -338,6 +338,7 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FORMAT_LHA 0xB0000 #define ARCHIVE_FORMAT_CAB 0xC0000 #define ARCHIVE_FORMAT_RAR 0xD0000 +#define ARCHIVE_FORMAT_RAR_V5 (ARCHIVE_FORMAT_RAR | 1) #define ARCHIVE_FORMAT_7ZIP 0xE0000 #define ARCHIVE_FORMAT_WARC 0xF0000 @@ -449,6 +450,7 @@ __LA_DECL int archive_read_support_format_iso9660(stru __LA_DECL int archive_read_support_format_lha(struct archive *); __LA_DECL int archive_read_support_format_mtree(struct archive *); __LA_DECL int archive_read_support_format_rar(struct archive *); +__LA_DECL int archive_read_support_format_rar5(struct archive *); __LA_DECL int archive_read_support_format_raw(struct archive *); __LA_DECL int archive_read_support_format_tar(struct archive *); __LA_DECL int archive_read_support_format_warc(struct archive *); Copied: projects/clang700-import/contrib/libarchive/libarchive/archive_blake2.h (from r339812, head/contrib/libarchive/libarchive/archive_blake2.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang700-import/contrib/libarchive/libarchive/archive_blake2.h Sat Oct 27 14:44:39 2018 (r339813, copy of r339812, head/contrib/libarchive/libarchive/archive_blake2.h) @@ -0,0 +1,194 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ +#ifndef BLAKE2_H +#define BLAKE2_H + +#include <stddef.h> +#include <stdint.h> + +#if defined(_MSC_VER) +#define BLAKE2_PACKED(x) __pragma(pack(push, 1)) x __pragma(pack(pop)) +#else +#define BLAKE2_PACKED(x) x __attribute__((packed)) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + + enum blake2s_constant + { + BLAKE2S_BLOCKBYTES = 64, + BLAKE2S_OUTBYTES = 32, + BLAKE2S_KEYBYTES = 32, + BLAKE2S_SALTBYTES = 8, + BLAKE2S_PERSONALBYTES = 8 + }; + + enum blake2b_constant + { + BLAKE2B_BLOCKBYTES = 128, + BLAKE2B_OUTBYTES = 64, + BLAKE2B_KEYBYTES = 64, + BLAKE2B_SALTBYTES = 16, + BLAKE2B_PERSONALBYTES = 16 + }; + + typedef struct blake2s_state__ + { + uint32_t h[8]; + uint32_t t[2]; + uint32_t f[2]; + uint8_t buf[BLAKE2S_BLOCKBYTES]; + size_t buflen; + size_t outlen; + uint8_t last_node; + } blake2s_state; + + typedef struct blake2b_state__ + { + uint64_t h[8]; + uint64_t t[2]; + uint64_t f[2]; + uint8_t buf[BLAKE2B_BLOCKBYTES]; + size_t buflen; + size_t outlen; + uint8_t last_node; + } blake2b_state; + + typedef struct blake2sp_state__ + { + blake2s_state S[8][1]; + blake2s_state R[1]; + uint8_t buf[8 * BLAKE2S_BLOCKBYTES]; + size_t buflen; + size_t outlen; + } blake2sp_state; + + typedef struct blake2bp_state__ + { + blake2b_state S[4][1]; + blake2b_state R[1]; + uint8_t buf[4 * BLAKE2B_BLOCKBYTES]; + size_t buflen; + size_t outlen; + } blake2bp_state; + + BLAKE2_PACKED(struct blake2s_param__ + { + uint8_t digest_length; /* 1 */ + uint8_t key_length; /* 2 */ + uint8_t fanout; /* 3 */ + uint8_t depth; /* 4 */ + uint32_t leaf_length; /* 8 */ + uint32_t node_offset; /* 12 */ + uint16_t xof_length; /* 14 */ + uint8_t node_depth; /* 15 */ + uint8_t inner_length; /* 16 */ + /* uint8_t reserved[0]; */ + uint8_t salt[BLAKE2S_SALTBYTES]; /* 24 */ + uint8_t personal[BLAKE2S_PERSONALBYTES]; /* 32 */ + }); + + typedef struct blake2s_param__ blake2s_param; + + BLAKE2_PACKED(struct blake2b_param__ + { + uint8_t digest_length; /* 1 */ + uint8_t key_length; /* 2 */ + uint8_t fanout; /* 3 */ + uint8_t depth; /* 4 */ + uint32_t leaf_length; /* 8 */ + uint32_t node_offset; /* 12 */ + uint32_t xof_length; /* 16 */ + uint8_t node_depth; /* 17 */ + uint8_t inner_length; /* 18 */ + uint8_t reserved[14]; /* 32 */ + uint8_t salt[BLAKE2B_SALTBYTES]; /* 48 */ + uint8_t personal[BLAKE2B_PERSONALBYTES]; /* 64 */ + }); + + typedef struct blake2b_param__ blake2b_param; + + typedef struct blake2xs_state__ + { + blake2s_state S[1]; + blake2s_param P[1]; + } blake2xs_state; + + typedef struct blake2xb_state__ + { + blake2b_state S[1]; + blake2b_param P[1]; + } blake2xb_state; + + /* Padded structs result in a compile-time error */ + enum { + BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), + BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) + }; + + /* Streaming API */ + int blake2s_init( blake2s_state *S, size_t outlen ); + int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2s_init_param( blake2s_state *S, const blake2s_param *P ); + int blake2s_update( blake2s_state *S, const void *in, size_t inlen ); + int blake2s_final( blake2s_state *S, void *out, size_t outlen ); + + int blake2b_init( blake2b_state *S, size_t outlen ); + int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2b_init_param( blake2b_state *S, const blake2b_param *P ); + int blake2b_update( blake2b_state *S, const void *in, size_t inlen ); + int blake2b_final( blake2b_state *S, void *out, size_t outlen ); + + int blake2sp_init( blake2sp_state *S, size_t outlen ); + int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2sp_update( blake2sp_state *S, const void *in, size_t inlen ); + int blake2sp_final( blake2sp_state *S, void *out, size_t outlen ); + + int blake2bp_init( blake2bp_state *S, size_t outlen ); + int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2bp_update( blake2bp_state *S, const void *in, size_t inlen ); + int blake2bp_final( blake2bp_state *S, void *out, size_t outlen ); + + /* Variable output length API */ + int blake2xs_init( blake2xs_state *S, const size_t outlen ); + int blake2xs_init_key( blake2xs_state *S, const size_t outlen, const void *key, size_t keylen ); + int blake2xs_update( blake2xs_state *S, const void *in, size_t inlen ); + int blake2xs_final(blake2xs_state *S, void *out, size_t outlen); + + int blake2xb_init( blake2xb_state *S, const size_t outlen ); + int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key, size_t keylen ); + int blake2xb_update( blake2xb_state *S, const void *in, size_t inlen ); + int blake2xb_final(blake2xb_state *S, void *out, size_t outlen); + + /* Simple API */ + int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2b( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2bp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + int blake2xs( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2xb( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + /* This is simply an alias for blake2b */ + int blake2( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + +#if defined(__cplusplus) +} +#endif + +#endif Copied: projects/clang700-import/contrib/libarchive/libarchive/archive_blake2_impl.h (from r339812, head/contrib/libarchive/libarchive/archive_blake2_impl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang700-import/contrib/libarchive/libarchive/archive_blake2_impl.h Sat Oct 27 14:44:39 2018 (r339813, copy of r339812, head/contrib/libarchive/libarchive/archive_blake2_impl.h) @@ -0,0 +1,160 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ +#ifndef BLAKE2_IMPL_H +#define BLAKE2_IMPL_H + +#include <stdint.h> +#include <string.h> + +#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) + #if defined(_MSC_VER) + #define BLAKE2_INLINE __inline + #elif defined(__GNUC__) + #define BLAKE2_INLINE __inline__ + #else + #define BLAKE2_INLINE + #endif +#else + #define BLAKE2_INLINE inline +#endif + +static BLAKE2_INLINE uint32_t load32( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint32_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return (( uint32_t )( p[0] ) << 0) | + (( uint32_t )( p[1] ) << 8) | + (( uint32_t )( p[2] ) << 16) | + (( uint32_t )( p[3] ) << 24) ; +#endif +} + +static BLAKE2_INLINE uint64_t load64( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint64_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return (( uint64_t )( p[0] ) << 0) | + (( uint64_t )( p[1] ) << 8) | + (( uint64_t )( p[2] ) << 16) | + (( uint64_t )( p[3] ) << 24) | + (( uint64_t )( p[4] ) << 32) | + (( uint64_t )( p[5] ) << 40) | + (( uint64_t )( p[6] ) << 48) | + (( uint64_t )( p[7] ) << 56) ; +#endif +} + +static BLAKE2_INLINE uint16_t load16( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint16_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return ( uint16_t )((( uint32_t )( p[0] ) << 0) | + (( uint32_t )( p[1] ) << 8)); +#endif +} + +static BLAKE2_INLINE void store16( void *dst, uint16_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + *p++ = ( uint8_t )w; w >>= 8; + *p++ = ( uint8_t )w; +#endif +} + +static BLAKE2_INLINE void store32( void *dst, uint32_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); +#endif +} + +static BLAKE2_INLINE void store64( void *dst, uint64_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); + p[4] = (uint8_t)(w >> 32); + p[5] = (uint8_t)(w >> 40); + p[6] = (uint8_t)(w >> 48); + p[7] = (uint8_t)(w >> 56); +#endif +} + +static BLAKE2_INLINE uint64_t load48( const void *src ) +{ + const uint8_t *p = ( const uint8_t * )src; + return (( uint64_t )( p[0] ) << 0) | + (( uint64_t )( p[1] ) << 8) | + (( uint64_t )( p[2] ) << 16) | + (( uint64_t )( p[3] ) << 24) | + (( uint64_t )( p[4] ) << 32) | + (( uint64_t )( p[5] ) << 40) ; +} + +static BLAKE2_INLINE void store48( void *dst, uint64_t w ) +{ + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); + p[4] = (uint8_t)(w >> 32); + p[5] = (uint8_t)(w >> 40); +} + +static BLAKE2_INLINE uint32_t rotr32( const uint32_t w, const unsigned c ) +{ + return ( w >> c ) | ( w << ( 32 - c ) ); +} + +static BLAKE2_INLINE uint64_t rotr64( const uint64_t w, const unsigned c ) +{ + return ( w >> c ) | ( w << ( 64 - c ) ); +} + +/* prevents compiler optimizing out memset() */ +static BLAKE2_INLINE void secure_zero_memory(void *v, size_t n) +{ + static void *(*const volatile memset_v)(void *, int, size_t) = &memset; + memset_v(v, 0, n); +} + +#endif Copied: projects/clang700-import/contrib/libarchive/libarchive/archive_blake2s_ref.c (from r339812, head/contrib/libarchive/libarchive/archive_blake2s_ref.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang700-import/contrib/libarchive/libarchive/archive_blake2s_ref.c Sat Oct 27 14:44:39 2018 (r339813, copy of r339812, head/contrib/libarchive/libarchive/archive_blake2s_ref.c) @@ -0,0 +1,367 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ + +#include <stdint.h> +#include <string.h> +#include <stdio.h> + +#include "archive_blake2.h" +#include "archive_blake2_impl.h" + +static const uint32_t blake2s_IV[8] = +{ + 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, + 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL +}; + +static const uint8_t blake2s_sigma[10][16] = +{ + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , + { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , + { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , + { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , + { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , + { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , + { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , + { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , + { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , + { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } , +}; + +static void blake2s_set_lastnode( blake2s_state *S ) +{ + S->f[1] = (uint32_t)-1; +} + +/* Some helper functions, not necessarily useful */ +static int blake2s_is_lastblock( const blake2s_state *S ) +{ + return S->f[0] != 0; +} + +static void blake2s_set_lastblock( blake2s_state *S ) +{ + if( S->last_node ) blake2s_set_lastnode( S ); + + S->f[0] = (uint32_t)-1; +} + +static void blake2s_increment_counter( blake2s_state *S, const uint32_t inc ) +{ + S->t[0] += inc; + S->t[1] += ( S->t[0] < inc ); +} + +static void blake2s_init0( blake2s_state *S ) +{ + size_t i; + memset( S, 0, sizeof( blake2s_state ) ); + + for( i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i]; +} + +/* init2 xors IV with input parameter block */ +int blake2s_init_param( blake2s_state *S, const blake2s_param *P ) +{ + const unsigned char *p = ( const unsigned char * )( P ); + size_t i; + + blake2s_init0( S ); + + /* IV XOR ParamBlock */ + for( i = 0; i < 8; ++i ) + S->h[i] ^= load32( &p[i * 4] ); + + S->outlen = P->digest_length; + return 0; +} + + +/* Sequential blake2s initialization */ +int blake2s_init( blake2s_state *S, size_t outlen ) +{ + blake2s_param P[1]; + + /* Move interval verification here? */ + if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; + + P->digest_length = (uint8_t)outlen; + P->key_length = 0; + P->fanout = 1; + P->depth = 1; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, 0 ); + store16( &P->xof_length, 0 ); + P->node_depth = 0; + P->inner_length = 0; + /* memset(P->reserved, 0, sizeof(P->reserved) ); */ + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + return blake2s_init_param( S, P ); +} + +int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ) +{ + blake2s_param P[1]; + + if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; + + if ( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; + + P->digest_length = (uint8_t)outlen; + P->key_length = (uint8_t)keylen; + P->fanout = 1; + P->depth = 1; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, 0 ); + store16( &P->xof_length, 0 ); + P->node_depth = 0; + P->inner_length = 0; + /* memset(P->reserved, 0, sizeof(P->reserved) ); */ + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + + if( blake2s_init_param( S, P ) < 0 ) return -1; + + { + uint8_t block[BLAKE2S_BLOCKBYTES]; + memset( block, 0, BLAKE2S_BLOCKBYTES ); + memcpy( block, key, keylen ); + blake2s_update( S, block, BLAKE2S_BLOCKBYTES ); + secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ + } + return 0; +} + +#define G(r,i,a,b,c,d) \ + do { \ + a = a + b + m[blake2s_sigma[r][2*i+0]]; \ + d = rotr32(d ^ a, 16); \ + c = c + d; \ + b = rotr32(b ^ c, 12); \ + a = a + b + m[blake2s_sigma[r][2*i+1]]; \ + d = rotr32(d ^ a, 8); \ + c = c + d; \ + b = rotr32(b ^ c, 7); \ + } while(0) + +#define ROUND(r) \ + do { \ + G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ + G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ + G(r,2,v[ 2],v[ 6],v[10],v[14]); \ + G(r,3,v[ 3],v[ 7],v[11],v[15]); \ + G(r,4,v[ 0],v[ 5],v[10],v[15]); \ + G(r,5,v[ 1],v[ 6],v[11],v[12]); \ + G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ + G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ + } while(0) + +static void blake2s_compress( blake2s_state *S, const uint8_t in[BLAKE2S_BLOCKBYTES] ) +{ + uint32_t m[16]; + uint32_t v[16]; + size_t i; + + for( i = 0; i < 16; ++i ) { + m[i] = load32( in + i * sizeof( m[i] ) ); + } + + for( i = 0; i < 8; ++i ) { + v[i] = S->h[i]; + } + + v[ 8] = blake2s_IV[0]; + v[ 9] = blake2s_IV[1]; + v[10] = blake2s_IV[2]; + v[11] = blake2s_IV[3]; + v[12] = S->t[0] ^ blake2s_IV[4]; + v[13] = S->t[1] ^ blake2s_IV[5]; + v[14] = S->f[0] ^ blake2s_IV[6]; + v[15] = S->f[1] ^ blake2s_IV[7]; + + ROUND( 0 ); + ROUND( 1 ); + ROUND( 2 ); + ROUND( 3 ); + ROUND( 4 ); + ROUND( 5 ); + ROUND( 6 ); + ROUND( 7 ); + ROUND( 8 ); + ROUND( 9 ); + + for( i = 0; i < 8; ++i ) { + S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; + } +} + +#undef G +#undef ROUND + +int blake2s_update( blake2s_state *S, const void *pin, size_t inlen ) +{ + const unsigned char * in = (const unsigned char *)pin; + if( inlen > 0 ) + { + size_t left = S->buflen; + size_t fill = BLAKE2S_BLOCKBYTES - left; + if( inlen > fill ) + { + S->buflen = 0; + memcpy( S->buf + left, in, fill ); /* Fill buffer */ + blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); + blake2s_compress( S, S->buf ); /* Compress */ + in += fill; inlen -= fill; + while(inlen > BLAKE2S_BLOCKBYTES) { + blake2s_increment_counter(S, BLAKE2S_BLOCKBYTES); + blake2s_compress( S, in ); + in += BLAKE2S_BLOCKBYTES; + inlen -= BLAKE2S_BLOCKBYTES; + } + } + memcpy( S->buf + S->buflen, in, inlen ); + S->buflen += inlen; + } + return 0; +} + +int blake2s_final( blake2s_state *S, void *out, size_t outlen ) +{ + uint8_t buffer[BLAKE2S_OUTBYTES] = {0}; + size_t i; + + if( out == NULL || outlen < S->outlen ) + return -1; + + if( blake2s_is_lastblock( S ) ) + return -1; + + blake2s_increment_counter( S, ( uint32_t )S->buflen ); + blake2s_set_lastblock( S ); + memset( S->buf + S->buflen, 0, BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */ + blake2s_compress( S, S->buf ); + + for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ + store32( buffer + sizeof( S->h[i] ) * i, S->h[i] ); + + memcpy( out, buffer, outlen ); + secure_zero_memory(buffer, sizeof(buffer)); + return 0; +} + +int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) +{ + blake2s_state S[1]; + + /* Verify parameters */ + if ( NULL == in && inlen > 0 ) return -1; + + if ( NULL == out ) return -1; + + if ( NULL == key && keylen > 0) return -1; + + if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; + + if( keylen > BLAKE2S_KEYBYTES ) return -1; + + if( keylen > 0 ) + { + if( blake2s_init_key( S, outlen, key, keylen ) < 0 ) return -1; + } + else + { + if( blake2s_init( S, outlen ) < 0 ) return -1; + } + + blake2s_update( S, ( const uint8_t * )in, inlen ); + blake2s_final( S, out, outlen ); + return 0; +} + +#if defined(SUPERCOP) +int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) +{ + return blake2s( out, BLAKE2S_OUTBYTES, in, inlen, NULL, 0 ); +} +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810271444.w9REieTE045670>