From: Stig Venaas Date: Sun, 7 Jan 2001 11:36:15 +0000 (+0000) Subject: Made OpenSSL extension work with 0.9.5 and changed version check to 0.9.5 X-Git-Tag: php-4.0.5RC1~700 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59fa3f3d044c2d9e3711750e1627e33047bfddd1;p=php Made OpenSSL extension work with 0.9.5 and changed version check to 0.9.5 --- diff --git a/acinclude.m4 b/acinclude.m4 index a84d1d9366..9465e7cd08 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -25,13 +25,13 @@ AC_DEFUN(PHP_SETUP_OPENSSL,[ AC_MSG_CHECKING(for OpenSSL version) AC_EGREP_CPP(yes,[ #include - #if OPENSSL_VERSION_NUMBER >= 0x0090600fL + #if OPENSSL_VERSION_NUMBER >= 0x0090500fL yes #endif ],[ - AC_MSG_RESULT(>= 0.9.6) + AC_MSG_RESULT(>= 0.9.5) ],[ - AC_MSG_ERROR(OpenSSL version 0.9.6 or greater required.) + AC_MSG_ERROR(OpenSSL version 0.9.5 or greater required.) ]) CPPFLAGS=$old_CPPFLAGS diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index b22bf5c369..d3e4399f5e 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -403,6 +403,7 @@ PHP_FUNCTION(openssl_seal) i++; } +#if OPENSSL_VERSION_NUMBER >= 0x0090600fL if (!EVP_EncryptInit(&ctx,EVP_rc4(),NULL,NULL)) { for (i=0; i= 0x0090600fL + || !EVP_SealUpdate(&ctx, buf, &len1, Z_STRVAL_PP(data), + Z_STRLEN_PP(data)) +#endif + ) { efree(buf); for (i=0; i= 0x0090600fL + && EVP_OpenUpdate(&ctx, buf, &len1, Z_STRVAL_PP(data), + Z_STRLEN_PP(data)) +#endif + ) { +#if OPENSSL_VERSION_NUMBER < 0x0090600fL + EVP_OpenUpdate(&ctx, buf, &len1, Z_STRVAL_PP(data), + Z_STRLEN_PP(data)); +#endif + if (!EVP_OpenFinal(&ctx, buf + len1, &len2) || + (len1 + len2 == 0)) { + efree(buf); + RETURN_FALSE; + } + } else { efree(buf); RETURN_FALSE; }