List Archive

Thread

Thread Index

Message

From: Andrew Molyneux <andrew%molyneuxfamily.co.uk@localhost>
To: Thomas Klausner <tk%giga.or.at@localhost>
Subject: Re: Winzip AES support committed
Date: Sat, 24 Dec 2016 18:53:36 +0000

On 16 December 2016 at 15:17, Thomas Klausner <tk%giga.or.at@localhost> wrote:
>
> Hi!
>
> We've just committed support for Winzip AES encryption. This is the
> AES encryption version that's supported by 7zip and Winzip.
>
> Use the new function zip_file_set_encryption() to encrypt files, and
> zip_fopen_encrypted() for decrypting files. You can also provide an
> archive-wide password with zip_set_password() for both encryption and
> decryption.
>
> Windows support is missing a part for encryption: Can someone please
> fill in lib/zip_random_windows.c with code to provide random bytes?
>
> Let us know if you find any problems.
>
> Cheers,
>  Thomas & Dillo
>

Hi all,

I've attached 2 small patches:

1. cmake-gladman-fcrypt.patch fixes build errors due to
gladman-fcrypt.c not being included in CMake builds and the
"lib/gladman-fcrypt" subdirectory not being included in the include
path.

2. random-win32.patch adds a Win32 implementation of the zip_random()
function, as requested. It uses the CryptoAPI function
CryptGenRandom() which I believe is suitable for this purpose. One
thing to note: it calls CryptAcquireContext() and
CryptReleaseContext() every time, and I've heard that
CryptAcquireContext() might be slow under some circumstances. If that
did turn out to be an issue, caching the HCRYPTPROV handle somehow
might help.

Have a great Christmas!

Andrew

Attachment: cmake-gladman-fcrypt.patch
Description: Binary data

Attachment: random-win32.patch
Description: Binary data

Made by MHonArc.