@@ -1351,14 +1351,15 @@ static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_reso
1351
1351
if (Z_TYPE_P (val ) == IS_RESOURCE ) {
1352
1352
/* is it an x509 resource ? */
1353
1353
void * what ;
1354
+ zend_resource * res = Z_RES_P (val );
1354
1355
1355
- what = zend_fetch_resource_ex ( val , "OpenSSL X.509" , le_x509 );
1356
+ what = zend_fetch_resource ( res , "OpenSSL X.509" , le_x509 );
1356
1357
if (!what ) {
1357
1358
return NULL ;
1358
1359
}
1359
1360
/* this is so callers can decide if they should free the X509 */
1360
1361
if (resourceval ) {
1361
- * resourceval = Z_RES_P ( val ) ;
1362
+ * resourceval = res ;
1362
1363
Z_ADDREF_P (val );
1363
1364
}
1364
1365
return (X509 * )what ;
@@ -2762,11 +2763,12 @@ static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_r
2762
2763
}
2763
2764
if (Z_TYPE_P (val ) == IS_RESOURCE ) {
2764
2765
void * what ;
2766
+ zend_resource * res = Z_RES_P (val );
2765
2767
2766
- what = zend_fetch_resource_ex ( val , "OpenSSL X.509 CSR" , le_csr );
2768
+ what = zend_fetch_resource ( res , "OpenSSL X.509 CSR" , le_csr );
2767
2769
if (what ) {
2768
2770
if (resourceval ) {
2769
- * resourceval = Z_RES_P ( val ) ;
2771
+ * resourceval = res ;
2770
2772
Z_ADDREF_P (val );
2771
2773
}
2772
2774
return (X509_REQ * )what ;
@@ -3219,20 +3221,21 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
3219
3221
3220
3222
if (Z_TYPE_P (val ) == IS_RESOURCE ) {
3221
3223
void * what ;
3224
+ zend_resource * res = Z_RES_P (val );
3222
3225
3223
- what = zend_fetch_resource2_ex ( val , "OpenSSL X.509/key" , le_x509 , le_key );
3226
+ what = zend_fetch_resource2 ( res , "OpenSSL X.509/key" , le_x509 , le_key );
3224
3227
if (!what ) {
3225
3228
TMP_CLEAN ;
3226
3229
}
3227
3230
if (resourceval ) {
3228
- * resourceval = Z_RES_P ( val ) ;
3231
+ * resourceval = res ;
3229
3232
Z_ADDREF_P (val );
3230
3233
}
3231
- if (Z_RES_P ( val ) -> type == le_x509 ) {
3234
+ if (res -> type == le_x509 ) {
3232
3235
/* extract key from cert, depending on public_key param */
3233
3236
cert = (X509 * )what ;
3234
3237
free_cert = 0 ;
3235
- } else if (Z_RES_P ( val ) -> type == le_key ) {
3238
+ } else if (res -> type == le_key ) {
3236
3239
int is_priv ;
3237
3240
3238
3241
is_priv = php_openssl_is_private_key ((EVP_PKEY * )what );
0 commit comments