php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
openssl.c File Reference
#include "php.h"
#include "php_ini.h"
#include "php_openssl.h"
#include "zend_attributes.h"
#include "zend_exceptions.h"
#include "ext/standard/file.h"
#include "ext/standard/info.h"
#include "ext/standard/php_fopen_wrappers.h"
#include "ext/standard/md5.h"
#include "ext/standard/base64.h"
#include <openssl/evp.h>
#include <openssl/bn.h>
#include <openssl/rsa.h>
#include <openssl/dsa.h>
#include <openssl/dh.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include <openssl/crypto.h>
#include <openssl/pem.h>
#include <openssl/err.h>
#include <openssl/conf.h>
#include <openssl/rand.h>
#include <openssl/ssl.h>
#include <openssl/pkcs12.h>
#include <openssl/cms.h>
#include <time.h>
#include "openssl_arginfo.h"

Go to the source code of this file.

Data Structures

struct  _php_openssl_x509_request_object
 
struct  _php_openssl_pkey_object
 
struct  php_x509_request
 
struct  php_openssl_pem_password
 
struct  php_openssl_cipher_mode
 

Macros

#define MIN_KEY_LENGTH   384
 
#define OPENSSL_ALGO_SHA1   1
 
#define OPENSSL_ALGO_MD5   2
 
#define OPENSSL_ALGO_MD4   3
 
#define OPENSSL_ALGO_MD2   4
 
#define OPENSSL_ALGO_DSS1   5
 
#define OPENSSL_ALGO_SHA224   6
 
#define OPENSSL_ALGO_SHA256   7
 
#define OPENSSL_ALGO_SHA384   8
 
#define OPENSSL_ALGO_SHA512   9
 
#define OPENSSL_ALGO_RMD160   10
 
#define DEBUG_SMIME   0
 
#define Z_OPENSSL_REQUEST_P(zv)
 
#define Z_OPENSSL_PKEY_P(zv)
 
#define EVP_PKEY_get0_RSA(_pkey)
 
#define EVP_PKEY_get0_DH(_pkey)
 
#define EVP_PKEY_get0_DSA(_pkey)
 
#define EVP_PKEY_get0_EC_KEY(_pkey)
 
#define OpenSSL_version   SSLeay_version
 
#define OPENSSL_VERSION   SSLEAY_VERSION
 
#define X509_getm_notBefore   X509_get_notBefore
 
#define X509_getm_notAfter   X509_get_notAfter
 
#define EVP_CIPHER_CTX_reset   EVP_CIPHER_CTX_cleanup
 
#define PHP_OPENSSL_CHECK_NUMBER_CONVERSION(_cond, _name, _arg_num)
 
#define PHP_OPENSSL_CHECK_NUMBER_CONVERSION_NULL_RETURN(_cond, _name)
 
#define PHP_OPENSSL_CHECK_SIZE_T_TO_INT(_var, _name, _arg_num)
 
#define PHP_OPENSSL_CHECK_SIZE_T_TO_INT_NULL_RETURN(_var, _name)
 
#define PHP_OPENSSL_CHECK_SIZE_T_TO_UINT(_var, _name, _arg_num)
 
#define PHP_OPENSSL_CHECK_LONG_TO_INT(_var, _name, _arg_num)
 
#define PHP_OPENSSL_CHECK_LONG_TO_INT_NULL_RETURN(_var, _name)
 
#define PHP_SSL_REQ_INIT(req)
 
#define PHP_SSL_REQ_DISPOSE(req)
 
#define PHP_SSL_REQ_PARSE(req, zval)
 
#define PHP_SSL_CONFIG_SYNTAX_CHECK(var)
 
#define SET_OPTIONAL_STRING_ARG(key, varname, defval)
 
#define SET_OPTIONAL_LONG_ARG(key, varname, defval)
 
#define PHP_OPENSSL_RAND_ADD_TIME()
 
#define PHP_OPENSSL_ASN1_INTEGER_set   ASN1_INTEGER_set
 
#define TMP_CLEAN
 
#define OPENSSL_PKEY_GET_BN(_type, _name)
 
#define OPENSSL_PKEY_SET_BN(_data, _name)
 

Typedefs

typedef struct _php_openssl_x509_request_object php_openssl_request_object
 
typedef struct _php_openssl_pkey_object php_openssl_pkey_object
 

Enumerations

enum  php_openssl_key_type { OPENSSL_KEYTYPE_RSA , OPENSSL_KEYTYPE_DSA , OPENSSL_KEYTYPE_DH , OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA }
 
