Skip to content

Commit 78714d0

Browse files
authored
ext/openssl: Use zend_result return type instead of int where applicable (#17721)
1 parent d662ab5 commit 78714d0

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

ext/openssl/openssl_backend_common.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ void php_openssl_dispose_config(struct php_x509_request * req)
419419
}
420420
}
421421

422-
int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded)
422+
zend_result php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded)
423423
{
424424
char buffer[MAXPATHLEN];
425425

@@ -448,7 +448,7 @@ int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded)
448448
return SUCCESS;
449449
}
450450

451-
int php_openssl_write_rand_file(const char * file, int egdsocket, int seeded)
451+
zend_result php_openssl_write_rand_file(const char * file, int egdsocket, int seeded)
452452
{
453453
char buffer[MAXPATHLEN];
454454

@@ -1746,7 +1746,7 @@ void php_openssl_load_cipher_mode(struct php_openssl_cipher_mode *mode, const EV
17461746
}
17471747
}
17481748

1749-
int php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv_required_len,
1749+
zend_result php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv_required_len,
17501750
bool *free_iv, EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode)
17511751
{
17521752
char *iv_new;
@@ -1797,7 +1797,7 @@ int php_openssl_validate_iv(const char **piv, size_t *piv_len, size_t iv_require
17971797

17981798
}
17991799

1800-
int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
1800+
zend_result php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
18011801
EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode,
18021802
const char **ppassword, size_t *ppassword_len, bool *free_password,
18031803
const char **piv, size_t *piv_len, bool *free_iv,
@@ -1869,7 +1869,7 @@ int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
18691869
return SUCCESS;
18701870
}
18711871

1872-
int php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
1872+
zend_result php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
18731873
EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode,
18741874
zend_string **poutbuf, int *poutlen, const char *data, size_t data_len,
18751875
const char *aad, size_t aad_len, int enc)

ext/openssl/php_openssl_backend.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ static inline void php_openssl_rand_add_timeval(void) /* {{{ */
237237

238238
#endif
239239

240-
int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded);
241-
int php_openssl_write_rand_file(const char * file, int egdsocket, int seeded);
240+
zend_result php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded);
241+
zend_result php_openssl_write_rand_file(const char * file, int egdsocket, int seeded);
242242

243243
EVP_MD * php_openssl_get_evp_md_from_algo(zend_long algo);
244244
const EVP_CIPHER * php_openssl_get_evp_cipher_from_algo(zend_long algo);
@@ -359,16 +359,16 @@ static inline void php_openssl_set_aead_flags(struct php_openssl_cipher_mode *mo
359359
#endif
360360

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

365-
int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
365+
zend_result php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
366366
EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode,
367367
const char **ppassword, size_t *ppassword_len, bool *free_password,
368368
const char **piv, size_t *piv_len, bool *free_iv,
369369
const char *tag, int tag_len, zend_long options, int enc);
370370

371-
int php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
371+
zend_result php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
372372
EVP_CIPHER_CTX *cipher_ctx, struct php_openssl_cipher_mode *mode,
373373
zend_string **poutbuf, int *poutlen, const char *data, size_t data_len,
374374
const char *aad, size_t aad_len, int enc);

0 commit comments

Comments
 (0)