@@ -1672,7 +1672,7 @@ PHP_FUNCTION(openssl_x509_export)
1672
1672
}
1673
1673
/* }}} */
1674
1674
1675
- static int php_openssl_x509_fingerprint (X509 * peer , const char * method , zend_bool raw , char * * out , int * out_len )
1675
+ static int php_openssl_x509_fingerprint (X509 * peer , const char * method , zend_bool raw , char * * out , int * out_len TSRMLS_DC )
1676
1676
{
1677
1677
unsigned char md [EVP_MAX_MD_SIZE ];
1678
1678
const EVP_MD * mdtype ;
@@ -1699,21 +1699,21 @@ static int php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_boo
1699
1699
return SUCCESS ;
1700
1700
}
1701
1701
1702
- static int php_x509_fingerprint_cmp (X509 * peer , const char * method , const char * expected )
1702
+ static int php_x509_fingerprint_cmp (X509 * peer , const char * method , const char * expected TSRMLS_DC )
1703
1703
{
1704
1704
char * fingerprint ;
1705
1705
int fingerprint_len ;
1706
1706
int result = -1 ;
1707
1707
1708
- if (php_openssl_x509_fingerprint (peer , method , 0 , & fingerprint , & fingerprint_len ) == SUCCESS ) {
1708
+ if (php_openssl_x509_fingerprint (peer , method , 0 , & fingerprint , & fingerprint_len TSRMLS_CC ) == SUCCESS ) {
1709
1709
result = strcmp (expected , fingerprint );
1710
1710
efree (fingerprint );
1711
1711
}
1712
1712
1713
1713
return result ;
1714
1714
}
1715
1715
1716
- static zend_bool php_x509_fingerprint_match (X509 * peer , zval * val )
1716
+ static zend_bool php_x509_fingerprint_match (X509 * peer , zval * val TSRMLS_DC )
1717
1717
{
1718
1718
if (Z_TYPE_P (val ) == IS_STRING ) {
1719
1719
const char * method = NULL ;
@@ -1728,7 +1728,7 @@ static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val)
1728
1728
break ;
1729
1729
}
1730
1730
1731
- return method && php_x509_fingerprint_cmp (peer , method , Z_STRVAL_P (val )) == 0 ;
1731
+ return method && php_x509_fingerprint_cmp (peer , method , Z_STRVAL_P (val ) TSRMLS_CC ) == 0 ;
1732
1732
} else if (Z_TYPE_P (val ) == IS_ARRAY ) {
1733
1733
HashPosition pos ;
1734
1734
zval * * current ;
@@ -1744,7 +1744,7 @@ static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val)
1744
1744
1745
1745
if (key_type == HASH_KEY_IS_STRING
1746
1746
&& Z_TYPE_PP (current ) == IS_STRING
1747
- && php_x509_fingerprint_cmp (peer , key , Z_STRVAL_PP (current )) != 0
1747
+ && php_x509_fingerprint_cmp (peer , key , Z_STRVAL_PP (current ) TSRMLS_CC ) != 0
1748
1748
) {
1749
1749
return 0 ;
1750
1750
}
@@ -1776,7 +1776,7 @@ PHP_FUNCTION(openssl_x509_fingerprint)
1776
1776
RETURN_FALSE ;
1777
1777
}
1778
1778
1779
- if (php_openssl_x509_fingerprint (cert , method , raw_output , & fingerprint , & fingerprint_len ) == SUCCESS ) {
1779
+ if (php_openssl_x509_fingerprint (cert , method , raw_output , & fingerprint , & fingerprint_len TSRMLS_CC ) == SUCCESS ) {
1780
1780
RETVAL_STRINGL (fingerprint , fingerprint_len , 0 );
1781
1781
} else {
1782
1782
RETVAL_FALSE ;
@@ -5009,7 +5009,7 @@ static zend_bool matches_san_list(X509 *peer, const char *subject_name)
5009
5009
return is_match ;
5010
5010
}
5011
5011
5012
- static zend_bool matches_common_name (X509 * peer , const char * subject_name )
5012
+ static zend_bool matches_common_name (X509 * peer , const char * subject_name TSRMLS_DC )
5013
5013
{
5014
5014
char buf [1024 ];
5015
5015
X509_NAME * cert_name ;
@@ -5068,7 +5068,7 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
5068
5068
5069
5069
if (GET_VER_OPT ("peer_fingerprint" )) {
5070
5070
if (Z_TYPE_PP (val ) == IS_STRING || Z_TYPE_PP (val ) == IS_ARRAY ) {
5071
- if (!php_x509_fingerprint_match (peer , * val )) {
5071
+ if (!php_x509_fingerprint_match (peer , * val TSRMLS_CC )) {
5072
5072
php_error_docref (NULL TSRMLS_CC , E_WARNING , "Peer fingerprint doesn't match" );
5073
5073
return FAILURE ;
5074
5074
}
@@ -5082,7 +5082,7 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
5082
5082
if (cnmatch ) {
5083
5083
if (matches_san_list (peer , cnmatch )) {
5084
5084
return SUCCESS ;
5085
- } else if (matches_common_name (peer , cnmatch )) {
5085
+ } else if (matches_common_name (peer , cnmatch TSRMLS_CC )) {
5086
5086
return SUCCESS ;
5087
5087
} else {
5088
5088
return FAILURE ;
0 commit comments