Hello Pierre-Alain,

Tuesday, November 18, 2008, 3:02:19 AM, you wrote:

> pajoye          Tue Nov 18 02:02:19 2008 UTC

>   Added files:                 (Branch: PHP_5_2)
>     /php-src/ext/openssl/tests  bug41033.pem bug41033.phpt 
>                                 bug41033pub.pem 

>   Modified files:              
>     /php-src/ext/openssl        openssl.c 
>   Log:
>   - MFH: #41033, enable signing with DSA keys
>   
> http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/openssl.c?r1=1.98.2.5.2.48&r2=1.98.2.5.2.49&diff_format=u
> Index: php-src/ext/openssl/openssl.c
> diff -u php-src/ext/openssl/openssl.c:1.98.2.5.2.48
> php-src/ext/openssl/openssl.c:1.98.2.5.2.49
> --- php-src/ext/openssl/openssl.c:1.98.2.5.2.48       Sun Oct 26 14:35:59 2008
> +++ php-src/ext/openssl/openssl.c       Tue Nov 18 02:02:19 2008
> @@ -20,7 +20,7 @@
>    
> +----------------------------------------------------------------------+
>   */
>  
> -/* $Id: openssl.c,v 1.98.2.5.2.48 2008/10/26 14:35:59 iliaa Exp $ */
> +/* $Id: openssl.c,v 1.98.2.5.2.49 2008/11/18 02:02:19 pajoye Exp $ */
>  
>  #ifdef HAVE_CONFIG_H
>  #include "config.h"
> @@ -56,6 +56,7 @@
>  #define OPENSSL_ALGO_MD5       2
>  #define OPENSSL_ALGO_MD4       3
>  #define OPENSSL_ALGO_MD2       4
> +#define OPENSSL_ALGO_DSS1      5
>  
>  #define DEBUG_SMIME    0
>  
> @@ -641,6 +642,9 @@
>                 case OPENSSL_ALGO_MD2:
>                         mdtype = (EVP_MD *) EVP_md2();
>                         break;
> +               case OPENSSL_ALGO_DSS1:
> +                       mdtype = (EVP_MD *) EVP_dss1();
> +                       break;
>                 default:
>                         return NULL;
>                         break;
> @@ -692,6 +696,7 @@
>         REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD5", OPENSSL_ALGO_MD5, 
> CONST_CS|CONST_PERSISTENT);
>         REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD4", OPENSSL_ALGO_MD4, 
> CONST_CS|CONST_PERSISTENT);
>         REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, 
> CONST_CS|CONST_PERSISTENT);
> +       REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, 
> CONST_CS|CONST_PERSISTENT);
>  
>         /* flags for S/MIME */
>         REGISTER_LONG_CONSTANT("PKCS7_DETACHED", PKCS7_DETACHED, 
> CONST_CS|CONST_PERSISTENT);
> @@ -1200,7 +1205,7 @@
>         STACK_OF(X509) * untrustedchain = NULL;
>         long purpose;
>         char * untrusted = NULL;
> -       int untrusted_len;
> +       int untrusted_len, ret;
>  
>         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zl|a!s",
> &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len)
>                         == FAILURE) {
> @@ -1224,7 +1229,15 @@
>         if (cert == NULL) {
>                 goto clean_exit;
>         }
> -       RETVAL_LONG(check_cert(cainfo, cert, untrustedchain, purpose));
> +
> +       ret = check_cert(cainfo, cert, untrustedchain, purpose);
> +
> +        if (ret != 0 && ret != 1) {
> +                RETVAL_LONG(ret);
> +        } else {
> +                RETVAL_BOOL(ret);
Why not simply: RETVAL_BOOL(ret != 0 and ret != 
> +        }
> +
>  
>  clean_exit:
>         if (certresource == 1 && cert) {

> http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/bug41033.pem?view=markup&rev=1.1
> Index: php-src/ext/openssl/tests/bug41033.pem
> +++ php-src/ext/openssl/tests/bug41033.pem

> http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/bug41033.phpt?view=markup&rev=1.1
> Index: php-src/ext/openssl/tests/bug41033.phpt
> +++ php-src/ext/openssl/tests/bug41033.phpt

> http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/bug41033pub.pem?view=markup&rev=1.1
> Index: php-src/ext/openssl/tests/bug41033pub.pem
> +++ php-src/ext/openssl/tests/bug41033pub.pem






Best regards,
 Marcus


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

Reply via email to