xref: /PHP-8.1/ext/openssl/openssl_arginfo.h (revision c8218867)
1 /* This is a generated file, edit the .stub.php file instead.
2  * Stub hash: b820bb89ed3a0612473de268b057663ee237f876 */
3 
4 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_x509_export_to_file, 0, 2, _IS_BOOL, 0)
5 	ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
6 	ZEND_ARG_TYPE_INFO(0, output_filename, IS_STRING, 0)
7 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, no_text, _IS_BOOL, 0, "true")
8 ZEND_END_ARG_INFO()
9 
10 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_x509_export, 0, 2, _IS_BOOL, 0)
11 	ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
12 	ZEND_ARG_INFO(1, output)
13 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, no_text, _IS_BOOL, 0, "true")
14 ZEND_END_ARG_INFO()
15 
16 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_x509_fingerprint, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
17 	ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
18 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, digest_algo, IS_STRING, 0, "\"sha1\"")
19 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
20 ZEND_END_ARG_INFO()
21 
22 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_x509_check_private_key, 0, 2, _IS_BOOL, 0)
23 	ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
24 	ZEND_ARG_INFO(0, private_key)
25 ZEND_END_ARG_INFO()
26 
27 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_x509_verify, 0, 2, IS_LONG, 0)
28 	ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
29 	ZEND_ARG_INFO(0, public_key)
30 ZEND_END_ARG_INFO()
31 
32 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_x509_parse, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
33 	ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
34 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, short_names, _IS_BOOL, 0, "true")
35 ZEND_END_ARG_INFO()
36 
37 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_x509_checkpurpose, 0, 2, MAY_BE_BOOL|MAY_BE_LONG)
38 	ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
39 	ZEND_ARG_TYPE_INFO(0, purpose, IS_LONG, 0)
40 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ca_info, IS_ARRAY, 0, "[]")
41 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, untrusted_certificates_file, IS_STRING, 1, "null")
42 ZEND_END_ARG_INFO()
43 
44 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_openssl_x509_read, 0, 1, OpenSSLCertificate, MAY_BE_FALSE)
45 	ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
46 ZEND_END_ARG_INFO()
47 
48 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_x509_free, 0, 1, IS_VOID, 0)
49 	ZEND_ARG_OBJ_INFO(0, certificate, OpenSSLCertificate, 0)
50 ZEND_END_ARG_INFO()
51 
52 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkcs12_export_to_file, 0, 4, _IS_BOOL, 0)
53 	ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
54 	ZEND_ARG_TYPE_INFO(0, output_filename, IS_STRING, 0)
55 	ZEND_ARG_INFO(0, private_key)
56 	ZEND_ARG_TYPE_INFO(0, passphrase, IS_STRING, 0)
57 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
58 ZEND_END_ARG_INFO()
59 
60 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkcs12_export, 0, 4, _IS_BOOL, 0)
61 	ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
62 	ZEND_ARG_INFO(1, output)
63 	ZEND_ARG_INFO(0, private_key)
64 	ZEND_ARG_TYPE_INFO(0, passphrase, IS_STRING, 0)
65 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
66 ZEND_END_ARG_INFO()
67 
68 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkcs12_read, 0, 3, _IS_BOOL, 0)
69 	ZEND_ARG_TYPE_INFO(0, pkcs12, IS_STRING, 0)
70 	ZEND_ARG_INFO(1, certificates)
71 	ZEND_ARG_TYPE_INFO(0, passphrase, IS_STRING, 0)
72 ZEND_END_ARG_INFO()
73 
74 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_csr_export_to_file, 0, 2, _IS_BOOL, 0)
75 	ZEND_ARG_OBJ_TYPE_MASK(0, csr, OpenSSLCertificateSigningRequest, MAY_BE_STRING, NULL)
76 	ZEND_ARG_TYPE_INFO(0, output_filename, IS_STRING, 0)
77 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, no_text, _IS_BOOL, 0, "true")
78 ZEND_END_ARG_INFO()
79 
80 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_csr_export, 0, 2, _IS_BOOL, 0)
81 	ZEND_ARG_OBJ_TYPE_MASK(0, csr, OpenSSLCertificateSigningRequest, MAY_BE_STRING, NULL)
82 	ZEND_ARG_INFO(1, output)
83 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, no_text, _IS_BOOL, 0, "true")
84 ZEND_END_ARG_INFO()
85 
86 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_openssl_csr_sign, 0, 4, OpenSSLCertificate, MAY_BE_FALSE)
87 	ZEND_ARG_OBJ_TYPE_MASK(0, csr, OpenSSLCertificateSigningRequest, MAY_BE_STRING, NULL)
88 	ZEND_ARG_OBJ_TYPE_MASK(0, ca_certificate, OpenSSLCertificate, MAY_BE_STRING|MAY_BE_NULL, NULL)
89 	ZEND_ARG_INFO(0, private_key)
90 	ZEND_ARG_TYPE_INFO(0, days, IS_LONG, 0)
91 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")
92 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, serial, IS_LONG, 0, "0")
93 ZEND_END_ARG_INFO()
94 
95 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_openssl_csr_new, 0, 2, OpenSSLCertificateSigningRequest, MAY_BE_FALSE)
96 	ZEND_ARG_TYPE_INFO(0, distinguished_names, IS_ARRAY, 0)
97 	ZEND_ARG_INFO(1, private_key)
98 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")
99 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extra_attributes, IS_ARRAY, 1, "null")
100 ZEND_END_ARG_INFO()
101 
102 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_csr_get_subject, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
103 	ZEND_ARG_OBJ_TYPE_MASK(0, csr, OpenSSLCertificateSigningRequest, MAY_BE_STRING, NULL)
104 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, short_names, _IS_BOOL, 0, "true")
105 ZEND_END_ARG_INFO()
106 
107 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_openssl_csr_get_public_key, 0, 1, OpenSSLAsymmetricKey, MAY_BE_FALSE)
108 	ZEND_ARG_OBJ_TYPE_MASK(0, csr, OpenSSLCertificateSigningRequest, MAY_BE_STRING, NULL)
109 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, short_names, _IS_BOOL, 0, "true")
110 ZEND_END_ARG_INFO()
111 
112 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_openssl_pkey_new, 0, 0, OpenSSLAsymmetricKey, MAY_BE_FALSE)
113 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")
114 ZEND_END_ARG_INFO()
115 
116 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkey_export_to_file, 0, 2, _IS_BOOL, 0)
117 	ZEND_ARG_INFO(0, key)
118 	ZEND_ARG_TYPE_INFO(0, output_filename, IS_STRING, 0)
119 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, passphrase, IS_STRING, 1, "null")
120 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")
121 ZEND_END_ARG_INFO()
122 
123 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkey_export, 0, 2, _IS_BOOL, 0)
124 	ZEND_ARG_INFO(0, key)
125 	ZEND_ARG_INFO(1, output)
126 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, passphrase, IS_STRING, 1, "null")
127 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")
128 ZEND_END_ARG_INFO()
129 
130 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_openssl_pkey_get_public, 0, 1, OpenSSLAsymmetricKey, MAY_BE_FALSE)
131 	ZEND_ARG_INFO(0, public_key)
132 ZEND_END_ARG_INFO()
133 
134 #define arginfo_openssl_get_publickey arginfo_openssl_pkey_get_public
135 
136 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkey_free, 0, 1, IS_VOID, 0)
137 	ZEND_ARG_OBJ_INFO(0, key, OpenSSLAsymmetricKey, 0)
138 ZEND_END_ARG_INFO()
139 
140 #define arginfo_openssl_free_key arginfo_openssl_pkey_free
141 
142 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_openssl_pkey_get_private, 0, 1, OpenSSLAsymmetricKey, MAY_BE_FALSE)
143 	ZEND_ARG_INFO(0, private_key)
144 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, passphrase, IS_STRING, 1, "null")
145 ZEND_END_ARG_INFO()
146 
147 #define arginfo_openssl_get_privatekey arginfo_openssl_pkey_get_private
148 
149 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_pkey_get_details, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
150 	ZEND_ARG_OBJ_INFO(0, key, OpenSSLAsymmetricKey, 0)
151 ZEND_END_ARG_INFO()
152 
153 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_pbkdf2, 0, 4, MAY_BE_STRING|MAY_BE_FALSE)
154 	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
155 	ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
156 	ZEND_ARG_TYPE_INFO(0, key_length, IS_LONG, 0)
157 	ZEND_ARG_TYPE_INFO(0, iterations, IS_LONG, 0)
158 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, digest_algo, IS_STRING, 0, "\"sha1\"")
159 ZEND_END_ARG_INFO()
160 
161 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_pkcs7_verify, 0, 2, MAY_BE_BOOL|MAY_BE_LONG)
162 	ZEND_ARG_TYPE_INFO(0, input_filename, IS_STRING, 0)
163 	ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0)
164 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, signers_certificates_filename, IS_STRING, 1, "null")
165 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ca_info, IS_ARRAY, 0, "[]")
166 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, untrusted_certificates_filename, IS_STRING, 1, "null")
167 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, content, IS_STRING, 1, "null")
168 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, output_filename, IS_STRING, 1, "null")
169 ZEND_END_ARG_INFO()
170 
171 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkcs7_encrypt, 0, 4, _IS_BOOL, 0)
172 	ZEND_ARG_TYPE_INFO(0, input_filename, IS_STRING, 0)
173 	ZEND_ARG_TYPE_INFO(0, output_filename, IS_STRING, 0)
174 	ZEND_ARG_INFO(0, certificate)
175 	ZEND_ARG_TYPE_INFO(0, headers, IS_ARRAY, 1)
176 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
177 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cipher_algo, IS_LONG, 0, "OPENSSL_CIPHER_AES_128_CBC")
178 ZEND_END_ARG_INFO()
179 
180 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkcs7_sign, 0, 5, _IS_BOOL, 0)
181 	ZEND_ARG_TYPE_INFO(0, input_filename, IS_STRING, 0)
182 	ZEND_ARG_TYPE_INFO(0, output_filename, IS_STRING, 0)
183 	ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
184 	ZEND_ARG_INFO(0, private_key)
185 	ZEND_ARG_TYPE_INFO(0, headers, IS_ARRAY, 1)
186 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "PKCS7_DETACHED")
187 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, untrusted_certificates_filename, IS_STRING, 1, "null")
188 ZEND_END_ARG_INFO()
189 
190 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkcs7_decrypt, 0, 3, _IS_BOOL, 0)
191 	ZEND_ARG_TYPE_INFO(0, input_filename, IS_STRING, 0)
192 	ZEND_ARG_TYPE_INFO(0, output_filename, IS_STRING, 0)
193 	ZEND_ARG_INFO(0, certificate)
194 	ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, private_key, "null")
195 ZEND_END_ARG_INFO()
196 
197 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_pkcs7_read, 0, 2, _IS_BOOL, 0)
198 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
199 	ZEND_ARG_INFO(1, certificates)
200 ZEND_END_ARG_INFO()
201 
202 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_cms_verify, 0, 1, _IS_BOOL, 0)
203 	ZEND_ARG_TYPE_INFO(0, input_filename, IS_STRING, 0)
204 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
205 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, certificates, IS_STRING, 1, "null")
206 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ca_info, IS_ARRAY, 0, "[]")
207 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, untrusted_certificates_filename, IS_STRING, 1, "null")
208 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, content, IS_STRING, 1, "null")
209 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pk7, IS_STRING, 1, "null")
210 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sigfile, IS_STRING, 1, "null")
211 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_LONG, 0, "OPENSSL_ENCODING_SMIME")
212 ZEND_END_ARG_INFO()
213 
214 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_cms_encrypt, 0, 4, _IS_BOOL, 0)
215 	ZEND_ARG_TYPE_INFO(0, input_filename, IS_STRING, 0)
216 	ZEND_ARG_TYPE_INFO(0, output_filename, IS_STRING, 0)
217 	ZEND_ARG_INFO(0, certificate)
218 	ZEND_ARG_TYPE_INFO(0, headers, IS_ARRAY, 1)
219 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
220 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_LONG, 0, "OPENSSL_ENCODING_SMIME")
221 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cipher_algo, IS_LONG, 0, "OPENSSL_CIPHER_AES_128_CBC")
222 ZEND_END_ARG_INFO()
223 
224 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_cms_sign, 0, 5, _IS_BOOL, 0)
225 	ZEND_ARG_TYPE_INFO(0, input_filename, IS_STRING, 0)
226 	ZEND_ARG_TYPE_INFO(0, output_filename, IS_STRING, 0)
227 	ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL)
228 	ZEND_ARG_INFO(0, private_key)
229 	ZEND_ARG_TYPE_INFO(0, headers, IS_ARRAY, 1)
230 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
231 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_LONG, 0, "OPENSSL_ENCODING_SMIME")
232 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, untrusted_certificates_filename, IS_STRING, 1, "null")
233 ZEND_END_ARG_INFO()
234 
235 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_cms_decrypt, 0, 3, _IS_BOOL, 0)
236 	ZEND_ARG_TYPE_INFO(0, input_filename, IS_STRING, 0)
237 	ZEND_ARG_TYPE_INFO(0, output_filename, IS_STRING, 0)
238 	ZEND_ARG_INFO(0, certificate)
239 	ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, private_key, "null")
240 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_LONG, 0, "OPENSSL_ENCODING_SMIME")
241 ZEND_END_ARG_INFO()
242 
243 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_cms_read, 0, 2, _IS_BOOL, 0)
244 	ZEND_ARG_TYPE_INFO(0, input_filename, IS_STRING, 0)
245 	ZEND_ARG_INFO(1, certificates)
246 ZEND_END_ARG_INFO()
247 
248 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_private_encrypt, 0, 3, _IS_BOOL, 0)
249 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
250 	ZEND_ARG_INFO(1, encrypted_data)
251 	ZEND_ARG_INFO(0, private_key)
252 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, padding, IS_LONG, 0, "OPENSSL_PKCS1_PADDING")
253 ZEND_END_ARG_INFO()
254 
255 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_private_decrypt, 0, 3, _IS_BOOL, 0)
256 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
257 	ZEND_ARG_INFO(1, decrypted_data)
258 	ZEND_ARG_INFO(0, private_key)
259 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, padding, IS_LONG, 0, "OPENSSL_PKCS1_PADDING")
260 ZEND_END_ARG_INFO()
261 
262 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_public_encrypt, 0, 3, _IS_BOOL, 0)
263 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
264 	ZEND_ARG_INFO(1, encrypted_data)
265 	ZEND_ARG_INFO(0, public_key)
266 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, padding, IS_LONG, 0, "OPENSSL_PKCS1_PADDING")
267 ZEND_END_ARG_INFO()
268 
269 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_public_decrypt, 0, 3, _IS_BOOL, 0)
270 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
271 	ZEND_ARG_INFO(1, decrypted_data)
272 	ZEND_ARG_INFO(0, public_key)
273 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, padding, IS_LONG, 0, "OPENSSL_PKCS1_PADDING")
274 ZEND_END_ARG_INFO()
275 
276 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_error_string, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
277 ZEND_END_ARG_INFO()
278 
279 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_sign, 0, 3, _IS_BOOL, 0)
280 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
281 	ZEND_ARG_INFO(1, signature)
282 	ZEND_ARG_INFO(0, private_key)
283 	ZEND_ARG_TYPE_MASK(0, algorithm, MAY_BE_STRING|MAY_BE_LONG, "OPENSSL_ALGO_SHA1")
284 ZEND_END_ARG_INFO()
285 
286 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_verify, 0, 3, MAY_BE_LONG|MAY_BE_FALSE)
287 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
288 	ZEND_ARG_TYPE_INFO(0, signature, IS_STRING, 0)
289 	ZEND_ARG_INFO(0, public_key)
290 	ZEND_ARG_TYPE_MASK(0, algorithm, MAY_BE_STRING|MAY_BE_LONG, "OPENSSL_ALGO_SHA1")
291 ZEND_END_ARG_INFO()
292 
293 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_seal, 0, 5, MAY_BE_LONG|MAY_BE_FALSE)
294 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
295 	ZEND_ARG_INFO(1, sealed_data)
296 	ZEND_ARG_INFO(1, encrypted_keys)
297 	ZEND_ARG_TYPE_INFO(0, public_key, IS_ARRAY, 0)
298 	ZEND_ARG_TYPE_INFO(0, cipher_algo, IS_STRING, 0)
299 	ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, iv, "null")
300 ZEND_END_ARG_INFO()
301 
302 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_open, 0, 5, _IS_BOOL, 0)
303 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
304 	ZEND_ARG_INFO(1, output)
305 	ZEND_ARG_TYPE_INFO(0, encrypted_key, IS_STRING, 0)
306 	ZEND_ARG_INFO(0, private_key)
307 	ZEND_ARG_TYPE_INFO(0, cipher_algo, IS_STRING, 0)
308 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iv, IS_STRING, 1, "null")
309 ZEND_END_ARG_INFO()
310 
311 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_get_md_methods, 0, 0, IS_ARRAY, 0)
312 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, aliases, _IS_BOOL, 0, "false")
313 ZEND_END_ARG_INFO()
314 
315 #define arginfo_openssl_get_cipher_methods arginfo_openssl_get_md_methods
316 
317 #if defined(HAVE_EVP_PKEY_EC)
318 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_get_curve_names, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
319 ZEND_END_ARG_INFO()
320 #endif
321 
322 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_digest, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
323 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
324 	ZEND_ARG_TYPE_INFO(0, digest_algo, IS_STRING, 0)
325 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
326 ZEND_END_ARG_INFO()
327 
328 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_encrypt, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
329 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
330 	ZEND_ARG_TYPE_INFO(0, cipher_algo, IS_STRING, 0)
331 	ZEND_ARG_TYPE_INFO(0, passphrase, IS_STRING, 0)
332 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
333 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iv, IS_STRING, 0, "\"\"")
334 	ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, tag, "null")
335 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, aad, IS_STRING, 0, "\"\"")
336 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, tag_length, IS_LONG, 0, "16")
337 ZEND_END_ARG_INFO()
338 
339 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_decrypt, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
340 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
341 	ZEND_ARG_TYPE_INFO(0, cipher_algo, IS_STRING, 0)
342 	ZEND_ARG_TYPE_INFO(0, passphrase, IS_STRING, 0)
343 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
344 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iv, IS_STRING, 0, "\"\"")
345 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, tag, IS_STRING, 1, "null")
346 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, aad, IS_STRING, 0, "\"\"")
347 ZEND_END_ARG_INFO()
348 
349 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_cipher_iv_length, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
350 	ZEND_ARG_TYPE_INFO(0, cipher_algo, IS_STRING, 0)
351 ZEND_END_ARG_INFO()
352 
353 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_dh_compute_key, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
354 	ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
355 	ZEND_ARG_OBJ_INFO(0, private_key, OpenSSLAsymmetricKey, 0)
356 ZEND_END_ARG_INFO()
357 
358 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_pkey_derive, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
359 	ZEND_ARG_INFO(0, public_key)
360 	ZEND_ARG_INFO(0, private_key)
361 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key_length, IS_LONG, 0, "0")
362 ZEND_END_ARG_INFO()
363 
364 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_random_pseudo_bytes, 0, 1, IS_STRING, 0)
365 	ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
366 	ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, strong_result, "null")
367 ZEND_END_ARG_INFO()
368 
369 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_spki_new, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
370 	ZEND_ARG_OBJ_INFO(0, private_key, OpenSSLAsymmetricKey, 0)
371 	ZEND_ARG_TYPE_INFO(0, challenge, IS_STRING, 0)
372 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, digest_algo, IS_LONG, 0, "OPENSSL_ALGO_MD5")
373 ZEND_END_ARG_INFO()
374 
375 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_spki_verify, 0, 1, _IS_BOOL, 0)
376 	ZEND_ARG_TYPE_INFO(0, spki, IS_STRING, 0)
377 ZEND_END_ARG_INFO()
378 
379 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_openssl_spki_export, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
380 	ZEND_ARG_TYPE_INFO(0, spki, IS_STRING, 0)
381 ZEND_END_ARG_INFO()
382 
383 #define arginfo_openssl_spki_export_challenge arginfo_openssl_spki_export
384 
385 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_get_cert_locations, 0, 0, IS_ARRAY, 0)
386 ZEND_END_ARG_INFO()
387 
388 
389 ZEND_FUNCTION(openssl_x509_export_to_file);
390 ZEND_FUNCTION(openssl_x509_export);
391 ZEND_FUNCTION(openssl_x509_fingerprint);
392 ZEND_FUNCTION(openssl_x509_check_private_key);
393 ZEND_FUNCTION(openssl_x509_verify);
394 ZEND_FUNCTION(openssl_x509_parse);
395 ZEND_FUNCTION(openssl_x509_checkpurpose);
396 ZEND_FUNCTION(openssl_x509_read);
397 ZEND_FUNCTION(openssl_x509_free);
398 ZEND_FUNCTION(openssl_pkcs12_export_to_file);
399 ZEND_FUNCTION(openssl_pkcs12_export);
400 ZEND_FUNCTION(openssl_pkcs12_read);
401 ZEND_FUNCTION(openssl_csr_export_to_file);
402 ZEND_FUNCTION(openssl_csr_export);
403 ZEND_FUNCTION(openssl_csr_sign);
404 ZEND_FUNCTION(openssl_csr_new);
405 ZEND_FUNCTION(openssl_csr_get_subject);
406 ZEND_FUNCTION(openssl_csr_get_public_key);
407 ZEND_FUNCTION(openssl_pkey_new);
408 ZEND_FUNCTION(openssl_pkey_export_to_file);
409 ZEND_FUNCTION(openssl_pkey_export);
410 ZEND_FUNCTION(openssl_pkey_get_public);
411 ZEND_FUNCTION(openssl_pkey_free);
412 ZEND_FUNCTION(openssl_pkey_get_private);
413 ZEND_FUNCTION(openssl_pkey_get_details);
414 ZEND_FUNCTION(openssl_pbkdf2);
415 ZEND_FUNCTION(openssl_pkcs7_verify);
416 ZEND_FUNCTION(openssl_pkcs7_encrypt);
417 ZEND_FUNCTION(openssl_pkcs7_sign);
418 ZEND_FUNCTION(openssl_pkcs7_decrypt);
419 ZEND_FUNCTION(openssl_pkcs7_read);
420 ZEND_FUNCTION(openssl_cms_verify);
421 ZEND_FUNCTION(openssl_cms_encrypt);
422 ZEND_FUNCTION(openssl_cms_sign);
423 ZEND_FUNCTION(openssl_cms_decrypt);
424 ZEND_FUNCTION(openssl_cms_read);
425 ZEND_FUNCTION(openssl_private_encrypt);
426 ZEND_FUNCTION(openssl_private_decrypt);
427 ZEND_FUNCTION(openssl_public_encrypt);
428 ZEND_FUNCTION(openssl_public_decrypt);
429 ZEND_FUNCTION(openssl_error_string);
430 ZEND_FUNCTION(openssl_sign);
431 ZEND_FUNCTION(openssl_verify);
432 ZEND_FUNCTION(openssl_seal);
433 ZEND_FUNCTION(openssl_open);
434 ZEND_FUNCTION(openssl_get_md_methods);
435 ZEND_FUNCTION(openssl_get_cipher_methods);
436 #if defined(HAVE_EVP_PKEY_EC)
437 ZEND_FUNCTION(openssl_get_curve_names);
438 #endif
439 ZEND_FUNCTION(openssl_digest);
440 ZEND_FUNCTION(openssl_encrypt);
441 ZEND_FUNCTION(openssl_decrypt);
442 ZEND_FUNCTION(openssl_cipher_iv_length);
443 ZEND_FUNCTION(openssl_dh_compute_key);
444 ZEND_FUNCTION(openssl_pkey_derive);
445 ZEND_FUNCTION(openssl_random_pseudo_bytes);
446 ZEND_FUNCTION(openssl_spki_new);
447 ZEND_FUNCTION(openssl_spki_verify);
448 ZEND_FUNCTION(openssl_spki_export);
449 ZEND_FUNCTION(openssl_spki_export_challenge);
450 ZEND_FUNCTION(openssl_get_cert_locations);
451 
452 
453 static const zend_function_entry ext_functions[] = {
454 	ZEND_FE(openssl_x509_export_to_file, arginfo_openssl_x509_export_to_file)
455 	ZEND_FE(openssl_x509_export, arginfo_openssl_x509_export)
456 	ZEND_FE(openssl_x509_fingerprint, arginfo_openssl_x509_fingerprint)
457 	ZEND_FE(openssl_x509_check_private_key, arginfo_openssl_x509_check_private_key)
458 	ZEND_FE(openssl_x509_verify, arginfo_openssl_x509_verify)
459 	ZEND_FE(openssl_x509_parse, arginfo_openssl_x509_parse)
460 	ZEND_FE(openssl_x509_checkpurpose, arginfo_openssl_x509_checkpurpose)
461 	ZEND_FE(openssl_x509_read, arginfo_openssl_x509_read)
462 	ZEND_DEP_FE(openssl_x509_free, arginfo_openssl_x509_free)
463 	ZEND_FE(openssl_pkcs12_export_to_file, arginfo_openssl_pkcs12_export_to_file)
464 	ZEND_FE(openssl_pkcs12_export, arginfo_openssl_pkcs12_export)
465 	ZEND_FE(openssl_pkcs12_read, arginfo_openssl_pkcs12_read)
466 	ZEND_FE(openssl_csr_export_to_file, arginfo_openssl_csr_export_to_file)
467 	ZEND_FE(openssl_csr_export, arginfo_openssl_csr_export)
468 	ZEND_FE(openssl_csr_sign, arginfo_openssl_csr_sign)
469 	ZEND_FE(openssl_csr_new, arginfo_openssl_csr_new)
470 	ZEND_FE(openssl_csr_get_subject, arginfo_openssl_csr_get_subject)
471 	ZEND_FE(openssl_csr_get_public_key, arginfo_openssl_csr_get_public_key)
472 	ZEND_FE(openssl_pkey_new, arginfo_openssl_pkey_new)
473 	ZEND_FE(openssl_pkey_export_to_file, arginfo_openssl_pkey_export_to_file)
474 	ZEND_FE(openssl_pkey_export, arginfo_openssl_pkey_export)
475 	ZEND_FE(openssl_pkey_get_public, arginfo_openssl_pkey_get_public)
476 	ZEND_FALIAS(openssl_get_publickey, openssl_pkey_get_public, arginfo_openssl_get_publickey)
477 	ZEND_DEP_FE(openssl_pkey_free, arginfo_openssl_pkey_free)
478 	ZEND_DEP_FALIAS(openssl_free_key, openssl_pkey_free, arginfo_openssl_free_key)
479 	ZEND_FE(openssl_pkey_get_private, arginfo_openssl_pkey_get_private)
480 	ZEND_FALIAS(openssl_get_privatekey, openssl_pkey_get_private, arginfo_openssl_get_privatekey)
481 	ZEND_FE(openssl_pkey_get_details, arginfo_openssl_pkey_get_details)
482 	ZEND_FE(openssl_pbkdf2, arginfo_openssl_pbkdf2)
483 	ZEND_FE(openssl_pkcs7_verify, arginfo_openssl_pkcs7_verify)
484 	ZEND_FE(openssl_pkcs7_encrypt, arginfo_openssl_pkcs7_encrypt)
485 	ZEND_FE(openssl_pkcs7_sign, arginfo_openssl_pkcs7_sign)
486 	ZEND_FE(openssl_pkcs7_decrypt, arginfo_openssl_pkcs7_decrypt)
487 	ZEND_FE(openssl_pkcs7_read, arginfo_openssl_pkcs7_read)
488 	ZEND_FE(openssl_cms_verify, arginfo_openssl_cms_verify)
489 	ZEND_FE(openssl_cms_encrypt, arginfo_openssl_cms_encrypt)
490 	ZEND_FE(openssl_cms_sign, arginfo_openssl_cms_sign)
491 	ZEND_FE(openssl_cms_decrypt, arginfo_openssl_cms_decrypt)
492 	ZEND_FE(openssl_cms_read, arginfo_openssl_cms_read)
493 	ZEND_FE(openssl_private_encrypt, arginfo_openssl_private_encrypt)
494 	ZEND_FE(openssl_private_decrypt, arginfo_openssl_private_decrypt)
495 	ZEND_FE(openssl_public_encrypt, arginfo_openssl_public_encrypt)
496 	ZEND_FE(openssl_public_decrypt, arginfo_openssl_public_decrypt)
497 	ZEND_FE(openssl_error_string, arginfo_openssl_error_string)
498 	ZEND_FE(openssl_sign, arginfo_openssl_sign)
499 	ZEND_FE(openssl_verify, arginfo_openssl_verify)
500 	ZEND_FE(openssl_seal, arginfo_openssl_seal)
501 	ZEND_FE(openssl_open, arginfo_openssl_open)
502 	ZEND_FE(openssl_get_md_methods, arginfo_openssl_get_md_methods)
503 	ZEND_FE(openssl_get_cipher_methods, arginfo_openssl_get_cipher_methods)
504 #if defined(HAVE_EVP_PKEY_EC)
505 	ZEND_FE(openssl_get_curve_names, arginfo_openssl_get_curve_names)
506 #endif
507 	ZEND_FE(openssl_digest, arginfo_openssl_digest)
508 	ZEND_FE(openssl_encrypt, arginfo_openssl_encrypt)
509 	ZEND_FE(openssl_decrypt, arginfo_openssl_decrypt)
510 	ZEND_FE(openssl_cipher_iv_length, arginfo_openssl_cipher_iv_length)
511 	ZEND_FE(openssl_dh_compute_key, arginfo_openssl_dh_compute_key)
512 	ZEND_FE(openssl_pkey_derive, arginfo_openssl_pkey_derive)
513 	ZEND_FE(openssl_random_pseudo_bytes, arginfo_openssl_random_pseudo_bytes)
514 	ZEND_FE(openssl_spki_new, arginfo_openssl_spki_new)
515 	ZEND_FE(openssl_spki_verify, arginfo_openssl_spki_verify)
516 	ZEND_FE(openssl_spki_export, arginfo_openssl_spki_export)
517 	ZEND_FE(openssl_spki_export_challenge, arginfo_openssl_spki_export_challenge)
518 	ZEND_FE(openssl_get_cert_locations, arginfo_openssl_get_cert_locations)
519 	ZEND_FE_END
520 };
521 
522 
523 static const zend_function_entry class_OpenSSLCertificate_methods[] = {
524 	ZEND_FE_END
525 };
526 
527 
528 static const zend_function_entry class_OpenSSLCertificateSigningRequest_methods[] = {
529 	ZEND_FE_END
530 };
531 
532 
533 static const zend_function_entry class_OpenSSLAsymmetricKey_methods[] = {
534 	ZEND_FE_END
535 };
536 
register_class_OpenSSLCertificate(void)537 static zend_class_entry *register_class_OpenSSLCertificate(void)
538 {
539 	zend_class_entry ce, *class_entry;
540 
541 	INIT_CLASS_ENTRY(ce, "OpenSSLCertificate", class_OpenSSLCertificate_methods);
542 	class_entry = zend_register_internal_class_ex(&ce, NULL);
543 	class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE;
544 
545 	return class_entry;
546 }
547 
register_class_OpenSSLCertificateSigningRequest(void)548 static zend_class_entry *register_class_OpenSSLCertificateSigningRequest(void)
549 {
550 	zend_class_entry ce, *class_entry;
551 
552 	INIT_CLASS_ENTRY(ce, "OpenSSLCertificateSigningRequest", class_OpenSSLCertificateSigningRequest_methods);
553 	class_entry = zend_register_internal_class_ex(&ce, NULL);
554 	class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE;
555 
556 	return class_entry;
557 }
558 
register_class_OpenSSLAsymmetricKey(void)559 static zend_class_entry *register_class_OpenSSLAsymmetricKey(void)
560 {
561 	zend_class_entry ce, *class_entry;
562 
563 	INIT_CLASS_ENTRY(ce, "OpenSSLAsymmetricKey", class_OpenSSLAsymmetricKey_methods);
564 	class_entry = zend_register_internal_class_ex(&ce, NULL);
565 	class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE;
566 
567 	return class_entry;
568 }
569