summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipensp@gmail.com>2012-06-11 17:08:38 (GMT)
committerFelipe Pena <felipensp@gmail.com>2012-06-11 17:08:38 (GMT)
commit733aaf23b1ba58e1a6abb9c0d00aedf67d143167 (patch)
tree4edb911e77d654529d8d01e8a8ff00bbf6059504
parent0c6351778a2974342f630a25a3bab4d8fee7e0c6 (diff)
downloadphp-733aaf23b1ba58e1a6abb9c0d00aedf67d143167.tar.gz
- Fixed build (PKCS5_PBKDF2_HMAC is from 1.0.0)
-rw-r--r--ext/openssl/openssl.c10
-rw-r--r--ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt2
2 files changed, 10 insertions, 2 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 12ecfa4..1f515c7 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -238,6 +238,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0)
ZEND_ARG_INFO(0, key)
ZEND_END_ARG_INFO()
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4)
ZEND_ARG_INFO(0, password)
ZEND_ARG_INFO(0, salt)
@@ -245,6 +246,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4)
ZEND_ARG_INFO(0, iterations)
ZEND_ARG_INFO(0, digest_algorithm)
ZEND_END_ARG_INFO()
+#endif
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs7_verify, 0, 0, 2)
ZEND_ARG_INFO(0, filename)
@@ -432,7 +434,9 @@ const zend_function_entry openssl_functions[] = {
PHP_FE(openssl_seal, arginfo_openssl_seal)
PHP_FE(openssl_open, arginfo_openssl_open)
- PHP_FE(openssl_pkcs5_pbkdf2_hmac, arginfo_openssl_pkcs5_pbkdf2_hmac)
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ PHP_FE(openssl_pkcs5_pbkdf2_hmac, arginfo_openssl_pkcs5_pbkdf2_hmac)
+#endif
/* for S/MIME handling */
PHP_FE(openssl_pkcs7_verify, arginfo_openssl_pkcs7_verify)
@@ -3323,6 +3327,8 @@ PHP_FUNCTION(openssl_pkey_get_details)
/* }}} */
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+
/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */
PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac)
@@ -3370,6 +3376,8 @@ PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac)
}
/* }}} */
+#endif
+
/* {{{ PKCS7 S/MIME functions */
/* {{{ proto bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts [, string content]]]])
diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
index 348d399..af1fcb1 100644
--- a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
+++ b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
@@ -1,7 +1,7 @@
--TEST--
openssl_pkcs5_pbkdf2_hmac() tests
--SKIPIF--
-<?php if (!extension_loaded("openssl")) print "skip"; ?>
+<?php if (!extension_loaded("openssl") || !function_exists("openssl_pkcs5_pbkdf2_hmac")) print "skip"; ?>
--FILE--
<?php
// official test vectors