From: Ilia Alshanetsky Date: Wed, 27 Jan 2010 12:55:01 +0000 (+0000) Subject: Fixed bug #50859 (build fails with openssl 1.0 due to md2 deprecation) X-Git-Tag: php-5.2.13RC1~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cbe25fd397ea7d5404c25ae7db67ab2a75a9c6cc;p=php Fixed bug #50859 (build fails with openssl 1.0 due to md2 deprecation) --- diff --git a/NEWS b/NEWS index 3526e77593..e3f10332e0 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,8 @@ PHP NEWS gdImageFilledPolygon (libgd #100). (Takeshi Abe) - Fixed build of mysqli with MySQL 5.5.0-m2. (Andrey) +- Fixed bug #50859 (build fails with openssl 1.0 due to md2 deprecation). + (Ilia, hanno at hboeck dot de) - Fixed bug #50832 (HTTP fopen wrapper does not support passwordless HTTP authentication). (Jani) - Fixed bug #50823 (ReflectionFunction::isDeprecated producing "cannot be called diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 5cbf6717e4..53714c632b 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -59,7 +59,9 @@ #define OPENSSL_ALGO_SHA1 1 #define OPENSSL_ALGO_MD5 2 #define OPENSSL_ALGO_MD4 3 +#ifdef HAVE_OPENSSL_MD2_H #define OPENSSL_ALGO_MD2 4 +#endif #define OPENSSL_ALGO_DSS1 5 #define DEBUG_SMIME 0 @@ -649,9 +651,11 @@ static EVP_MD * php_openssl_get_evp_md_from_algo(long algo) { /* {{{ */ case OPENSSL_ALGO_MD4: mdtype = (EVP_MD *) EVP_md4(); break; +#ifdef HAVE_OPENSSL_MD2_H case OPENSSL_ALGO_MD2: mdtype = (EVP_MD *) EVP_md2(); break; +#endif case OPENSSL_ALGO_DSS1: mdtype = (EVP_MD *) EVP_dss1(); break; @@ -705,7 +709,9 @@ PHP_MINIT_FUNCTION(openssl) REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA1", OPENSSL_ALGO_SHA1, CONST_CS|CONST_PERSISTENT); 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); +#ifdef HAVE_OPENSSL_MD2_H REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT); +#endif REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT); /* flags for S/MIME */