Skip to content

Commit 9d57243

Browse files
rdlowreynikic
authored andcommitted
Fixes broken zts build (recent openssl changes)
1 parent 0ca4b6c commit 9d57243

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ext/openssl/openssl.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ PHP_FUNCTION(openssl_x509_export)
16721672
}
16731673
/* }}} */
16741674

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)
16761676
{
16771677
unsigned char md[EVP_MAX_MD_SIZE];
16781678
const EVP_MD *mdtype;
@@ -1699,21 +1699,21 @@ static int php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_boo
16991699
return SUCCESS;
17001700
}
17011701

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)
17031703
{
17041704
char *fingerprint;
17051705
int fingerprint_len;
17061706
int result = -1;
17071707

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) {
17091709
result = strcmp(expected, fingerprint);
17101710
efree(fingerprint);
17111711
}
17121712

17131713
return result;
17141714
}
17151715

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)
17171717
{
17181718
if (Z_TYPE_P(val) == IS_STRING) {
17191719
const char *method = NULL;
@@ -1728,7 +1728,7 @@ static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val)
17281728
break;
17291729
}
17301730

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;
17321732
} else if (Z_TYPE_P(val) == IS_ARRAY) {
17331733
HashPosition pos;
17341734
zval **current;
@@ -1744,7 +1744,7 @@ static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val)
17441744

17451745
if (key_type == HASH_KEY_IS_STRING
17461746
&& 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
17481748
) {
17491749
return 0;
17501750
}
@@ -1776,7 +1776,7 @@ PHP_FUNCTION(openssl_x509_fingerprint)
17761776
RETURN_FALSE;
17771777
}
17781778

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) {
17801780
RETVAL_STRINGL(fingerprint, fingerprint_len, 0);
17811781
} else {
17821782
RETVAL_FALSE;
@@ -5009,7 +5009,7 @@ static zend_bool matches_san_list(X509 *peer, const char *subject_name)
50095009
return is_match;
50105010
}
50115011

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)
50135013
{
50145014
char buf[1024];
50155015
X509_NAME *cert_name;
@@ -5068,7 +5068,7 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
50685068

50695069
if (GET_VER_OPT("peer_fingerprint")) {
50705070
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)) {
50725072
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer fingerprint doesn't match");
50735073
return FAILURE;
50745074
}
@@ -5082,7 +5082,7 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
50825082
if (cnmatch) {
50835083
if (matches_san_list(peer, cnmatch)) {
50845084
return SUCCESS;
5085-
} else if (matches_common_name(peer, cnmatch)) {
5085+
} else if (matches_common_name(peer, cnmatch TSRMLS_CC)) {
50865086
return SUCCESS;
50875087
} else {
50885088
return FAILURE;

0 commit comments

Comments
 (0)