Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar config.m4 util.c

2008-11-04 Thread Steph Fox

But - since when is hash not optional?


It still is optional :-)

Only if it is shared we cannot rely on it for higher SHA.


Grr no exports. OK, gotcha now, sorry for the noise.

- Steph


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar config.m4 util.c

2008-11-04 Thread Marcus Boerger
Hello Steph,

Tuesday, November 4, 2008, 2:52:48 PM, you wrote:

>>> Nope. The *original* logic said 'is it there?' Greg changed that to 'is 
>>> it
>>> !shared?' You changed it back to 'is it there?' It needs to be 'is it 
>>> there
>>> && !shared?'
>>
>> read again. It says if it is shared then issue an error. If it is present
>> then use it.

> Args, sorry. I misread the commit and thought you'd removed the first line 
> in that block, so yes the check is now correct in config.m4.

> But - since when is hash not optional?

It still is optional :-)

Only if it is shared we cannot rely on it for higher SHA.

Best regards,
 Marcus


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar config.m4 util.c

2008-11-04 Thread Steph Fox
Nope. The *original* logic said 'is it there?' Greg changed that to 'is 
it
!shared?' You changed it back to 'is it there?' It needs to be 'is it 
there

&& !shared?'


read again. It says if it is shared then issue an error. If it is present
then use it.


Args, sorry. I misread the commit and thought you'd removed the first line 
in that block, so yes the check is now correct in config.m4.


But - since when is hash not optional?

- Steph 



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar config.m4 util.c

2008-11-04 Thread Marcus Boerger
Hello Steph,

Tuesday, November 4, 2008, 2:42:05 PM, you wrote:

> Hi Marcus,

>>> I'm pretty sure this is a wrong fix - the check for "not shared" replaces
>>> the original check for HAVE_HASH_EXT, which is effectively a global
>>> equivalent to $PHP_HASH. So it should be something like:
>>
>>>  if test "$PHP_HASH" != "no"; then
>>>   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
>>>  fi
>>
>> As far as I can tell that acomplishes the same. Onlz zou

> German kb? ;)

oops

>> changed the
>> original logic a lot rather then trzing to keep as much of it as possible.

> Nope. The *original* logic said 'is it there?' Greg changed that to 'is it 
> !shared?' You changed it back to 'is it there?' It needs to be 'is it there
> && !shared?'

read again. It says if it is shared then issue an error. If it is present
then use it.

>>> The ext/hash files are already included as appropriate in phar_internal.h
>>> and don't/shouldn't need re-including anywhere else.
>>
>> Doesnät matter. This helps me figuring out what is wrong.

> In CVS?

>>> Also - it looks like ext/hash needs adding to phar_deps in phar.c (as
>>> ZEND_MOD_OPTIONAL).
>>
>> Zep, that's a good point.
>>
>>> And config.w32 needs updating to define PHAR_HASH_OK, since there'll be 
>>> zero
>>> hash support under doze otherwise.  HAVE_HASH_EXT is at least 
>>> automatic...!
>>
>> Since I cannot test on windows I need windows developers like zou to fix
>> it.

> I haven't been able to test 5.3 in months.. I'll fix/test/merge out of PECL
> & 5.2 once it's working under *nix, but currently it doesn't seem to be 
> working anywhere :)

> - Steph




Best regards,
 Marcus


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar config.m4 util.c

2008-11-04 Thread Steph Fox

Hi Marcus,


I'm pretty sure this is a wrong fix - the check for "not shared" replaces
the original check for HAVE_HASH_EXT, which is effectively a global
equivalent to $PHP_HASH. So it should be something like:



 if test "$PHP_HASH" != "no"; then
  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
 fi


As far as I can tell that acomplishes the same. Onlz zou


German kb? ;)


changed the
original logic a lot rather then trzing to keep as much of it as possible.


Nope. The *original* logic said 'is it there?' Greg changed that to 'is it 
!shared?' You changed it back to 'is it there?' It needs to be 'is it there 
&& !shared?'



The ext/hash files are already included as appropriate in phar_internal.h
and don't/shouldn't need re-including anywhere else.


Doesnät matter. This helps me figuring out what is wrong.


In CVS?


Also - it looks like ext/hash needs adding to phar_deps in phar.c (as
ZEND_MOD_OPTIONAL).


Zep, that's a good point.

And config.w32 needs updating to define PHAR_HASH_OK, since there'll be 
zero
hash support under doze otherwise.  HAVE_HASH_EXT is at least 
automatic...!


Since I cannot test on windows I need windows developers like zou to fix
it.


I haven't been able to test 5.3 in months.. I'll fix/test/merge out of PECL 
& 5.2 once it's working under *nix, but currently it doesn't seem to be 
working anywhere :)


- Steph


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar config.m4 util.c