enum  php_openssl_cipher_type {
  PHP_OPENSSL_CIPHER_RC2_40 , PHP_OPENSSL_CIPHER_RC2_128 , PHP_OPENSSL_CIPHER_RC2_64 , PHP_OPENSSL_CIPHER_DES ,
  PHP_OPENSSL_CIPHER_3DES , PHP_OPENSSL_CIPHER_AES_128_CBC , PHP_OPENSSL_CIPHER_AES_192_CBC , PHP_OPENSSL_CIPHER_AES_256_CBC ,
  PHP_OPENSSL_CIPHER_DEFAULT = PHP_OPENSSL_CIPHER_AES_128_CBC
}
 
enum  php_openssl_encoding { ENCODING_DER , ENCODING_SMIME , ENCODING_PEM }
 

Functions

int DSA_set0_pqg (DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g)
 
int DSA_set0_key (DSA *d, BIGNUM *pub_key, BIGNUM *priv_key)
 
void php_openssl_store_errors (void)
 
bool php_openssl_check_path_ex (const char *file_path, size_t file_path_len, char *real_path, uint32_t arg_num, bool contains_file_protocol, bool is_from_array, const char *option_name)
 
php_streamphp_openssl_get_stream_from_ssl_handle (const SSL *ssl)
 
int php_openssl_get_ssl_stream_data_index (void)
 
 PHP_MINIT_FUNCTION (openssl)
 
 PHP_GINIT_FUNCTION (openssl)
 
 PHP_GSHUTDOWN_FUNCTION (openssl)
 
 PHP_MINFO_FUNCTION (openssl)
 
 PHP_MSHUTDOWN_FUNCTION (openssl)
 
 PHP_FUNCTION (openssl_get_cert_locations)
 
 PHP_FUNCTION (openssl_x509_export_to_file)
 
 PHP_FUNCTION (openssl_spki_new)
 
 PHP_FUNCTION (openssl_spki_verify)
 
 PHP_FUNCTION (openssl_spki_export)
 
 PHP_FUNCTION (openssl_spki_export_challenge)
 
 PHP_FUNCTION (openssl_x509_export)
 
zend_stringphp_openssl_x509_fingerprint (X509 *peer, const char *method, bool raw)
 
 PHP_FUNCTION (openssl_x509_fingerprint)
 
 PHP_FUNCTION (openssl_x509_check_private_key)
 
 PHP_FUNCTION (openssl_x509_verify)
 
 PHP_FUNCTION (openssl_x509_parse)
 
 PHP_FUNCTION (openssl_x509_checkpurpose)
 
 PHP_FUNCTION (openssl_x509_read)
 
 PHP_FUNCTION (openssl_x509_free)
 
 PHP_FUNCTION (openssl_pkcs12_export_to_file)
 
 PHP_FUNCTION (openssl_pkcs12_export)
 
 PHP_FUNCTION (openssl_pkcs12_read)
 
 PHP_FUNCTION (openssl_csr_export_to_file)
 
 PHP_FUNCTION (openssl_csr_export)
 
 PHP_FUNCTION (openssl_csr_sign)
 
 PHP_FUNCTION (openssl_csr_new)
 
 PHP_FUNCTION (openssl_csr_get_subject)
 
 PHP_FUNCTION (openssl_csr_get_public_key)
 
 PHP_FUNCTION (openssl_pkey_new)
 
 PHP_FUNCTION (openssl_pkey_export_to_file)
 
 PHP_FUNCTION (openssl_pkey_export)
 
 PHP_FUNCTION (openssl_pkey_get_public)
 
 PHP_FUNCTION (openssl_pkey_free)
 
 PHP_FUNCTION (openssl_pkey_get_private)
 
 PHP_FUNCTION (openssl_pkey_get_details)
 
 PHP_FUNCTION (openssl_dh_compute_key)
 
 PHP_FUNCTION (openssl_pkey_derive)
 
 PHP_FUNCTION (openssl_pbkdf2)
 
 PHP_FUNCTION (openssl_pkcs7_verify)
 
 PHP_FUNCTION (openssl_pkcs7_encrypt)
 
 PHP_FUNCTION (openssl_pkcs7_read)
 
 PHP_FUNCTION (openssl_pkcs7_sign)
 
 PHP_FUNCTION (openssl_pkcs7_decrypt)
 
 PHP_FUNCTION (openssl_cms_verify)
 
 PHP_FUNCTION (openssl_cms_encrypt)
 
 PHP_FUNCTION (openssl_cms_read)
 
 PHP_FUNCTION (openssl_cms_sign)
 
 PHP_FUNCTION (openssl_cms_decrypt)
 
 PHP_FUNCTION (openssl_private_encrypt)
 
 PHP_FUNCTION (openssl_private_decrypt)
 
 PHP_FUNCTION (openssl_public_encrypt)
 
 PHP_FUNCTION (openssl_public_decrypt)
 
 PHP_FUNCTION (openssl_error_string)
 
 PHP_FUNCTION (openssl_sign)
 
 PHP_FUNCTION (openssl_verify)
 
 PHP_FUNCTION (openssl_seal)
 
 PHP_FUNCTION (openssl_open)
 
 PHP_FUNCTION (openssl_get_md_methods)
 
 PHP_FUNCTION (openssl_get_cipher_methods)
 
 PHP_FUNCTION (openssl_digest)
 
