@@ -5303,7 +5303,8 @@ PHP_FUNCTION(openssl_encrypt)
5303
5303
size_t data_len , method_len , password_len , iv_len = 0 , max_iv_len ;
5304
5304
const EVP_CIPHER * cipher_type ;
5305
5305
EVP_CIPHER_CTX cipher_ctx ;
5306
- int i = 0 , outlen , keylen ;
5306
+ int i = 0 , keylen ;
5307
+ size_t outlen ;
5307
5308
zend_string * outbuf ;
5308
5309
unsigned char * key ;
5309
5310
zend_bool free_iv ;
@@ -5334,7 +5335,7 @@ PHP_FUNCTION(openssl_encrypt)
5334
5335
}
5335
5336
free_iv = php_openssl_validate_iv (& iv , & iv_len , max_iv_len );
5336
5337
5337
- outlen = ( int ) data_len + EVP_CIPHER_block_size (cipher_type );
5338
+ outlen = data_len + EVP_CIPHER_block_size (cipher_type );
5338
5339
outbuf = zend_string_alloc (outlen , 0 );
5339
5340
5340
5341
EVP_EncryptInit (& cipher_ctx , cipher_type , NULL , NULL );
@@ -5386,7 +5387,8 @@ PHP_FUNCTION(openssl_decrypt)
5386
5387
size_t data_len , method_len , password_len , iv_len = 0 ;
5387
5388
const EVP_CIPHER * cipher_type ;
5388
5389
EVP_CIPHER_CTX cipher_ctx ;
5389
- int i , outlen , keylen ;
5390
+ int i , keylen ;
5391
+ size_t outlen ;
5390
5392
zend_string * outbuf ;
5391
5393
unsigned char * key ;
5392
5394
zend_string * base64_str = NULL ;
@@ -5410,7 +5412,7 @@ PHP_FUNCTION(openssl_decrypt)
5410
5412
}
5411
5413
5412
5414
if (!(options & OPENSSL_RAW_DATA )) {
5413
- base64_str = php_base64_decode ((unsigned char * )data , ( int ) data_len );
5415
+ base64_str = php_base64_decode ((unsigned char * )data , data_len );
5414
5416
if (!base64_str ) {
5415
5417
php_error_docref (NULL , E_WARNING , "Failed to base64 decode the input" );
5416
5418
RETURN_FALSE ;
@@ -5430,7 +5432,7 @@ PHP_FUNCTION(openssl_decrypt)
5430
5432
5431
5433
free_iv = php_openssl_validate_iv (& iv , & iv_len , EVP_CIPHER_iv_length (cipher_type ));
5432
5434
5433
- outlen = ( int ) data_len + EVP_CIPHER_block_size (cipher_type );
5435
+ outlen = data_len + EVP_CIPHER_block_size (cipher_type );
5434
5436
outbuf = zend_string_alloc (outlen , 0 );
5435
5437
5436
5438
EVP_DecryptInit (& cipher_ctx , cipher_type , NULL , NULL );
0 commit comments