2008-11-04 Thread Marcus Boerger
Hello Steph,

Tuesday, November 4, 2008, 1:12:32 PM, you wrote:

> Hi Marcus,

> I'm pretty sure this is a wrong fix - the check for "not shared" replaces 
> the original check for HAVE_HASH_EXT, which is effectively a global 
> equivalent to $PHP_HASH. So it should be something like:

>  if test "$PHP_HASH" != "no"; then
>   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
>  fi

As far as I can tell that acomplishes the same. Onlz zou changed the
original logic a lot rather then trzing to keep as much of it as possible.

> The ext/hash files are already included as appropriate in phar_internal.h 
> and don't/shouldn't need re-including anywhere else.

Doesnät matter. This helps me figuring out what is wrong.

> Also - it looks like ext/hash needs adding to phar_deps in phar.c (as 
> ZEND_MOD_OPTIONAL).

Zep, that's a good point.

> And config.w32 needs updating to define PHAR_HASH_OK, since there'll be zero
> hash support under doze otherwise.  HAVE_HASH_EXT is at least automatic...!

Since I cannot test on windows I need windows developers like zou to fix
it.

> - Steph


> - Original Message - 
> From: "Marcus Boerger" <[EMAIL PROTECTED]>
> To: 
> Sent: Tuesday, November 04, 2008 1:27 AM
> Subject: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar config.m4 util.c


>> helly Tue Nov  4 01:27:52 2008 UTC
>>
>>  Modified files:  (Branch: PHP_5_3)
>>/php-src/ext/phar config.m4 util.c
>>  Log:
>>  - MFH Fix dependency from Phar to hash
>>
>> http://cvs.php.net/viewvc.cgi/php-src/ext/phar/config.m4?r1=1.27.2.7&r2=1.27.2.8&diff_format=u
>> Index: php-src/ext/phar/config.m4
>> diff -u php-src/ext/phar/config.m4:1.27.2.7 
>> php-src/ext/phar/config.m4:1.27.2.8
>> --- php-src/ext/phar/config.m4:1.27.2.7 Thu Oct  9 00:50:46 2008
>> +++ php-src/ext/phar/config.m4 Tue Nov  4 01:27:52 2008
>> @@ -1,4 +1,4 @@
>> -dnl $Id: config.m4,v 1.27.2.7 2008/10/09 00:50:46 cellog Exp $
>> +dnl $Id: config.m4,v 1.27.2.8 2008/11/04 01:27:52 helly Exp $
>> dnl config.m4 for extension phar
>>
>> PHP_ARG_ENABLE(phar, for phar archive support,
>> @@ -8,7 +8,9 @@
>>   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,[ ])
>> +if test "$PHP_HASH" != "no"; then
>> +  AC_DEFINE(PHAR_HASH_OK,1,[ ])
>> +fi
>>   else
>> AC_MSG_WARN([Phar: sha256/sha512 signature support disabled if 
>> ext/hash is built shared])
>>   fi
>> @@ -22,6 +24,7 @@
>>   AC_MSG_RESULT([no])
>> fi
>>   fi
>> +  PHP_ADD_EXTENSION_DEP(phar, hash, true)
>>   PHP_ADD_EXTENSION_DEP(phar, spl, true)
>>   PHP_ADD_MAKEFILE_FRAGMENT
>> fi
>> http://cvs.php.net/viewvc.cgi/php-src/ext/phar/util.c?r1=1.55.2.39&r2=1.55.2.40&diff_format=u
>> Index: php-src/ext/phar/util.c
>> diff -u php-src/ext/phar/util.c:1.55.2.39 
>> php-src/ext/phar/util.c:1.55.2.40
>> --- php-src/ext/phar/util.c:1.55.2.39 Sun Oct 26 05:49:09 2008
>> +++ php-src/ext/phar/util.c Tue Nov  4 01:27:52 2008
>> @@ -18,9 +18,12 @@
>>   +--+
>> */
>>
>> -/* $Id: util.c,v 1.55.2.39 2008/10/26 05:49:09 cellog Exp $ */
>> +/* $Id: util.c,v 1.55.2.40 2008/11/04 01:27:52 helly Exp $ */
>>
>> #include "phar_internal.h"
>> +#ifdef PHAR_HASH_OK
>> +#include "ext/hash/php_hash_sha.h"
>> +#endif
>>
>> #ifdef PHAR_HAVE_OPENSSL
>> /* OpenSSL includes */
>>
>>
>>
>> -- 
>> PHP CVS Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 





Best regards,
 Marcus


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar config.m4 util.c

2008-11-04 Thread Steph Fox

Hi Marcus,

I'm pretty sure this is a wrong fix - the check for "not shared" replaces 
the original check for HAVE_HASH_EXT, which is effectively a global 
equivalent to $PHP_HASH. So it should be something like:


