[libzip] update to rel-1-6-1 (#10784)

* Libzip updated to rel-1-6-1

* [libzip] Add windows_crypto feature

The new BCrypt/CNG-based crypto uses BCryptDeriveKeyPBKDF2 which is only
available since WinNT 6.1. It is important to me as a consumer of libzip
through vcpkg to be able to turn this off.

* Additional options added.

* Common Crypto supported as an option for encryption backend.

Co-authored-by: Michał Janiszewski <janisozaur+signed@gmail.com>
This commit is contained in:
mitzal 2020-04-24 06:40:21 +02:00 committed by GitHub
parent 6717e1b9d0
commit 242897b046
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 32 deletions

View File

@ -1,14 +1,32 @@
Source: libzip
Version: rel-1-5-2--1
Version: rel-1-6-1
Homepage: https://github.com/nih-at/libzip
Build-Depends: zlib
Default-Features: openssl, bzip2
Description: A library for reading, creating, and modifying zip archives.
Default-Features: bzip2,default-aes
Description: A library for reading, creating, and modifying zip archives
Feature: bzip2
Build-Depends: bzip2
Description: Support bzip2-compressed zip archives
Feature: liblzma
Build-Depends: liblzma
Description: Support XZ compressed zip archives using liblzma
Feature: default-aes
Build-Depends: libzip[core,openssl](!(windows|osx)),libzip[core,wincrypto](windows),libzip[core,commoncrypto](osx)
Description: Use default AES
Feature: openssl
Build-Depends: openssl
Description: AES (encryption) support using OpenSSL
Feature: wincrypto
Description: AES (encryption) support using Windows Crypto API
Feature: commoncrypto
Description: AES( encryption) support using Apple's Common Crypto API
Feature: mbedtls
Build-Depends: mbedtls
Description: AES (encryption) support using mbedtls

View File

@ -1,13 +0,0 @@
diff --git a/lib/zip_source_winzip_aes_encode.c b/lib/zip_source_winzip_aes_encode.c
index c428c9a..4e5f753 100644
--- a/lib/zip_source_winzip_aes_encode.c
+++ b/lib/zip_source_winzip_aes_encode.c
@@ -163,7 +163,7 @@ winzip_aes_encrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t length,
/* TODO: return partial read? */
return -1;
}
- buffer_n += _zip_buffer_read(ctx->buffer, data + ret, length - (zip_uint64_t)ret);
+ buffer_n += _zip_buffer_read(ctx->buffer, (zip_uint8_t *)data + ret, length - (zip_uint64_t)ret);
}
return (zip_int64_t)(buffer_n + (zip_uint64_t)ret);

View File

@ -1,34 +1,31 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO nih-at/libzip
REF rel-1-5-2
SHA512 5ba765c5d4ab47dff24bfa5e73b798046126fcc88b29d5d9ce9d77d035499ae91d90cc526f1f73bbefa07b7b68ff6cf77e912e5793859f801caaf2061cb20aee
REF rel-1-6-1
SHA512 7ee414c063f9f76bec7d96ff9dadbc4be8d37a7b907b977882bf40f8ab66f0e46d3b8f70083c7bd272cc298d855d0d72b494b5772f26e1f4ff7ffeefe780adaf
HEAD_REF master
PATCHES avoid_computation_on_void_pointer.patch
)
# AES encryption
set(USE_OPENSSL OFF)
if("openssl" IN_LIST FEATURES)
set(USE_OPENSSL ON)
endif()
set(USE_BZIP2 OFF)
if("bzip2" IN_LIST FEATURES)
set(USE_BZIP2 ON)
endif()
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
bzip2 ENABLE_BZIP2
liblzma ENABLE_LZMA
openssl ENABLE_OPENSSL
wincrypto ENABLE_WINDOWS_CRYPTO
commoncrypto ENABLE_COMMONCRYPTO
mbedtls ENABLE_MBEDTLS
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
${FEATURE_OPTIONS}
-DBUILD_DOC=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_REGRESS=OFF
-DBUILD_TOOLS=OFF
# see https://github.com/nih-at/libzip/blob/rel-1-5-2/INSTALL.md
-DENABLE_OPENSSL=${USE_OPENSSL}
-DENABLE_BZIP2=${USE_BZIP2}
-DENABLE_GNUTLS=OFF
)
vcpkg_install_cmake()