Skip to content

Commit 18a02cc

Browse files
committed
Convert OpenSSL X.509 Certificate resource to object
1 parent 80b4d49 commit 18a02cc

25 files changed

+575
-367
lines changed

UPGRADING

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,14 @@ PHP 8.0 UPGRADE NOTES
325325
ISO 8859 aliases with underscores (ISO_8859_* and ISO8859_*) have also been
326326
removed.
327327

328+
- OpenSSL:
329+
. openssl_x509_read() and openssl_csr_sign() will now return an
330+
X509Certificate object rather than a resource. Return value checks using
331+
is_resource() should be replaced with checks for `false`.
332+
. The openssl_x509_free() function no longer has an effect, instead the
333+
X509Certificate instance is automatically destroyed if it is no longer
334+
referenced.
335+
328336
- OCI8:
329337
. Several alias functions have been marked as deprecated.
330338
. oci_internal_debug() and its alias ociinternaldebug() have been removed.

Zend/zend_API.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,9 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num
16021602
#define Z_PARAM_PATH(dest, dest_len) \
16031603
Z_PARAM_PATH_EX(dest, dest_len, 0, 0)
16041604

1605+
#define Z_PARAM_PATH_OR_NULL(dest, dest_len) \
1606+
Z_PARAM_PATH_EX(dest, dest_len, 1, 0)
1607+
16051608
/* old "P" */
16061609
#define Z_PARAM_PATH_STR_EX2(dest, check_null, deref, separate) \
16071610
Z_PARAM_PROLOGUE(deref, separate); \
@@ -1682,6 +1685,9 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_value_error(uint32_t arg_num
16821685
#define Z_PARAM_ZVAL(dest) \
16831686
Z_PARAM_ZVAL_EX(dest, 0, 0)
16841687

1688+
#define Z_PARAM_ZVAL_OR_NULL(dest) \
1689+
Z_PARAM_ZVAL_EX(dest, 1, 0)
1690+
16851691
/* old "+" and "*" */
16861692
#define Z_PARAM_VARIADIC_EX(spec, dest, dest_num, post_varargs) do { \
16871693
uint32_t _num_varargs = _num_args - _i - (post_varargs); \
@@ -2008,7 +2014,8 @@ static zend_always_inline int zend_parse_arg_str_or_obj(
20082014
) {
20092015
if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) {
20102016
if (base_ce && UNEXPECTED(!instanceof_function(Z_OBJCE_P(arg), base_ce))) {
2011-
return 0;
2017+
*destination_object = NULL;
2018+
return zend_parse_arg_str_slow(arg, destination_string);
20122019
}
20132020

20142021
*destination_string = NULL;

0 commit comments

Comments
 (0)