[Midnightbsd-cvs] src [9166] vendor/libarchive/dist: remove old files

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Oct 13 22:43:48 EDT 2016


Revision: 9166
          http://svnweb.midnightbsd.org/src/?rev=9166
Author:   laffer1
Date:     2016-10-13 22:43:48 -0400 (Thu, 13 Oct 2016)
Log Message:
-----------
remove old files

Removed Paths:
-------------
    vendor/libarchive/dist/build/cmake/LibarchiveCheckCSourceCompiles.cmake
    vendor/libarchive/dist/build/cmake/LibarchiveCheckCSourceRuns.cmake
    vendor/libarchive/dist/libarchive/archive_crypto.c
    vendor/libarchive/dist/libarchive/archive_crypto_private.h
    vendor/libarchive/dist/libarchive/test/test_archive_crypto.c
    vendor/libarchive/dist/libarchive/test/test_write_format_zip_no_compression.c
    vendor/libarchive/dist/libarchive/test/test_write_zip_set_compression_store.c

Deleted: vendor/libarchive/dist/build/cmake/LibarchiveCheckCSourceCompiles.cmake
===================================================================
--- vendor/libarchive/dist/build/cmake/LibarchiveCheckCSourceCompiles.cmake	2016-10-14 02:40:30 UTC (rev 9165)
+++ vendor/libarchive/dist/build/cmake/LibarchiveCheckCSourceCompiles.cmake	2016-10-14 02:43:48 UTC (rev 9166)
@@ -1,106 +0,0 @@
-# - Check if given C source compiles and links into an executable
-# CHECK_C_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail-regex>])
-#  <code>       - source code to try to compile, must define 'main'
-#  <var>        - variable to store whether the source code compiled
-#  <fail-regex> - fail if test output matches this regex
-# The following variables may be set before calling this macro to
-# modify the way the check is run:
-#
-#  CMAKE_REQUIRED_FLAGS = string of compile command line flags
-#  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-#  CMAKE_REQUIRED_INCLUDES = list of include directories
-#  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-
-#=============================================================================
-# Copyright 2005-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-#
-# Extra arguments added by libarchive
-# CMAKE_REQUIRED_LINKER_FLAGS = string of linker command line flags
-#
-
-include(CMakeExpandImportedTargets)
-
-
-macro(LIBARCHIVE_CHECK_C_SOURCE_COMPILES SOURCE VAR)
-  if("${VAR}" MATCHES "^${VAR}$")
-    set(_FAIL_REGEX)
-    set(_key)
-    foreach(arg ${ARGN})
-      if("${arg}" MATCHES "^(FAIL_REGEX)$")
-        set(_key "${arg}")
-      elseif(_key)
-        list(APPEND _${_key} "${arg}")
-      else()
-        message(FATAL_ERROR "Unknown argument:\n  ${arg}\n")
-      endif()
-    endforeach()
-    set(MACRO_CHECK_FUNCTION_DEFINITIONS
-      "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    if(CMAKE_REQUIRED_LIBRARIES)
-      # this one translates potentially used imported library targets to their files on disk
-      CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
-      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
-        "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    else()
-      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    endif()
-    if(CMAKE_REQUIRED_INCLUDES)
-      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
-        "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    else()
-      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    endif()
-	if(CMAKE_REQUIRED_LINKER_FLAGS)
-	  set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS
-	    "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}")
-	else()
-	  set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS)
-	endif()
-    file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
-      "${SOURCE}\n")
-
-    message(STATUS "Performing Test ${VAR}")
-    try_compile(${VAR}
-      ${CMAKE_BINARY_DIR}
-      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
-      COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} ${CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS}
-      "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
-      "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
-      OUTPUT_VARIABLE OUTPUT)
-
-    foreach(_regex ${_FAIL_REGEX})
-      if("${OUTPUT}" MATCHES "${_regex}")
-        set(${VAR} 0)
-      endif()
-    endforeach()
-
-    if(${VAR})
-      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      message(STATUS "Performing Test ${VAR} - Success")
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
-        "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
-        "${OUTPUT}\n"
-        "Source file was:\n${SOURCE}\n")
-    else()
-      message(STATUS "Performing Test ${VAR} - Failed")
-      set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
-        "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
-        "${OUTPUT}\n"
-        "Source file was:\n${SOURCE}\n")
-    endif()
-  endif()
-endmacro()
-

Deleted: vendor/libarchive/dist/build/cmake/LibarchiveCheckCSourceRuns.cmake
===================================================================
--- vendor/libarchive/dist/build/cmake/LibarchiveCheckCSourceRuns.cmake	2016-10-14 02:40:30 UTC (rev 9165)
+++ vendor/libarchive/dist/build/cmake/LibarchiveCheckCSourceRuns.cmake	2016-10-14 02:43:48 UTC (rev 9166)
@@ -1,102 +0,0 @@
-# - Check if the given C source code compiles and runs.
-# CHECK_C_SOURCE_RUNS(<code> <var>)
-#  <code>   - source code to try to compile
-#  <var>    - variable to store the result
-#             (1 for success, empty for failure)
-# The following variables may be set before calling this macro to
-# modify the way the check is run:
-#
-#  CMAKE_REQUIRED_FLAGS = string of compile command line flags
-#  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-#  CMAKE_REQUIRED_INCLUDES = list of include directories
-#  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-
-#=============================================================================
-# Copyright 2006-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-#
-# Extra arguments added by libarchive
-# CMAKE_REQUIRED_LINKER_FLAGS = string of linker command line flags
-#
-
-include(CMakeExpandImportedTargets)
-
-
-macro(LIBARCHIVE_CHECK_C_SOURCE_RUNS SOURCE VAR)
-  if("${VAR}" MATCHES "^${VAR}$")
-    set(MACRO_CHECK_FUNCTION_DEFINITIONS
-      "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    if(CMAKE_REQUIRED_LIBRARIES)
-      # this one translates potentially used imported library targets to their files on disk
-      CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES  LIBRARIES  ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
-      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
-        "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
-    else()
-      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    endif()
-    if(CMAKE_REQUIRED_INCLUDES)
-      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
-        "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    else()
-      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    endif()
-	if(CMAKE_REQUIRED_LINKER_FLAGS)
-	  set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS
-	    "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}")
-	else()
-	  set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS)
-	endif()
-    file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
-      "${SOURCE}\n")
-
-    message(STATUS "Performing Test ${VAR}")
-    try_run(${VAR}_EXITCODE ${VAR}_COMPILED
-      ${CMAKE_BINARY_DIR}
-      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
-      COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} ${CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS}
-      -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
-      "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
-      "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
-      COMPILE_OUTPUT_VARIABLE OUTPUT)
-    # if it did not compile make the return value fail code of 1
-    if(NOT ${VAR}_COMPILED)
-      set(${VAR}_EXITCODE 1)
-    endif()
-    # if the return value was 0 then it worked
-    if("${${VAR}_EXITCODE}" EQUAL 0)
-      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      message(STATUS "Performing Test ${VAR} - Success")
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
-        "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
-        "${OUTPUT}\n"
-        "Return value: ${${VAR}}\n"
-        "Source file was:\n${SOURCE}\n")
-    else()
-      if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        set(${VAR} "${${VAR}_EXITCODE}")
-      else()
-        set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      endif()
-
-      message(STATUS "Performing Test ${VAR} - Failed")
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
-        "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
-        "${OUTPUT}\n"
-        "Return value: ${${VAR}_EXITCODE}\n"
-        "Source file was:\n${SOURCE}\n")
-
-    endif()
-  endif()
-endmacro()
-