PHP_OPENSSL_API zend_stringphp_openssl_encrypt (const char *data, size_t data_len, const char *method, size_t method_len, const char *password, size_t password_len, zend_long options, const char *iv, size_t iv_len, zval *tag, zend_long tag_len, const char *aad, size_t aad_len)
 
 PHP_FUNCTION (openssl_encrypt)
 
PHP_OPENSSL_API zend_stringphp_openssl_decrypt (const char *data, size_t data_len, const char *method, size_t method_len, const char *password, size_t password_len, zend_long options, const char *iv, size_t iv_len, const char *tag, zend_long tag_len, const char *aad, size_t aad_len)
 
 PHP_FUNCTION (openssl_decrypt)
 
PHP_OPENSSL_API zend_long php_openssl_cipher_iv_length (const char *method)
 
 PHP_FUNCTION (openssl_cipher_iv_length)
 
PHP_OPENSSL_API zend_long php_openssl_cipher_key_length (const char *method)
 
 PHP_FUNCTION (openssl_cipher_key_length)
 
PHP_OPENSSL_API zend_stringphp_openssl_random_pseudo_bytes (zend_long buffer_length)
 
 PHP_FUNCTION (openssl_random_pseudo_bytes)
 

Variables

zend_class_entryphp_openssl_certificate_ce
 
zend_module_entry openssl_module_entry
 

Macro Definition Documentation

◆ DEBUG_SMIME

#define DEBUG_SMIME   0

Definition at line 97 of file openssl.c.

◆ EVP_CIPHER_CTX_reset

#define EVP_CIPHER_CTX_reset   EVP_CIPHER_CTX_cleanup

Definition at line 444 of file openssl.c.

◆ EVP_PKEY_get0_DH

#define EVP_PKEY_get0_DH ( _pkey)
Value:
_pkey->pkey.dh

Definition at line 311 of file openssl.c.

◆ EVP_PKEY_get0_DSA

#define EVP_PKEY_get0_DSA ( _pkey)
Value:
_pkey->pkey.dsa

Definition at line 312 of file openssl.c.

◆ EVP_PKEY_get0_EC_KEY

#define EVP_PKEY_get0_EC_KEY ( _pkey)
Value:
_pkey->pkey.ec

Definition at line 313 of file openssl.c.

◆ EVP_PKEY_get0_RSA

#define EVP_PKEY_get0_RSA ( _pkey)
Value:
_pkey->pkey.rsa

Definition at line 310 of file openssl.c.

◆ MIN_KEY_LENGTH

#define MIN_KEY_LENGTH   384

Definition at line 76 of file openssl.c.

◆ OPENSSL_ALGO_DSS1

#define OPENSSL_ALGO_DSS1   5

Definition at line 88 of file openssl.c.

◆ OPENSSL_ALGO_MD2

#define OPENSSL_ALGO_MD2   4

Definition at line 85 of file openssl.c.

◆ OPENSSL_ALGO_MD4

#define OPENSSL_ALGO_MD4   3

Definition at line 82 of file openssl.c.

◆ OPENSSL_ALGO_MD5

#define OPENSSL_ALGO_MD5   2

Definition at line 80 of file openssl.c.

◆ OPENSSL_ALGO_RMD160

#define OPENSSL_ALGO_RMD160   10

Definition at line 95 of file openssl.c.

◆ OPENSSL_ALGO_SHA1

#define OPENSSL_ALGO_SHA1   1

Definition at line 79 of file openssl.c.

◆ OPENSSL_ALGO_SHA224

#define OPENSSL_ALGO_SHA224   6

Definition at line 90 of file openssl.c.

◆ OPENSSL_ALGO_SHA256

#define OPENSSL_ALGO_SHA256   7

Definition at line 91 of file openssl.c.

◆ OPENSSL_ALGO_SHA384

#define OPENSSL_ALGO_SHA384   8

Definition at line 92 of file openssl.c.

◆ OPENSSL_ALGO_SHA512

#define OPENSSL_ALGO_SHA512   9

