mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/openssl: Add X509 purpose constants.
- X509_PURPOSE_OCSP_HELPER. - X509_PURPOSE_TIMESTAMP_SIGN. - Also X509_PURPOSE_ANY is ok since 1.0.1+ Close GH-13149
This commit is contained in:
committed by
David Carlier
parent
4bd63568fb
commit
98e2948ca7
2
NEWS
2
NEWS
@@ -59,6 +59,8 @@ OpenSSL:
|
||||
(Jakub Zelenka)
|
||||
. Introduced new serial_hex parameter to openssl_csr_sign. (Jakub Zelenka,
|
||||
Florian Sowade)
|
||||
. Added X509_PURPOSE_OCSP_HELPER and X509_PURPOSE_TIMESTAMP_SIGN constants.
|
||||
(Vincent Jardin)
|
||||
|
||||
PDO:
|
||||
. Fixed setAttribute and getAttribute. (SakiTakamachi)
|
||||
|
||||
@@ -418,6 +418,10 @@ PDO_SQLITE:
|
||||
. The IntlDateFormatter class exposes now the new PATTERN constant
|
||||
reflecting udat api's UDAT_PATTERN.
|
||||
|
||||
- OpenSSL:
|
||||
. X509_PURPOSE_OCSP_HELPER.
|
||||
. X509_PURPOSE_TIMESTAMP_SIGN.
|
||||
|
||||
- Standard:
|
||||
. PHP_ROUND_CEILING.
|
||||
. PHP_ROUND_FLOOR.
|
||||
|
||||
@@ -44,13 +44,21 @@ const X509_PURPOSE_SMIME_ENCRYPT = UNKNOWN;
|
||||
* @cvalue X509_PURPOSE_CRL_SIGN
|
||||
*/
|
||||
const X509_PURPOSE_CRL_SIGN = UNKNOWN;
|
||||
#ifdef X509_PURPOSE_ANY
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue X509_PURPOSE_ANY
|
||||
*/
|
||||
const X509_PURPOSE_ANY = UNKNOWN;
|
||||
#endif
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue X509_PURPOSE_OCSP_HELPER
|
||||
*/
|
||||
const X509_PURPOSE_OCSP_HELPER = UNKNOWN;
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue X509_PURPOSE_TIMESTAMP_SIGN
|
||||
*/
|
||||
const X509_PURPOSE_TIMESTAMP_SIGN = UNKNOWN;
|
||||
|
||||
/* digest algorithm constants */
|
||||
|
||||
|
||||
6
ext/openssl/openssl_arginfo.h
generated
6
ext/openssl/openssl_arginfo.h
generated
@@ -1,5 +1,5 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 1bb1eab5199d2e72e624f7e93f59dd5114ed7c86 */
|
||||
* Stub hash: 295c11739a3588a8254db2fe904be6f9911f85b3 */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_x509_export_to_file, 0, 2, _IS_BOOL, 0)
|
||||
ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
|
||||
@@ -549,9 +549,9 @@ static void register_openssl_symbols(int module_number)
|
||||
REGISTER_LONG_CONSTANT("X509_PURPOSE_SMIME_SIGN", X509_PURPOSE_SMIME_SIGN, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("X509_PURPOSE_SMIME_ENCRYPT", X509_PURPOSE_SMIME_ENCRYPT, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("X509_PURPOSE_CRL_SIGN", X509_PURPOSE_CRL_SIGN, CONST_PERSISTENT);
|
||||
#if defined(X509_PURPOSE_ANY)
|
||||
REGISTER_LONG_CONSTANT("X509_PURPOSE_ANY", X509_PURPOSE_ANY, CONST_PERSISTENT);
|
||||
#endif
|
||||
REGISTER_LONG_CONSTANT("X509_PURPOSE_OCSP_HELPER", X509_PURPOSE_OCSP_HELPER, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("X509_PURPOSE_TIMESTAMP_SIGN", X509_PURPOSE_TIMESTAMP_SIGN, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA1", OPENSSL_ALGO_SHA1, CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD5", OPENSSL_ALGO_MD5, CONST_PERSISTENT);
|
||||
#if !defined(OPENSSL_NO_MD4)
|
||||
|
||||
@@ -42,6 +42,8 @@ var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_SIGN));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_ENCRYPT));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_CRL_SIGN));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_ANY));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_OCSP_HELPER));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_TIMESTAMP_SIGN));
|
||||
|
||||
/* int openssl_x509_checkpurpose ( mixed $x509cert , int $purpose [, array $cainfo = array() ] ); */
|
||||
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))
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_ENCRYPT, array($cpca)));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_CRL_SIGN, array($cpca)));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_ANY, array($cpca)));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_OCSP_HELPER, array($cpca)));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_TIMESTAMP_SIGN, array($cpca)));
|
||||
|
||||
/* int openssl_x509_checkpurpose ( mixed $x509cert , int $purpose [, array $cainfo = array() [, string $untrustedfile ]] ); function */
|
||||
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),
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_SMIME_ENCRYPT, array($cpca), $utfl));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_CRL_SIGN, array($cpca), $utfl));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_ANY, array($cpca), $utfl));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_OCSP_HELPER, array($cpca), $utfl));
|
||||
var_dump(openssl_x509_checkpurpose($sert, X509_PURPOSE_TIMESTAMP_SIGN, array($cpca), $utfl));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -122,6 +128,8 @@ bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
int(-1)
|
||||
int(-1)
|
||||
int(-1)
|
||||
@@ -136,6 +144,8 @@ bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -157,3 +167,5 @@ bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
|
||||
Reference in New Issue
Block a user