Deleted: vendor/libarchive/dist/libarchive/archive_crypto.c
===================================================================
--- vendor/libarchive/dist/libarchive/archive_crypto.c	2016-10-14 02:40:30 UTC (rev 9165)
+++ vendor/libarchive/dist/libarchive/archive_crypto.c	2016-10-14 02:43:48 UTC (rev 9166)
@@ -1,1429 +0,0 @@
-/*-
-* Copyright (c) 2003-2007 Tim Kientzle
-* Copyright (c) 2011 Andres Mejia
-* Copyright (c) 2011 Michihiro NAKAJIMA
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-* 1. Redistributions of source code must retain the above copyright
-*    notice, this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright
-*    notice, this list of conditions and the following disclaimer in the
-*    documentation and/or other materials provided with the distribution.
-*
-* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
-* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "archive_platform.h"
-
-#include "archive.h"
-#include "archive_crypto_private.h"
-
-/* In particular, force the configure probe to break if it tries
- * to test a combination of OpenSSL and libmd. */
-#if defined(ARCHIVE_CRYPTO_OPENSSL) && defined(ARCHIVE_CRYPTO_LIBMD)
-#error Cannot use both OpenSSL and libmd.
-#endif
-
-/*
- * Message digest functions for Windows platform.
- */
-#if defined(ARCHIVE_CRYPTO_MD5_WIN)    ||\
-	defined(ARCHIVE_CRYPTO_SHA1_WIN)   ||\
-	defined(ARCHIVE_CRYPTO_SHA256_WIN) ||\
-	defined(ARCHIVE_CRYPTO_SHA384_WIN) ||\
-	defined(ARCHIVE_CRYPTO_SHA512_WIN)
-
-/*
- * Initialize a Message digest.
- */
-static int
-win_crypto_init(Digest_CTX *ctx, ALG_ID algId)
-{
-
-	ctx->valid = 0;
-	if (!CryptAcquireContext(&ctx->cryptProv, NULL, NULL,
-	    PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
-		if (GetLastError() != (DWORD)NTE_BAD_KEYSET)
-			return (ARCHIVE_FAILED);
-		if (!CryptAcquireContext(&ctx->cryptProv, NULL, NULL,
-		    PROV_RSA_FULL, CRYPT_NEWKEYSET))
-			return (ARCHIVE_FAILED);
-	}
-
-	if (!CryptCreateHash(ctx->cryptProv, algId, 0, 0, &ctx->hash)) {
-		CryptReleaseContext(ctx->cryptProv, 0);
-		return (ARCHIVE_FAILED);
-	}
-
-	ctx->valid = 1;
-	return (ARCHIVE_OK);
-}
-
-/*
- * Update a Message digest.
- */
-static int
-win_crypto_Update(Digest_CTX *ctx, const unsigned char *buf, size_t len)
-{
-
-	if (!ctx->valid)
-		return (ARCHIVE_FAILED);
-
-	CryptHashData(ctx->hash,
-		      (unsigned char *)(uintptr_t)buf,
-		      (DWORD)len, 0);
-	return (ARCHIVE_OK);
-}
-
-static int
-win_crypto_Final(unsigned char *buf, size_t bufsize, Digest_CTX *ctx)
-{
-	DWORD siglen = (DWORD)bufsize;
-
-	if (!ctx->valid)
-		return (ARCHIVE_FAILED);
-
-	CryptGetHashParam(ctx->hash, HP_HASHVAL, buf, &siglen, 0);
-	CryptDestroyHash(ctx->hash);
-	CryptReleaseContext(ctx->cryptProv, 0);
-	ctx->valid = 0;
-	return (ARCHIVE_OK);
-}
-
-#endif /* defined(ARCHIVE_CRYPTO_*_WIN) */
-
-
-/* MD5 implementations */
-#if defined(ARCHIVE_CRYPTO_MD5_LIBC)
-
-static int
-__archive_libc_md5init(archive_md5_ctx *ctx)
-{
-  MD5Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc_md5update(archive_md5_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  MD5Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc_md5final(archive_md5_ctx *ctx, void *md)
-{
-  MD5Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_MD5_LIBMD)
-
-static int
-__archive_libmd_md5init(archive_md5_ctx *ctx)
-{
-  MD5Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libmd_md5update(archive_md5_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  MD5Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libmd_md5final(archive_md5_ctx *ctx, void *md)
-{
-  MD5Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM)
-
-static int
-__archive_libsystem_md5init(archive_md5_ctx *ctx)
-{
-  CC_MD5_Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libsystem_md5update(archive_md5_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  CC_MD5_Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libsystem_md5final(archive_md5_ctx *ctx, void *md)
-{
-  CC_MD5_Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_MD5_NETTLE)
-
-static int
-__archive_nettle_md5init(archive_md5_ctx *ctx)
-{
-  md5_init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_nettle_md5update(archive_md5_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  md5_update(ctx, insize, indata);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_nettle_md5final(archive_md5_ctx *ctx, void *md)
-{
-  md5_digest(ctx, MD5_DIGEST_SIZE, md);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL)
-
-static int
-__archive_openssl_md5init(archive_md5_ctx *ctx)
-{
-  EVP_DigestInit(ctx, EVP_md5());
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_openssl_md5update(archive_md5_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  EVP_DigestUpdate(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_openssl_md5final(archive_md5_ctx *ctx, void *md)
-{
-  /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so
-   * this is meant to cope with that. Real fix is probably to fix
-   * archive_write_set_format_xar.c
-   */
-  if (ctx->digest)
-    EVP_DigestFinal(ctx, md, NULL);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_MD5_WIN)
-
-static int
-__archive_windowsapi_md5init(archive_md5_ctx *ctx)
-{
-  return (win_crypto_init(ctx, CALG_MD5));
-}
-
-static int
-__archive_windowsapi_md5update(archive_md5_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  return (win_crypto_Update(ctx, indata, insize));
-}
-
-static int
-__archive_windowsapi_md5final(archive_md5_ctx *ctx, void *md)
-{
-  return (win_crypto_Final(md, 16, ctx));
-}
-
-#else
-
-static int
-__archive_stub_md5init(archive_md5_ctx *ctx)
-{
-	(void)ctx; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-static int
-__archive_stub_md5update(archive_md5_ctx *ctx, const void *indata,
-    size_t insize)
-{
-	(void)ctx; /* UNUSED */
-	(void)indata; /* UNUSED */
-	(void)insize; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-static int
-__archive_stub_md5final(archive_md5_ctx *ctx, void *md)
-{
-	(void)ctx; /* UNUSED */
-	(void)md; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-#endif
-
-/* RIPEMD160 implementations */
-#if defined(ARCHIVE_CRYPTO_RMD160_LIBC)
-
-static int
-__archive_libc_ripemd160init(archive_rmd160_ctx *ctx)
-{
-  RMD160Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc_ripemd160update(archive_rmd160_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  RMD160Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc_ripemd160final(archive_rmd160_ctx *ctx, void *md)
-{
-  RMD160Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_RMD160_LIBMD)
-
-static int
-__archive_libmd_ripemd160init(archive_rmd160_ctx *ctx)
-{
-  RIPEMD160_Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libmd_ripemd160update(archive_rmd160_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  RIPEMD160_Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libmd_ripemd160final(archive_rmd160_ctx *ctx, void *md)
-{
-  RIPEMD160_Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE)
-
-static int
-__archive_nettle_ripemd160init(archive_rmd160_ctx *ctx)
-{
-  ripemd160_init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_nettle_ripemd160update(archive_rmd160_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  ripemd160_update(ctx, insize, indata);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_nettle_ripemd160final(archive_rmd160_ctx *ctx, void *md)
-{
-  ripemd160_digest(ctx, RIPEMD160_DIGEST_SIZE, md);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL)
-
-static int
-__archive_openssl_ripemd160init(archive_rmd160_ctx *ctx)
-{
-  EVP_DigestInit(ctx, EVP_ripemd160());
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_openssl_ripemd160update(archive_rmd160_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  EVP_DigestUpdate(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_openssl_ripemd160final(archive_rmd160_ctx *ctx, void *md)
-{
-  EVP_DigestFinal(ctx, md, NULL);
-  return (ARCHIVE_OK);
-}
-
-#else
-
-static int
-__archive_stub_ripemd160init(archive_rmd160_ctx *ctx)
-{
-	(void)ctx; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-static int
-__archive_stub_ripemd160update(archive_rmd160_ctx *ctx, const void *indata,
-    size_t insize)
-{
-	(void)ctx; /* UNUSED */
-	(void)indata; /* UNUSED */
-	(void)insize; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-static int
-__archive_stub_ripemd160final(archive_rmd160_ctx *ctx, void *md)
-{
-	(void)ctx; /* UNUSED */
-	(void)md; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-#endif
-
-/* SHA1 implementations */
-#if defined(ARCHIVE_CRYPTO_SHA1_LIBC)
-
-static int
-__archive_libc_sha1init(archive_sha1_ctx *ctx)
-{
-  SHA1Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc_sha1update(archive_sha1_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA1Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc_sha1final(archive_sha1_ctx *ctx, void *md)
-{
-  SHA1Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA1_LIBMD)
-
-static int
-__archive_libmd_sha1init(archive_sha1_ctx *ctx)
-{
-  SHA1_Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libmd_sha1update(archive_sha1_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA1_Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libmd_sha1final(archive_sha1_ctx *ctx, void *md)
-{
-  SHA1_Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM)
-
-static int
-__archive_libsystem_sha1init(archive_sha1_ctx *ctx)
-{
-  CC_SHA1_Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libsystem_sha1update(archive_sha1_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  CC_SHA1_Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libsystem_sha1final(archive_sha1_ctx *ctx, void *md)
-{
-  CC_SHA1_Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE)
-
-static int
-__archive_nettle_sha1init(archive_sha1_ctx *ctx)
-{
-  sha1_init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_nettle_sha1update(archive_sha1_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  sha1_update(ctx, insize, indata);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_nettle_sha1final(archive_sha1_ctx *ctx, void *md)
-{
-  sha1_digest(ctx, SHA1_DIGEST_SIZE, md);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL)
-
-static int
-__archive_openssl_sha1init(archive_sha1_ctx *ctx)
-{
-  EVP_DigestInit(ctx, EVP_sha1());
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_openssl_sha1update(archive_sha1_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  EVP_DigestUpdate(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_openssl_sha1final(archive_sha1_ctx *ctx, void *md)
-{
-  /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so
-   * this is meant to cope with that. Real fix is probably to fix
-   * archive_write_set_format_xar.c
-   */
-  if (ctx->digest)
-    EVP_DigestFinal(ctx, md, NULL);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA1_WIN)
-
-static int
-__archive_windowsapi_sha1init(archive_sha1_ctx *ctx)
-{
-  return (win_crypto_init(ctx, CALG_SHA1));
-}
-
-static int
-__archive_windowsapi_sha1update(archive_sha1_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  return (win_crypto_Update(ctx, indata, insize));
-}
-
-static int
-__archive_windowsapi_sha1final(archive_sha1_ctx *ctx, void *md)
-{
-  return (win_crypto_Final(md, 20, ctx));
-}
-
-#else
-
-static int
-__archive_stub_sha1init(archive_sha1_ctx *ctx)
-{
-	(void)ctx; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-static int
-__archive_stub_sha1update(archive_sha1_ctx *ctx, const void *indata,
-    size_t insize)
-{
-	(void)ctx; /* UNUSED */
-	(void)indata; /* UNUSED */
-	(void)insize; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-static int
-__archive_stub_sha1final(archive_sha1_ctx *ctx, void *md)
-{
-	(void)ctx; /* UNUSED */
-	(void)md; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-#endif
-
-/* SHA256 implementations */
-#if defined(ARCHIVE_CRYPTO_SHA256_LIBC)
-
-static int
-__archive_libc_sha256init(archive_sha256_ctx *ctx)
-{
-  SHA256_Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc_sha256update(archive_sha256_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA256_Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc_sha256final(archive_sha256_ctx *ctx, void *md)
-{
-  SHA256_Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA256_LIBC2)
-
-static int
-__archive_libc2_sha256init(archive_sha256_ctx *ctx)
-{
-  SHA256Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc2_sha256update(archive_sha256_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA256Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc2_sha256final(archive_sha256_ctx *ctx, void *md)
-{
-  SHA256Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA256_LIBC3)
-
-static int
-__archive_libc3_sha256init(archive_sha256_ctx *ctx)
-{
-  SHA256Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc3_sha256update(archive_sha256_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA256Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc3_sha256final(archive_sha256_ctx *ctx, void *md)
-{
-  SHA256Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA256_LIBMD)
-
-static int
-__archive_libmd_sha256init(archive_sha256_ctx *ctx)
-{
-  SHA256_Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libmd_sha256update(archive_sha256_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA256_Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libmd_sha256final(archive_sha256_ctx *ctx, void *md)
-{
-  SHA256_Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM)
-
-static int
-__archive_libsystem_sha256init(archive_sha256_ctx *ctx)
-{
-  CC_SHA256_Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libsystem_sha256update(archive_sha256_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  CC_SHA256_Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libsystem_sha256final(archive_sha256_ctx *ctx, void *md)
-{
-  CC_SHA256_Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE)
-
-static int
-__archive_nettle_sha256init(archive_sha256_ctx *ctx)
-{
-  sha256_init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_nettle_sha256update(archive_sha256_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  sha256_update(ctx, insize, indata);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_nettle_sha256final(archive_sha256_ctx *ctx, void *md)
-{
-  sha256_digest(ctx, SHA256_DIGEST_SIZE, md);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL)
-
-static int
-__archive_openssl_sha256init(archive_sha256_ctx *ctx)
-{
-  EVP_DigestInit(ctx, EVP_sha256());
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_openssl_sha256update(archive_sha256_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  EVP_DigestUpdate(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_openssl_sha256final(archive_sha256_ctx *ctx, void *md)
-{
-  EVP_DigestFinal(ctx, md, NULL);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA256_WIN)
-
-static int
-__archive_windowsapi_sha256init(archive_sha256_ctx *ctx)
-{
-  return (win_crypto_init(ctx, CALG_SHA_256));
-}
-
-static int
-__archive_windowsapi_sha256update(archive_sha256_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  return (win_crypto_Update(ctx, indata, insize));
-}
-
-static int
-__archive_windowsapi_sha256final(archive_sha256_ctx *ctx, void *md)
-{
-  return (win_crypto_Final(md, 32, ctx));
-}
-
-#else
-
-static int
-__archive_stub_sha256init(archive_sha256_ctx *ctx)
-{
-	(void)ctx; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-static int
-__archive_stub_sha256update(archive_sha256_ctx *ctx, const void *indata,
-    size_t insize)
-{
-	(void)ctx; /* UNUSED */
-	(void)indata; /* UNUSED */
-	(void)insize; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-static int
-__archive_stub_sha256final(archive_sha256_ctx *ctx, void *md)
-{
-	(void)ctx; /* UNUSED */
-	(void)md; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-#endif
-
-/* SHA384 implementations */
-#if defined(ARCHIVE_CRYPTO_SHA384_LIBC)
-
-static int
-__archive_libc_sha384init(archive_sha384_ctx *ctx)
-{
-  SHA384_Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc_sha384update(archive_sha384_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA384_Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc_sha384final(archive_sha384_ctx *ctx, void *md)
-{
-  SHA384_Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA384_LIBC2)
-
-static int
-__archive_libc2_sha384init(archive_sha384_ctx *ctx)
-{
-  SHA384Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc2_sha384update(archive_sha384_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA384Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc2_sha384final(archive_sha384_ctx *ctx, void *md)
-{
-  SHA384Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA384_LIBC3)
-
-static int
-__archive_libc3_sha384init(archive_sha384_ctx *ctx)
-{
-  SHA384Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc3_sha384update(archive_sha384_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA384Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc3_sha384final(archive_sha384_ctx *ctx, void *md)
-{
-  SHA384Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM)
-
-static int
-__archive_libsystem_sha384init(archive_sha384_ctx *ctx)
-{
-  CC_SHA384_Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libsystem_sha384update(archive_sha384_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  CC_SHA384_Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libsystem_sha384final(archive_sha384_ctx *ctx, void *md)
-{
-  CC_SHA384_Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE)
-
-static int
-__archive_nettle_sha384init(archive_sha384_ctx *ctx)
-{
-  sha384_init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_nettle_sha384update(archive_sha384_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  sha384_update(ctx, insize, indata);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_nettle_sha384final(archive_sha384_ctx *ctx, void *md)
-{
-  sha384_digest(ctx, SHA384_DIGEST_SIZE, md);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA384_OPENSSL)
-
-static int
-__archive_openssl_sha384init(archive_sha384_ctx *ctx)
-{
-  EVP_DigestInit(ctx, EVP_sha384());
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_openssl_sha384update(archive_sha384_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  EVP_DigestUpdate(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_openssl_sha384final(archive_sha384_ctx *ctx, void *md)
-{
-  EVP_DigestFinal(ctx, md, NULL);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA384_WIN)
-
-static int
-__archive_windowsapi_sha384init(archive_sha384_ctx *ctx)
-{
-  return (win_crypto_init(ctx, CALG_SHA_384));
-}
-
-static int
-__archive_windowsapi_sha384update(archive_sha384_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  return (win_crypto_Update(ctx, indata, insize));
-}
-
-static int
-__archive_windowsapi_sha384final(archive_sha384_ctx *ctx, void *md)
-{
-  return (win_crypto_Final(md, 48, ctx));
-}
-
-#else
-
-static int
-__archive_stub_sha384init(archive_sha384_ctx *ctx)
-{
-	(void)ctx; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-static int
-__archive_stub_sha384update(archive_sha384_ctx *ctx, const void *indata,
-    size_t insize)
-{
-	(void)ctx; /* UNUSED */
-	(void)indata; /* UNUSED */
-	(void)insize; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-static int
-__archive_stub_sha384final(archive_sha384_ctx *ctx, void *md)
-{
-	(void)ctx; /* UNUSED */
-	(void)md; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-#endif
-
-/* SHA512 implementations */
-#if defined(ARCHIVE_CRYPTO_SHA512_LIBC)
-
-static int
-__archive_libc_sha512init(archive_sha512_ctx *ctx)
-{
-  SHA512_Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc_sha512update(archive_sha512_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA512_Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc_sha512final(archive_sha512_ctx *ctx, void *md)
-{
-  SHA512_Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA512_LIBC2)
-
-static int
-__archive_libc2_sha512init(archive_sha512_ctx *ctx)
-{
-  SHA512Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc2_sha512update(archive_sha512_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA512Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc2_sha512final(archive_sha512_ctx *ctx, void *md)
-{
-  SHA512Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA512_LIBC3)
-
-static int
-__archive_libc3_sha512init(archive_sha512_ctx *ctx)
-{
-  SHA512Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc3_sha512update(archive_sha512_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA512Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libc3_sha512final(archive_sha512_ctx *ctx, void *md)
-{
-  SHA512Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA512_LIBMD)
-
-static int
-__archive_libmd_sha512init(archive_sha512_ctx *ctx)
-{
-  SHA512_Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libmd_sha512update(archive_sha512_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  SHA512_Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libmd_sha512final(archive_sha512_ctx *ctx, void *md)
-{
-  SHA512_Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA512_LIBSYSTEM)
-
-static int
-__archive_libsystem_sha512init(archive_sha512_ctx *ctx)
-{
-  CC_SHA512_Init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libsystem_sha512update(archive_sha512_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  CC_SHA512_Update(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_libsystem_sha512final(archive_sha512_ctx *ctx, void *md)
-{
-  CC_SHA512_Final(md, ctx);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE)
-
-static int
-__archive_nettle_sha512init(archive_sha512_ctx *ctx)
-{
-  sha512_init(ctx);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_nettle_sha512update(archive_sha512_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  sha512_update(ctx, insize, indata);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_nettle_sha512final(archive_sha512_ctx *ctx, void *md)
-{
-  sha512_digest(ctx, SHA512_DIGEST_SIZE, md);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
-
-static int
-__archive_openssl_sha512init(archive_sha512_ctx *ctx)
-{
-  EVP_DigestInit(ctx, EVP_sha512());
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_openssl_sha512update(archive_sha512_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  EVP_DigestUpdate(ctx, indata, insize);
-  return (ARCHIVE_OK);
-}
-
-static int
-__archive_openssl_sha512final(archive_sha512_ctx *ctx, void *md)
-{
-  EVP_DigestFinal(ctx, md, NULL);
-  return (ARCHIVE_OK);
-}
-
-#elif defined(ARCHIVE_CRYPTO_SHA512_WIN)
-
-static int
-__archive_windowsapi_sha512init(archive_sha512_ctx *ctx)
-{
-  return (win_crypto_init(ctx, CALG_SHA_512));
-}
-
-static int
-__archive_windowsapi_sha512update(archive_sha512_ctx *ctx, const void *indata,
-    size_t insize)
-{
-  return (win_crypto_Update(ctx, indata, insize));
-}
-
-static int
-__archive_windowsapi_sha512final(archive_sha512_ctx *ctx, void *md)
-{
-  return (win_crypto_Final(md, 64, ctx));
-}
-
-#else
-
-static int
-__archive_stub_sha512init(archive_sha512_ctx *ctx)
-{
-	(void)ctx; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-static int
-__archive_stub_sha512update(archive_sha512_ctx *ctx, const void *indata,
-    size_t insize)
-{
-	(void)ctx; /* UNUSED */
-	(void)indata; /* UNUSED */
-	(void)insize; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-static int
-__archive_stub_sha512final(archive_sha512_ctx *ctx, void *md)
-{
-	(void)ctx; /* UNUSED */
-	(void)md; /* UNUSED */
-	return (ARCHIVE_FAILED);
-}
-
-#endif
-
-/* NOTE: Crypto functions are set based on availability and by the following
- * order of preference.
- * 1. libc
- * 2. libc2
- * 3. libc3
- * 4. libSystem
- * 5. Nettle
- * 6. OpenSSL
- * 7. libmd
- * 8. Windows API
- */
-const struct archive_crypto __archive_crypto =
-{
-/* MD5 */
-#if defined(ARCHIVE_CRYPTO_MD5_LIBC)
-  &__archive_libc_md5init,
-  &__archive_libc_md5update,
-  &__archive_libc_md5final,
-#elif defined(ARCHIVE_CRYPTO_MD5_LIBMD)
-  &__archive_libmd_md5init,
-  &__archive_libmd_md5update,
-  &__archive_libmd_md5final,
-#elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM)
-  &__archive_libsystem_md5init,
-  &__archive_libsystem_md5update,
-  &__archive_libsystem_md5final,
-#elif defined(ARCHIVE_CRYPTO_MD5_NETTLE)
-  &__archive_nettle_md5init,
-  &__archive_nettle_md5update,
-  &__archive_nettle_md5final,
-#elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL)
-  &__archive_openssl_md5init,
-  &__archive_openssl_md5update,
-  &__archive_openssl_md5final,
-#elif defined(ARCHIVE_CRYPTO_MD5_WIN)
-  &__archive_windowsapi_md5init,
-  &__archive_windowsapi_md5update,
-  &__archive_windowsapi_md5final,
-#elif !defined(ARCHIVE_MD5_COMPILE_TEST)
-  &__archive_stub_md5init,
-  &__archive_stub_md5update,
-  &__archive_stub_md5final,
-#endif
-
-/* RIPEMD160 */
-#if defined(ARCHIVE_CRYPTO_RMD160_LIBC)
-  &__archive_libc_ripemd160init,
-  &__archive_libc_ripemd160update,
-  &__archive_libc_ripemd160final,
-#elif defined(ARCHIVE_CRYPTO_RMD160_LIBMD)
-  &__archive_libmd_ripemd160init,
-  &__archive_libmd_ripemd160update,
-  &__archive_libmd_ripemd160final,
-#elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE)
-  &__archive_nettle_ripemd160init,
-  &__archive_nettle_ripemd160update,
-  &__archive_nettle_ripemd160final,
-#elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL)
-  &__archive_openssl_ripemd160init,
-  &__archive_openssl_ripemd160update,
-  &__archive_openssl_ripemd160final,
-#elif !defined(ARCHIVE_RMD160_COMPILE_TEST)
-  &__archive_stub_ripemd160init,
-  &__archive_stub_ripemd160update,
-  &__archive_stub_ripemd160final,
-#endif
-
-/* SHA1 */
-#if defined(ARCHIVE_CRYPTO_SHA1_LIBC)
-  &__archive_libc_sha1init,
-  &__archive_libc_sha1update,
-  &__archive_libc_sha1final,
-#elif defined(ARCHIVE_CRYPTO_SHA1_LIBMD)
-  &__archive_libmd_sha1init,
-  &__archive_libmd_sha1update,
-  &__archive_libmd_sha1final,
-#elif defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM)
-  &__archive_libsystem_sha1init,
-  &__archive_libsystem_sha1update,
-  &__archive_libsystem_sha1final,
-#elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE)
-  &__archive_nettle_sha1init,
-  &__archive_nettle_sha1update,
-  &__archive_nettle_sha1final,
-#elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL)
-  &__archive_openssl_sha1init,
-  &__archive_openssl_sha1update,
-  &__archive_openssl_sha1final,
-#elif defined(ARCHIVE_CRYPTO_SHA1_WIN)
-  &__archive_windowsapi_sha1init,
-  &__archive_windowsapi_sha1update,
-  &__archive_windowsapi_sha1final,
-#elif !defined(ARCHIVE_SHA1_COMPILE_TEST)
-  &__archive_stub_sha1init,
-  &__archive_stub_sha1update,
-  &__archive_stub_sha1final,
-#endif
-
-/* SHA256 */
-#if defined(ARCHIVE_CRYPTO_SHA256_LIBC)
-  &__archive_libc_sha256init,
-  &__archive_libc_sha256update,
-  &__archive_libc_sha256final,
-#elif defined(ARCHIVE_CRYPTO_SHA256_LIBC2)
-  &__archive_libc2_sha256init,
-  &__archive_libc2_sha256update,
-  &__archive_libc2_sha256final,
-#elif defined(ARCHIVE_CRYPTO_SHA256_LIBC3)
-  &__archive_libc3_sha256init,
-  &__archive_libc3_sha256update,
-  &__archive_libc3_sha256final,
-#elif defined(ARCHIVE_CRYPTO_SHA256_LIBMD)
-  &__archive_libmd_sha256init,
-  &__archive_libmd_sha256update,
-  &__archive_libmd_sha256final,
-#elif defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM)
-  &__archive_libsystem_sha256init,
-  &__archive_libsystem_sha256update,
-  &__archive_libsystem_sha256final,
-#elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE)
-  &__archive_nettle_sha256init,
-  &__archive_nettle_sha256update,
-  &__archive_nettle_sha256final,
-#elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL)
-  &__archive_openssl_sha256init,
-  &__archive_openssl_sha256update,
-  &__archive_openssl_sha256final,
-#elif defined(ARCHIVE_CRYPTO_SHA256_WIN)
-  &__archive_windowsapi_sha256init,
-  &__archive_windowsapi_sha256update,
-  &__archive_windowsapi_sha256final,
-#elif !defined(ARCHIVE_SHA256_COMPILE_TEST)
-  &__archive_stub_sha256init,
-  &__archive_stub_sha256update,
-  &__archive_stub_sha256final,
-#endif
-
-/* SHA384 */
-#if defined(ARCHIVE_CRYPTO_SHA384_LIBC)
-  &__archive_libc_sha384init,
-  &__archive_libc_sha384update,
-  &__archive_libc_sha384final,
-#elif defined(ARCHIVE_CRYPTO_SHA384_LIBC2)
-  &__archive_libc2_sha384init,
-  &__archive_libc2_sha384update,
-  &__archive_libc2_sha384final,
-#elif defined(ARCHIVE_CRYPTO_SHA384_LIBC3)
-  &__archive_libc3_sha384init,
-  &__archive_libc3_sha384update,
-  &__archive_libc3_sha384final,
-#elif defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM)
-  &__archive_libsystem_sha384init,
-  &__archive_libsystem_sha384update,
-  &__archive_libsystem_sha384final,
-#elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE)
-  &__archive_nettle_sha384init,
-  &__archive_nettle_sha384update,
-  &__archive_nettle_sha384final,
-#elif defined(ARCHIVE_CRYPTO_SHA384_OPENSSL)
-  &__archive_openssl_sha384init,
-  &__archive_openssl_sha384update,
-  &__archive_openssl_sha384final,
-#elif defined(ARCHIVE_CRYPTO_SHA384_WIN)
-  &__archive_windowsapi_sha384init,
-  &__archive_windowsapi_sha384update,
-  &__archive_windowsapi_sha384final,
-#elif !defined(ARCHIVE_SHA384_COMPILE_TEST)
-  &__archive_stub_sha384init,
-  &__archive_stub_sha384update,
-  &__archive_stub_sha384final,
-#endif
-
-/* SHA512 */
-#if defined(ARCHIVE_CRYPTO_SHA512_LIBC)
-  &__archive_libc_sha512init,
-  &__archive_libc_sha512update,
-  &__archive_libc_sha512final
-#elif defined(ARCHIVE_CRYPTO_SHA512_LIBC2)
-  &__archive_libc2_sha512init,
-  &__archive_libc2_sha512update,
-  &__archive_libc2_sha512final
-#elif defined(ARCHIVE_CRYPTO_SHA512_LIBC3)
-  &__archive_libc3_sha512init,
-  &__archive_libc3_sha512update,
-  &__archive_libc3_sha512final
-#elif defined(ARCHIVE_CRYPTO_SHA512_LIBMD)
-  &__archive_libmd_sha512init,
-  &__archive_libmd_sha512update,
-  &__archive_libmd_sha512final
-#elif defined(ARCHIVE_CRYPTO_SHA512_LIBSYSTEM)
-  &__archive_libsystem_sha512init,
-  &__archive_libsystem_sha512update,
-  &__archive_libsystem_sha512final
-#elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE)
-  &__archive_nettle_sha512init,
-  &__archive_nettle_sha512update,
-  &__archive_nettle_sha512final,
-#elif defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
-  &__archive_openssl_sha512init,
-  &__archive_openssl_sha512update,
-  &__archive_openssl_sha512final
-#elif defined(ARCHIVE_CRYPTO_SHA512_WIN)
-  &__archive_windowsapi_sha512init,
-  &__archive_windowsapi_sha512update,
-  &__archive_windowsapi_sha512final
-#elif !defined(ARCHIVE_SHA512_COMPILE_TEST)
-  &__archive_stub_sha512init,
-  &__archive_stub_sha512update,
-  &__archive_stub_sha512final
-#endif
-};

Deleted: vendor/libarchive/dist/libarchive/archive_crypto_private.h
===================================================================
--- vendor/libarchive/dist/libarchive/archive_crypto_private.h	2016-10-14 02:40:30 UTC (rev 9165)
+++ vendor/libarchive/dist/libarchive/archive_crypto_private.h	2016-10-14 02:43:48 UTC (rev 9166)
@@ -1,376 +0,0 @@
-/*-
-* Copyright (c) 2003-2007 Tim Kientzle
-* Copyright (c) 2011 Andres Mejia
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-* 1. Redistributions of source code must retain the above copyright
-*    notice, this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright
-*    notice, this list of conditions and the following disclaimer in the
-*    documentation and/or other materials provided with the distribution.
-*
-* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
-* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-* 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_CRYPTO_PRIVATE_H_INCLUDED
-#define ARCHIVE_CRYPTO_PRIVATE_H_INCLUDED
-
-/*
- * Crypto support in various Operating Systems:
- *
- * NetBSD:
- * - MD5 and SHA1 in libc: without _ after algorithm name
- * - SHA2 in libc: with _ after algorithm name
- *
- * OpenBSD:
- * - MD5, SHA1 and SHA2 in libc: without _ after algorithm name
- * - OpenBSD 4.4 and earlier have SHA2 in libc with _ after algorithm name
- *
- * DragonFly and FreeBSD:
- * - MD5 libmd: without _ after algorithm name
- * - SHA1, SHA256 and SHA512 in libmd: with _ after algorithm name
- *
- * Mac OS X (10.4 and later):
- * - MD5, SHA1 and SHA2 in libSystem: with CC_ prefix and _ after algorithm name
- *
- * OpenSSL:
- * - MD5, SHA1 and SHA2 in libcrypto: with _ after algorithm name
- *
- * Windows:
- * - MD5, SHA1 and SHA2 in archive_crypto.c using Windows crypto API
- */
-
-/* libc crypto headers */
-#if defined(ARCHIVE_CRYPTO_MD5_LIBC)
-#include <md5.h>
-#endif
-#if defined(ARCHIVE_CRYPTO_RMD160_LIBC)
-#include <rmd160.h>
-#endif
-#if defined(ARCHIVE_CRYPTO_SHA1_LIBC)
-#include <sha1.h>
-#endif
-#if defined(ARCHIVE_CRYPTO_SHA256_LIBC) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_LIBC2) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_LIBC3) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_LIBC) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_LIBC2) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_LIBC3) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_LIBC) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_LIBC2) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_LIBC3)
-#include <sha2.h>
-#endif
-
-/* libmd crypto headers */
-#if defined(ARCHIVE_CRYPTO_MD5_LIBMD) ||\
-  defined(ARCHIVE_CRYPTO_RMD160_LIBMD) ||\
-  defined(ARCHIVE_CRYPTO_SHA1_LIBMD) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_LIBMD) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_LIBMD)
-#define	ARCHIVE_CRYPTO_LIBMD 1
-#endif
-
-#if defined(ARCHIVE_CRYPTO_MD5_LIBMD)
-#include <md5.h>
-#endif
-#if defined(ARCHIVE_CRYPTO_RMD160_LIBMD)
-#include <ripemd.h>
-#endif
-#if defined(ARCHIVE_CRYPTO_SHA1_LIBMD)
-#include <sha.h>
-#endif
-#if defined(ARCHIVE_CRYPTO_SHA256_LIBMD)
-#include <sha256.h>
-#endif
-#if defined(ARCHIVE_CRYPTO_SHA512_LIBMD)
-#include <sha512.h>
-#endif
-
-/* libSystem crypto headers */
-#if defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) ||\
-  defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_LIBSYSTEM)
-#include <CommonCrypto/CommonDigest.h>
-#endif
-
-/* Nettle crypto headers */
-#if defined(ARCHIVE_CRYPTO_MD5_NETTLE)
-#include <nettle/md5.h>
-#endif
-#if defined(ARCHIVE_CRYPTO_RMD160_NETTLE)
-#include <nettle/ripemd160.h>
-#endif
-#if defined(ARCHIVE_CRYPTO_SHA1_NETTLE) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_NETTLE) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_NETTLE) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_NETTLE)
-#include <nettle/sha.h>
-#endif
-
-/* OpenSSL crypto headers */
-#if defined(ARCHIVE_CRYPTO_MD5_OPENSSL) ||\
-  defined(ARCHIVE_CRYPTO_RMD160_OPENSSL) ||\
-  defined(ARCHIVE_CRYPTO_SHA1_OPENSSL) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
-#define	ARCHIVE_CRYPTO_OPENSSL 1
-#include <openssl/evp.h>
-#endif
-
-/* Windows crypto headers */
-#if defined(ARCHIVE_CRYPTO_MD5_WIN)    ||\
-  defined(ARCHIVE_CRYPTO_SHA1_WIN)   ||\
-  defined(ARCHIVE_CRYPTO_SHA256_WIN) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_WIN) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_WIN)
-#include <wincrypt.h>
-typedef struct {
-  int   valid;
-  HCRYPTPROV  cryptProv;
-  HCRYPTHASH  hash;
-} Digest_CTX;
-#endif
-
-/* typedefs */
-#if defined(ARCHIVE_CRYPTO_MD5_LIBC)
-typedef MD5_CTX archive_md5_ctx;
-#elif defined(ARCHIVE_CRYPTO_MD5_LIBMD)
-typedef MD5_CTX archive_md5_ctx;
-#elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM)
-typedef CC_MD5_CTX archive_md5_ctx;
-#elif defined(ARCHIVE_CRYPTO_MD5_NETTLE)
-typedef struct md5_ctx archive_md5_ctx;
-#elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL)
-typedef EVP_MD_CTX archive_md5_ctx;
-#elif defined(ARCHIVE_CRYPTO_MD5_WIN)
-typedef Digest_CTX archive_md5_ctx;
-#else
-typedef unsigned char archive_md5_ctx;
-#endif
-
-#if defined(ARCHIVE_CRYPTO_RMD160_LIBC)
-typedef RMD160_CTX archive_rmd160_ctx;
-#elif defined(ARCHIVE_CRYPTO_RMD160_LIBMD)
-typedef RIPEMD160_CTX archive_rmd160_ctx;
-#elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE)
-typedef struct ripemd160_ctx archive_rmd160_ctx;
-#elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL)
-typedef EVP_MD_CTX archive_rmd160_ctx;
-#else
-typedef unsigned char archive_rmd160_ctx;
-#endif
-
-#if defined(ARCHIVE_CRYPTO_SHA1_LIBC)
-typedef SHA1_CTX archive_sha1_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA1_LIBMD)
-typedef SHA1_CTX archive_sha1_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM)
-typedef CC_SHA1_CTX archive_sha1_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE)
-typedef struct sha1_ctx archive_sha1_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL)
-typedef EVP_MD_CTX archive_sha1_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA1_WIN)
-typedef Digest_CTX archive_sha1_ctx;
-#else
-typedef unsigned char archive_sha1_ctx;
-#endif
-
-#if defined(ARCHIVE_CRYPTO_SHA256_LIBC)
-typedef SHA256_CTX archive_sha256_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA256_LIBC2)
-typedef SHA256_CTX archive_sha256_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA256_LIBC3)
-typedef SHA2_CTX archive_sha256_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA256_LIBMD)
-typedef SHA256_CTX archive_sha256_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM)
-typedef CC_SHA256_CTX archive_sha256_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE)
-typedef struct sha256_ctx archive_sha256_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL)
-typedef EVP_MD_CTX archive_sha256_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA256_WIN)
-typedef Digest_CTX archive_sha256_ctx;
-#else
-typedef unsigned char archive_sha256_ctx;
-#endif
-
-#if defined(ARCHIVE_CRYPTO_SHA384_LIBC)
-typedef SHA384_CTX archive_sha384_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA384_LIBC2)
-typedef SHA384_CTX archive_sha384_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA384_LIBC3)
-typedef SHA2_CTX archive_sha384_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM)
-typedef CC_SHA512_CTX archive_sha384_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE)
-typedef struct sha384_ctx archive_sha384_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA384_OPENSSL)
-typedef EVP_MD_CTX archive_sha384_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA384_WIN)
-typedef Digest_CTX archive_sha384_ctx;
-#else
-typedef unsigned char archive_sha384_ctx;
-#endif
-
-#if defined(ARCHIVE_CRYPTO_SHA512_LIBC)
-typedef SHA512_CTX archive_sha512_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA512_LIBC2)
-typedef SHA512_CTX archive_sha512_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA512_LIBC3)
-typedef SHA2_CTX archive_sha512_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA512_LIBMD)
-typedef SHA512_CTX archive_sha512_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA512_LIBSYSTEM)
-typedef CC_SHA512_CTX archive_sha512_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE)
-typedef struct sha512_ctx archive_sha512_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
-typedef EVP_MD_CTX archive_sha512_ctx;
-#elif defined(ARCHIVE_CRYPTO_SHA512_WIN)
-typedef Digest_CTX archive_sha512_ctx;
-#else
-typedef unsigned char archive_sha512_ctx;
-#endif
-
-/* defines */
-#if defined(ARCHIVE_CRYPTO_MD5_LIBC) ||\
-  defined(ARCHIVE_CRYPTO_MD5_LIBMD) ||	\
-  defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) ||\
-  defined(ARCHIVE_CRYPTO_MD5_NETTLE) ||\
-  defined(ARCHIVE_CRYPTO_MD5_OPENSSL) ||\
-  defined(ARCHIVE_CRYPTO_MD5_WIN)
-#define ARCHIVE_HAS_MD5
-#endif
-#define archive_md5_init(ctx)\
-  __archive_crypto.md5init(ctx)
-#define archive_md5_final(ctx, md)\
-  __archive_crypto.md5final(ctx, md)
-#define archive_md5_update(ctx, buf, n)\
-  __archive_crypto.md5update(ctx, buf, n)
-
-#if defined(ARCHIVE_CRYPTO_RMD160_LIBC) ||\
-  defined(ARCHIVE_CRYPTO_RMD160_NETTLE) ||\
-  defined(ARCHIVE_CRYPTO_RMD160_OPENSSL)
-#define ARCHIVE_HAS_RMD160
-#endif
-#define archive_rmd160_init(ctx)\
-  __archive_crypto.rmd160init(ctx)
-#define archive_rmd160_final(ctx, md)\
-  __archive_crypto.rmd160final(ctx, md)
-#define archive_rmd160_update(ctx, buf, n)\
-  __archive_crypto.rmd160update(ctx, buf, n)
-
-#if defined(ARCHIVE_CRYPTO_SHA1_LIBC) ||\
-  defined(ARCHIVE_CRYPTO_SHA1_LIBMD) ||	\
-  defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM) ||\
-  defined(ARCHIVE_CRYPTO_SHA1_NETTLE) ||\
-  defined(ARCHIVE_CRYPTO_SHA1_OPENSSL) ||\
-  defined(ARCHIVE_CRYPTO_SHA1_WIN)
-#define ARCHIVE_HAS_SHA1
-#endif
-#define archive_sha1_init(ctx)\
-  __archive_crypto.sha1init(ctx)
-#define archive_sha1_final(ctx, md)\
-  __archive_crypto.sha1final(ctx, md)
-#define archive_sha1_update(ctx, buf, n)\
-  __archive_crypto.sha1update(ctx, buf, n)
-
-#if defined(ARCHIVE_CRYPTO_SHA256_LIBC) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_LIBC2) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_LIBC3) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_LIBMD) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_NETTLE) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) ||\
-  defined(ARCHIVE_CRYPTO_SHA256_WIN)
-#define ARCHIVE_HAS_SHA256
-#endif
-#define archive_sha256_init(ctx)\
-  __archive_crypto.sha256init(ctx)
-#define archive_sha256_final(ctx, md)\
-  __archive_crypto.sha256final(ctx, md)
-#define archive_sha256_update(ctx, buf, n)\
-  __archive_crypto.sha256update(ctx, buf, n)
-
-#if defined(ARCHIVE_CRYPTO_SHA384_LIBC) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_LIBC2) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_LIBC3) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_NETTLE) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) ||\
-  defined(ARCHIVE_CRYPTO_SHA384_WIN)
-#define ARCHIVE_HAS_SHA384
-#endif
-#define archive_sha384_init(ctx)\
-  __archive_crypto.sha384init(ctx)
-#define archive_sha384_final(ctx, md)\
-  __archive_crypto.sha384final(ctx, md)
-#define archive_sha384_update(ctx, buf, n)\
-  __archive_crypto.sha384update(ctx, buf, n)
-
-#if defined(ARCHIVE_CRYPTO_SHA512_LIBC) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_LIBC2) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_LIBC3) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_LIBMD) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_LIBSYSTEM) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_NETTLE) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_OPENSSL) ||\
-  defined(ARCHIVE_CRYPTO_SHA512_WIN)
-#define ARCHIVE_HAS_SHA512
-#endif
-#define archive_sha512_init(ctx)\
-  __archive_crypto.sha512init(ctx)
-#define archive_sha512_final(ctx, md)\
-  __archive_crypto.sha512final(ctx, md)
-#define archive_sha512_update(ctx, buf, n)\
-  __archive_crypto.sha512update(ctx, buf, n)
-
-/* Minimal interface to crypto functionality for internal use in libarchive */
-struct archive_crypto
-{
-  /* Message Digest */
-  int (*md5init)(archive_md5_ctx *ctx);
-  int (*md5update)(archive_md5_ctx *, const void *, size_t);
-  int (*md5final)(archive_md5_ctx *, void *);
-  int (*rmd160init)(archive_rmd160_ctx *);
-  int (*rmd160update)(archive_rmd160_ctx *, const void *, size_t);
-  int (*rmd160final)(archive_rmd160_ctx *, void *);
-  int (*sha1init)(archive_sha1_ctx *);
-  int (*sha1update)(archive_sha1_ctx *, const void *, size_t);
-  int (*sha1final)(archive_sha1_ctx *, void *);
-  int (*sha256init)(archive_sha256_ctx *);
-  int (*sha256update)(archive_sha256_ctx *, const void *, size_t);
-  int (*sha256final)(archive_sha256_ctx *, void *);
-  int (*sha384init)(archive_sha384_ctx *);
-  int (*sha384update)(archive_sha384_ctx *, const void *, size_t);
-  int (*sha384final)(archive_sha384_ctx *, void *);
-  int (*sha512init)(archive_sha512_ctx *);
-  int (*sha512update)(archive_sha512_ctx *, const void *, size_t);
-  int (*sha512final)(archive_sha512_ctx *, void *);
-};
-
-extern const struct archive_crypto __archive_crypto;
-
-#endif

Deleted: vendor/libarchive/dist/libarchive/test/test_archive_crypto.c
===================================================================
--- vendor/libarchive/dist/libarchive/test/test_archive_crypto.c	2016-10-14 02:40:30 UTC (rev 9165)
+++ vendor/libarchive/dist/libarchive/test/test_archive_crypto.c	2016-10-14 02:43:48 UTC (rev 9166)
@@ -1,145 +0,0 @@
-/*-
- * Copyright (c) 2003-2007 Tim Kientzle
- * Copyright (c) 2011 Andres Mejia
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "test.h"
-
-/* Sanity test of internal crypto functionality */
-
-#define __LIBARCHIVE_BUILD 1
-#include "archive_crypto_private.h"
-
-DEFINE_TEST(test_archive_md5)
-{
-	archive_md5_ctx ctx;
-	unsigned char buf[] = "";
-	unsigned char md[16];
-	unsigned char actualmd[] = "\x93\xb8\x85\xad\xfe\x0d\xa0\x89"
-                             "\xcd\xf6\x34\x90\x4f\xd5\x9f\x71";
-
-	if (ARCHIVE_OK != archive_md5_init(&ctx)) {
-		skipping("This platform does not support MD5");
-		return;
-	}
-	assertEqualInt(ARCHIVE_OK, archive_md5_update(&ctx, buf, sizeof(buf)));
-	assertEqualInt(ARCHIVE_OK, archive_md5_final(&ctx, md));
-	assertEqualMem(md, actualmd, sizeof(md));
-}
-
-DEFINE_TEST(test_archive_rmd160)
-{
-	archive_rmd160_ctx ctx;
-	unsigned char buf[] = "";
-	unsigned char md[20];
-	unsigned char actualmd[] = "\xc8\x1b\x94\x93\x34\x20\x22\x1a\x7a\xc0"
-                             "\x04\xa9\x02\x42\xd8\xb1\xd3\xe5\x07\x0d";
-
-	if (ARCHIVE_OK != archive_rmd160_init(&ctx)) {
-		skipping("This platform does not support RMD160");
-		return;
-	}
-	assertEqualInt(ARCHIVE_OK, archive_rmd160_update(&ctx, buf, sizeof(buf)));
-	assertEqualInt(ARCHIVE_OK, archive_rmd160_final(&ctx, md));
-	assertEqualMem(md, actualmd, sizeof(md));
-}
-
-DEFINE_TEST(test_archive_sha1)
-{
-	archive_sha1_ctx ctx;
-	unsigned char buf[] = "";
-	unsigned char md[20];
-	unsigned char actualmd[] = "\x5b\xa9\x3c\x9d\xb0\xcf\xf9\x3f\x52\xb5"
-                             "\x21\xd7\x42\x0e\x43\xf6\xed\xa2\x78\x4f";
-
-	if (ARCHIVE_OK != archive_sha1_init(&ctx)) {
-		skipping("This platform does not support SHA1");
-		return;
-	}
-	assertEqualInt(ARCHIVE_OK, archive_sha1_update(&ctx, buf, sizeof(buf)));
-	assertEqualInt(ARCHIVE_OK, archive_sha1_final(&ctx, md));
-	assertEqualMem(md, actualmd, sizeof(md));
-}
-
-DEFINE_TEST(test_archive_sha256)
-{
-	archive_sha256_ctx ctx;
-	unsigned char buf[] = "";
-	unsigned char md[32];
-	unsigned char actualmd[] = "\x6e\x34\x0b\x9c\xff\xb3\x7a\x98"
-                             "\x9c\xa5\x44\xe6\xbb\x78\x0a\x2c"
-                             "\x78\x90\x1d\x3f\xb3\x37\x38\x76"
-                             "\x85\x11\xa3\x06\x17\xaf\xa0\x1d";
-
-	if (ARCHIVE_OK != archive_sha256_init(&ctx)) {
-		skipping("This platform does not support SHA256");
-		return;
-	}
-	assertEqualInt(ARCHIVE_OK, archive_sha256_update(&ctx, buf, sizeof(buf)));
-	assertEqualInt(ARCHIVE_OK, archive_sha256_final(&ctx, md));
-	assertEqualMem(md, actualmd, sizeof(md));
-}
-
-DEFINE_TEST(test_archive_sha384)
-{
-	archive_sha384_ctx ctx;
-	unsigned char buf[] = "";
-	unsigned char md[48];
-	unsigned char actualmd[] = "\xbe\xc0\x21\xb4\xf3\x68\xe3\x06"
-                             "\x91\x34\xe0\x12\xc2\xb4\x30\x70"
-                             "\x83\xd3\xa9\xbd\xd2\x06\xe2\x4e"
-                             "\x5f\x0d\x86\xe1\x3d\x66\x36\x65"
-                             "\x59\x33\xec\x2b\x41\x34\x65\x96"
-                             "\x68\x17\xa9\xc2\x08\xa1\x17\x17";
-
-	if (ARCHIVE_OK != archive_sha384_init(&ctx)) {
-		skipping("This platform does not support SHA384");
-		return;
-	}
-	assertEqualInt(ARCHIVE_OK, archive_sha384_update(&ctx, buf, sizeof(buf)));
-	assertEqualInt(ARCHIVE_OK, archive_sha384_final(&ctx, md));
-	assertEqualMem(md, actualmd, sizeof(md));
-}
-
-DEFINE_TEST(test_archive_sha512)
-{
-	archive_sha512_ctx ctx;
-	unsigned char buf[] = "";
-	unsigned char md[64];
-	unsigned char actualmd[] = "\xb8\x24\x4d\x02\x89\x81\xd6\x93"
-                             "\xaf\x7b\x45\x6a\xf8\xef\xa4\xca"
-                             "\xd6\x3d\x28\x2e\x19\xff\x14\x94"
-                             "\x2c\x24\x6e\x50\xd9\x35\x1d\x22"
-                             "\x70\x4a\x80\x2a\x71\xc3\x58\x0b"
-                             "\x63\x70\xde\x4c\xeb\x29\x3c\x32"
-                             "\x4a\x84\x23\x34\x25\x57\xd4\xe5"
-                             "\xc3\x84\x38\xf0\xe3\x69\x10\xee";
-
-	if (ARCHIVE_OK != archive_sha512_init(&ctx)) {
-		skipping("This platform does not support SHA512");
-		return;
-	}
-	assertEqualInt(ARCHIVE_OK, archive_sha512_update(&ctx, buf, sizeof(buf)));
-	assertEqualInt(ARCHIVE_OK, archive_sha512_final(&ctx, md));
-	assertEqualMem(md, actualmd, sizeof(md));
-}

Deleted: vendor/libarchive/dist/libarchive/test/test_write_format_zip_no_compression.c
===================================================================
--- vendor/libarchive/dist/libarchive/test/test_write_format_zip_no_compression.c	2016-10-14 02:40:30 UTC (rev 9165)
+++ vendor/libarchive/dist/libarchive/test/test_write_format_zip_no_compression.c	2016-10-14 02:43:48 UTC (rev 9166)
@@ -1,310 +0,0 @@
-/*-
- * Copyright (c) 2008 Anselm Strauss
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Development supported by Google Summer of Code 2008.
- */
-
-#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_zip_no_compression.c 201247 2009-12-30 05:59:21Z kientzle $");
-
-static unsigned long
-bitcrc32(unsigned long c, void *_p, size_t s)
-{
-	/* This is a drop-in replacement for crc32() from zlib.
-	 * Libarchive should be able to correctly generate
-	 * uncompressed zip archives (including correct CRCs) even
-	 * when zlib is unavailable, and this function helps us verify
-	 * that.  Yes, this is very, very slow and unsuitable for
-	 * production use, but it's correct, compact, and works well
-	 * enough for this particular usage.  Libarchive internally
-	 * uses a much more efficient implementation.  */
-	const unsigned char *p = _p;
-	int bitctr;
-
-	if (p == NULL)
-		return (0);
-
-	for (; s > 0; --s) {
-		c ^= *p++;
-		for (bitctr = 8; bitctr > 0; --bitctr) {
-			if (c & 1) c = (c >> 1);
-			else	   c = (c >> 1) ^ 0xedb88320;
-			c ^= 0x80000000;
-		}
-	}
-	return (c);
-}
-
-/* Quick and dirty: Read 2-byte and 4-byte integers from Zip file. */
-static int i2(const char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); }
-static int i4(const char *p) { return (i2(p) | (i2(p + 2) << 16)); }
-
-DEFINE_TEST(test_write_format_zip_no_compression)
-{
-	/* Buffer data */
-	struct archive *a;
-	struct archive_entry *entry;
-	char buff[100000];
-	const char *buffend;
-	/* p is the pointer to walk over the central directory,
-	 * q walks over the local headers, the data and the data descriptors. */
-	const char *p, *q;
-	size_t used;
-
-	/* File data */
-	char file_name[] = "file";
-	char file_data1[] = {'1', '2', '3', '4', '5'};
-	char file_data2[] = {'6', '7', '8', '9', '0'};
-	int file_perm = 00644;
-	short file_uid = 10;
-	short file_gid = 20;
-
-	/* Folder data */
-	char folder_name[] = "folder/";
-	int folder_perm = 00755;
-	short folder_uid = 30;
-	short folder_gid = 40;
-
-	/* Time data */
-	time_t t = time(NULL);
-	struct tm *tm = localtime(&t);
-
-	/* Misc variables */
-	unsigned long crc;
-
-	/* Create new ZIP archive in memory without padding. */
-	assert((a = archive_write_new()) != NULL);
-	assertA(0 == archive_write_set_format_zip(a));
-	assertA(0 == archive_write_set_options(a, "zip:compression=store"));
-	assertA(0 == archive_write_add_filter_none(a));
-	assertA(0 == archive_write_set_bytes_per_block(a, 1));
-	assertA(0 == archive_write_set_bytes_in_last_block(a, 1));
-	assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
-
-	/* Write entries. */
-
-	/* Regular file */
-	assert((entry = archive_entry_new()) != NULL);
-	archive_entry_set_pathname(entry, file_name);
-	archive_entry_set_mode(entry, S_IFREG | 0644);
-	archive_entry_set_size(entry, sizeof(file_data1) + sizeof(file_data2));
-	archive_entry_set_uid(entry, file_uid);
-	archive_entry_set_gid(entry, file_gid);
-	archive_entry_set_mtime(entry, t, 0);
-	archive_entry_set_atime(entry, t, 0);
-	archive_entry_set_ctime(entry, t, 0);
-	assertEqualIntA(a, 0, archive_write_header(a, entry));
-	assertEqualIntA(a, sizeof(file_data1), archive_write_data(a, file_data1, sizeof(file_data1)));
-	assertEqualIntA(a, sizeof(file_data2), archive_write_data(a, file_data2, sizeof(file_data2)));
-	archive_entry_free(entry);
-
-	/* Folder */
-	assert((entry = archive_entry_new()) != NULL);
-	archive_entry_set_pathname(entry, folder_name);
-	archive_entry_set_mode(entry, S_IFDIR | folder_perm);
-	archive_entry_set_size(entry, 0);
-	archive_entry_set_uid(entry, folder_uid);
-	archive_entry_set_gid(entry, folder_gid);
-	archive_entry_set_mtime(entry, t, 0);
-	archive_entry_set_atime(entry, t, 0);
-	archive_entry_set_ctime(entry, t, 0);
-	assertEqualIntA(a, 0, archive_write_header(a, entry));
-	archive_entry_free(entry);
-
-	/* Close the archive . */
-	assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
-	assertEqualInt(ARCHIVE_OK, archive_write_free(a));
-
-	/* Remember the end of the archive in memory. */
-	buffend = buff + used;
-
-	/* Verify "End of Central Directory" record. */
-	/* Get address of end-of-central-directory record. */
-	p = buffend - 22; /* Assumes there is no zip comment field. */
-	failure("End-of-central-directory begins with PK\\005\\006 signature");
-	assertEqualMem(p, "PK\005\006", 4);
-	failure("This must be disk 0");
-	assertEqualInt(i2(p + 4), 0);
-	failure("Central dir must start on disk 0");
-	assertEqualInt(i2(p + 6), 0);
-	failure("All central dir entries are on this disk");
-	assertEqualInt(i2(p + 8), i2(p + 10));
-	failure("CD start (%d) + CD length (%d) should == archive size - 22",
-	    i4(p + 12), i4(p + 16));
-	assertEqualInt(i4(p + 12) + i4(p + 16), used - 22);
-	failure("no zip comment");
-	assertEqualInt(i2(p + 20), 0);
-
-	/* Get address of first entry in central directory. */
-	p = buff + i4(buffend - 6);
-	failure("Central file record at offset %d should begin with"
-	    " PK\\001\\002 signature",
-	    i4(buffend - 10));
-
-	/* Verify file entry in central directory. */
-	assertEqualMem(p, "PK\001\002", 4); /* Signature */
-	assertEqualInt(i2(p + 4), 3 * 256 + 20); /* Version made by */
-	assertEqualInt(i2(p + 6), 20); /* Version needed to extract */
-	assertEqualInt(i2(p + 8), 8); /* Flags */
-	assertEqualInt(i2(p + 10), 0); /* Compression method */
-	assertEqualInt(i2(p + 12), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
-	assertEqualInt(i2(p + 14), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
-	crc = bitcrc32(0, file_data1, sizeof(file_data1));
-	crc = bitcrc32(crc, file_data2, sizeof(file_data2));
-	assertEqualInt(i4(p + 16), crc); /* CRC-32 */
-	assertEqualInt(i4(p + 20), sizeof(file_data1) + sizeof(file_data2)); /* Compressed size */
-	assertEqualInt(i4(p + 24), sizeof(file_data1) + sizeof(file_data2)); /* Uncompressed size */
-	assertEqualInt(i2(p + 28), strlen(file_name)); /* Pathname length */
-	assertEqualInt(i2(p + 30), 13); /* Extra field length */
-	assertEqualInt(i2(p + 32), 0); /* File comment length */
-	assertEqualInt(i2(p + 34), 0); /* Disk number start */
-	assertEqualInt(i2(p + 36), 0); /* Internal file attrs */
-	assertEqualInt(i4(p + 38) >> 16 & 01777, file_perm); /* External file attrs */
-	assertEqualInt(i4(p + 42), 0); /* Offset of local header */
-	assertEqualMem(p + 46, file_name, strlen(file_name)); /* Pathname */
-	p = p + 46 + strlen(file_name);
-	assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
-	assertEqualInt(i2(p + 2), 5); /* 'UT' size */
-	assertEqualInt(p[4], 7); /* 'UT' flags */
-	assertEqualInt(i4(p + 5), t); /* 'UT' mtime */
-	p = p + 9;
-	assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
-	assertEqualInt(i2(p + 2), 0); /* 'ux' size */
-	p = p + 4;
-
-	/* Verify local header of file entry. */
-	q = buff;
-	assertEqualMem(q, "PK\003\004", 4); /* Signature */
-	assertEqualInt(i2(q + 4), 20); /* Version needed to extract */
-	assertEqualInt(i2(q + 6), 8); /* Flags */
-	assertEqualInt(i2(q + 8), 0); /* Compression method */
-	assertEqualInt(i2(q + 10), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
-	assertEqualInt(i2(q + 12), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
-	assertEqualInt(i4(q + 14), 0); /* CRC-32 */
-	assertEqualInt(i4(q + 18), sizeof(file_data1) + sizeof(file_data2)); /* Compressed size */
-	assertEqualInt(i4(q + 22), sizeof(file_data1) + sizeof(file_data2)); /* Uncompressed size */
-	assertEqualInt(i2(q + 26), strlen(file_name)); /* Pathname length */
-	assertEqualInt(i2(q + 28), 32); /* Extra field length */
-	assertEqualMem(q + 30, file_name, strlen(file_name)); /* Pathname */
-	q = q + 30 + strlen(file_name);
-	assertEqualInt(i2(q), 0x5455); /* 'UT' extension header */
-	assertEqualInt(i2(q + 2), 13); /* 'UT' size */
-	assertEqualInt(q[4], 7); /* 'UT' flags */
-	assertEqualInt(i4(q + 5), t); /* 'UT' mtime */
-	assertEqualInt(i4(q + 9), t); /* 'UT' atime */
-	assertEqualInt(i4(q + 13), t); /* 'UT' ctime */
-	q = q + 17;
-	assertEqualInt(i2(q), 0x7875); /* 'ux' extension header */
-	assertEqualInt(i2(q + 2), 11); /* 'ux' size */
-	assertEqualInt(q[4], 1); /* 'ux' version */
-	assertEqualInt(q[5], 4); /* 'ux' uid size */
-	assertEqualInt(i4(q + 6), file_uid); /* 'Ux' UID */
-	assertEqualInt(q[10], 4); /* 'ux' gid size */
-	assertEqualInt(i4(q + 11), file_gid); /* 'Ux' GID */
-	q = q + 15;
-
-	/* Verify data of file entry. */
-	assertEqualMem(q, file_data1, sizeof(file_data1));
-	assertEqualMem(q + sizeof(file_data1), file_data2, sizeof(file_data2));
-	q = q + sizeof(file_data1) + sizeof(file_data2);
-
-	/* Verify data descriptor of file entry. */
-	assertEqualMem(q, "PK\007\010", 4); /* Signature */
-	assertEqualInt(i4(q + 4), crc); /* CRC-32 */
-	assertEqualInt(i4(q + 8), sizeof(file_data1) + sizeof(file_data2)); /* Compressed size */
-	assertEqualInt(i4(q + 12), sizeof(file_data1) + sizeof(file_data2)); /* Uncompressed size */
-	q = q + 16;
-
-	/* Verify folder entry in central directory. */
-	assertEqualMem(p, "PK\001\002", 4); /* Signature */
-	assertEqualInt(i2(p + 4), 3 * 256 + 20); /* Version made by */
-	assertEqualInt(i2(p + 6), 20); /* Version needed to extract */
-	assertEqualInt(i2(p + 8), 8); /* Flags */
-	assertEqualInt(i2(p + 10), 0); /* Compression method */
-	assertEqualInt(i2(p + 12), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
-	assertEqualInt(i2(p + 14), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
-	crc = 0;
-	assertEqualInt(i4(p + 16), crc); /* CRC-32 */
-	assertEqualInt(i4(p + 20), 0); /* Compressed size */
-	assertEqualInt(i4(p + 24), 0); /* Uncompressed size */
-	assertEqualInt(i2(p + 28), strlen(folder_name)); /* Pathname length */
-	assertEqualInt(i2(p + 30), 13); /* Extra field length */
-	assertEqualInt(i2(p + 32), 0); /* File comment length */
-	assertEqualInt(i2(p + 34), 0); /* Disk number start */
-	assertEqualInt(i2(p + 36), 0); /* Internal file attrs */
-	assertEqualInt(i4(p + 38) >> 16 & 01777, folder_perm); /* External file attrs */
-	assertEqualInt(i4(p + 42), q - buff); /* Offset of local header */
-	assertEqualMem(p + 46, folder_name, strlen(folder_name)); /* Pathname */
-	p = p + 46 + strlen(folder_name);
-	assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
-	assertEqualInt(i2(p + 2), 5); /* 'UT' size */
-	assertEqualInt(p[4], 7); /* 'UT' flags */
-	assertEqualInt(i4(p + 5), t); /* 'UT' mtime */
-	p = p + 9;
-	assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
-	assertEqualInt(i2(p + 2), 0); /* 'ux' size */
-	/*p = p + 4;*/
-
-	/* Verify local header of folder entry. */
-	assertEqualMem(q, "PK\003\004", 4); /* Signature */
-	assertEqualInt(i2(q + 4), 20); /* Version needed to extract */
-	assertEqualInt(i2(q + 6), 8); /* Flags */
-	assertEqualInt(i2(q + 8), 0); /* Compression method */
-	assertEqualInt(i2(q + 10), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
-	assertEqualInt(i2(q + 12), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
-	assertEqualInt(i4(q + 14), 0); /* CRC-32 */
-	assertEqualInt(i4(q + 18), 0); /* Compressed size */
-	assertEqualInt(i4(q + 22), 0); /* Uncompressed size */
-	assertEqualInt(i2(q + 26), strlen(folder_name)); /* Pathname length */
-	assertEqualInt(i2(q + 28), 32); /* Extra field length */
-	assertEqualMem(q + 30, folder_name, strlen(folder_name)); /* Pathname */
-	q = q + 30 + strlen(folder_name);
-	assertEqualInt(i2(q), 0x5455); /* 'UT' extension header */
-	assertEqualInt(i2(q + 2), 13); /* 'UT' size */
-	assertEqualInt(q[4], 7); /* 'UT' flags */
-	assertEqualInt(i4(q + 5), t); /* 'UT' mtime */
-	assertEqualInt(i4(q + 9), t); /* 'UT' atime */
-	assertEqualInt(i4(q + 13), t); /* 'UT' ctime */
-	q = q + 17;
-	assertEqualInt(i2(q), 0x7875); /* 'ux' extension header */
-	assertEqualInt(i2(q + 2), 11); /* 'ux' size */
-	assertEqualInt(q[4], 1); /* 'ux' version */
-	assertEqualInt(q[5], 4); /* 'ux' uid size */
-	assertEqualInt(i4(q + 6), folder_uid); /* 'ux' UID */
-	assertEqualInt(q[10], 4); /* 'ux' gid size */
-	assertEqualInt(i4(q + 11), folder_gid); /* 'ux' GID */
-	q = q + 15;
-
-	/* There should not be any data in the folder entry,
-	 * meaning next is the data descriptor header. */
-
-	/* Verify data descriptor of folder entry. */
-	assertEqualMem(q, "PK\007\010", 4); /* Signature */
-	assertEqualInt(i4(q + 4), crc); /* CRC-32 */
-	assertEqualInt(i4(q + 8), 0); /* Compressed size */
-	assertEqualInt(i4(q + 12), 0); /* Uncompressed size */
-	/*q = q + 16;*/
-}

Deleted: vendor/libarchive/dist/libarchive/test/test_write_zip_set_compression_store.c
===================================================================
--- vendor/libarchive/dist/libarchive/test/test_write_zip_set_compression_store.c	2016-10-14 02:40:30 UTC (rev 9165)
+++ vendor/libarchive/dist/libarchive/test/test_write_zip_set_compression_store.c	2016-10-14 02:43:48 UTC (rev 9166)
@@ -1,308 +0,0 @@
-/*-
- * Copyright (c) 2012 Matthias Brantner
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "test.h"
-
-static unsigned long
-bitcrc32(unsigned long c, void *_p, size_t s)
-{
-	/* This is a drop-in replacement for crc32() from zlib.
-	 * Libarchive should be able to correctly generate
-	 * uncompressed zip archives (including correct CRCs) even
-	 * when zlib is unavailable, and this function helps us verify
-	 * that.  Yes, this is very, very slow and unsuitable for
-	 * production use, but it's correct, compact, and works well
-	 * enough for this particular usage.  Libarchive internally
-	 * uses a much more efficient implementation.  */
-	const unsigned char *p = _p;
-	int bitctr;
-
-	if (p == NULL)
-		return (0);
-
-	for (; s > 0; --s) {
-		c ^= *p++;
-		for (bitctr = 8; bitctr > 0; --bitctr) {
-			if (c & 1) c = (c >> 1);
-			else	   c = (c >> 1) ^ 0xedb88320;
-			c ^= 0x80000000;
-		}
-	}
-	return (c);
-}
-
-/* Quick and dirty: Read 2-byte and 4-byte integers from Zip file. */
-static int i2(const char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); }
-static int i4(const char *p) { return (i2(p) | (i2(p + 2) << 16)); }
-
-DEFINE_TEST(test_write_zip_set_compression_store)
-{
-	/* Buffer data */
-	struct archive *a;
-	struct archive_entry *entry;
-	char buff[100000];
-	const char *buffend;
-	/* p is the pointer to walk over the central directory,
-	 * q walks over the local headers, the data and the data descriptors. */
-	const char *p, *q;
-	size_t used;
-
-	/* File data */
-	char file_name[] = "file";
-	char file_data1[] = {'1', '2', '3', '4', '5'};
-	char file_data2[] = {'6', '7', '8', '9', '0'};
-	int file_perm = 00644;
-	short file_uid = 10;
-	short file_gid = 20;
-
-	/* Folder data */
-	char folder_name[] = "folder/";
-	int folder_perm = 00755;
-	short folder_uid = 30;
-	short folder_gid = 40;
-
-	/* Time data */
-	time_t t = time(NULL);
-	struct tm *tm = localtime(&t);
-
-	/* Misc variables */
-	unsigned long crc;
-
-	/* Create new ZIP archive in memory without padding. */
-	assert((a = archive_write_new()) != NULL);
-	assertA(0 == archive_write_set_format_zip(a));
-	assertA(0 == archive_write_add_filter_none(a));
-	assertA(0 == archive_write_set_bytes_per_block(a, 1));
-	assertA(0 == archive_write_set_bytes_in_last_block(a, 1));
-	assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
-
-	/* Write entries. */
-
-	/* Regular file */
-	assert((entry = archive_entry_new()) != NULL);
-	archive_entry_set_pathname(entry, file_name);
-	archive_entry_set_mode(entry, S_IFREG | 0644);
-	archive_entry_set_size(entry, sizeof(file_data1) + sizeof(file_data2));
-	archive_entry_set_uid(entry, file_uid);
-	archive_entry_set_gid(entry, file_gid);
-	archive_entry_set_mtime(entry, t, 0);
-	archive_entry_set_atime(entry, t, 0);
-	archive_entry_set_ctime(entry, t, 0);
-	archive_write_zip_set_compression_store(a);
-	assertEqualIntA(a, 0, archive_write_header(a, entry));
-	assertEqualIntA(a, sizeof(file_data1), archive_write_data(a, file_data1, sizeof(file_data1)));
-	assertEqualIntA(a, sizeof(file_data2), archive_write_data(a, file_data2, sizeof(file_data2)));
-	archive_entry_free(entry);
-	archive_write_finish_entry(a);
-
-	/* Folder */
-	assert((entry = archive_entry_new()) != NULL);
-	archive_entry_set_pathname(entry, folder_name);
-	archive_entry_set_mode(entry, S_IFDIR | folder_perm);
-	archive_entry_set_size(entry, 0);
-	archive_entry_set_uid(entry, folder_uid);
-	archive_entry_set_gid(entry, folder_gid);
-	archive_entry_set_mtime(entry, t, 0);
-	archive_entry_set_atime(entry, t, 0);
-	archive_entry_set_ctime(entry, t, 0);
-	archive_write_zip_set_compression_store(a);
-	assertEqualIntA(a, 0, archive_write_header(a, entry));
-	archive_entry_free(entry);
-	archive_write_finish_entry(a);
-
-	/* Close the archive . */
-	assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
-	assertEqualInt(ARCHIVE_OK, archive_write_free(a));
-
-	/* Remember the end of the archive in memory. */
-	buffend = buff + used;
-
-	/* Verify "End of Central Directory" record. */
-	/* Get address of end-of-central-directory record. */
-	p = buffend - 22; /* Assumes there is no zip comment field. */
-	failure("End-of-central-directory begins with PK\\005\\006 signature");
-	assertEqualMem(p, "PK\005\006", 4);
-	failure("This must be disk 0");
-	assertEqualInt(i2(p + 4), 0);
-	failure("Central dir must start on disk 0");
-	assertEqualInt(i2(p + 6), 0);
-	failure("All central dir entries are on this disk");
-	assertEqualInt(i2(p + 8), i2(p + 10));
-	failure("CD start (%d) + CD length (%d) should == archive size - 22",
-	    i4(p + 12), i4(p + 16));
-	assertEqualInt(i4(p + 12) + i4(p + 16), used - 22);
-	failure("no zip comment");
-	assertEqualInt(i2(p + 20), 0);
-
-	/* Get address of first entry in central directory. */
-	p = buff + i4(buffend - 6);
-	failure("Central file record at offset %d should begin with"
-	    " PK\\001\\002 signature",
-	    i4(buffend - 10));
-
-	/* Verify file entry in central directory. */
-	assertEqualMem(p, "PK\001\002", 4); /* Signature */
-	assertEqualInt(i2(p + 4), 3 * 256 + 20); /* Version made by */
-	assertEqualInt(i2(p + 6), 20); /* Version needed to extract */
-	assertEqualInt(i2(p + 8), 8); /* Flags */
-	assertEqualInt(i2(p + 10), 0); /* Compression method */
-	assertEqualInt(i2(p + 12), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
-	assertEqualInt(i2(p + 14), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
-	crc = bitcrc32(0, file_data1, sizeof(file_data1));
-	crc = bitcrc32(crc, file_data2, sizeof(file_data2));
-	assertEqualInt(i4(p + 16), crc); /* CRC-32 */
-	assertEqualInt(i4(p + 20), sizeof(file_data1) + sizeof(file_data2)); /* Compressed size */
-	assertEqualInt(i4(p + 24), sizeof(file_data1) + sizeof(file_data2)); /* Uncompressed size */
-	assertEqualInt(i2(p + 28), strlen(file_name)); /* Pathname length */
-	assertEqualInt(i2(p + 30), 13); /* Extra field length */
-	assertEqualInt(i2(p + 32), 0); /* File comment length */
-	assertEqualInt(i2(p + 34), 0); /* Disk number start */
-	assertEqualInt(i2(p + 36), 0); /* Internal file attrs */
-	assertEqualInt(i4(p + 38) >> 16 & 01777, file_perm); /* External file attrs */
-	assertEqualInt(i4(p + 42), 0); /* Offset of local header */
-	assertEqualMem(p + 46, file_name, strlen(file_name)); /* Pathname */
-	p = p + 46 + strlen(file_name);
-	assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
-	assertEqualInt(i2(p + 2), 5); /* 'UT' size */
-	assertEqualInt(p[4], 7); /* 'UT' flags */
-	assertEqualInt(i4(p + 5), t); /* 'UT' mtime */
-	p = p + 9;
-	assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
-	assertEqualInt(i2(p + 2), 0); /* 'ux' size */
-	p = p + 4;
-
-	/* Verify local header of file entry. */
-	q = buff;
-	assertEqualMem(q, "PK\003\004", 4); /* Signature */
-	assertEqualInt(i2(q + 4), 20); /* Version needed to extract */
-	assertEqualInt(i2(q + 6), 8); /* Flags */
-	assertEqualInt(i2(q + 8), 0); /* Compression method */
-	assertEqualInt(i2(q + 10), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
-	assertEqualInt(i2(q + 12), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
-	assertEqualInt(i4(q + 14), 0); /* CRC-32 */
-	assertEqualInt(i4(q + 18), sizeof(file_data1) + sizeof(file_data2)); /* Compressed size */
-	assertEqualInt(i4(q + 22), sizeof(file_data1) + sizeof(file_data2)); /* Uncompressed size */
-	assertEqualInt(i2(q + 26), strlen(file_name)); /* Pathname length */
-	assertEqualInt(i2(q + 28), 32); /* Extra field length */
-	assertEqualMem(q + 30, file_name, strlen(file_name)); /* Pathname */
-	q = q + 30 + strlen(file_name);
-	assertEqualInt(i2(q), 0x5455); /* 'UT' extension header */
-	assertEqualInt(i2(q + 2), 13); /* 'UT' size */
-	assertEqualInt(q[4], 7); /* 'UT' flags */
-	assertEqualInt(i4(q + 5), t); /* 'UT' mtime */
-	assertEqualInt(i4(q + 9), t); /* 'UT' atime */
-	assertEqualInt(i4(q + 13), t); /* 'UT' ctime */
-	q = q + 17;
-	assertEqualInt(i2(q), 0x7875); /* 'ux' extension header */
-	assertEqualInt(i2(q + 2), 11); /* 'ux' size */
-	assertEqualInt(q[4], 1); /* 'ux' version */
-	assertEqualInt(q[5], 4); /* 'ux' uid size */
-	assertEqualInt(i4(q + 6), file_uid); /* 'Ux' UID */
-	assertEqualInt(q[10], 4); /* 'ux' gid size */
-	assertEqualInt(i4(q + 11), file_gid); /* 'Ux' GID */
-	q = q + 15;
-
-	/* Verify data of file entry. */
-	assertEqualMem(q, file_data1, sizeof(file_data1));
-	assertEqualMem(q + sizeof(file_data1), file_data2, sizeof(file_data2));
-	q = q + sizeof(file_data1) + sizeof(file_data2);
-
-	/* Verify data descriptor of file entry. */
-	assertEqualMem(q, "PK\007\010", 4); /* Signature */
-	assertEqualInt(i4(q + 4), crc); /* CRC-32 */
-	assertEqualInt(i4(q + 8), sizeof(file_data1) + sizeof(file_data2)); /* Compressed size */
-	assertEqualInt(i4(q + 12), sizeof(file_data1) + sizeof(file_data2)); /* Uncompressed size */
-	q = q + 16;
-
-	/* Verify folder entry in central directory. */
-	assertEqualMem(p, "PK\001\002", 4); /* Signature */
-	assertEqualInt(i2(p + 4), 3 * 256 + 20); /* Version made by */
-	assertEqualInt(i2(p + 6), 20); /* Version needed to extract */
-	assertEqualInt(i2(p + 8), 8); /* Flags */
-	assertEqualInt(i2(p + 10), 0); /* Compression method */
-	assertEqualInt(i2(p + 12), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
-	assertEqualInt(i2(p + 14), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
-	crc = 0;
-	assertEqualInt(i4(p + 16), crc); /* CRC-32 */
-	assertEqualInt(i4(p + 20), 0); /* Compressed size */
-	assertEqualInt(i4(p + 24), 0); /* Uncompressed size */
-	assertEqualInt(i2(p + 28), strlen(folder_name)); /* Pathname length */
-	assertEqualInt(i2(p + 30), 13); /* Extra field length */
-	assertEqualInt(i2(p + 32), 0); /* File comment length */
-	assertEqualInt(i2(p + 34), 0); /* Disk number start */
-	assertEqualInt(i2(p + 36), 0); /* Internal file attrs */
-	assertEqualInt(i4(p + 38) >> 16 & 01777, folder_perm); /* External file attrs */
-	assertEqualInt(i4(p + 42), q - buff); /* Offset of local header */
-	assertEqualMem(p + 46, folder_name, strlen(folder_name)); /* Pathname */
-	p = p + 46 + strlen(folder_name);
-	assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
-	assertEqualInt(i2(p + 2), 5); /* 'UT' size */
-	assertEqualInt(p[4], 7); /* 'UT' flags */
-	assertEqualInt(i4(p + 5), t); /* 'UT' mtime */
-	p = p + 9;
-	assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
-	assertEqualInt(i2(p + 2), 0); /* 'ux' size */
-	/*p = p + 4;*/
-
-	/* Verify local header of folder entry. */
-	assertEqualMem(q, "PK\003\004", 4); /* Signature */
-	assertEqualInt(i2(q + 4), 20); /* Version needed to extract */
-	assertEqualInt(i2(q + 6), 8); /* Flags */
-	assertEqualInt(i2(q + 8), 0); /* Compression method */
-	assertEqualInt(i2(q + 10), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
-	assertEqualInt(i2(q + 12), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
-	assertEqualInt(i4(q + 14), 0); /* CRC-32 */
-	assertEqualInt(i4(q + 18), 0); /* Compressed size */
-	assertEqualInt(i4(q + 22), 0); /* Uncompressed size */
-	assertEqualInt(i2(q + 26), strlen(folder_name)); /* Pathname length */
-	assertEqualInt(i2(q + 28), 32); /* Extra field length */
-	assertEqualMem(q + 30, folder_name, strlen(folder_name)); /* Pathname */
-	q = q + 30 + strlen(folder_name);
-	assertEqualInt(i2(q), 0x5455); /* 'UT' extension header */
-	assertEqualInt(i2(q + 2), 13); /* 'UT' size */
-	assertEqualInt(q[4], 7); /* 'UT' flags */
-	assertEqualInt(i4(q + 5), t); /* 'UT' mtime */
-	assertEqualInt(i4(q + 9), t); /* 'UT' atime */
-	assertEqualInt(i4(q + 13), t); /* 'UT' ctime */
-	q = q + 17;
-	assertEqualInt(i2(q), 0x7875); /* 'ux' extension header */
-	assertEqualInt(i2(q + 2), 11); /* 'ux' size */
-	assertEqualInt(q[4], 1); /* 'ux' version */
-	assertEqualInt(q[5], 4); /* 'ux' uid size */
-	assertEqualInt(i4(q + 6), folder_uid); /* 'ux' UID */
-	assertEqualInt(q[10], 4); /* 'ux' gid size */
-	assertEqualInt(i4(q + 11), folder_gid); /* 'ux' GID */
-	q = q + 15;
-
-	/* There should not be any data in the folder entry,
-	 * meaning next is the data descriptor header. */
-
-	/* Verify data descriptor of folder entry. */
-	assertEqualMem(q, "PK\007\010", 4); /* Signature */
-	assertEqualInt(i4(q + 4), crc); /* CRC-32 */
-	assertEqualInt(i4(q + 8), 0); /* Compressed size */
-	assertEqualInt(i4(q + 12), 0); /* Uncompressed size */
-	/*q = q + 16;*/
-}



More information about the Midnightbsd-cvs mailing list