mirror of
https://github.com/zlib-ng/minizip-ng
synced 2025-03-28 21:13:18 +00:00
Fixed no encryption configuration.
Added more possible configurations.
This commit is contained in:
parent
13ae3ab2bc
commit
1770d3554e
15
.travis.yml
15
.travis.yml
@ -4,6 +4,21 @@ matrix:
|
||||
include:
|
||||
- os: windows
|
||||
compiler: clang
|
||||
- os: windows
|
||||
compiler: clang
|
||||
env: TOOL="-DUSE_ZLIB=OFF"
|
||||
- os: windows
|
||||
compiler: clang
|
||||
env: TOOL="-DUSE_BZIP=OFF"
|
||||
- os: windows
|
||||
compiler: clang
|
||||
env: TOOL="-DUSE_LZMA=OFF"
|
||||
- os: windows
|
||||
compiler: clang
|
||||
env: TOOL="-DUSE_AES=OFF"
|
||||
- os: windows
|
||||
compiler: clang
|
||||
env: TOOL="-DUSE_PKCRYPT=OFF"
|
||||
- os: windows
|
||||
compiler: clang
|
||||
env: TOOL="-DUSE_PKCRYPT=OFF -DUSE_AES=OFF"
|
||||
|
@ -471,7 +471,6 @@ source_group("Minizip" FILES ${MINIZIP_SRC} ${MINIZIP_PUBLIC_HEADERS})
|
||||
|
||||
add_library(${PROJECT_NAME}
|
||||
${MINIZIP_SRC} ${MINIZIP_PUBLIC_HEADERS}
|
||||
${ZLIB_PUBLIC_HEADERS}
|
||||
${BRG_SRC} ${BRG_PUBLIC_HEADERS}
|
||||
${BZIP2_SRC} ${BZIP2_PUBLIC_HEADERS}
|
||||
${LZMA_SRC} ${LZMA_PUBLIC_HEADERS})
|
||||
|
@ -439,8 +439,10 @@ int32_t mz_zip_reader_entry_read(void *handle, void *buf, int32_t len)
|
||||
mz_zip_reader *reader = (mz_zip_reader *)handle;
|
||||
int32_t read = 0;
|
||||
read = mz_zip_entry_read(reader->zip_handle, buf, len);
|
||||
#ifndef MZ_ZIP_NO_ENCRYPTION
|
||||
if (read > 0)
|
||||
mz_crypt_sha_update(reader->sha256, buf, read);
|
||||
#endif
|
||||
return read;
|
||||
}
|
||||
|
||||
@ -1244,6 +1246,7 @@ int32_t mz_zip_writer_entry_close(void *handle)
|
||||
|
||||
|
||||
mz_crypt_sha_end(writer->sha256, sha256, sizeof(sha256));
|
||||
mz_crypt_sha_delete(&writer->sha256);
|
||||
|
||||
// Copy extrafield so we can append our own fields before close
|
||||
mz_stream_mem_create(&writer->file_extra_stream);
|
||||
@ -1283,8 +1286,6 @@ int32_t mz_zip_writer_entry_close(void *handle)
|
||||
else
|
||||
err = mz_zip_entry_close(writer->zip_handle);
|
||||
|
||||
mz_crypt_sha_delete(&writer->sha256);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user