@@ -6119,7 +6119,7 @@ static void php_openssl_load_cipher_mode(struct php_openssl_cipher_mode *mode, c
6119
6119
}
6120
6120
/* }}} */
6121
6121
6122
- static int php_openssl_validate_iv (char * * piv , size_t * piv_len , size_t iv_required_len ,
6122
+ static int php_openssl_validate_iv (const char * * piv , size_t * piv_len , size_t iv_required_len ,
6123
6123
zend_bool * free_iv , EVP_CIPHER_CTX * cipher_ctx , struct php_openssl_cipher_mode * mode ) /* {{{ */
6124
6124
{
6125
6125
char * iv_new ;
@@ -6173,9 +6173,9 @@ static int php_openssl_validate_iv(char **piv, size_t *piv_len, size_t iv_requir
6173
6173
6174
6174
static int php_openssl_cipher_init (const EVP_CIPHER * cipher_type ,
6175
6175
EVP_CIPHER_CTX * cipher_ctx , struct php_openssl_cipher_mode * mode ,
6176
- char * * ppassword , size_t * ppassword_len , zend_bool * free_password ,
6177
- char * * piv , size_t * piv_len , zend_bool * free_iv ,
6178
- char * tag , int tag_len , zend_long options , int enc ) /* {{{ */
6176
+ const char * * ppassword , size_t * ppassword_len , zend_bool * free_password ,
6177
+ const char * * piv , size_t * piv_len , zend_bool * free_iv ,
6178
+ const char * tag , int tag_len , zend_long options , int enc ) /* {{{ */
6179
6179
{
6180
6180
unsigned char * key ;
6181
6181
int key_len , password_len ;
@@ -6245,8 +6245,8 @@ static int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
6245
6245
6246
6246
static int php_openssl_cipher_update (const EVP_CIPHER * cipher_type ,
6247
6247
EVP_CIPHER_CTX * cipher_ctx , struct php_openssl_cipher_mode * mode ,
6248
- zend_string * * poutbuf , int * poutlen , char * data , size_t data_len ,
6249
- char * aad , size_t aad_len , int enc ) /* {{{ */
6248
+ zend_string * * poutbuf , int * poutlen , const char * data , size_t data_len ,
6249
+ const char * aad , size_t aad_len , int enc ) /* {{{ */
6250
6250
{
6251
6251
int i = 0 ;
6252
6252
@@ -6256,7 +6256,7 @@ static int php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
6256
6256
return FAILURE ;
6257
6257
}
6258
6258
6259
- if (mode -> is_aead && !EVP_CipherUpdate (cipher_ctx , NULL , & i , (unsigned char * )aad , (int )aad_len )) {
6259
+ if (mode -> is_aead && !EVP_CipherUpdate (cipher_ctx , NULL , & i , (const unsigned char * ) aad , (int ) aad_len )) {
6260
6260
php_openssl_store_errors ();
6261
6261
php_error_docref (NULL , E_WARNING , "Setting of additional application data failed" );
6262
6262
return FAILURE ;
@@ -6265,7 +6265,7 @@ static int php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
6265
6265
* poutbuf = zend_string_alloc ((int )data_len + EVP_CIPHER_block_size (cipher_type ), 0 );
6266
6266
6267
6267
if (!EVP_CipherUpdate (cipher_ctx , (unsigned char * )ZSTR_VAL (* poutbuf ),
6268
- & i , (unsigned char * )data , (int )data_len )) {
6268
+ & i , (const unsigned char * )data , (int )data_len )) {
6269
6269
/* we don't show warning when we fail but if we ever do, then it should look like this:
6270
6270
if (mode->is_single_run_aead && !enc) {
6271
6271
php_error_docref(NULL, E_WARNING, "Tag verifycation failed");
@@ -6368,10 +6368,10 @@ PHP_OPENSSL_API zend_string* php_openssl_encrypt(
6368
6368
}
6369
6369
6370
6370
if (free_password ) {
6371
- efree (password );
6371
+ efree (( void * ) password );
6372
6372
}
6373
6373
if (free_iv ) {
6374
- efree (iv );
6374
+ efree (( void * ) iv );
6375
6375
}
6376
6376
EVP_CIPHER_CTX_reset (cipher_ctx );
6377
6377
EVP_CIPHER_CTX_free (cipher_ctx );
@@ -6467,10 +6467,10 @@ PHP_OPENSSL_API zend_string* php_openssl_decrypt(
6467
6467
}
6468
6468
6469
6469
if (free_password ) {
6470
- efree (password );
6470
+ efree (( void * ) password );
6471
6471
}
6472
6472
if (free_iv ) {
6473
- efree (iv );
6473
+ efree (( void * ) iv );
6474
6474
}
6475
6475
if (base64_str ) {
6476
6476
zend_string_release_ex (base64_str , 0 );
0 commit comments