regen
diff --git a/man/zip_fopen_encrypted.html b/man/zip_fopen_encrypted.html index 495b580..fd4ec77 100644 --- a/man/zip_fopen_encrypted.html +++ b/man/zip_fopen_encrypted.html
@@ -78,8 +78,11 @@ <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> The <code class="Fn">zip_fopen_encrypted</code>() function opens the encrypted file name <var class="Ar">fname</var> in <var class="Ar">archive</var> using - the password given in the <var class="Ar">password</var> argument. The - <var class="Ar">flags</var> argument are the same as for + the password given in the <var class="Ar">password</var> argument. If + <var class="Ar">password</var> is <code class="Dv">NULL</code> or the empty + string, the default password is used (see + <a class="Xr" href="zip_set_default_password.html">zip_set_default_password(3)</a>). + The <var class="Ar">flags</var> argument are the same as for <a class="Xr" href="zip_fopen.html">zip_fopen(3)</a>. <p class="Pp">The <code class="Fn">zip_fopen_index_encrypted</code>() function opens the file at position <var class="Ar">index</var>, see @@ -133,10 +136,21 @@ <span class="An">Thomas Klausner</span> <<a class="Mt" href="mailto:tk@giga.or.at">tk@giga.or.at</a>> </section> +<section class="Sh"> +<h1 class="Sh" id="CAVEATS"><a class="permalink" href="#CAVEATS">CAVEATS</a></h1> +The zip file format provides very limited possibility for password verification + (a short hash of is compared against one byte in the zip archive). For this + reason, reading a file while using an incorrect password may immediately fail + with <code class="Er">ZIP_ER_WRONGPASSWD</code>, but if the mismatch is not + detected, a zlib error may be returned later instead. Since zlib errors can + also be caused by broken compressed data, there is no way to make sure if the + password was incorrect or if it was correct, but the compressed data was + invalid. +</section> </div> <table class="foot"> <tr> - <td class="foot-date">December 18, 2017</td> + <td class="foot-date">September 15, 2020</td> <td class="foot-os">NiH</td> </tr> </table>
diff --git a/man/zip_fopen_encrypted.man b/man/zip_fopen_encrypted.man index 872a3c8..dfa5ab0 100644 --- a/man/zip_fopen_encrypted.man +++ b/man/zip_fopen_encrypted.man
@@ -30,7 +30,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.TH "ZIP_FOPEN_ENCRYPTED" "3" "December 18, 2017" "NiH" "Library Functions Manual" +.TH "ZIP_FOPEN_ENCRYPTED" "3" "September 15, 2020" "NiH" "Library Functions Manual" .nh .if n .ad l .SH "NAME" @@ -65,6 +65,12 @@ using the password given in the \fIpassword\fR argument. +If +\fIpassword\fR +is +\fRNULL\fR +or the empty string, the default password is used (see +zip_set_default_password(3)). The \fIflags\fR argument are the same as for @@ -124,3 +130,15 @@ Dieter Baron <\fIdillo@nih.at\fR> and Thomas Klausner <\fItk@giga.or.at\fR> +.SH "CAVEATS" +The zip file format provides very limited possibility for password +verification (a short hash of is compared against one byte in the zip +archive). +For this reason, reading a file while using an incorrect password may +immediately fail with +\fRZIP_ER_WRONGPASSWD\fR, +but if the mismatch is not detected, a zlib error may be returned +later instead. +Since zlib errors can also be caused by broken compressed data, there +is no way to make sure if the password was incorrect or if it was +correct, but the compressed data was invalid.
diff --git a/man/zip_set_default_password.html b/man/zip_set_default_password.html index bb2940e..8349fae 100644 --- a/man/zip_set_default_password.html +++ b/man/zip_set_default_password.html
@@ -68,12 +68,16 @@ <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> The <code class="Fn">zip_set_default_password</code>() function sets the default password used when accessing encrypted files. If - <var class="Ar">password</var> is <code class="Dv">NULL</code>, the default - password is unset. + <var class="Ar">password</var> is <code class="Dv">NULL</code> or the empty + string, the default password is unset. <p class="Pp">If you prefer a different password for single files, use <a class="Xr" href="zip_fopen_encrypted.html">zip_fopen_encrypted(3)</a> instead of <a class="Xr" href="zip_fopen.html">zip_fopen(3)</a>. Usually, however, the same password is used for every file in an zip archive.</p> +<p class="Pp">The password is not verified when calling this function. See the + <a class="Sx" href="#CAVEATS">CAVEATS</a> section in + <a class="Xr" href="zip_fopen_encrypted.html">zip_fopen_encrypted(3)</a> for + more details about password handling.</p> </section> <section class="Sh"> <h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN @@ -111,7 +115,7 @@ </div> <table class="foot"> <tr> - <td class="foot-date">December 18, 2017</td> + <td class="foot-date">September 15, 2020</td> <td class="foot-os">NiH</td> </tr> </table>
diff --git a/man/zip_set_default_password.man b/man/zip_set_default_password.man index 7104bb3..36acad8 100644 --- a/man/zip_set_default_password.man +++ b/man/zip_set_default_password.man
@@ -30,7 +30,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.TH "ZIP_SET_DEFAULT_PASSWORD" "3" "December 18, 2017" "NiH" "Library Functions Manual" +.TH "ZIP_SET_DEFAULT_PASSWORD" "3" "September 15, 2020" "NiH" "Library Functions Manual" .nh .if n .ad l .SH "NAME" @@ -54,8 +54,8 @@ If \fIpassword\fR is -\fRNULL\fR, -the default password is unset. +\fRNULL\fR +or the empty string, the default password is unset. .PP If you prefer a different password for single files, use zip_fopen_encrypted(3) @@ -63,6 +63,13 @@ zip_fopen(3). Usually, however, the same password is used for every file in an zip archive. +.PP +The password is not verified when calling this function. +See the +\fICAVEATS\fR +section in +zip_fopen_encrypted(3) +for more details about password handling. .SH "RETURN VALUES" Upon successful completion 0 is returned. Otherwise, \-1 is returned and the error information in