@@ -705,6 +705,12 @@ static int X509_get_signature_nid(const X509 *x)
705
705
706
706
#endif
707
707
708
+ #define OpenSSL_version SSLeay_version
709
+ #define OPENSSL_VERSION SSLEAY_VERSION
710
+ #define X509_getm_notBefore X509_get_notBefore
711
+ #define X509_getm_notAfter X509_get_notAfter
712
+ #define EVP_CIPHER_CTX_reset EVP_CIPHER_CTX_cleanup
713
+
708
714
#endif
709
715
/* }}} */
710
716
@@ -1617,7 +1623,7 @@ PHP_MINFO_FUNCTION(openssl)
1617
1623
{
1618
1624
php_info_print_table_start ();
1619
1625
php_info_print_table_row (2 , "OpenSSL support" , "enabled" );
1620
- php_info_print_table_row (2 , "OpenSSL Library Version" , SSLeay_version ( SSLEAY_VERSION ));
1626
+ php_info_print_table_row (2 , "OpenSSL Library Version" , OpenSSL_version ( OPENSSL_VERSION ));
1621
1627
php_info_print_table_row (2 , "OpenSSL Header Version" , OPENSSL_VERSION_TEXT );
1622
1628
php_info_print_table_row (2 , "Openssl default config" , default_ssl_conf_filename );
1623
1629
php_info_print_table_end ();
@@ -2420,11 +2426,11 @@ PHP_FUNCTION(openssl_x509_parse)
2420
2426
add_assoc_string (return_value , "serialNumberHex" , hex_serial );
2421
2427
OPENSSL_free (hex_serial );
2422
2428
2423
- php_openssl_add_assoc_asn1_string (return_value , "validFrom" , X509_get_notBefore (cert ));
2424
- php_openssl_add_assoc_asn1_string (return_value , "validTo" , X509_get_notAfter (cert ));
2429
+ php_openssl_add_assoc_asn1_string (return_value , "validFrom" , X509_getm_notBefore (cert ));
2430
+ php_openssl_add_assoc_asn1_string (return_value , "validTo" , X509_getm_notAfter (cert ));
2425
2431
2426
- add_assoc_long (return_value , "validFrom_time_t" , php_openssl_asn1_time_to_time_t (X509_get_notBefore (cert )));
2427
- add_assoc_long (return_value , "validTo_time_t" , php_openssl_asn1_time_to_time_t (X509_get_notAfter (cert )));
2432
+ add_assoc_long (return_value , "validFrom_time_t" , php_openssl_asn1_time_to_time_t (X509_getm_notBefore (cert )));
2433
+ add_assoc_long (return_value , "validTo_time_t" , php_openssl_asn1_time_to_time_t (X509_getm_notAfter (cert )));
2428
2434
2429
2435
tmpstr = (char * )X509_alias_get0 (cert , NULL );
2430
2436
if (tmpstr ) {
@@ -3525,8 +3531,8 @@ PHP_FUNCTION(openssl_csr_sign)
3525
3531
php_openssl_store_errors ();
3526
3532
goto cleanup ;
3527
3533
}
3528
- X509_gmtime_adj (X509_get_notBefore (new_cert ), 0 );
3529
- X509_gmtime_adj (X509_get_notAfter (new_cert ), 60 * 60 * 24 * (long )num_days );
3534
+ X509_gmtime_adj (X509_getm_notBefore (new_cert ), 0 );
3535
+ X509_gmtime_adj (X509_getm_notAfter (new_cert ), 60 * 60 * 24 * (long )num_days );
3530
3536
i = X509_set_pubkey (new_cert , key );
3531
3537
if (!i ) {
3532
3538
php_openssl_store_errors ();
@@ -6197,7 +6203,7 @@ PHP_FUNCTION(openssl_seal)
6197
6203
6198
6204
/* allocate one byte extra to make room for \0 */
6199
6205
buf = emalloc (data_len + EVP_CIPHER_CTX_block_size (ctx ));
6200
- EVP_CIPHER_CTX_cleanup (ctx );
6206
+ EVP_CIPHER_CTX_reset (ctx );
6201
6207
6202
6208
if (EVP_SealInit (ctx , cipher , eks , eksl , & iv_buf [0 ], pkeys , nkeys ) <= 0 ||
6203
6209
!EVP_SealUpdate (ctx , buf , & len1 , (unsigned char * )data , (int )data_len ) ||
@@ -6739,7 +6745,7 @@ PHP_OPENSSL_API zend_string* php_openssl_encrypt(char *data, size_t data_len, ch
6739
6745
if (free_iv ) {
6740
6746
efree (iv );
6741
6747
}
6742
- EVP_CIPHER_CTX_cleanup (cipher_ctx );
6748
+ EVP_CIPHER_CTX_reset (cipher_ctx );
6743
6749
EVP_CIPHER_CTX_free (cipher_ctx );
6744
6750
return outbuf ;
6745
6751
}
@@ -6834,7 +6840,7 @@ PHP_OPENSSL_API zend_string* php_openssl_decrypt(char *data, size_t data_len, ch
6834
6840
if (base64_str ) {
6835
6841
zend_string_release_ex (base64_str , 0 );
6836
6842
}
6837
- EVP_CIPHER_CTX_cleanup (cipher_ctx );
6843
+ EVP_CIPHER_CTX_reset (cipher_ctx );
6838
6844
EVP_CIPHER_CTX_free (cipher_ctx );
6839
6845
return outbuf ;
6840
6846
}
0 commit comments