Definition at line 93 of file openssl.c.

◆ OPENSSL_PKEY_GET_BN

#define OPENSSL_PKEY_GET_BN ( _type,
_name )
Value:
php_openssl_add_bn_to_array(&_type, _name, #_name)

Definition at line 3925 of file openssl.c.

◆ OPENSSL_PKEY_SET_BN

#define OPENSSL_PKEY_SET_BN ( _data,
_name )
Value:
do { \
zval *bn; \
if ((bn = zend_hash_str_find(Z_ARRVAL_P(_data), #_name, sizeof(#_name)-1)) != NULL && \
Z_TYPE_P(bn) == IS_STRING) { \
_name = BN_bin2bn( \
(unsigned char*)Z_STRVAL_P(bn), \
(int)Z_STRLEN_P(bn), NULL); \
} else { \
_name = NULL; \
} \
} while (0);
#define NULL
Definition gdcache.h:45
struct _zval_struct zval
ZEND_API zval *ZEND_FASTCALL zend_hash_str_find(const HashTable *ht, const char *str, size_t len)
Definition zend_hash.c:2689
#define Z_TYPE_P(zval_p)
Definition zend_types.h:660
#define Z_STRVAL_P(zval_p)
Definition zend_types.h:975
#define Z_ARRVAL_P(zval_p)
Definition zend_types.h:987
#define IS_STRING
Definition zend_types.h:606
#define Z_STRLEN_P(zval_p)
Definition zend_types.h:978

Definition at line 3927 of file openssl.c.

◆ OPENSSL_VERSION

#define OPENSSL_VERSION   SSLEAY_VERSION

Definition at line 441 of file openssl.c.

◆ OpenSSL_version

#define OpenSSL_version   SSLeay_version

Definition at line 440 of file openssl.c.

◆ PHP_OPENSSL_ASN1_INTEGER_set

#define PHP_OPENSSL_ASN1_INTEGER_set   ASN1_INTEGER_set

Definition at line 3227 of file openssl.c.

◆ PHP_OPENSSL_CHECK_LONG_TO_INT

#define PHP_OPENSSL_CHECK_LONG_TO_INT ( _var,
_name,
_arg_num )
Value:
#define PHP_OPENSSL_CHECK_NUMBER_CONVERSION(_cond, _name, _arg_num)
Definition openssl.c:450
#define ZEND_LONG_EXCEEDS_INT(zlong)

Definition at line 473 of file openssl.c.

◆ PHP_OPENSSL_CHECK_LONG_TO_INT_NULL_RETURN

#define PHP_OPENSSL_CHECK_LONG_TO_INT_NULL_RETURN ( _var,
_name )
Value:
#define PHP_OPENSSL_CHECK_NUMBER_CONVERSION_NULL_RETURN(_cond, _name)
Definition openssl.c:457

Definition at line 475 of file openssl.c.

◆ PHP_OPENSSL_CHECK_NUMBER_CONVERSION

#define PHP_OPENSSL_CHECK_NUMBER_CONVERSION ( _cond,
_name,
_arg_num )
Value:
do { \
if (_cond) { \
zend_argument_value_error((_arg_num), #_name" is too long"); \
RETURN_THROWS(); \
} \
} while(0)

Definition at line 450 of file openssl.c.

◆ PHP_OPENSSL_CHECK_NUMBER_CONVERSION_NULL_RETURN

#define PHP_OPENSSL_CHECK_NUMBER_CONVERSION_NULL_RETURN ( _cond,
_name )
Value:
do { \
if (_cond) { \
zend_value_error(#_name" is too long"); \
return NULL; \
} \
} while(0)

Definition at line 457 of file openssl.c.

◆ PHP_OPENSSL_CHECK_SIZE_T_TO_INT

#define PHP_OPENSSL_CHECK_SIZE_T_TO_INT ( _var,
_name,
_arg_num )
Value:
#define ZEND_SIZE_T_INT_OVFL(size)

Definition at line 465 of file openssl.c.

◆ PHP_OPENSSL_CHECK_SIZE_T_TO_INT_NULL_RETURN

#define PHP_OPENSSL_CHECK_SIZE_T_TO_INT_NULL_RETURN ( _var,
_name )
Value:

Definition at line 467 of file openssl.c.

◆ PHP_OPENSSL_CHECK_SIZE_T_TO_UINT

#define PHP_OPENSSL_CHECK_SIZE_T_TO_UINT ( _var,
_name,
_arg_num )
Value:
#define ZEND_SIZE_T_UINT_OVFL(size)

Definition at line 470 of file openssl.c.

◆ PHP_OPENSSL_RAND_ADD_TIME

