cellog Thu Oct 9 00:50:47 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/phar config.m4 phar.c phar_internal.h phar_object.c
util.c
/php-src/ext/phar/tests phar_get_supported_signatures_002a.phpt
phar_setsignaturealgo2.phpt
test_signaturealgos.phpt
/php-src/ext/phar/tests/tar phar_setsignaturealgo2.phpt
Log:
fix bug #45907: undefined reference to PHP_SHA512Init
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/config.m4?r1=1.27.2.6&r2=1.27.2.7&diff_format=u
Index: php-src/ext/phar/config.m4
diff -u php-src/ext/phar/config.m4:1.27.2.6 php-src/ext/phar/config.m4:1.27.2.7
--- php-src/ext/phar/config.m4:1.27.2.6 Sat Aug 2 15:38:46 2008
+++ php-src/ext/phar/config.m4 Thu Oct 9 00:50:46 2008
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.27.2.6 2008/08/02 15:38:46 sfox Exp $
+dnl $Id: config.m4,v 1.27.2.7 2008/10/09 00:50:46 cellog Exp $
dnl config.m4 for extension phar
PHP_ARG_ENABLE(phar, for phar archive support,
@@ -7,6 +7,11 @@
if test "$PHP_PHAR" != "no"; then
PHP_NEW_EXTENSION(phar, util.c tar.c zip.c stream.c func_interceptors.c
dirstream.c phar.c phar_object.c phar_path_check.c, $ext_shared)
AC_MSG_CHECKING([for phar openssl support])
+ if test "$PHP_HASH_SHARED" != "yes"; then
+ AC_DEFINE(PHAR_HASH_OK,1,[ ])
+ else
+ AC_MSG_WARN([Phar: sha256/sha512 signature support disabled if ext/hash is
built shared])
+ fi
if test "$PHP_OPENSSL_SHARED" = "yes"; then
AC_MSG_RESULT([no (shared openssl)])
else
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar.c?r1=1.370.2.48&r2=1.370.2.49&diff_format=u
Index: php-src/ext/phar/phar.c
diff -u php-src/ext/phar/phar.c:1.370.2.48 php-src/ext/phar/phar.c:1.370.2.49
--- php-src/ext/phar/phar.c:1.370.2.48 Tue Sep 30 02:40:17 2008
+++ php-src/ext/phar/phar.c Thu Oct 9 00:50:46 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: phar.c,v 1.370.2.48 2008/09/30 02:40:17 cellog Exp $ */
+/* $Id: phar.c,v 1.370.2.49 2008/10/09 00:50:46 cellog Exp $ */
#define PHAR_MAIN 1
#include "phar_internal.h"
@@ -838,7 +838,7 @@
efree(sig);
}
break;
-#if HAVE_HASH_EXT
+#if PHAR_HASH_OK
case PHAR_SIG_SHA512: {
unsigned char digest[64];
@@ -3108,7 +3108,7 @@
}
switch(phar->sig_flags) {
-#ifndef HAVE_HASH_EXT
+#ifndef PHAR_HASH_OK
case PHAR_SIG_SHA512:
case PHAR_SIG_SHA256:
if (closeoldfile) {
@@ -3620,7 +3620,7 @@
php_info_print_table_header(2, "Phar: PHP Archive support", "enabled");
php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION);
php_info_print_table_row(2, "Phar API version", PHP_PHAR_API_VERSION);
- php_info_print_table_row(2, "CVS revision", "$Revision: 1.370.2.48 $");
+ php_info_print_table_row(2, "CVS revision", "$Revision: 1.370.2.49 $");
php_info_print_table_row(2, "Phar-based phar archives", "enabled");
php_info_print_table_row(2, "Tar-based phar archives", "enabled");
php_info_print_table_row(2, "ZIP-based phar archives", "enabled");
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_internal.h?r1=1.109.2.26&r2=1.109.2.27&diff_format=u
Index: php-src/ext/phar/phar_internal.h
diff -u php-src/ext/phar/phar_internal.h:1.109.2.26
php-src/ext/phar/phar_internal.h:1.109.2.27
--- php-src/ext/phar/phar_internal.h:1.109.2.26 Sun Sep 14 06:31:19 2008
+++ php-src/ext/phar/phar_internal.h Thu Oct 9 00:50:46 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: phar_internal.h,v 1.109.2.26 2008/09/14 06:31:19 cellog Exp $ */
+/* $Id: phar_internal.h,v 1.109.2.27 2008/10/09 00:50:46 cellog Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -66,7 +66,7 @@
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
-#ifdef HAVE_HASH_EXT
+#ifdef PHAR_HASH_OK
#include "ext/hash/php_hash.h"
#include "ext/hash/php_hash_sha.h"
#endif
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_object.c?r1=1.266.2.48&r2=1.266.2.49&diff_format=u
Index: php-src/ext/phar/phar_object.c
diff -u php-src/ext/phar/phar_object.c:1.266.2.48
php-src/ext/phar/phar_object.c:1.266.2.49
--- php-src/ext/phar/phar_object.c:1.266.2.48 Sat Sep 13 22:30:55 2008
+++ php-src/ext/phar/phar_object.c Thu Oct 9 00:50:46 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: phar_object.c,v 1.266.2.48 2008/09/13 22:30:55 cellog Exp $ */
+/* $Id: phar_object.c,v 1.266.2.49 2008/10/09 00:50:46 cellog Exp $ */
#include "phar_internal.h"
#include "func_interceptors.h"
@@ -1271,7 +1271,7 @@
add_next_index_stringl(return_value, "MD5", 3, 1);
add_next_index_stringl(return_value, "SHA-1", 5, 1);
-#ifdef HAVE_HASH_EXT
+#ifdef PHAR_HASH_OK
add_next_index_stringl(return_value, "SHA-256", 7, 1);
add_next_index_stringl(return_value, "SHA-512", 7, 1);
#endif
@@ -2939,9 +2939,9 @@
switch (algo) {
case PHAR_SIG_SHA256:
case PHAR_SIG_SHA512:
-#ifndef HAVE_HASH_EXT
+#ifndef PHAR_HASH_OK
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
- "SHA-256 and SHA-512 signatures are only
supported if the hash extension is enabled");
+ "SHA-256 and SHA-512 signatures are only
supported if the hash extension is enabled and built non-shared");
return;
#endif
case PHAR_SIG_MD5:
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/util.c?r1=1.55.2.35&r2=1.55.2.36&diff_format=u
Index: php-src/ext/phar/util.c
diff -u php-src/ext/phar/util.c:1.55.2.35 php-src/ext/phar/util.c:1.55.2.36
--- php-src/ext/phar/util.c:1.55.2.35 Sat Sep 13 22:30:55 2008
+++ php-src/ext/phar/util.c Thu Oct 9 00:50:46 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: util.c,v 1.55.2.35 2008/09/13 22:30:55 cellog Exp $ */
+/* $Id: util.c,v 1.55.2.36 2008/10/09 00:50:46 cellog Exp $ */
#include "phar_internal.h"
@@ -1875,7 +1875,7 @@
*signature_len = phar_hex_str((const char*)sig,
sig_len, signature TSRMLS_CC);
}
break;
-#ifdef HAVE_HASH_EXT
+#ifdef PHAR_HASH_OK
case PHAR_SIG_SHA512: {
unsigned char digest[64];
PHP_SHA512_CTX context;
@@ -2039,7 +2039,7 @@
}
switch(phar->sig_flags) {
-#ifdef HAVE_HASH_EXT
+#ifdef PHAR_HASH_OK
case PHAR_SIG_SHA512: {
unsigned char digest[64];
PHP_SHA512_CTX context;
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_get_supported_signatures_002a.phpt?r1=1.1.2.3&r2=1.1.2.4&diff_format=u
Index: php-src/ext/phar/tests/phar_get_supported_signatures_002a.phpt
diff -u php-src/ext/phar/tests/phar_get_supported_signatures_002a.phpt:1.1.2.3
php-src/ext/phar/tests/phar_get_supported_signatures_002a.phpt:1.1.2.4
--- php-src/ext/phar/tests/phar_get_supported_signatures_002a.phpt:1.1.2.3
Sun Aug 31 19:18:35 2008
+++ php-src/ext/phar/tests/phar_get_supported_signatures_002a.phpt Thu Oct
9 00:50:47 2008
@@ -6,6 +6,7 @@
if (!extension_loaded("hash")) die("skip extension hash required");
$arr = Phar::getSupportedSignatures();
if (!in_array("OpenSSL", $arr)) die("skip openssl support required");
+if (!in_array('SHA-256', $arr)) die("skip hash extension loaded shared");
?>
--INI--
phar.require_hash=0
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/phar_setsignaturealgo2.phpt?r1=1.3.2.3&r2=1.3.2.4&diff_format=u
Index: php-src/ext/phar/tests/phar_setsignaturealgo2.phpt
diff -u php-src/ext/phar/tests/phar_setsignaturealgo2.phpt:1.3.2.3
php-src/ext/phar/tests/phar_setsignaturealgo2.phpt:1.3.2.4
--- php-src/ext/phar/tests/phar_setsignaturealgo2.phpt:1.3.2.3 Mon Jun 23
19:18:01 2008
+++ php-src/ext/phar/tests/phar_setsignaturealgo2.phpt Thu Oct 9 00:50:47 2008
@@ -4,7 +4,9 @@
<?php
if (!extension_loaded("phar")) die("skip");
if (!extension_loaded("hash")) die("skip hash extension required");
-if (!extension_loaded("openssl")) die("skip openssl extension required");
+$arr = Phar::getSupportedSignatures();
+if (!in_array("OpenSSL", $arr)) die("skip openssl support required");
+if (!in_array('SHA-256', $arr)) die("skip hash extension loaded shared");
?>
--INI--
phar.require_hash=0
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/test_signaturealgos.phpt?r1=1.5.2.2&r2=1.5.2.3&diff_format=u
Index: php-src/ext/phar/tests/test_signaturealgos.phpt
diff -u php-src/ext/phar/tests/test_signaturealgos.phpt:1.5.2.2
php-src/ext/phar/tests/test_signaturealgos.phpt:1.5.2.3
--- php-src/ext/phar/tests/test_signaturealgos.phpt:1.5.2.2 Mon Jun 23
19:18:01 2008
+++ php-src/ext/phar/tests/test_signaturealgos.phpt Thu Oct 9 00:50:47 2008
@@ -6,6 +6,7 @@
if (!extension_loaded("hash")) die("skip extension hash conflicts");
$arr = Phar::getSupportedSignatures();
if (!in_array("OpenSSL", $arr)) die("skip openssl support required");
+if (!in_array('SHA-256', $arr)) die("skip hash extension loaded shared");
?>
--INI--
phar.require_hash=0
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tests/tar/phar_setsignaturealgo2.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/phar/tests/tar/phar_setsignaturealgo2.phpt
diff -u php-src/ext/phar/tests/tar/phar_setsignaturealgo2.phpt:1.1.2.1
php-src/ext/phar/tests/tar/phar_setsignaturealgo2.phpt:1.1.2.2
--- php-src/ext/phar/tests/tar/phar_setsignaturealgo2.phpt:1.1.2.1 Fri Jun
13 22:07:44 2008
+++ php-src/ext/phar/tests/tar/phar_setsignaturealgo2.phpt Thu Oct 9
00:50:47 2008
@@ -2,8 +2,10 @@
Phar::setSupportedSignatures() with hash, tar-based
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
-<?php if (!extension_loaded("hash")) die("skip extension hash required"); ?>
-<?php if (!extension_loaded("openssl")) die("skip extension openssl
required"); ?>
+<?php if (!extension_loaded("hash")) die("skip extension hash required");
+$arr = Phar::getSupportedSignatures();
+if (!in_array("OpenSSL", $arr)) die("skip openssl support required");
+if (!in_array('SHA-256', $arr)) die("skip hash extension loaded shared"); ?>
--INI--
phar.require_hash=0
phar.readonly=0
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php