Skip to content

Commit 2cd2ca8

Browse files
committed
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4: Revert "Add missing X509 purpose constants"
2 parents da60849 + 41e4a77 commit 2cd2ca8

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

ext/openssl/openssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,9 +1175,9 @@ PHP_MINIT_FUNCTION(openssl)
11751175
REGISTER_LONG_CONSTANT("X509_PURPOSE_SMIME_SIGN", X509_PURPOSE_SMIME_SIGN, CONST_CS|CONST_PERSISTENT);
11761176
REGISTER_LONG_CONSTANT("X509_PURPOSE_SMIME_ENCRYPT", X509_PURPOSE_SMIME_ENCRYPT, CONST_CS|CONST_PERSISTENT);
11771177
REGISTER_LONG_CONSTANT("X509_PURPOSE_CRL_SIGN", X509_PURPOSE_CRL_SIGN, CONST_CS|CONST_PERSISTENT);
1178+
#ifdef X509_PURPOSE_ANY
11781179
REGISTER_LONG_CONSTANT("X509_PURPOSE_ANY", X509_PURPOSE_ANY, CONST_CS|CONST_PERSISTENT);
1179-
REGISTER_LONG_CONSTANT("X509_PURPOSE_OCSP_HELPER", X509_PURPOSE_OCSP_HELPER, CONST_CS|CONST_PERSISTENT);
1180-
REGISTER_LONG_CONSTANT("X509_PURPOSE_TIMESTAMP_SIGN", X509_PURPOSE_TIMESTAMP_SIGN, CONST_CS|CONST_PERSISTENT);
1180+
#endif
11811181

11821182
/* digest algorithm constants */
11831183
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA1", OPENSSL_ALGO_SHA1, CONST_CS|CONST_PERSISTENT);

ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_SIGN));
3737
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_ENCRYPT));
3838
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_CRL_SIGN));
3939
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_ANY));
40-
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_OCSP_HELPER));
41-
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_TIMESTAMP_SIGN));
4240

4341
/* int openssl_x509_checkpurpose ( mixed $x509cert , int $purpose [, array $cainfo = array() ] ); */
4442
var_dump(openssl_x509_checkpurpose($cert, X509_PURPOSE_SSL_CLIENT, array($cpca)));
@@ -62,8 +60,6 @@ var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_SIGN, array($cpca))
6260
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_ENCRYPT, array($cpca)));
6361
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_CRL_SIGN, array($cpca)));
6462
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_ANY, array($cpca)));
65-
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_OCSP_HELPER, array($cpca)));
66-
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_TIMESTAMP_SIGN, array($cpca)));
6763

6864
/* int openssl_x509_checkpurpose ( mixed $x509cert , int $purpose [, array $cainfo = array() [, string $untrustedfile ]] ); function */
6965
var_dump(openssl_x509_checkpurpose($cert, X509_PURPOSE_SSL_CLIENT, array($cpca), $utfl));
@@ -87,8 +83,6 @@ var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_SIGN, array($cpca),
8783
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_ENCRYPT, array($cpca), $utfl));
8884
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_CRL_SIGN, array($cpca), $utfl));
8985
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_ANY, array($cpca), $utfl));
90-
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_OCSP_HELPER, array($cpca), $utfl));
91-
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_TIMESTAMP_SIGN, array($cpca), $utfl));
9286
?>
9387
--EXPECT--
9488
bool(false)
@@ -119,8 +113,6 @@ bool(false)
119113
bool(false)
120114
bool(false)
121115
bool(false)
122-
bool(false)
123-
bool(false)
124116
int(-1)
125117
int(-1)
126118
int(-1)
@@ -135,8 +127,6 @@ bool(true)
135127
bool(true)
136128
bool(true)
137129
bool(true)
138-
bool(true)
139-
bool(false)
140130
bool(false)
141131
bool(false)
142132
bool(false)
@@ -158,5 +148,3 @@ bool(true)
158148
bool(true)
159149
bool(true)
160150
bool(true)
161-
bool(true)
162-
bool(false)

0 commit comments

Comments
 (0)