#define PHP_OPENSSL_RAND_ADD_TIME ( )
Value:
php_openssl_rand_add_timeval()

Definition at line 1086 of file openssl.c.

◆ PHP_SSL_CONFIG_SYNTAX_CHECK

#define PHP_SSL_CONFIG_SYNTAX_CHECK ( var)
Value:
if (req->var && php_openssl_config_check_syntax(#var, \
req->config_filename, req->var, req->req_config) == FAILURE) return FAILURE
@ FAILURE
Definition zend_types.h:61

Definition at line 911 of file openssl.c.

◆ PHP_SSL_REQ_DISPOSE

#define PHP_SSL_REQ_DISPOSE ( req)
Value:
php_openssl_dispose_config(req)

Definition at line 908 of file openssl.c.

◆ PHP_SSL_REQ_INIT

#define PHP_SSL_REQ_INIT ( req)
Value:
memset(req, 0, sizeof(*req))
memset(ptr, 0, type->size)

Definition at line 907 of file openssl.c.

◆ PHP_SSL_REQ_PARSE

#define PHP_SSL_REQ_PARSE ( req,
zval )
Value:
php_openssl_parse_config(req, zval)

Definition at line 909 of file openssl.c.

◆ SET_OPTIONAL_LONG_ARG

#define SET_OPTIONAL_LONG_ARG ( key,
varname,
defval )
Value:
if (optional_args && (item = zend_hash_str_find(Z_ARRVAL_P(optional_args), key, sizeof(key)-1)) != NULL && Z_TYPE_P(item) == IS_LONG) \
varname = (int)Z_LVAL_P(item); \
else \
varname = defval
unsigned char key[REFLECTION_KEY_LEN]
#define IS_LONG
Definition zend_types.h:604
#define Z_LVAL_P(zval_p)
Definition zend_types.h:966

Definition at line 926 of file openssl.c.

◆ SET_OPTIONAL_STRING_ARG

#define SET_OPTIONAL_STRING_ARG ( key,
varname,
defval )
Value:
do { \
if (optional_args && (item = zend_hash_str_find(Z_ARRVAL_P(optional_args), key, sizeof(key)-1)) != NULL && Z_TYPE_P(item) == IS_STRING) { \
varname = Z_STRVAL_P(item); \
} else { \
varname = defval; \
if (varname == NULL) { \
php_openssl_store_errors(); \
} \
} \
} while(0)

Definition at line 914 of file openssl.c.

◆ TMP_CLEAN

#define TMP_CLEAN
Value:
if (Z_TYPE(tmp) == IS_STRING) {\
zval_ptr_dtor_str(&tmp); \
} \
return NULL;
#define Z_TYPE(zval)
Definition zend_types.h:659

◆ X509_getm_notAfter

#define X509_getm_notAfter   X509_get_notAfter

Definition at line 443 of file openssl.c.

◆ X509_getm_notBefore

#define X509_getm_notBefore   X509_get_notBefore

Definition at line 442 of file openssl.c.

◆ Z_OPENSSL_PKEY_P

#define Z_OPENSSL_PKEY_P ( zv)
Value:
php_openssl_pkey_from_obj(Z_OBJ_P(zv))
zval * zv
Definition ffi.c:3975
#define Z_OBJ_P(zval_p)
Definition zend_types.h:990

Definition at line 240 of file openssl.c.

◆ Z_OPENSSL_REQUEST_P

#define Z_OPENSSL_REQUEST_P ( zv)
Value:
php_openssl_request_from_obj(Z_OBJ_P(zv))

Definition at line 200 of file openssl.c.

Typedef Documentation

◆ php_openssl_pkey_object

◆ php_openssl_request_object

Enumeration Type Documentation

◆ php_openssl_cipher_type

Enumerator
PHP_OPENSSL_CIPHER_RC2_40 
PHP_OPENSSL_CIPHER_RC2_128 
PHP_OPENSSL_CIPHER_RC2_64 
PHP_OPENSSL_CIPHER_DES 
PHP_OPENSSL_CIPHER_3DES 
PHP_OPENSSL_CIPHER_AES_128_CBC 
PHP_OPENSSL_CIPHER_AES_192_CBC 
PHP_OPENSSL_CIPHER_AES_256_CBC 
PHP_OPENSSL_CIPHER_DEFAULT 

Definition at line 134 of file openssl.c.

◆ php_openssl_encoding

Enumerator
ENCODING_DER 
ENCODING_SMIME 
ENCODING_PEM 

Definition at line 151 of file openssl.c.

◆ php_openssl_key_type