if test "$PHP_HASH" != "no"; then
 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
fi

The ext/hash files are already included as appropriate in phar_internal.h 
and don't/shouldn't need re-including anywhere else.


Also - it looks like ext/hash needs adding to phar_deps in phar.c (as 
ZEND_MOD_OPTIONAL).


And config.w32 needs updating to define PHAR_HASH_OK, since there'll be zero 
hash support under doze otherwise.  HAVE_HASH_EXT is at least automatic...!


- Steph


- Original Message - 
From: "Marcus Boerger" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, November 04, 2008 1:27 AM
Subject: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar config.m4 util.c



helly Tue Nov  4 01:27:52 2008 UTC

 Modified files:  (Branch: PHP_5_3)
   /php-src/ext/phar config.m4 util.c
 Log:
 - MFH Fix dependency from Phar to hash

http://cvs.php.net/viewvc.cgi/php-src/ext/phar/config.m4?r1=1.27.2.7&r2=1.27.2.8&diff_format=u
Index: php-src/ext/phar/config.m4
diff -u php-src/ext/phar/config.m4:1.27.2.7 
php-src/ext/phar/config.m4:1.27.2.8

--- php-src/ext/phar/config.m4:1.27.2.7 Thu Oct  9 00:50:46 2008
+++ php-src/ext/phar/config.m4 Tue Nov  4 01:27:52 2008
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.27.2.7 2008/10/09 00:50:46 cellog Exp $
+dnl $Id: config.m4,v 1.27.2.8 2008/11/04 01:27:52 helly Exp $
dnl config.m4 for extension phar

PHP_ARG_ENABLE(phar, for phar archive support,
@@ -8,7 +8,9 @@
  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,[ ])
+if test "$PHP_HASH" != "no"; then
+  AC_DEFINE(PHAR_HASH_OK,1,[ ])
+fi
  else
AC_MSG_WARN([Phar: sha256/sha512 signature support disabled if 
ext/hash is built shared])

  fi
@@ -22,6 +24,7 @@
  AC_MSG_RESULT([no])
fi
  fi
+  PHP_ADD_EXTENSION_DEP(phar, hash, true)
  PHP_ADD_EXTENSION_DEP(phar, spl, true)
  PHP_ADD_MAKEFILE_FRAGMENT
fi
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/util.c?r1=1.55.2.39&r2=1.55.2.40&diff_format=u
Index: php-src/ext/phar/util.c
diff -u php-src/ext/phar/util.c:1.55.2.39 
php-src/ext/phar/util.c:1.55.2.40

--- php-src/ext/phar/util.c:1.55.2.39 Sun Oct 26 05:49:09 2008
+++ php-src/ext/phar/util.c Tue Nov  4 01:27:52 2008
@@ -18,9 +18,12 @@
  +--+
*/

-/* $Id: util.c,v 1.55.2.39 2008/10/26 05:49:09 cellog Exp $ */
+/* $Id: util.c,v 1.55.2.40 2008/11/04 01:27:52 helly Exp $ */

#include "phar_internal.h"
+#ifdef PHAR_HASH_OK
+#include "ext/hash/php_hash_sha.h"
+#endif

#ifdef PHAR_HAVE_OPENSSL
/* OpenSSL includes */



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/phar config.m4

2008-06-03 Thread Antony Dovgal

On 01.06.2008 08:21, Greg Beaver wrote:

cellog  Sun Jun  1 04:21:27 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/phar/tests/files	openssl.phar openssl.phar.pubkey 
 	private.pem 

  Modified files:  


Valgrind has found several problems in phar_setsignaturealgo2.phpt:

