VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/libzip/zip_source_zip_new.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-04-26 00:10:55 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-04-26 00:20:19 +0200
commitd081d6143e86bd350bd62dc6811629346746ac52 (patch)
tree24559cfc688a694d1fb085b000228118eb845f32 /src/Common/libzip/zip_source_zip_new.c
parent9270952b3dd956ba2f6b2e444768354bee3ae5e2 (diff)
downloadVeraCrypt-d081d6143e86bd350bd62dc6811629346746ac52.tar.gz
VeraCrypt-d081d6143e86bd350bd62dc6811629346746ac52.zip
Windows: update libzip to version 1.2.0
Diffstat (limited to 'src/Common/libzip/zip_source_zip_new.c')
-rw-r--r--src/Common/libzip/zip_source_zip_new.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Common/libzip/zip_source_zip_new.c b/src/Common/libzip/zip_source_zip_new.c
index 40f1195f..92562558 100644
--- a/src/Common/libzip/zip_source_zip_new.c
+++ b/src/Common/libzip/zip_source_zip_new.c
@@ -1,6 +1,6 @@
/*
zip_source_zip_new.c -- prepare data structures for zip_fopen/zip_source_zip
- Copyright (C) 2012-2015 Dieter Baron and Thomas Klausner
+ Copyright (C) 2012-2016 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <libzip@nih.at>
@@ -81,11 +81,14 @@ _zip_source_zip_new(zip_t *za, zip_t *srcza, zip_uint64_t srcidx, zip_flags_t fl
enc_impl = NULL;
if (((flags & ZIP_FL_ENCRYPTED) == 0) && (st.encryption_method != ZIP_EM_NONE)) {
+ if (password == NULL) {
+ password = za->default_password;
+ }
if (password == NULL) {
zip_error_set(&za->error, ZIP_ER_NOPASSWD, 0);
return NULL;
}
- if ((enc_impl=_zip_get_encryption_implementation(st.encryption_method)) == NULL) {
+ if ((enc_impl=_zip_get_encryption_implementation(st.encryption_method, ZIP_CODEC_DECODE)) == NULL) {
zip_error_set(&za->error, ZIP_ER_ENCRNOTSUPP, 0);
return NULL;
}
@@ -94,7 +97,7 @@ _zip_source_zip_new(zip_t *za, zip_t *srcza, zip_uint64_t srcidx, zip_flags_t fl
comp_impl = NULL;
if ((flags & ZIP_FL_COMPRESSED) == 0) {
if (st.comp_method != ZIP_CM_STORE) {
- if ((comp_impl=_zip_get_compression_implementation(st.comp_method)) == NULL) {
+ if ((comp_impl=_zip_get_compression_implementation(st.comp_method, ZIP_CODEC_DECODE)) == NULL) {
zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0);
return NULL;
}