Enumerator
OPENSSL_KEYTYPE_RSA 
OPENSSL_KEYTYPE_DSA 
OPENSSL_KEYTYPE_DH 
OPENSSL_KEYTYPE_DEFAULT 

Definition at line 118 of file openssl.c.

Function Documentation

◆ DSA_set0_key()

int DSA_set0_key ( DSA * d,
BIGNUM * pub_key,
BIGNUM * priv_key )

Definition at line 413 of file openssl.c.

◆ DSA_set0_pqg()

int DSA_set0_pqg ( DSA * d,
BIGNUM * p,
BIGNUM * q,
BIGNUM * g )

Definition at line 398 of file openssl.c.

◆ PHP_FUNCTION() [1/60]

PHP_FUNCTION ( openssl_cipher_iv_length )

Definition at line 8093 of file openssl.c.

◆ PHP_FUNCTION() [2/60]

PHP_FUNCTION ( openssl_cipher_key_length )

Definition at line 8122 of file openssl.c.

◆ PHP_FUNCTION() [3/60]

PHP_FUNCTION ( openssl_cms_decrypt )

Definition at line 6810 of file openssl.c.

◆ PHP_FUNCTION() [4/60]

PHP_FUNCTION ( openssl_cms_encrypt )

Definition at line 6350 of file openssl.c.

◆ PHP_FUNCTION() [5/60]

PHP_FUNCTION ( openssl_cms_read )

Definition at line 6528 of file openssl.c.

◆ PHP_FUNCTION() [6/60]

PHP_FUNCTION ( openssl_cms_sign )

Definition at line 6627 of file openssl.c.

◆ PHP_FUNCTION() [7/60]

PHP_FUNCTION ( openssl_cms_verify )

Definition at line 6178 of file openssl.c.

◆ PHP_FUNCTION() [8/60]

PHP_FUNCTION ( openssl_csr_export )

Definition at line 3175 of file openssl.c.

◆ PHP_FUNCTION() [9/60]

PHP_FUNCTION ( openssl_csr_export_to_file )

Definition at line 3120 of file openssl.c.

◆ PHP_FUNCTION() [10/60]

PHP_FUNCTION ( openssl_csr_get_public_key )

Definition at line 3540 of file openssl.c.

◆ PHP_FUNCTION() [11/60]

PHP_FUNCTION ( openssl_csr_get_subject )

Definition at line 3495 of file openssl.c.

◆ PHP_FUNCTION() [12/60]

PHP_FUNCTION ( openssl_csr_new )

Definition at line 3413 of file openssl.c.

◆ PHP_FUNCTION() [13/60]

PHP_FUNCTION ( openssl_csr_sign )

Definition at line 3231 of file openssl.c.

◆ PHP_FUNCTION() [14/60]

PHP_FUNCTION ( openssl_decrypt )

Definition at line 8048 of file openssl.c.

◆ PHP_FUNCTION() [15/60]

PHP_FUNCTION ( openssl_dh_compute_key )

Definition at line 5470 of file openssl.c.

◆ PHP_FUNCTION() [16/60]

PHP_FUNCTION ( openssl_digest )

Definition at line 7568 of file openssl.c.

◆ PHP_FUNCTION() [17/60]

PHP_FUNCTION ( openssl_encrypt )

Definition at line 7947 of file openssl.c.

◆ PHP_FUNCTION() [18/60]

PHP_FUNCTION ( openssl_error_string )

Definition at line 7102 of file openssl.c.

◆ PHP_FUNCTION() [19/60]

PHP_FUNCTION ( openssl_get_cert_locations )

Definition at line 1434 of file openssl.c.

◆ PHP_FUNCTION() [20/60]

PHP_FUNCTION ( openssl_get_cipher_methods )

Definition at line 7516 of file openssl.c.

◆ PHP_FUNCTION() [21/60]

PHP_FUNCTION ( openssl_get_md_methods )

Definition at line 7476 of file openssl.c.

◆ PHP_FUNCTION() [22/60]

PHP_FUNCTION ( openssl_open )

Definition at line 7389 of file openssl.c.

◆ PHP_FUNCTION() [23/60]

PHP_FUNCTION ( openssl_pbkdf2 )

Definition at line 5537 of file openssl.c.

◆ PHP_FUNCTION() [24/60]

PHP_FUNCTION ( openssl_pkcs12_export )

Definition at line 2703 of file openssl.c.

◆ PHP_FUNCTION() [25/60]

Definition at line 2600 of file openssl.c.

◆ PHP_FUNCTION() [26/60]

PHP_FUNCTION ( openssl_pkcs12_read )

Definition at line 2791 of file openssl.c.

◆ PHP_FUNCTION() [27/60]

