Skip to content

Commit c7be96b

Browse files
committed
Revert "Add PBKDF2 support via openssl()"
This reverts commit b5b8ea1. Looks like we don't have agreement yet on this for 5.4. Let's keep it in 5.5 for now.
1 parent a2bfad0 commit c7be96b

File tree

3 files changed

+0
-93
lines changed

3 files changed

+0
-93
lines changed

ext/openssl/openssl.c

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0)
242242
ZEND_ARG_INFO(0, key)
243243
ZEND_END_ARG_INFO()
244244

245-
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
246-
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4)
247-
ZEND_ARG_INFO(0, password)
248-
ZEND_ARG_INFO(0, salt)
249-
ZEND_ARG_INFO(0, key_length)
250-
ZEND_ARG_INFO(0, iterations)
251-
ZEND_ARG_INFO(0, digest_algorithm)
252-
ZEND_END_ARG_INFO()
253-
#endif
254-
255245
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs7_verify, 0, 0, 2)
256246
ZEND_ARG_INFO(0, filename)
257247
ZEND_ARG_INFO(0, flags)
@@ -438,10 +428,6 @@ const zend_function_entry openssl_functions[] = {
438428
PHP_FE(openssl_seal, arginfo_openssl_seal)
439429
PHP_FE(openssl_open, arginfo_openssl_open)
440430

441-
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
442-
PHP_FE(openssl_pkcs5_pbkdf2_hmac, arginfo_openssl_pkcs5_pbkdf2_hmac)
443-
#endif
444-
445431
/* for S/MIME handling */
446432
PHP_FE(openssl_pkcs7_verify, arginfo_openssl_pkcs7_verify)
447433
PHP_FE(openssl_pkcs7_decrypt, arginfo_openssl_pkcs7_decrypt)
@@ -3331,57 +3317,6 @@ PHP_FUNCTION(openssl_pkey_get_details)
33313317

33323318
/* }}} */
33333319

3334-
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
3335-
3336-
/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
3337-
Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */
3338-
PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac)
3339-
{
3340-
long key_length = 0, iterations = 0;
3341-
char *password; int password_len;
3342-
char *salt; int salt_len;
3343-
char *method; int method_len = 0;
3344-
unsigned char *out_buffer;
3345-
3346-
const EVP_MD *digest;
3347-
3348-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssll|s",
3349-
&password, &password_len,
3350-
&salt, &salt_len,
3351-
&key_length, &iterations,
3352-
&method, &method_len) == FAILURE) {
3353-
return;
3354-
}
3355-
3356-
if (key_length <= 0) {
3357-
RETURN_FALSE;
3358-
}
3359-
3360-
if (method_len) {
3361-
digest = EVP_get_digestbyname(method);
3362-
} else {
3363-
digest = EVP_sha1();
3364-
}
3365-
3366-
if (!digest) {
3367-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
3368-
RETURN_FALSE;
3369-
}
3370-
3371-
out_buffer = emalloc(key_length + 1);
3372-
out_buffer[key_length] = '\0';
3373-
3374-
if (PKCS5_PBKDF2_HMAC(password, password_len, (unsigned char *)salt, salt_len, iterations, digest, key_length, out_buffer) == 1) {
3375-
RETVAL_STRINGL((char *)out_buffer, key_length, 0);
3376-
} else {
3377-
efree(out_buffer);
3378-
RETURN_FALSE;
3379-
}
3380-
}
3381-
/* }}} */
3382-
3383-
#endif
3384-
33853320
/* {{{ PKCS7 S/MIME functions */
33863321

33873322
/* {{{ proto bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts [, string content]]]])

ext/openssl/php_openssl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ PHP_FUNCTION(openssl_private_decrypt);
5252
PHP_FUNCTION(openssl_public_encrypt);
5353
PHP_FUNCTION(openssl_public_decrypt);
5454

55-
PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac);
56-
5755
PHP_FUNCTION(openssl_pkcs7_verify);
5856
PHP_FUNCTION(openssl_pkcs7_decrypt);
5957
PHP_FUNCTION(openssl_pkcs7_sign);

ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)