From 138e5e7c1dfba4717a4e6d5abb1abb0f82d6f49f Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 1 Jan 2025 10:37:56 +0100 Subject: Windows: Update libzip to version 1.11.2 --- src/Common/libzip/zip_crypto_openssl.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/Common/libzip/zip_crypto_openssl.c') diff --git a/src/Common/libzip/zip_crypto_openssl.c b/src/Common/libzip/zip_crypto_openssl.c index 7f1da10e..9e9e8e7c 100644 --- a/src/Common/libzip/zip_crypto_openssl.c +++ b/src/Common/libzip/zip_crypto_openssl.c @@ -1,6 +1,6 @@ /* zip_crypto_openssl.c -- OpenSSL wrapper. - Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2023 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -126,8 +126,9 @@ _zip_crypto_aes_free(_zip_crypto_aes_t *aes) { bool _zip_crypto_aes_encrypt_block(_zip_crypto_aes_t *aes, const zip_uint8_t *in, zip_uint8_t *out) { - int len; - if (EVP_EncryptUpdate(aes, out, &len, in, ZIP_CRYPTO_AES_BLOCK_LENGTH) != 1) { + int len = 0; + if (EVP_EncryptUpdate(aes, out, &len, in, ZIP_CRYPTO_AES_BLOCK_LENGTH) != 1 + || len != ZIP_CRYPTO_AES_BLOCK_LENGTH) { return false; } return true; @@ -214,11 +215,11 @@ _zip_crypto_hmac_free(_zip_crypto_hmac_t *hmac) { bool _zip_crypto_hmac_output(_zip_crypto_hmac_t *hmac, zip_uint8_t *data) { #ifdef USE_OPENSSL_3_API - size_t length; + size_t length = 0; return EVP_MAC_final(hmac->ctx, data, &length, ZIP_CRYPTO_SHA1_LENGTH) == 1 && length == ZIP_CRYPTO_SHA1_LENGTH; #else - unsigned int length; - return HMAC_Final(hmac, data, &length) == 1; + unsigned int length = 0; + return HMAC_Final(hmac, data, &length) == 1 && length == ZIP_CRYPTO_SHA1_LENGTH; #endif } -- cgit v1.2.3