Skip to content

Commit 8d12614

Browse files
committed
test next X509_PURPOSE_
Thanks to the previous commit, we get new constants, let's check and enforce them: X509_PURPOSE_OCSP_HELPER, X509_PURPOSE_TIMESTAMP_SIGN
1 parent ae8ba6e commit 8d12614

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_SIGN));
4242
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_ENCRYPT));
4343
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_CRL_SIGN));
4444
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_ANY));
45+
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_OCSP_HELPER));
46+
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_TIMESTAMP_SIGN));
4547

4648
/* int openssl_x509_checkpurpose ( mixed $x509cert , int $purpose [, array $cainfo = array() ] ); */
4749
var_dump(openssl_x509_checkpurpose($cert, X509_PURPOSE_SSL_CLIENT, array($cpca)));
@@ -65,6 +67,8 @@ var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_SIGN, array($cpca))
6567
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_ENCRYPT, array($cpca)));
6668
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_CRL_SIGN, array($cpca)));
6769
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_ANY, array($cpca)));
70+
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_OCSP_HELPER, array($cpca)));
71+
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_TIMESTAMP_SIGN, array($cpca)));
6872

6973
/* int openssl_x509_checkpurpose ( mixed $x509cert , int $purpose [, array $cainfo = array() [, string $untrustedfile ]] ); function */
7074
var_dump(openssl_x509_checkpurpose($cert, X509_PURPOSE_SSL_CLIENT, array($cpca), $utfl));
@@ -88,6 +92,8 @@ var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_SIGN, array($cpca),
8892
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_ENCRYPT, array($cpca), $utfl));
8993
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_CRL_SIGN, array($cpca), $utfl));
9094
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_ANY, array($cpca), $utfl));
95+
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_OCSP_HELPER, array($cpca), $utfl));
96+
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_TIMESTAMP_SIGN, array($cpca), $utfl));
9197
?>
9298
--CLEAN--
9399
<?php
@@ -122,6 +128,8 @@ bool(false)
122128
bool(false)
123129
bool(false)
124130
bool(false)
131+
bool(false)
132+
bool(false)
125133
int(-1)
126134
int(-1)
127135
int(-1)
@@ -136,6 +144,8 @@ bool(true)
136144
bool(true)
137145
bool(true)
138146
bool(true)
147+
bool(true)
148+
bool(false)
139149
bool(false)
140150
bool(false)
141151
bool(false)
@@ -157,3 +167,5 @@ bool(true)
157167
bool(true)
158168
bool(true)
159169
bool(true)
170+
bool(true)
171+
bool(false)

0 commit comments

Comments
 (0)