==10190== Use of uninitialised value of size 8
==10190==at 0x650931: phar_hex_str (phar.c:498)
==10190==by 0x659706: phar_flush (phar.c:3016)
==10190==by 0x664B5E: zim_Phar_setSignatureAlgorithm (phar_object.c:2727)
==10190==by 0x8EDD02: zend_do_fcall_common_helper_SPEC 
(zend_vm_execute.h:194)
==10190==by 0x8EEB0B: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(zend_vm_execute.h:295)
==10190==by 0x8ED5BD: execute (zend_vm_execute.h:96)
==10190==by 0x8BE54D: zend_execute_scripts (zend.c:1195)
==10190==by 0x8485D6: php_execute_script (main.c:2080)
==10190==by 0x95FABD: main (php_cli.c:1139)
==10190==
==10190== Use of uninitialised value of size 8
==10190==at 0x650965: phar_hex_str (phar.c:499)
==10190==by 0x659706: phar_flush (phar.c:3016)
==10190==by 0x664B5E: zim_Phar_setSignatureAlgorithm (phar_object.c:2727)
==10190==by 0x8EDD02: zend_do_fcall_common_helper_SPEC 
(zend_vm_execute.h:194)
==10190==by 0x8EEB0B: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(zend_vm_execute.h:295)
==10190==by 0x8ED5BD: execute (zend_vm_execute.h:96)
==10190==by 0x8BE54D: zend_execute_scripts (zend.c:1195)
==10190==by 0x8485D6: php_execute_script (main.c:2080)
==10190==by 0x95FABD: main (php_cli.c:1139)
==10190==
==10190== Syscall param write(buf) points to uninitialised byte(s)
==10190==at 0x8646280: __write_nocancel (in /lib64/libc-2.5.so)
==10190==by 0x86A8E2: php_stdiop_write (plain_wrapper.c:312)
==10190==by 0x862C34: _php_stream_write_buffer (streams.c:932)
==10190==by 0x862F29: _php_stream_write (streams.c:1043)
==10190==by 0x65972E: phar_flush (phar.c:3017)
==10190==by 0x664B5E: zim_Phar_setSignatureAlgorithm (phar_object.c:2727)
==10190==by 0x8EDD02: zend_do_fcall_common_helper_SPEC 
(zend_vm_execute.h:194)
==10190==by 0x8EEB0B: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(zend_vm_execute.h:295)
==10190==by 0x8ED5BD: execute (zend_vm_execute.h:96)
==10190==by 0x8BE54D: zend_execute_scripts (zend.c:1195)
==10190==by 0x8485D6: php_execute_script (main.c:2080)
==10190==by 0x95FABD: main (php_cli.c:1139)
==10190==  Address 0x8ed3af8 is 0 bytes inside a block of size 129 alloc'd
==10190==at 0x4C22DAB: malloc (vg_replace_malloc.c:207)
==10190==by 0x89922B: _emalloc (zend_alloc.c:2281)
==10190==by 0x6595CD: phar_flush (phar.c:2981)
==10190==by 0x664B5E: zim_Phar_setSignatureAlgorithm (phar_object.c:2727)
==10190==by 0x8EDD02: zend_do_fcall_common_helper_SPEC 
(zend_vm_execute.h:194)
==10190==by 0x8EEB0B: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(zend_vm_execute.h:295)
==10190==by 0x8ED5BD: execute (zend_vm_execute.h:96)
==10190==by 0x8BE54D: zend_execute_scripts (zend.c:1195)
==10190==by 0x8485D6: php_execute_script (main.c:2080)
==10190==by 0x95FABD: main (php_cli.c:1139)

and test_signaturealgos.phpt:

==10759== Conditional jump or move depends on uninitialised value(s)
==10759==at 0x89946E: safe_address (zend_alloc.c:2348)
==10759==by 0x89940F: _safe_emalloc (zend_alloc.c:2374)
==10759==by 0x6508F1: phar_hex_str (phar.c:495)
==10759==by 0x65196C: phar_parse_pharfile (phar.c:768)
==10759==by 0x6550DA: phar_open_from_fp (phar.c:1566)
==10759==by 0x653E01: phar_create_or_parse_filename (phar.c:1238)
==10759==by 0x653CAB: phar_open_or_create_filename (phar.c:1207)
==10759==by 0x65F594: zim_Phar___construct (phar_object.c:1162)
==10759==by 0x8EDD02: zend_do_fcall_common_helper_SPEC 
(zend_vm_execute.h:194)
==10759==by 0x8EEB0B: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(zend_vm_execute.h:295)
==10759==by 0x8ED5BD: execute (zend_vm_execute.h:96)
==10759==by 0x8BE54D: zend_execute_scripts (zend.c:1195)
==10759==
==10759== Conditional jump or move depends on uninitialised value(s)
==10759==at 0x65097B: phar_hex_str (phar.c:497)
==10759==by 0x65196C: phar_parse_pharfile (phar.c:768)
==10759==by 0x6550DA: phar_open_from_fp (phar.c:1566)
==10759==by 0x653E01: phar_create_or_parse_filename (phar.c:1238)
==10759==by 0x653CAB: phar_open_or_create_filename (phar.c:1207)
==10759==by 0x65F594: zim_Phar___construct (phar_object.c:1162)
==10759==by 0x8EDD02: zend_do_fcall_common_helper_SPEC 
(zend_vm_execute.h:194)
==10759==by 0x8EEB0B: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 
(zend_vm_execute.h:295)
==10759==by 0x8ED5BD: execute (zend_vm_execute.h:96)
==10759==by 0x8BE54D: zend_execute_scripts (zend.c:1195)
==10759==by 0x8485D6: php_execute_script (main.c:2080)
==10759==by 0x95FABD: main (php_cli.c:1139)


--
Wbr, 
Antony Dovgal


--
PHP CVS Mailing List (http://www.php.net/)
To u