cellog          Thu Oct  9 00:51:27 2008 UTC

  Modified files:              
    /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:
  MFB: fix bug #45907: undefined reference to PHP_SHA512Init
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/config.m4?r1=1.32&r2=1.33&diff_format=u
Index: php-src/ext/phar/config.m4
diff -u php-src/ext/phar/config.m4:1.32 php-src/ext/phar/config.m4:1.33
--- php-src/ext/phar/config.m4:1.32     Sat Aug  2 15:37:38 2008
+++ php-src/ext/phar/config.m4  Thu Oct  9 00:51:27 2008
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.32 2008/08/02 15:37:38 sfox Exp $
+dnl $Id: config.m4,v 1.33 2008/10/09 00:51:27 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.387&r2=1.388&diff_format=u
Index: php-src/ext/phar/phar.c
diff -u php-src/ext/phar/phar.c:1.387 php-src/ext/phar/phar.c:1.388
--- php-src/ext/phar/phar.c:1.387       Tue Sep 30 02:40:37 2008
+++ php-src/ext/phar/phar.c     Thu Oct  9 00:51:27 2008
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: phar.c,v 1.387 2008/09/30 02:40:37 cellog Exp $ */
+/* $Id: phar.c,v 1.388 2008/10/09 00:51:27 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.387 $");
+       php_info_print_table_row(2, "CVS revision", "$Revision: 1.388 $");
        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.118&r2=1.119&diff_format=u
Index: php-src/ext/phar/phar_internal.h
diff -u php-src/ext/phar/phar_internal.h:1.118 
php-src/ext/phar/phar_internal.h:1.119
--- php-src/ext/phar/phar_internal.h:1.118      Sun Sep 14 06:32:52 2008
+++ php-src/ext/phar/phar_internal.h    Thu Oct  9 00:51:27 2008
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: phar_internal.h,v 1.118 2008/09/14 06:32:52 cellog Exp $ */
+/* $Id: phar_internal.h,v 1.119 2008/10/09 00:51:27 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.284&r2=1.285&diff_format=u
Index: php-src/ext/phar/phar_object.c
diff -u php-src/ext/phar/phar_object.c:1.284 
php-src/ext/phar/phar_object.c:1.285
--- php-src/ext/phar/phar_object.c:1.284        Sat Sep 13 22:31:18 2008
+++ php-src/ext/phar/phar_object.c      Thu Oct  9 00:51:27 2008
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: phar_object.c,v 1.284 2008/09/13 22:31:18 cellog Exp $ */
+/* $Id: phar_object.c,v 1.285 2008/10/09 00:51:27 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.65&r2=1.66&diff_format=u
Index: php-src/ext/phar/util.c
diff -u php-src/ext/phar/util.c:1.65 php-src/ext/phar/util.c:1.66
--- php-src/ext/phar/util.c:1.65        Sat Sep 13 22:31:18 2008
+++ php-src/ext/phar/util.c     Thu Oct  9 00:51:27 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: util.c,v 1.65 2008/09/13 22:31:18 cellog Exp $ */
+/* $Id: util.c,v 1.66 2008/10/09 00:51:27 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.3&r2=1.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.3 
php-src/ext/phar/tests/phar_get_supported_signatures_002a.phpt:1.4
--- php-src/ext/phar/tests/phar_get_supported_signatures_002a.phpt:1.3  Sun Aug 
31 20:54:27 2008
+++ php-src/ext/phar/tests/phar_get_supported_signatures_002a.phpt      Thu Oct 
 9 00:51:27 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.4&r2=1.5&diff_format=u
Index: php-src/ext/phar/tests/phar_setsignaturealgo2.phpt
diff -u php-src/ext/phar/tests/phar_setsignaturealgo2.phpt:1.4 
php-src/ext/phar/tests/phar_setsignaturealgo2.phpt:1.5
--- php-src/ext/phar/tests/phar_setsignaturealgo2.phpt:1.4      Fri Aug  1 
13:36:18 2008
+++ php-src/ext/phar/tests/phar_setsignaturealgo2.phpt  Thu Oct  9 00:51:27 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.6&r2=1.7&diff_format=u
Index: php-src/ext/phar/tests/test_signaturealgos.phpt
diff -u php-src/ext/phar/tests/test_signaturealgos.phpt:1.6 
php-src/ext/phar/tests/test_signaturealgos.phpt:1.7
--- php-src/ext/phar/tests/test_signaturealgos.phpt:1.6 Fri Aug  1 13:36:18 2008
+++ php-src/ext/phar/tests/test_signaturealgos.phpt     Thu Oct  9 00:51:27 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.2&r2=1.3&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.2 
php-src/ext/phar/tests/tar/phar_setsignaturealgo2.phpt:1.3
--- php-src/ext/phar/tests/tar/phar_setsignaturealgo2.phpt:1.2  Fri Aug  1 
13:36:19 2008
+++ php-src/ext/phar/tests/tar/phar_setsignaturealgo2.phpt      Thu Oct  9 
00:51:27 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

Reply via email to