From 4516e22160a32ea09b2e547ceebd9a009fc6b597 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 28 Sep 2024 08:02:19 +0200 Subject: [PATCH] simplify --- crypto_cipher.c | 8 ++------ crypto_hash.c | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/crypto_cipher.c b/crypto_cipher.c index fb3e410..f88c535 100644 --- a/crypto_cipher.c +++ b/crypto_cipher.c @@ -497,7 +497,7 @@ PHP_MINIT_FUNCTION(crypto_cipher) static inline void php_crypto_cipher_set_algorithm_name(zval *object, char *algorithm, phpc_str_size_t algorithm_len TSRMLS_DC) { -#if PHP_VERSION_ID < 80400 +#if PHP_VERSION_ID < 80200 php_strtoupper(algorithm, algorithm_len); #else zend_str_toupper(algorithm, algorithm_len); @@ -517,18 +517,14 @@ PHP_CRYPTO_API const EVP_CIPHER *php_crypto_get_cipher_algorithm( return NULL; } -#if PHP_VERSION_ID < 80400 +#if PHP_VERSION_ID < 80200 php_strtoupper(algorithm, algorithm_len); #else zend_str_toupper(algorithm, algorithm_len); #endif cipher = EVP_get_cipherbyname(algorithm); if (!cipher) { -#if PHP_VERSION_ID < 80400 - php_strtolower(algorithm, algorithm_len); -#else zend_str_tolower(algorithm, algorithm_len); -#endif cipher = EVP_get_cipherbyname(algorithm); } return cipher; diff --git a/crypto_hash.c b/crypto_hash.c index 9c4f182..46dd68f 100644 --- a/crypto_hash.c +++ b/crypto_hash.c @@ -319,7 +319,7 @@ PHP_MINIT_FUNCTION(crypto_hash) static inline void php_crypto_hash_set_algorithm_name(zval *object, char *algorithm, phpc_str_size_t algorithm_len TSRMLS_DC) { -#if PHP_VERSION_ID < 80400 +#if PHP_VERSION_ID < 80200 php_strtoupper(algorithm, algorithm_len); #else zend_str_toupper(algorithm, algorithm_len);