xref: /PHP-7.0/ext/openssl/php_openssl.h (revision 478f119a)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 7                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1997-2017 The PHP Group                                |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 3.01 of the PHP license,      |
8    | that is bundled with this package in the file LICENSE, and is        |
9    | available through the world-wide-web at the following url:           |
10    | http://www.php.net/license/3_01.txt                                  |
11    | If you did not receive a copy of the PHP license and are unable to   |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@php.net so we can mail you a copy immediately.               |
14    +----------------------------------------------------------------------+
15    | Authors: Stig Venaas <venaas@php.net>                                |
16    |          Wez Furlong <wez@thebrainroom.com                           |
17    +----------------------------------------------------------------------+
18  */
19 
20 /* $Id$ */
21 
22 #ifndef PHP_OPENSSL_H
23 #define PHP_OPENSSL_H
24 /* HAVE_OPENSSL would include SSL MySQL stuff */
25 #ifdef HAVE_OPENSSL_EXT
26 extern zend_module_entry openssl_module_entry;
27 #define phpext_openssl_ptr &openssl_module_entry
28 
29 #include "php_version.h"
30 #define PHP_OPENSSL_VERSION PHP_VERSION
31 
32 #define OPENSSL_RAW_DATA 1
33 #define OPENSSL_ZERO_PADDING 2
34 
35 #define OPENSSL_ERROR_X509_PRIVATE_KEY_VALUES_MISMATCH 0x0B080074
36 
37 /* Used for client-initiated handshake renegotiation DoS protection*/
38 #define OPENSSL_DEFAULT_RENEG_LIMIT 2
39 #define OPENSSL_DEFAULT_RENEG_WINDOW 300
40 #define OPENSSL_DEFAULT_STREAM_VERIFY_DEPTH 9
41 #define OPENSSL_DEFAULT_STREAM_CIPHERS "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:" \
42 	"ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:" \
43 	"DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:" \
44 	"ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:" \
45 	"ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:" \
46 	"DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:" \
47 	"AES256-GCM-SHA384:AES128:AES256:HIGH:!SSLv2:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!RC4:!ADH"
48 
49 php_stream_transport_factory_func php_openssl_ssl_socket_factory;
50 
51 PHP_MINIT_FUNCTION(openssl);
52 PHP_MSHUTDOWN_FUNCTION(openssl);
53 PHP_MINFO_FUNCTION(openssl);
54 
55 PHP_FUNCTION(openssl_pkey_get_private);
56 PHP_FUNCTION(openssl_pkey_get_public);
57 PHP_FUNCTION(openssl_pkey_free);
58 PHP_FUNCTION(openssl_pkey_new);
59 PHP_FUNCTION(openssl_pkey_export);
60 PHP_FUNCTION(openssl_pkey_export_to_file);
61 PHP_FUNCTION(openssl_pkey_get_details);
62 
63 PHP_FUNCTION(openssl_sign);
64 PHP_FUNCTION(openssl_verify);
65 PHP_FUNCTION(openssl_seal);
66 PHP_FUNCTION(openssl_open);
67 PHP_FUNCTION(openssl_private_encrypt);
68 PHP_FUNCTION(openssl_private_decrypt);
69 PHP_FUNCTION(openssl_public_encrypt);
70 PHP_FUNCTION(openssl_public_decrypt);
71 
72 PHP_FUNCTION(openssl_pbkdf2);
73 
74 PHP_FUNCTION(openssl_pkcs7_verify);
75 PHP_FUNCTION(openssl_pkcs7_decrypt);
76 PHP_FUNCTION(openssl_pkcs7_sign);
77 PHP_FUNCTION(openssl_pkcs7_encrypt);
78 
79 PHP_FUNCTION(openssl_error_string);
80 
81 PHP_FUNCTION(openssl_x509_read);
82 PHP_FUNCTION(openssl_x509_free);
83 PHP_FUNCTION(openssl_x509_parse);
84 PHP_FUNCTION(openssl_x509_checkpurpose);
85 PHP_FUNCTION(openssl_x509_export);
86 PHP_FUNCTION(openssl_x509_fingerprint);
87 PHP_FUNCTION(openssl_x509_export_to_file);
88 PHP_FUNCTION(openssl_x509_check_private_key);
89 
90 PHP_FUNCTION(openssl_pkcs12_export);
91 PHP_FUNCTION(openssl_pkcs12_export_to_file);
92 PHP_FUNCTION(openssl_pkcs12_read);
93 
94 PHP_FUNCTION(openssl_csr_new);
95 PHP_FUNCTION(openssl_csr_export);
96 PHP_FUNCTION(openssl_csr_export_to_file);
97 PHP_FUNCTION(openssl_csr_sign);
98 PHP_FUNCTION(openssl_csr_get_subject);
99 PHP_FUNCTION(openssl_csr_get_public_key);
100 
101 PHP_FUNCTION(openssl_spki_new);
102 PHP_FUNCTION(openssl_spki_verify);
103 PHP_FUNCTION(openssl_spki_export);
104 PHP_FUNCTION(openssl_spki_export_challenge);
105 
106 PHP_FUNCTION(openssl_get_cert_locations);
107 #else
108 
109 #define phpext_openssl_ptr NULL
110 
111 #endif
112 
113 #endif
114 
115 /*
116  * Local variables:
117  * tab-width: 4
118  * c-basic-offset: 4
119  * End:
120  */
121