PHP_FUNCTION ( openssl_pkcs7_decrypt )

Definition at line 6101 of file openssl.c.

◆ PHP_FUNCTION() [28/60]

PHP_FUNCTION ( openssl_pkcs7_encrypt )

Definition at line 5748 of file openssl.c.

◆ PHP_FUNCTION() [29/60]

PHP_FUNCTION ( openssl_pkcs7_read )

Definition at line 5880 of file openssl.c.

◆ PHP_FUNCTION() [30/60]

PHP_FUNCTION ( openssl_pkcs7_sign )

Definition at line 5981 of file openssl.c.

◆ PHP_FUNCTION() [31/60]

PHP_FUNCTION ( openssl_pkcs7_verify )

Definition at line 5614 of file openssl.c.

◆ PHP_FUNCTION() [32/60]

PHP_FUNCTION ( openssl_pkey_derive )

Definition at line 5497 of file openssl.c.

◆ PHP_FUNCTION() [33/60]

PHP_FUNCTION ( openssl_pkey_export )

Definition at line 4964 of file openssl.c.

◆ PHP_FUNCTION() [34/60]

PHP_FUNCTION ( openssl_pkey_export_to_file )

Definition at line 4892 of file openssl.c.

◆ PHP_FUNCTION() [35/60]

PHP_FUNCTION ( openssl_pkey_free )

Definition at line 5046 of file openssl.c.

◆ PHP_FUNCTION() [36/60]

PHP_FUNCTION ( openssl_pkey_get_details )

Definition at line 5130 of file openssl.c.

◆ PHP_FUNCTION() [37/60]

PHP_FUNCTION ( openssl_pkey_get_private )

Definition at line 5057 of file openssl.c.

◆ PHP_FUNCTION() [38/60]

PHP_FUNCTION ( openssl_pkey_get_public )

Definition at line 5028 of file openssl.c.

◆ PHP_FUNCTION() [39/60]

PHP_FUNCTION ( openssl_pkey_new )

Definition at line 4805 of file openssl.c.

◆ PHP_FUNCTION() [40/60]

PHP_FUNCTION ( openssl_private_decrypt )

Definition at line 6953 of file openssl.c.

◆ PHP_FUNCTION() [41/60]

PHP_FUNCTION ( openssl_private_encrypt )

Definition at line 6904 of file openssl.c.

◆ PHP_FUNCTION() [42/60]

PHP_FUNCTION ( openssl_public_decrypt )

Definition at line 7052 of file openssl.c.

◆ PHP_FUNCTION() [43/60]

PHP_FUNCTION ( openssl_public_encrypt )

Definition at line 7003 of file openssl.c.

◆ PHP_FUNCTION() [44/60]

PHP_FUNCTION ( openssl_random_pseudo_bytes )

Definition at line 8170 of file openssl.c.

◆ PHP_FUNCTION() [45/60]

PHP_FUNCTION ( openssl_seal )

Definition at line 7263 of file openssl.c.

◆ PHP_FUNCTION() [46/60]

PHP_FUNCTION ( openssl_sign )

Definition at line 7130 of file openssl.c.

◆ PHP_FUNCTION() [47/60]

PHP_FUNCTION ( openssl_spki_export )

Definition at line 1740 of file openssl.c.

◆ PHP_FUNCTION() [48/60]

Definition at line 1802 of file openssl.c.

◆ PHP_FUNCTION() [49/60]

PHP_FUNCTION ( openssl_spki_new )

Definition at line 1596 of file openssl.c.

◆ PHP_FUNCTION() [50/60]

PHP_FUNCTION ( openssl_spki_verify )

Definition at line 1683 of file openssl.c.

◆ PHP_FUNCTION() [51/60]

PHP_FUNCTION ( openssl_verify )

Definition at line 7201 of file openssl.c.

◆ PHP_FUNCTION() [52/60]

Definition at line 1959 of file openssl.c.

◆ PHP_FUNCTION() [53/60]

PHP_FUNCTION ( openssl_x509_checkpurpose )

Definition at line 2363 of file openssl.c.

◆ PHP_FUNCTION() [54/60]

PHP_FUNCTION ( openssl_x509_export )

Definition at line 1844 of file openssl.c.

◆ PHP_FUNCTION() [55/60]

PHP_FUNCTION ( openssl_x509_export_to_file )

Definition at line 1538 of file openssl.c.

◆ PHP_FUNCTION() [56/60]

PHP_FUNCTION ( openssl_x509_fingerprint )

Definition at line 1923 of file openssl.c.

◆ PHP_FUNCTION() [57/60]

PHP_FUNCTION ( openssl_x509_free )

Definition at line 2522 of file openssl.c.

