Skip to content

Commit

Permalink
ext/openssl: Use zend_result return type instead of int where applica…
Browse files Browse the repository at this point in the history
…ble (#17721)
  • Loading branch information
Girgias authored Feb 6, 2025
1 parent d662ab5 commit 78714d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions ext/openssl/openssl_backend_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ void php_openssl_dispose_config(struct php_x509_request * req)
}
}

int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded)
zend_result php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded)
{
char buffer[MAXPATHLEN];

Expand Down Expand Up @@ -448,7 +448,7 @@ int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded)
return SUCCESS;
}

int php_openssl_write_rand_file(const char * file, int egdsocket, int seeded)
zend_result php_openssl_write_rand_file(const char * file, int egdsocket, int seeded)
{
char buffer[MAXPATHLEN];

Expand Down Expand Up @@ -1746,7 +1746,7 @@ void php_openssl_load_cipher_mode(struct php_openssl_cipher_mode *mode, const EV
}
}

int php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv_required_len,
zend_result php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv_required_len,
bool *free_iv, EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode)
{
char *iv_new;
Expand Down Expand Up @@ -1797,7 +1797,7 @@ int php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv_require

}

int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
zend_result php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode,
const char **ppassword, size_t *ppassword_len, bool *free_password,
const char **piv, size_t *piv_len, bool *free_iv,
Expand Down Expand Up @@ -1869,7 +1869,7 @@ int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
return SUCCESS;
}

int php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
zend_result php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode,
zend_string **poutbuf, int *poutlen, const char *data, size_t data_len,
const char *aad, size_t aad_len, int enc)
Expand Down
10 changes: 5 additions & 5 deletions ext/openssl/php_openssl_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ static inline void php_openssl_rand_add_timeval(void) /* {{{ */

#endif

int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded);
int php_openssl_write_rand_file(const char * file, int egdsocket, int seeded);
zend_result php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded);
zend_result php_openssl_write_rand_file(const char * file, int egdsocket, int seeded);

EVP_MD * php_openssl_get_evp_md_from_algo(zend_long algo);
const EVP_CIPHER * php_openssl_get_evp_cipher_from_algo(zend_long algo);
Expand Down Expand Up @@ -359,16 +359,16 @@ static inline void php_openssl_set_aead_flags(struct php_openssl_cipher_mode *mo
#endif

void php_openssl_load_cipher_mode(struct php_openssl_cipher_mode *mode, const EVP_CIPHER *cipher_type);
int php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv_required_len,
zend_result php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv_required_len,
bool *free_iv, EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode);

int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
zend_result php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode,
const char **ppassword, size_t *ppassword_len, bool *free_password,
const char **piv, size_t *piv_len, bool *free_iv,
const char *tag, int tag_len, zend_long options, int enc);

int php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
zend_result php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode,
zend_string **poutbuf, int *poutlen, const char *data, size_t data_len,
const char *aad, size_t aad_len, int enc);
Expand Down

0 comments on commit 78714d0

Please sign in to comment.