[PHP-DOC] cvs: php-src(PHP_5_3) /ext/phar config.m4 phar.c phar_internal.h phar_object.c /ext/phar/tests phar_get_supported_signatures_001.phpt phar_get_supported_signatures_002.phpt phar_setsignatur
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: /php-src/ext/phar config.m4 phar.c phar_internal.h phar_object.c /php-src/ext/phar/tests phar_get_supported_signatures_001.phpt phar_get_supported_signatures_002.phpt phar_setsignaturealgo2.phpt test_signaturealgos.phpt Log: add openssl signing support. This adds an extra parameter for the contents of the exported private key to Phar->setSignatureAlgorithm, and expects the public key to be in a file named blah.phar.pubkey in the same directory as the phar blah.phar. This works with openssl static or shared and fails gracefully if openssl is not present without adding a dependency. config.w32 needs updating to match config.m4 [DOC] http://cvs.php.net/viewvc.cgi/php-src/ext/phar/config.m4?r1=1.27.2.3&r2=1.27.2.4&diff_format=u Index: php-src/ext/phar/config.m4 diff -u php-src/ext/phar/config.m4:1.27.2.3 php-src/ext/phar/config.m4:1.27.2.4 --- php-src/ext/phar/config.m4:1.27.2.3 Sat May 17 20:07:22 2008 +++ php-src/ext/phar/config.m4 Sun Jun 1 04:21:26 2008 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.27.2.3 2008/05/17 20:07:22 cellog Exp $ +dnl $Id: config.m4,v 1.27.2.4 2008/06/01 04:21:26 cellog Exp $ dnl config.m4 for extension phar PHP_ARG_ENABLE(phar, for phar archive support, @@ -8,6 +8,17 @@ 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) PHP_ADD_BUILD_DIR($ext_builddir/lib, 1) PHP_SUBST(PHAR_SHARED_LIBADD) + AC_MSG_CHECKING([for phar openssl support]) + if test "$PHP_OPENSSL_SHARED" = "yes"; then +AC_MSG_RESULT([no (shared openssl)]) + else +if test "$PHP_OPENSSL" = "yes"; then + AC_MSG_RESULT([yes]) + AC_DEFINE(PHAR_HAVE_OPENSSL,1,[ ]) +else + AC_MSG_RESULT([no]) +fi + fi PHP_ADD_EXTENSION_DEP(phar, spl, true) PHP_ADD_MAKEFILE_FRAGMENT fi http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar.c?r1=1.370.2.9&r2=1.370.2.10&diff_format=u Index: php-src/ext/phar/phar.c diff -u php-src/ext/phar/phar.c:1.370.2.9 php-src/ext/phar/phar.c:1.370.2.10 --- php-src/ext/phar/phar.c:1.370.2.9 Fri May 30 22:49:33 2008 +++ php-src/ext/phar/phar.c Sun Jun 1 04:21:26 2008 @@ -17,13 +17,31 @@ +--+ */ -/* $Id: phar.c,v 1.370.2.9 2008/05/30 22:49:33 cellog Exp $ */ +/* $Id: phar.c,v 1.370.2.10 2008/06/01 04:21:26 cellog Exp $ */ #define PHAR_MAIN 1 #include "phar_internal.h" #include "SAPI.h" #include "func_interceptors.h" +#ifdef PHAR_HAVE_OPENSSL + +/* OpenSSL includes */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif + +static int phar_call_openssl_signverify(int is_sign, php_stream *fp, off_t end, char *key, int key_len, char **signature, int *signature_len TSRMLS_DC); + ZEND_DECLARE_MODULE_GLOBALS(phar) #if PHP_VERSION_ID >= 50300 char *(*phar_save_resolve_path)(const char *filename, int filename_len TSRMLS_DC); @@ -113,6 +131,7 @@ } if (phar->signature) { efree(phar->signature); + phar->signature = NULL; } if (phar->manifest.arBuckets) { zend_hash_destroy(&phar->manifest); @@ -592,6 +611,7 @@ int read_size, len; char sig_buf[8], *sig_ptr = sig_buf; off_t read_len; + size_t end_of_phar; if (-1 == php_stream_seek(fp, -8, SEEK_END) || (read_len = php_stream_tell(fp)) < 20 @@ -606,6 +626,149 @@ } PHAR_GET_32(sig_ptr, sig_flags); switch(sig_flags) { + case PHAR_SIG_OPENSSL: { +#ifdef PHAR_HAVE_OPENSSL + BIO *in; + EVP_PKEY *key; + EVP_MD *mdtype = (EVP_MD *) EVP_sha1(); + EVP_MD_CTX md_ctx; +#endif + php_uint32 signature_len, pubkey_len; + char *sig, *pubkey = NULL, *pfile; + off_t whence; + php_stream *pfp; + int tempsig; + + if (!zend_hash_exists(&module_registry, "openssl", sizeof("openssl"))) { + efree(savebuf); + php_stream_close(fp); + if (error) { + spprintf(error, 0, "phar \"%s\" openssl signature cannot be verified, openssl not loaded", fname); + } + return FAILURE; + } +
Re: [PHP-DOC] Re: [PEAR-DOC] Re: [PHP-DOC] [PhD] CHM Support
The configure.php changes in phpdoc/ are completely separate from PhD. All PhD needs is a file containing the XML (i.e. .manual.xml) which can be created with PHP: On a related note, it's worth mentioning that using "configure.php" is a temporary measure until PhD-Setup (its replacement) exists. Gwynne is working on that now but I'm sure she would enjoy some collaboration with others too. Also, welcome to the team Rudy! :) Regards, Philip
[PHP-DOC] Re: [PEAR-DOC] Re: [PHP-DOC] [PhD] CHM Support
On Sat, May 31, 2008 at 7:00 PM, Brett Bieber <[EMAIL PROTECTED]> wrote: > Hello > > On Sat, May 31, 2008 at 9:23 AM, Hannes Magnusson > <[EMAIL PROTECTED]> wrote: >> Hi all >> >> I'd say the next task would be to check the status of the php-gtk and >> pear docs, these are still in DocBook4? Any ETA on DB5 upgrade? > > I put together a script to handle the upconvert of peardoc to DB5. > http://wiki.pear.php.net/index.php/PEARDocMoveToDocbook5#Conversion_Script > > So getting to DB5 is fine... the question is - where we go from there? > I think we really need help with the build magic to get the > .manual.xml, a minimal setup utilizing PhD, and some recommendations > on the set/book structure we need to target. > > Can we use our existing build scripts to get all the way up to > .manual.xml with the new DB5 sources? For some reason I was thinking > we have to rewrite our entire build process. No no. There is no need to rewrite anything. The configure.php changes in phpdoc/ are completely separate from PhD. All PhD needs is a file containing the XML (i.e. .manual.xml) which can be created with PHP: load("manual.xml", LIBXML_NOENT | LIBXML_NSCLEAN); $dom->xinclude(); if ($dom->validate()) { $dom->save(".manual.xml"); } ?> The .manual.xml isn't technically even required for PhD, it is just faster :) Since pear-doc is using Docbook-DL you will not be able to build the manual after upgrading to DB5 since the DSSSL stylesheets simply don't support it, so before you upgrade the PhD theme/stylesheet needs to be ready. The last step (optional) is to upgrade to set/book structure like phpdoc/ did few weeks ago.. I don't exactly recommend you upgrade just yet though, start small (DB5&PhD) then maybe restructure late on. Rudy: I guess you should check out that DB5 upgrade script and produce a .manual.xml file which you can use a test file until you've created the theme... -Hannes
[PHP-DOC] Re: [PEAR-DOC] Re: [PHP-DOC] [PhD] CHM Support
Hello On Sat, May 31, 2008 at 9:23 AM, Hannes Magnusson <[EMAIL PROTECTED]> wrote: > Hi all > > I'd say the next task would be to check the status of the php-gtk and > pear docs, these are still in DocBook4? Any ETA on DB5 upgrade? I put together a script to handle the upconvert of peardoc to DB5. http://wiki.pear.php.net/index.php/PEARDocMoveToDocbook5#Conversion_Script So getting to DB5 is fine... the question is - where we go from there? I think we really need help with the build magic to get the .manual.xml, a minimal setup utilizing PhD, and some recommendations on the set/book structure we need to target. Can we use our existing build scripts to get all the way up to .manual.xml with the new DB5 sources? For some reason I was thinking we have to rewrite our entire build process. That's where peardoc is at... ready to move to DB5, just not sure what the next step is. -- Brett Bieber http://saltybeagle.com/
Re: [PHP-DOC] [PhD] CHM Support
Hi all (crossposting to pear-doc@ and php-gtk-doc@) On Fri, May 30, 2008 at 2:56 AM, Loudi <[EMAIL PROTECTED]> wrote: > Hi ! > > I'm Rudy Nappée, a Google Summer of Code student. > > I work this summer on PhD and will implement some new output formats such as > PDF or Unix-Manpage and new themes (PHP-GTK, Pear...). > > I made my first commit in the PhD repository with the CHM theme which allow > to generate CHM files with PhD. You'll find an example of a generated CHM > file at http://iutinfoa1.free.fr/SoC/php_manual_en.chm and a HOWTO about > generating CHM file in the PhD root of the CVS. > > I request for comments about the output CHM file, wait for any rendering > questions and especially want to know what do you think I should do (CHM > improvements, whished formats, ...). The CHM looks good! I wasn't really expecting it to be done so quickly :) I'd say the next task would be to check the status of the php-gtk and pear docs, these are still in DocBook4? Any ETA on DB5 upgrade? If it is still to soon to create PhD themes for pear/php-gtk I think unix man page output is the next item on Rudy's schedule.. php-gtk/pear-doc guys: By all means, let us know if there is anything we can do to help you out upgrading to DB5/PhD :) -Hannes