fix signature generation/validation for zip archives by phar extension, fix a few edge cases where memory was leaked on error conditions by missing efree()

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@284707 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Greg Beaver 2009-07-24 15:42:17 +00:00
parent c7e5e0cddf
commit 188df632a7
4 changed files with 12 additions and 11 deletions

View file

@ -3,7 +3,7 @@
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="phar.getsignature">
<refnamediv>
<refname>Phar::getSignature</refname>
<refpurpose>Return MD5/SHA1/SHA256/SHA512 signature of a Phar archive</refpurpose>
<refpurpose>Return MD5/SHA1/SHA256/SHA512/OpenSSL signature of a Phar archive</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
@ -25,11 +25,12 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Array with the opened archive's signature in "hash" key and "md5", "sha1",
"sha256", or "sha512"
in "hash_type". This signature is a hash calculated on the
Array with the opened archive's signature in <literal>hash</literal> key and <literal>MD5</literal>,
<literal>SHA-1</literal>,
<literal>SHA-256</literal>, <literal>SHA-512</literal>, or <literal>OpenSSL</literal>
in <literal>hash_type</literal>. This signature is a hash calculated on the
entire phar's contents, and may be used to verify the integrity of the archive.
A valid signature is absolutely required of all phar-based phars if the
A valid signature is absolutely required of all executable phar archives if the
<link linkend="ini.phar.require-hash">phar.require_hash</link> INI variable
is set to true.
</para>

View file

@ -27,7 +27,8 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an array containing any of "MD5", "SHA-1", "SHA-256", "SHA-512".
Returns an array containing any of <literal>MD5</literal>, <literal>SHA-1</literal>,
<literal>SHA-256</literal>, <literal>SHA-512</literal>, or <literal>OpenSSL</literal>.
</para>
</refsect1>

View file

@ -22,8 +22,8 @@
<literal>Phar::SHA512</literal>, or <literal>Phar::OPENSSL</literal>.
</para>
<para>
Note that all phar-based and tar-based phar archives have a signature created
automatically, <literal>SHA1</literal> by default. data tar-based archives
Note that all executable phar archives have a signature created
automatically, <literal>SHA1</literal> by default. data tar- or zip-based archives
(archives created with the <classname>PharData</classname> class) must have
their signature created and set explicitly via
<function>Phar::setSignatureAlgorithm</function>.
@ -81,8 +81,7 @@ $p->setSignatureAlgorithm(Phar::OPENSSL, $pkey);
&reftitle.errors;
<para>
Throws <classname>UnexpectedValueException</classname> for many errors,
<classname>BadMethodCallException</classname> if called for a zip-based phar
archive, and a <classname>PharException</classname>
and a <classname>PharException</classname>
if any problems occur flushing changes to disk.
</para>
</refsect1>

View file

@ -114,7 +114,7 @@ __HALT_COMPILER();
<entry>Whole-archive signature validation</entry>
<entry>Yes</entry>
<entry>Yes</entry>
<entry>No</entry>
<entry>Yes (PHP 5.3.1+)</entry>
</row>
<row>
<entry>Web-specific application support</entry>