◆ PHP_FUNCTION() [58/60]

PHP_FUNCTION ( openssl_x509_parse )

Definition at line 2101 of file openssl.c.

◆ PHP_FUNCTION() [59/60]

PHP_FUNCTION ( openssl_x509_read )

Definition at line 2498 of file openssl.c.

◆ PHP_FUNCTION() [60/60]

PHP_FUNCTION ( openssl_x509_verify )

Definition at line 1992 of file openssl.c.

◆ PHP_GINIT_FUNCTION()

PHP_GINIT_FUNCTION ( openssl )

Definition at line 1355 of file openssl.c.

◆ PHP_GSHUTDOWN_FUNCTION()

PHP_GSHUTDOWN_FUNCTION ( openssl )

Definition at line 1366 of file openssl.c.

◆ PHP_MINFO_FUNCTION()

PHP_MINFO_FUNCTION ( openssl )

Definition at line 1378 of file openssl.c.

◆ PHP_MINIT_FUNCTION()

PHP_MINIT_FUNCTION ( openssl )

Definition at line 1253 of file openssl.c.

◆ PHP_MSHUTDOWN_FUNCTION()

PHP_MSHUTDOWN_FUNCTION ( openssl )

Definition at line 1391 of file openssl.c.

◆ php_openssl_check_path_ex()

bool php_openssl_check_path_ex ( const char * file_path,
size_t file_path_len,
char * real_path,
uint32_t arg_num,
bool contains_file_protocol,
bool is_from_array,
const char * option_name )

Definition at line 554 of file openssl.c.

◆ php_openssl_cipher_iv_length()

PHP_OPENSSL_API zend_long php_openssl_cipher_iv_length ( const char * method)

Definition at line 8086 of file openssl.c.

◆ php_openssl_cipher_key_length()

PHP_OPENSSL_API zend_long php_openssl_cipher_key_length ( const char * method)

Definition at line 8115 of file openssl.c.

◆ php_openssl_decrypt()

PHP_OPENSSL_API zend_string * php_openssl_decrypt ( const char * data,
size_t data_len,
const char * method,
size_t method_len,
const char * password,
size_t password_len,
zend_long options,
const char * iv,
size_t iv_len,
const char * tag,
zend_long tag_len,
const char * aad,
size_t aad_len )

Definition at line 7968 of file openssl.c.

◆ php_openssl_encrypt()

PHP_OPENSSL_API zend_string * php_openssl_encrypt ( const char * data,
size_t data_len,
const char * method,
size_t method_len,
const char * password,
size_t password_len,
zend_long options,
const char * iv,
size_t iv_len,
zval * tag,
zend_long tag_len,
const char * aad,
size_t aad_len )

Definition at line 7855 of file openssl.c.

◆ php_openssl_get_ssl_stream_data_index()

int php_openssl_get_ssl_stream_data_index ( void )

Definition at line 618 of file openssl.c.

◆ php_openssl_get_stream_from_ssl_handle()

php_stream * php_openssl_get_stream_from_ssl_handle ( const SSL * ssl)

Definition at line 613 of file openssl.c.

◆ php_openssl_random_pseudo_bytes()

PHP_OPENSSL_API zend_string * php_openssl_random_pseudo_bytes ( zend_long buffer_length)

Definition at line 8144 of file openssl.c.

◆ php_openssl_store_errors()

void php_openssl_store_errors ( void )

Definition at line 479 of file openssl.c.

◆ php_openssl_x509_fingerprint()

zend_string * php_openssl_x509_fingerprint ( X509 * peer,
const char * method,
bool raw )

Definition at line 1896 of file openssl.c.

Variable Documentation

◆ openssl_module_entry

zend_module_entry openssl_module_entry
Initial value:
= {
"openssl",
ext_functions,
PHP_MINIT(openssl),
PHP_MSHUTDOWN(openssl),
PHP_MINFO(openssl),
PHP_OPENSSL_VERSION,
PHP_GINIT(openssl),
PHP_GSHUTDOWN(openssl),
}
#define PHP_GINIT
Definition php.h:397
#define PHP_MINFO
Definition php.h:396
#define PHP_MSHUTDOWN
Definition php.h:393
#define PHP_MINIT
Definition php.h:392
#define PHP_MODULE_GLOBALS
Definition php.h:408
#define PHP_GSHUTDOWN
Definition php.h:398
#define STANDARD_MODULE_HEADER
#define STANDARD_MODULE_PROPERTIES_EX

Definition at line 280 of file openssl.c.

◆ php_openssl_certificate_ce

zend_class_entry* php_openssl_certificate_ce

Definition at line 161 of file openssl.c.