1 | /* |
2 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. |
3 | * |
4 | * Licensed under the Apache License 2.0 (the "License"). You may not use |
5 | * this file except in compliance with the License. You can obtain a copy |
6 | * in the file LICENSE in the source distribution or at |
7 | * https://www.openssl.org/source/license.html |
8 | */ |
9 | |
10 | #ifndef OPENSSL_EVP_H |
11 | # define OPENSSL_EVP_H |
12 | # pragma once |
13 | |
14 | # include <openssl/macros.h> |
15 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
16 | # define |
17 | # endif |
18 | |
19 | # include <stdarg.h> |
20 | |
21 | # include <openssl/opensslconf.h> |
22 | # include <openssl/types.h> |
23 | # include <openssl/core.h> |
24 | # include <openssl/symhacks.h> |
25 | # include <openssl/bio.h> |
26 | # include <openssl/evperr.h> |
27 | # include <openssl/params.h> |
28 | |
29 | # define EVP_MAX_MD_SIZE 64/* longest known is SHA512 */ |
30 | # define EVP_MAX_KEY_LENGTH 64 |
31 | # define EVP_MAX_IV_LENGTH 16 |
32 | # define EVP_MAX_BLOCK_LENGTH 32 |
33 | |
34 | # define PKCS5_SALT_LEN 8 |
35 | /* Default PKCS#5 iteration count */ |
36 | # define PKCS5_DEFAULT_ITER 2048 |
37 | |
38 | # include <openssl/objects.h> |
39 | |
40 | # define EVP_PK_RSA 0x0001 |
41 | # define EVP_PK_DSA 0x0002 |
42 | # define EVP_PK_DH 0x0004 |
43 | # define EVP_PK_EC 0x0008 |
44 | # define EVP_PKT_SIGN 0x0010 |
45 | # define EVP_PKT_ENC 0x0020 |
46 | # define EVP_PKT_EXCH 0x0040 |
47 | # define EVP_PKS_RSA 0x0100 |
48 | # define EVP_PKS_DSA 0x0200 |
49 | # define EVP_PKS_EC 0x0400 |
50 | |
51 | # define EVP_PKEY_NONE NID_undef |
52 | # define EVP_PKEY_RSA NID_rsaEncryption |
53 | # define EVP_PKEY_RSA2 NID_rsa |
54 | # define EVP_PKEY_RSA_PSS NID_rsassaPss |
55 | # define EVP_PKEY_DSA NID_dsa |
56 | # define EVP_PKEY_DSA1 NID_dsa_2 |
57 | # define EVP_PKEY_DSA2 NID_dsaWithSHA |
58 | # define EVP_PKEY_DSA3 NID_dsaWithSHA1 |
59 | # define EVP_PKEY_DSA4 NID_dsaWithSHA1_2 |
60 | # define EVP_PKEY_DH NID_dhKeyAgreement |
61 | # define EVP_PKEY_DHX NID_dhpublicnumber |
62 | # define EVP_PKEY_EC NID_X9_62_id_ecPublicKey |
63 | # define EVP_PKEY_SM2 NID_sm2 |
64 | # define EVP_PKEY_HMAC NID_hmac |
65 | # define EVP_PKEY_CMAC NID_cmac |
66 | # define EVP_PKEY_SCRYPT NID_id_scrypt |
67 | # define EVP_PKEY_TLS1_PRF NID_tls1_prf |
68 | # define EVP_PKEY_HKDF NID_hkdf |
69 | # define EVP_PKEY_POLY1305 NID_poly1305 |
70 | # define EVP_PKEY_SIPHASH NID_siphash |
71 | # define EVP_PKEY_X25519 NID_X25519 |
72 | # define EVP_PKEY_ED25519 NID_ED25519 |
73 | # define EVP_PKEY_X448 NID_X448 |
74 | # define EVP_PKEY_ED448 NID_ED448 |
75 | |
76 | #ifdef __cplusplus |
77 | extern "C" { |
78 | #endif |
79 | |
80 | int EVP_set_default_properties(OPENSSL_CTX *libctx, const char *propq); |
81 | |
82 | # define EVP_PKEY_MO_SIGN 0x0001 |
83 | # define EVP_PKEY_MO_VERIFY 0x0002 |
84 | # define EVP_PKEY_MO_ENCRYPT 0x0004 |
85 | # define EVP_PKEY_MO_DECRYPT 0x0008 |
86 | |
87 | # ifndef EVP_MD |
88 | EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type); |
89 | EVP_MD *EVP_MD_meth_dup(const EVP_MD *md); |
90 | void EVP_MD_meth_free(EVP_MD *md); |
91 | |
92 | int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize); |
93 | int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize); |
94 | int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize); |
95 | int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags); |
96 | int EVP_MD_meth_set_init(EVP_MD *md, int (*init)(EVP_MD_CTX *ctx)); |
97 | int EVP_MD_meth_set_update(EVP_MD *md, int (*update)(EVP_MD_CTX *ctx, |
98 | const void *data, |
99 | size_t count)); |
100 | int EVP_MD_meth_set_final(EVP_MD *md, int (*final)(EVP_MD_CTX *ctx, |
101 | unsigned char *md)); |
102 | int EVP_MD_meth_set_copy(EVP_MD *md, int (*copy)(EVP_MD_CTX *to, |
103 | const EVP_MD_CTX *from)); |
104 | int EVP_MD_meth_set_cleanup(EVP_MD *md, int (*cleanup)(EVP_MD_CTX *ctx)); |
105 | int EVP_MD_meth_set_ctrl(EVP_MD *md, int (*ctrl)(EVP_MD_CTX *ctx, int cmd, |
106 | int p1, void *p2)); |
107 | |
108 | int EVP_MD_meth_get_input_blocksize(const EVP_MD *md); |
109 | int EVP_MD_meth_get_result_size(const EVP_MD *md); |
110 | int EVP_MD_meth_get_app_datasize(const EVP_MD *md); |
111 | unsigned long EVP_MD_meth_get_flags(const EVP_MD *md); |
112 | int (*EVP_MD_meth_get_init(const EVP_MD *md))(EVP_MD_CTX *ctx); |
113 | int (*EVP_MD_meth_get_update(const EVP_MD *md))(EVP_MD_CTX *ctx, |
114 | const void *data, |
115 | size_t count); |
116 | int (*EVP_MD_meth_get_final(const EVP_MD *md))(EVP_MD_CTX *ctx, |
117 | unsigned char *md); |
118 | int (*EVP_MD_meth_get_copy(const EVP_MD *md))(EVP_MD_CTX *to, |
119 | const EVP_MD_CTX *from); |
120 | int (*EVP_MD_meth_get_cleanup(const EVP_MD *md))(EVP_MD_CTX *ctx); |
121 | int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd, |
122 | int p1, void *p2); |
123 | |
124 | /* digest can only handle a single block */ |
125 | # define EVP_MD_FLAG_ONESHOT 0x0001 |
126 | |
127 | /* digest is extensible-output function, XOF */ |
128 | # define EVP_MD_FLAG_XOF 0x0002 |
129 | |
130 | /* DigestAlgorithmIdentifier flags... */ |
131 | |
132 | # define EVP_MD_FLAG_DIGALGID_MASK 0x0018 |
133 | |
134 | /* NULL or absent parameter accepted. Use NULL */ |
135 | |
136 | # define EVP_MD_FLAG_DIGALGID_NULL 0x0000 |
137 | |
138 | /* NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent */ |
139 | |
140 | # define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008 |
141 | |
142 | /* Custom handling via ctrl */ |
143 | |
144 | # define EVP_MD_FLAG_DIGALGID_CUSTOM 0x0018 |
145 | |
146 | /* Note if suitable for use in FIPS mode */ |
147 | # define EVP_MD_FLAG_FIPS 0x0400 |
148 | |
149 | /* Digest ctrls */ |
150 | |
151 | # define EVP_MD_CTRL_DIGALGID 0x1 |
152 | # define EVP_MD_CTRL_MICALG 0x2 |
153 | # define EVP_MD_CTRL_XOF_LEN 0x3 |
154 | |
155 | /* Minimum Algorithm specific ctrl value */ |
156 | |
157 | # define EVP_MD_CTRL_ALG_CTRL 0x1000 |
158 | |
159 | # endif /* !EVP_MD */ |
160 | |
161 | /* values for EVP_MD_CTX flags */ |
162 | |
163 | # define EVP_MD_CTX_FLAG_ONESHOT 0x0001/* digest update will be |
164 | * called once only */ |
165 | # define EVP_MD_CTX_FLAG_CLEANED 0x0002/* context has already been |
166 | * cleaned */ |
167 | # define EVP_MD_CTX_FLAG_REUSE 0x0004/* Don't free up ctx->md_data |
168 | * in EVP_MD_CTX_reset */ |
169 | /* |
170 | * FIPS and pad options are ignored in 1.0.0, definitions are here so we |
171 | * don't accidentally reuse the values for other purposes. |
172 | */ |
173 | |
174 | # define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008/* Allow use of non FIPS |
175 | * digest in FIPS mode */ |
176 | |
177 | /* |
178 | * The following PAD options are also currently ignored in 1.0.0, digest |
179 | * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*() |
180 | * instead. |
181 | */ |
182 | # define EVP_MD_CTX_FLAG_PAD_MASK 0xF0/* RSA mode to use */ |
183 | # define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00/* PKCS#1 v1.5 mode */ |
184 | # define EVP_MD_CTX_FLAG_PAD_X931 0x10/* X9.31 mode */ |
185 | # define EVP_MD_CTX_FLAG_PAD_PSS 0x20/* PSS mode */ |
186 | |
187 | # define EVP_MD_CTX_FLAG_NO_INIT 0x0100/* Don't initialize md_data */ |
188 | /* |
189 | * Some functions such as EVP_DigestSign only finalise copies of internal |
190 | * contexts so additional data can be included after the finalisation call. |
191 | * This is inefficient if this functionality is not required: it is disabled |
192 | * if the following flag is set. |
193 | */ |
194 | # define EVP_MD_CTX_FLAG_FINALISE 0x0200 |
195 | /* NOTE: 0x0400 is reserved for internal usage */ |
196 | |
197 | EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len); |
198 | EVP_CIPHER *EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher); |
199 | void EVP_CIPHER_meth_free(EVP_CIPHER *cipher); |
200 | |
201 | int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len); |
202 | int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags); |
203 | int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size); |
204 | int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher, |
205 | int (*init) (EVP_CIPHER_CTX *ctx, |
206 | const unsigned char *key, |
207 | const unsigned char *iv, |
208 | int enc)); |
209 | int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher, |
210 | int (*do_cipher) (EVP_CIPHER_CTX *ctx, |
211 | unsigned char *out, |
212 | const unsigned char *in, |
213 | size_t inl)); |
214 | int EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher, |
215 | int (*cleanup) (EVP_CIPHER_CTX *)); |
216 | int EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher, |
217 | int (*set_asn1_parameters) (EVP_CIPHER_CTX *, |
218 | ASN1_TYPE *)); |
219 | int EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher, |
220 | int (*get_asn1_parameters) (EVP_CIPHER_CTX *, |
221 | ASN1_TYPE *)); |
222 | int EVP_CIPHER_meth_set_ctrl(EVP_CIPHER *cipher, |
223 | int (*ctrl) (EVP_CIPHER_CTX *, int type, |
224 | int arg, void *ptr)); |
225 | |
226 | int (*EVP_CIPHER_meth_get_init(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx, |
227 | const unsigned char *key, |
228 | const unsigned char *iv, |
229 | int enc); |
230 | int (*EVP_CIPHER_meth_get_do_cipher(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx, |
231 | unsigned char *out, |
232 | const unsigned char *in, |
233 | size_t inl); |
234 | int (*EVP_CIPHER_meth_get_cleanup(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *); |
235 | int (*EVP_CIPHER_meth_get_set_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, |
236 | ASN1_TYPE *); |
237 | int (*EVP_CIPHER_meth_get_get_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, |
238 | ASN1_TYPE *); |
239 | int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, |
240 | int type, int arg, |
241 | void *ptr); |
242 | |
243 | /* Values for cipher flags */ |
244 | |
245 | /* Modes for ciphers */ |
246 | |
247 | # define EVP_CIPH_STREAM_CIPHER 0x0 |
248 | # define EVP_CIPH_ECB_MODE 0x1 |
249 | # define EVP_CIPH_CBC_MODE 0x2 |
250 | # define EVP_CIPH_CFB_MODE 0x3 |
251 | # define EVP_CIPH_OFB_MODE 0x4 |
252 | # define EVP_CIPH_CTR_MODE 0x5 |
253 | # define EVP_CIPH_GCM_MODE 0x6 |
254 | # define EVP_CIPH_CCM_MODE 0x7 |
255 | # define EVP_CIPH_XTS_MODE 0x10001 |
256 | # define EVP_CIPH_WRAP_MODE 0x10002 |
257 | # define EVP_CIPH_OCB_MODE 0x10003 |
258 | # define EVP_CIPH_SIV_MODE 0x10004 |
259 | # define EVP_CIPH_MODE 0xF0007 |
260 | /* Set if variable length cipher */ |
261 | # define EVP_CIPH_VARIABLE_LENGTH 0x8 |
262 | /* Set if the iv handling should be done by the cipher itself */ |
263 | # define EVP_CIPH_CUSTOM_IV 0x10 |
264 | /* Set if the cipher's init() function should be called if key is NULL */ |
265 | # define EVP_CIPH_ALWAYS_CALL_INIT 0x20 |
266 | /* Call ctrl() to init cipher parameters */ |
267 | # define EVP_CIPH_CTRL_INIT 0x40 |
268 | /* Don't use standard key length function */ |
269 | # define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 |
270 | /* Don't use standard block padding */ |
271 | # define EVP_CIPH_NO_PADDING 0x100 |
272 | /* cipher handles random key generation */ |
273 | # define EVP_CIPH_RAND_KEY 0x200 |
274 | /* cipher has its own additional copying logic */ |
275 | # define EVP_CIPH_CUSTOM_COPY 0x400 |
276 | /* Don't use standard iv length function */ |
277 | # define EVP_CIPH_CUSTOM_IV_LENGTH 0x800 |
278 | /* Legacy and no longer relevant: Allow use default ASN1 get/set iv */ |
279 | # define EVP_CIPH_FLAG_DEFAULT_ASN1 0 |
280 | /* Free: 0x1000 */ |
281 | /* Buffer length in bits not bytes: CFB1 mode only */ |
282 | # define EVP_CIPH_FLAG_LENGTH_BITS 0x2000 |
283 | /* Note if suitable for use in FIPS mode */ |
284 | # define EVP_CIPH_FLAG_FIPS 0x4000 |
285 | /* Allow non FIPS cipher in FIPS mode */ |
286 | # define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x8000 |
287 | /* |
288 | * Cipher handles any and all padding logic as well as finalisation. |
289 | */ |
290 | # define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000 |
291 | # define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 |
292 | # define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000 |
293 | /* Cipher can handle pipeline operations */ |
294 | # define EVP_CIPH_FLAG_PIPELINE 0X800000 |
295 | /* For provider implementations that handle ASN1 get/set param themselves */ |
296 | # define EVP_CIPH_FLAG_CUSTOM_ASN1 0x1000000 |
297 | |
298 | /* |
299 | * Cipher context flag to indicate we can handle wrap mode: if allowed in |
300 | * older applications it could overflow buffers. |
301 | */ |
302 | |
303 | # define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0x1 |
304 | |
305 | /* ctrl() values */ |
306 | |
307 | # define EVP_CTRL_INIT 0x0 |
308 | # define EVP_CTRL_SET_KEY_LENGTH 0x1 |
309 | # define EVP_CTRL_GET_RC2_KEY_BITS 0x2 |
310 | # define EVP_CTRL_SET_RC2_KEY_BITS 0x3 |
311 | # define EVP_CTRL_GET_RC5_ROUNDS 0x4 |
312 | # define EVP_CTRL_SET_RC5_ROUNDS 0x5 |
313 | # define EVP_CTRL_RAND_KEY 0x6 |
314 | # define EVP_CTRL_PBE_PRF_NID 0x7 |
315 | # define EVP_CTRL_COPY 0x8 |
316 | # define EVP_CTRL_AEAD_SET_IVLEN 0x9 |
317 | # define EVP_CTRL_AEAD_GET_TAG 0x10 |
318 | # define EVP_CTRL_AEAD_SET_TAG 0x11 |
319 | # define EVP_CTRL_AEAD_SET_IV_FIXED 0x12 |
320 | # define EVP_CTRL_GCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN |
321 | # define EVP_CTRL_GCM_GET_TAG EVP_CTRL_AEAD_GET_TAG |
322 | # define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG |
323 | # define EVP_CTRL_GCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED |
324 | # define EVP_CTRL_GCM_IV_GEN 0x13 |
325 | # define EVP_CTRL_CCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN |
326 | # define EVP_CTRL_CCM_GET_TAG EVP_CTRL_AEAD_GET_TAG |
327 | # define EVP_CTRL_CCM_SET_TAG EVP_CTRL_AEAD_SET_TAG |
328 | # define EVP_CTRL_CCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED |
329 | # define EVP_CTRL_CCM_SET_L 0x14 |
330 | # define EVP_CTRL_CCM_SET_MSGLEN 0x15 |
331 | /* |
332 | * AEAD cipher deduces payload length and returns number of bytes required to |
333 | * store MAC and eventual padding. Subsequent call to EVP_Cipher even |
334 | * appends/verifies MAC. |
335 | */ |
336 | # define EVP_CTRL_AEAD_TLS1_AAD 0x16 |
337 | /* Used by composite AEAD ciphers, no-op in GCM, CCM... */ |
338 | # define EVP_CTRL_AEAD_SET_MAC_KEY 0x17 |
339 | /* Set the GCM invocation field, decrypt only */ |
340 | # define EVP_CTRL_GCM_SET_IV_INV 0x18 |
341 | |
342 | # define EVP_CTRL_TLS1_1_MULTIBLOCK_AAD 0x19 |
343 | # define EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT 0x1a |
344 | # define EVP_CTRL_TLS1_1_MULTIBLOCK_DECRYPT 0x1b |
345 | # define EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE 0x1c |
346 | |
347 | # define EVP_CTRL_SSL3_MASTER_SECRET 0x1d |
348 | |
349 | /* EVP_CTRL_SET_SBOX takes the char * specifying S-boxes */ |
350 | # define EVP_CTRL_SET_SBOX 0x1e |
351 | /* |
352 | * EVP_CTRL_SBOX_USED takes a 'size_t' and 'char *', pointing at a |
353 | * pre-allocated buffer with specified size |
354 | */ |
355 | # define EVP_CTRL_SBOX_USED 0x1f |
356 | /* EVP_CTRL_KEY_MESH takes 'size_t' number of bytes to mesh the key after, |
357 | * 0 switches meshing off |
358 | */ |
359 | # define EVP_CTRL_KEY_MESH 0x20 |
360 | /* EVP_CTRL_BLOCK_PADDING_MODE takes the padding mode */ |
361 | # define EVP_CTRL_BLOCK_PADDING_MODE 0x21 |
362 | |
363 | /* Set the output buffers to use for a pipelined operation */ |
364 | # define EVP_CTRL_SET_PIPELINE_OUTPUT_BUFS 0x22 |
365 | /* Set the input buffers to use for a pipelined operation */ |
366 | # define EVP_CTRL_SET_PIPELINE_INPUT_BUFS 0x23 |
367 | /* Set the input buffer lengths to use for a pipelined operation */ |
368 | # define EVP_CTRL_SET_PIPELINE_INPUT_LENS 0x24 |
369 | /* Get the IV length used by the cipher */ |
370 | # define EVP_CTRL_GET_IVLEN 0x25 |
371 | /* Get the IV used by the cipher */ |
372 | # define EVP_CTRL_GET_IV 0x26 |
373 | /* Tell the cipher it's doing a speed test (SIV disallows multiple ops) */ |
374 | # define EVP_CTRL_SET_SPEED 0x27 |
375 | |
376 | /* Padding modes */ |
377 | #define EVP_PADDING_PKCS7 1 |
378 | #define EVP_PADDING_ISO7816_4 2 |
379 | #define EVP_PADDING_ANSI923 3 |
380 | #define EVP_PADDING_ISO10126 4 |
381 | #define EVP_PADDING_ZERO 5 |
382 | |
383 | /* RFC 5246 defines additional data to be 13 bytes in length */ |
384 | # define EVP_AEAD_TLS1_AAD_LEN 13 |
385 | |
386 | typedef struct { |
387 | unsigned char *out; |
388 | const unsigned char *inp; |
389 | size_t len; |
390 | unsigned int interleave; |
391 | } EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM; |
392 | |
393 | /* GCM TLS constants */ |
394 | /* Length of fixed part of IV derived from PRF */ |
395 | # define EVP_GCM_TLS_FIXED_IV_LEN 4 |
396 | /* Length of explicit part of IV part of TLS records */ |
397 | # define EVP_GCM_TLS_EXPLICIT_IV_LEN 8 |
398 | /* Length of tag for TLS */ |
399 | # define EVP_GCM_TLS_TAG_LEN 16 |
400 | |
401 | /* CCM TLS constants */ |
402 | /* Length of fixed part of IV derived from PRF */ |
403 | # define EVP_CCM_TLS_FIXED_IV_LEN 4 |
404 | /* Length of explicit part of IV part of TLS records */ |
405 | # define EVP_CCM_TLS_EXPLICIT_IV_LEN 8 |
406 | /* Total length of CCM IV length for TLS */ |
407 | # define EVP_CCM_TLS_IV_LEN 12 |
408 | /* Length of tag for TLS */ |
409 | # define EVP_CCM_TLS_TAG_LEN 16 |
410 | /* Length of CCM8 tag for TLS */ |
411 | # define EVP_CCM8_TLS_TAG_LEN 8 |
412 | |
413 | /* Length of tag for TLS */ |
414 | # define EVP_CHACHAPOLY_TLS_TAG_LEN 16 |
415 | |
416 | typedef struct evp_cipher_info_st { |
417 | const EVP_CIPHER *cipher; |
418 | unsigned char iv[EVP_MAX_IV_LENGTH]; |
419 | } EVP_CIPHER_INFO; |
420 | |
421 | |
422 | /* Password based encryption function */ |
423 | typedef int (EVP_PBE_KEYGEN) (EVP_CIPHER_CTX *ctx, const char *pass, |
424 | int passlen, ASN1_TYPE *param, |
425 | const EVP_CIPHER *cipher, const EVP_MD *md, |
426 | int en_de); |
427 | |
428 | # ifndef OPENSSL_NO_RSA |
429 | # define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ |
430 | (rsa)) |
431 | # endif |
432 | |
433 | # ifndef OPENSSL_NO_DSA |
434 | # define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ |
435 | (dsa)) |
436 | # endif |
437 | |
438 | # ifndef OPENSSL_NO_DH |
439 | # define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,(dh)) |
440 | # endif |
441 | |
442 | # ifndef OPENSSL_NO_EC |
443 | # define EVP_PKEY_assign_EC_KEY(pkey,eckey) EVP_PKEY_assign((pkey),EVP_PKEY_EC,\ |
444 | (eckey)) |
445 | # endif |
446 | # ifndef OPENSSL_NO_SIPHASH |
447 | # define EVP_PKEY_assign_SIPHASH(pkey,shkey) EVP_PKEY_assign((pkey),\ |
448 | EVP_PKEY_SIPHASH,(shkey)) |
449 | # endif |
450 | |
451 | # ifndef OPENSSL_NO_POLY1305 |
452 | # define EVP_PKEY_assign_POLY1305(pkey,polykey) EVP_PKEY_assign((pkey),\ |
453 | EVP_PKEY_POLY1305,(polykey)) |
454 | # endif |
455 | |
456 | /* Add some extra combinations */ |
457 | # define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) |
458 | # define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) |
459 | # define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) |
460 | # define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) |
461 | |
462 | int EVP_MD_type(const EVP_MD *md); |
463 | # define EVP_MD_nid(e) EVP_MD_type(e) |
464 | const char *EVP_MD_name(const EVP_MD *md); |
465 | int EVP_MD_number(const EVP_MD *md); |
466 | int EVP_MD_is_a(const EVP_MD *md, const char *name); |
467 | void EVP_MD_names_do_all(const EVP_MD *md, |
468 | void (*fn)(const char *name, void *data), |
469 | void *data); |
470 | const OSSL_PROVIDER *EVP_MD_provider(const EVP_MD *md); |
471 | int EVP_MD_pkey_type(const EVP_MD *md); |
472 | int EVP_MD_size(const EVP_MD *md); |
473 | int EVP_MD_block_size(const EVP_MD *md); |
474 | unsigned long EVP_MD_flags(const EVP_MD *md); |
475 | |
476 | const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); |
477 | int (*EVP_MD_CTX_update_fn(EVP_MD_CTX *ctx))(EVP_MD_CTX *ctx, |
478 | const void *data, size_t count); |
479 | void EVP_MD_CTX_set_update_fn(EVP_MD_CTX *ctx, |
480 | int (*update) (EVP_MD_CTX *ctx, |
481 | const void *data, size_t count)); |
482 | # define EVP_MD_CTX_name(e) EVP_MD_name(EVP_MD_CTX_md(e)) |
483 | # define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) |
484 | # define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) |
485 | # define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) |
486 | EVP_PKEY_CTX *EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx); |
487 | void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx); |
488 | void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx); |
489 | |
490 | int EVP_CIPHER_nid(const EVP_CIPHER *cipher); |
491 | const char *EVP_CIPHER_name(const EVP_CIPHER *cipher); |
492 | int EVP_CIPHER_number(const EVP_CIPHER *cipher); |
493 | int EVP_CIPHER_is_a(const EVP_CIPHER *cipher, const char *name); |
494 | void EVP_CIPHER_names_do_all(const EVP_CIPHER *cipher, |
495 | void (*fn)(const char *name, void *data), |
496 | void *data); |
497 | const OSSL_PROVIDER *EVP_CIPHER_provider(const EVP_CIPHER *cipher); |
498 | int EVP_CIPHER_block_size(const EVP_CIPHER *cipher); |
499 | int EVP_CIPHER_impl_ctx_size(const EVP_CIPHER *cipher); |
500 | int EVP_CIPHER_key_length(const EVP_CIPHER *cipher); |
501 | int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher); |
502 | unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher); |
503 | int EVP_CIPHER_mode(const EVP_CIPHER *cipher); |
504 | EVP_CIPHER *EVP_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm, |
505 | const char *properties); |
506 | int EVP_CIPHER_up_ref(EVP_CIPHER *cipher); |
507 | void EVP_CIPHER_free(EVP_CIPHER *cipher); |
508 | |
509 | const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); |
510 | int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx); |
511 | int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); |
512 | int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); |
513 | int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); |
514 | int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx); |
515 | int EVP_CIPHER_CTX_tag_length(const EVP_CIPHER_CTX *ctx); |
516 | const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx); |
517 | const unsigned char *EVP_CIPHER_CTX_original_iv(const EVP_CIPHER_CTX *ctx); |
518 | unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx); |
519 | unsigned char *EVP_CIPHER_CTX_buf_noconst(EVP_CIPHER_CTX *ctx); |
520 | int EVP_CIPHER_CTX_num(const EVP_CIPHER_CTX *ctx); |
521 | int EVP_CIPHER_CTX_set_num(EVP_CIPHER_CTX *ctx, int num); |
522 | int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in); |
523 | void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx); |
524 | void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data); |
525 | void *EVP_CIPHER_CTX_get_cipher_data(const EVP_CIPHER_CTX *ctx); |
526 | void *EVP_CIPHER_CTX_set_cipher_data(EVP_CIPHER_CTX *ctx, void *cipher_data); |
527 | # define EVP_CIPHER_CTX_name(c) EVP_CIPHER_name(EVP_CIPHER_CTX_cipher(c)) |
528 | # define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) |
529 | # ifndef OPENSSL_NO_DEPRECATED_1_1_0 |
530 | # define EVP_CIPHER_CTX_flags(c) EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(c)) |
531 | # endif |
532 | # define EVP_CIPHER_CTX_mode(c) EVP_CIPHER_mode(EVP_CIPHER_CTX_cipher(c)) |
533 | |
534 | # define EVP_ENCODE_LENGTH(l) ((((l)+2)/3*4)+((l)/48+1)*2+80) |
535 | # define EVP_DECODE_LENGTH(l) (((l)+3)/4*3+80) |
536 | |
537 | # define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) |
538 | # define EVP_SignInit(a,b) EVP_DigestInit(a,b) |
539 | # define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) |
540 | # define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) |
541 | # define EVP_VerifyInit(a,b) EVP_DigestInit(a,b) |
542 | # define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) |
543 | # define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) |
544 | # define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e) |
545 | |
546 | # ifdef CONST_STRICT |
547 | void BIO_set_md(BIO *, const EVP_MD *md); |
548 | # else |
549 | # define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(void *)(md)) |
550 | # endif |
551 | # define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(mdp)) |
552 | # define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(mdcp)) |
553 | # define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(mdcp)) |
554 | # define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL) |
555 | # define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(c_pp)) |
556 | |
557 | /*__owur*/ int EVP_Cipher(EVP_CIPHER_CTX *c, |
558 | unsigned char *out, |
559 | const unsigned char *in, unsigned int inl); |
560 | |
561 | # define EVP_add_cipher_alias(n,alias) \ |
562 | OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n)) |
563 | # define EVP_add_digest_alias(n,alias) \ |
564 | OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n)) |
565 | # define EVP_delete_cipher_alias(alias) \ |
566 | OBJ_NAME_remove(alias,OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS); |
567 | # define EVP_delete_digest_alias(alias) \ |
568 | OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); |
569 | |
570 | int EVP_MD_get_params(const EVP_MD *digest, OSSL_PARAM params[]); |
571 | int EVP_MD_CTX_set_params(EVP_MD_CTX *ctx, const OSSL_PARAM params[]); |
572 | int EVP_MD_CTX_get_params(EVP_MD_CTX *ctx, OSSL_PARAM params[]); |
573 | const OSSL_PARAM *EVP_MD_gettable_params(const EVP_MD *digest); |
574 | const OSSL_PARAM *EVP_MD_settable_ctx_params(const EVP_MD *md); |
575 | const OSSL_PARAM *EVP_MD_gettable_ctx_params(const EVP_MD *md); |
576 | const OSSL_PARAM *EVP_MD_CTX_settable_params(EVP_MD_CTX *ctx); |
577 | const OSSL_PARAM *EVP_MD_CTX_gettable_params(EVP_MD_CTX *ctx); |
578 | int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2); |
579 | EVP_MD_CTX *EVP_MD_CTX_new(void); |
580 | int EVP_MD_CTX_reset(EVP_MD_CTX *ctx); |
581 | void EVP_MD_CTX_free(EVP_MD_CTX *ctx); |
582 | # define EVP_MD_CTX_create() EVP_MD_CTX_new() |
583 | # define EVP_MD_CTX_init(ctx) EVP_MD_CTX_reset((ctx)) |
584 | # define EVP_MD_CTX_destroy(ctx) EVP_MD_CTX_free((ctx)) |
585 | __owur int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in); |
586 | void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags); |
587 | void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags); |
588 | int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags); |
589 | __owur int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, |
590 | ENGINE *impl); |
591 | __owur int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, |
592 | size_t cnt); |
593 | __owur int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, |
594 | unsigned int *s); |
595 | __owur int EVP_Digest(const void *data, size_t count, |
596 | unsigned char *md, unsigned int *size, |
597 | const EVP_MD *type, ENGINE *impl); |
598 | |
599 | __owur int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in); |
600 | __owur int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); |
601 | __owur int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, |
602 | unsigned int *s); |
603 | __owur int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, unsigned char *md, |
604 | size_t len); |
605 | |
606 | __owur EVP_MD *EVP_MD_fetch(OPENSSL_CTX *ctx, const char *algorithm, |
607 | const char *properties); |
608 | int EVP_MD_up_ref(EVP_MD *md); |
609 | void EVP_MD_free(EVP_MD *md); |
610 | |
611 | int EVP_read_pw_string(char *buf, int length, const char *prompt, int verify); |
612 | int EVP_read_pw_string_min(char *buf, int minlen, int maxlen, |
613 | const char *prompt, int verify); |
614 | void EVP_set_pw_prompt(const char *prompt); |
615 | char *EVP_get_pw_prompt(void); |
616 | |
617 | __owur int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, |
618 | const unsigned char *salt, |
619 | const unsigned char *data, int datal, int count, |
620 | unsigned char *key, unsigned char *iv); |
621 | |
622 | void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags); |
623 | void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags); |
624 | int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags); |
625 | |
626 | __owur int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, |
627 | const unsigned char *key, const unsigned char *iv); |
628 | /*__owur*/ int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, |
629 | const EVP_CIPHER *cipher, ENGINE *impl, |
630 | const unsigned char *key, |
631 | const unsigned char *iv); |
632 | /*__owur*/ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, |
633 | int *outl, const unsigned char *in, int inl); |
634 | /*__owur*/ int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, |
635 | int *outl); |
636 | /*__owur*/ int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, |
637 | int *outl); |
638 | |
639 | __owur int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, |
640 | const unsigned char *key, const unsigned char *iv); |
641 | /*__owur*/ int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, |
642 | const EVP_CIPHER *cipher, ENGINE *impl, |
643 | const unsigned char *key, |
644 | const unsigned char *iv); |
645 | /*__owur*/ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, |
646 | int *outl, const unsigned char *in, int inl); |
647 | __owur int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, |
648 | int *outl); |
649 | /*__owur*/ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, |
650 | int *outl); |
651 | |
652 | __owur int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, |
653 | const unsigned char *key, const unsigned char *iv, |
654 | int enc); |
655 | /*__owur*/ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, |
656 | const EVP_CIPHER *cipher, ENGINE *impl, |
657 | const unsigned char *key, |
658 | const unsigned char *iv, int enc); |
659 | __owur int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, |
660 | int *outl, const unsigned char *in, int inl); |
661 | __owur int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, |
662 | int *outl); |
663 | __owur int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, |
664 | int *outl); |
665 | |
666 | __owur int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s, |
667 | EVP_PKEY *pkey); |
668 | |
669 | __owur int EVP_DigestSign(EVP_MD_CTX *ctx, unsigned char *sigret, |
670 | size_t *siglen, const unsigned char *tbs, |
671 | size_t tbslen); |
672 | |
673 | __owur int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, |
674 | unsigned int siglen, EVP_PKEY *pkey); |
675 | |
676 | __owur int EVP_DigestVerify(EVP_MD_CTX *ctx, const unsigned char *sigret, |
677 | size_t siglen, const unsigned char *tbs, |
678 | size_t tbslen); |
679 | |
680 | int EVP_DigestSignInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, |
681 | const char *mdname, const char *props, |
682 | EVP_PKEY *pkey); |
683 | /*__owur*/ int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, |
684 | const EVP_MD *type, ENGINE *e, |
685 | EVP_PKEY *pkey); |
686 | int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize); |
687 | __owur int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, |
688 | size_t *siglen); |
689 | |
690 | int EVP_DigestVerifyInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, |
691 | const char *mdname, const char *props, |
692 | EVP_PKEY *pkey); |
693 | __owur int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, |
694 | const EVP_MD *type, ENGINE *e, |
695 | EVP_PKEY *pkey); |
696 | int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize); |
697 | __owur int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, |
698 | size_t siglen); |
699 | |
700 | # ifndef OPENSSL_NO_RSA |
701 | __owur int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, |
702 | const unsigned char *ek, int ekl, |
703 | const unsigned char *iv, EVP_PKEY *priv); |
704 | __owur int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); |
705 | |
706 | __owur int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, |
707 | unsigned char **ek, int *ekl, unsigned char *iv, |
708 | EVP_PKEY **pubk, int npubk); |
709 | __owur int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); |
710 | # endif |
711 | |
712 | EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void); |
713 | void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx); |
714 | int EVP_ENCODE_CTX_copy(EVP_ENCODE_CTX *dctx, const EVP_ENCODE_CTX *sctx); |
715 | int EVP_ENCODE_CTX_num(EVP_ENCODE_CTX *ctx); |
716 | void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); |
717 | int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, |
718 | const unsigned char *in, int inl); |
719 | void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); |
720 | int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n); |
721 | |
722 | void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); |
723 | int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, |
724 | const unsigned char *in, int inl); |
725 | int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned |
726 | char *out, int *outl); |
727 | int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); |
728 | |
729 | # ifndef OPENSSL_NO_DEPRECATED_1_1_0 |
730 | # define EVP_CIPHER_CTX_init(c) EVP_CIPHER_CTX_reset(c) |
731 | # define EVP_CIPHER_CTX_cleanup(c) EVP_CIPHER_CTX_reset(c) |
732 | # endif |
733 | EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); |
734 | int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *c); |
735 | void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *c); |
736 | int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); |
737 | int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad); |
738 | int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); |
739 | int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key); |
740 | int EVP_CIPHER_get_params(EVP_CIPHER *cipher, OSSL_PARAM params[]); |
741 | int EVP_CIPHER_CTX_set_params(EVP_CIPHER_CTX *ctx, const OSSL_PARAM params[]); |
742 | int EVP_CIPHER_CTX_get_params(EVP_CIPHER_CTX *ctx, OSSL_PARAM params[]); |
743 | const OSSL_PARAM *EVP_CIPHER_gettable_params(const EVP_CIPHER *cipher); |
744 | const OSSL_PARAM *EVP_CIPHER_settable_ctx_params(const EVP_CIPHER *cipher); |
745 | const OSSL_PARAM *EVP_CIPHER_gettable_ctx_params(const EVP_CIPHER *cipher); |
746 | |
747 | const BIO_METHOD *BIO_f_md(void); |
748 | const BIO_METHOD *BIO_f_base64(void); |
749 | const BIO_METHOD *BIO_f_cipher(void); |
750 | const BIO_METHOD *BIO_f_reliable(void); |
751 | __owur int BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, |
752 | const unsigned char *i, int enc); |
753 | |
754 | const EVP_MD *EVP_md_null(void); |
755 | # ifndef OPENSSL_NO_MD2 |
756 | const EVP_MD *EVP_md2(void); |
757 | # endif |
758 | # ifndef OPENSSL_NO_MD4 |
759 | const EVP_MD *EVP_md4(void); |
760 | # endif |
761 | # ifndef OPENSSL_NO_MD5 |
762 | const EVP_MD *EVP_md5(void); |
763 | const EVP_MD *EVP_md5_sha1(void); |
764 | # endif |
765 | # ifndef OPENSSL_NO_BLAKE2 |
766 | const EVP_MD *EVP_blake2b512(void); |
767 | const EVP_MD *EVP_blake2s256(void); |
768 | # endif |
769 | const EVP_MD *EVP_sha1(void); |
770 | const EVP_MD *EVP_sha224(void); |
771 | const EVP_MD *EVP_sha256(void); |
772 | const EVP_MD *EVP_sha384(void); |
773 | const EVP_MD *EVP_sha512(void); |
774 | const EVP_MD *EVP_sha512_224(void); |
775 | const EVP_MD *EVP_sha512_256(void); |
776 | const EVP_MD *EVP_sha3_224(void); |
777 | const EVP_MD *EVP_sha3_256(void); |
778 | const EVP_MD *EVP_sha3_384(void); |
779 | const EVP_MD *EVP_sha3_512(void); |
780 | const EVP_MD *EVP_shake128(void); |
781 | const EVP_MD *EVP_shake256(void); |
782 | |
783 | # ifndef OPENSSL_NO_MDC2 |
784 | const EVP_MD *EVP_mdc2(void); |
785 | # endif |
786 | # ifndef OPENSSL_NO_RMD160 |
787 | const EVP_MD *EVP_ripemd160(void); |
788 | # endif |
789 | # ifndef OPENSSL_NO_WHIRLPOOL |
790 | const EVP_MD *EVP_whirlpool(void); |
791 | # endif |
792 | # ifndef OPENSSL_NO_SM3 |
793 | const EVP_MD *EVP_sm3(void); |
794 | # endif |
795 | const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ |
796 | # ifndef OPENSSL_NO_DES |
797 | const EVP_CIPHER *EVP_des_ecb(void); |
798 | const EVP_CIPHER *EVP_des_ede(void); |
799 | const EVP_CIPHER *EVP_des_ede3(void); |
800 | const EVP_CIPHER *EVP_des_ede_ecb(void); |
801 | const EVP_CIPHER *EVP_des_ede3_ecb(void); |
802 | const EVP_CIPHER *EVP_des_cfb64(void); |
803 | # define EVP_des_cfb EVP_des_cfb64 |
804 | const EVP_CIPHER *EVP_des_cfb1(void); |
805 | const EVP_CIPHER *EVP_des_cfb8(void); |
806 | const EVP_CIPHER *EVP_des_ede_cfb64(void); |
807 | # define EVP_des_ede_cfb EVP_des_ede_cfb64 |
808 | const EVP_CIPHER *EVP_des_ede3_cfb64(void); |
809 | # define EVP_des_ede3_cfb EVP_des_ede3_cfb64 |
810 | const EVP_CIPHER *EVP_des_ede3_cfb1(void); |
811 | const EVP_CIPHER *EVP_des_ede3_cfb8(void); |
812 | const EVP_CIPHER *EVP_des_ofb(void); |
813 | const EVP_CIPHER *EVP_des_ede_ofb(void); |
814 | const EVP_CIPHER *EVP_des_ede3_ofb(void); |
815 | const EVP_CIPHER *EVP_des_cbc(void); |
816 | const EVP_CIPHER *EVP_des_ede_cbc(void); |
817 | const EVP_CIPHER *EVP_des_ede3_cbc(void); |
818 | const EVP_CIPHER *EVP_desx_cbc(void); |
819 | const EVP_CIPHER *EVP_des_ede3_wrap(void); |
820 | /* |
821 | * This should now be supported through the dev_crypto ENGINE. But also, why |
822 | * are rc4 and md5 declarations made here inside a "NO_DES" precompiler |
823 | * branch? |
824 | */ |
825 | # endif |
826 | # ifndef OPENSSL_NO_RC4 |
827 | const EVP_CIPHER *EVP_rc4(void); |
828 | const EVP_CIPHER *EVP_rc4_40(void); |
829 | # ifndef OPENSSL_NO_MD5 |
830 | const EVP_CIPHER *EVP_rc4_hmac_md5(void); |
831 | # endif |
832 | # endif |
833 | # ifndef OPENSSL_NO_IDEA |
834 | const EVP_CIPHER *EVP_idea_ecb(void); |
835 | const EVP_CIPHER *EVP_idea_cfb64(void); |
836 | # define EVP_idea_cfb EVP_idea_cfb64 |
837 | const EVP_CIPHER *EVP_idea_ofb(void); |
838 | const EVP_CIPHER *EVP_idea_cbc(void); |
839 | # endif |
840 | # ifndef OPENSSL_NO_RC2 |
841 | const EVP_CIPHER *EVP_rc2_ecb(void); |
842 | const EVP_CIPHER *EVP_rc2_cbc(void); |
843 | const EVP_CIPHER *EVP_rc2_40_cbc(void); |
844 | const EVP_CIPHER *EVP_rc2_64_cbc(void); |
845 | const EVP_CIPHER *EVP_rc2_cfb64(void); |
846 | # define EVP_rc2_cfb EVP_rc2_cfb64 |
847 | const EVP_CIPHER *EVP_rc2_ofb(void); |
848 | # endif |
849 | # ifndef OPENSSL_NO_BF |
850 | const EVP_CIPHER *EVP_bf_ecb(void); |
851 | const EVP_CIPHER *EVP_bf_cbc(void); |
852 | const EVP_CIPHER *EVP_bf_cfb64(void); |
853 | # define EVP_bf_cfb EVP_bf_cfb64 |
854 | const EVP_CIPHER *EVP_bf_ofb(void); |
855 | # endif |
856 | # ifndef OPENSSL_NO_CAST |
857 | const EVP_CIPHER *EVP_cast5_ecb(void); |
858 | const EVP_CIPHER *EVP_cast5_cbc(void); |
859 | const EVP_CIPHER *EVP_cast5_cfb64(void); |
860 | # define EVP_cast5_cfb EVP_cast5_cfb64 |
861 | const EVP_CIPHER *EVP_cast5_ofb(void); |
862 | # endif |
863 | # ifndef OPENSSL_NO_RC5 |
864 | const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); |
865 | const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); |
866 | const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void); |
867 | # define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64 |
868 | const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); |
869 | # endif |
870 | const EVP_CIPHER *EVP_aes_128_ecb(void); |
871 | const EVP_CIPHER *EVP_aes_128_cbc(void); |
872 | const EVP_CIPHER *EVP_aes_128_cfb1(void); |
873 | const EVP_CIPHER *EVP_aes_128_cfb8(void); |
874 | const EVP_CIPHER *EVP_aes_128_cfb128(void); |
875 | # define EVP_aes_128_cfb EVP_aes_128_cfb128 |
876 | const EVP_CIPHER *EVP_aes_128_ofb(void); |
877 | const EVP_CIPHER *EVP_aes_128_ctr(void); |
878 | const EVP_CIPHER *EVP_aes_128_ccm(void); |
879 | const EVP_CIPHER *EVP_aes_128_gcm(void); |
880 | const EVP_CIPHER *EVP_aes_128_xts(void); |
881 | const EVP_CIPHER *EVP_aes_128_wrap(void); |
882 | const EVP_CIPHER *EVP_aes_128_wrap_pad(void); |
883 | # ifndef OPENSSL_NO_OCB |
884 | const EVP_CIPHER *EVP_aes_128_ocb(void); |
885 | # endif |
886 | const EVP_CIPHER *EVP_aes_192_ecb(void); |
887 | const EVP_CIPHER *EVP_aes_192_cbc(void); |
888 | const EVP_CIPHER *EVP_aes_192_cfb1(void); |
889 | const EVP_CIPHER *EVP_aes_192_cfb8(void); |
890 | const EVP_CIPHER *EVP_aes_192_cfb128(void); |
891 | # define EVP_aes_192_cfb EVP_aes_192_cfb128 |
892 | const EVP_CIPHER *EVP_aes_192_ofb(void); |
893 | const EVP_CIPHER *EVP_aes_192_ctr(void); |
894 | const EVP_CIPHER *EVP_aes_192_ccm(void); |
895 | const EVP_CIPHER *EVP_aes_192_gcm(void); |
896 | const EVP_CIPHER *EVP_aes_192_wrap(void); |
897 | const EVP_CIPHER *EVP_aes_192_wrap_pad(void); |
898 | # ifndef OPENSSL_NO_OCB |
899 | const EVP_CIPHER *EVP_aes_192_ocb(void); |
900 | # endif |
901 | const EVP_CIPHER *EVP_aes_256_ecb(void); |
902 | const EVP_CIPHER *EVP_aes_256_cbc(void); |
903 | const EVP_CIPHER *EVP_aes_256_cfb1(void); |
904 | const EVP_CIPHER *EVP_aes_256_cfb8(void); |
905 | const EVP_CIPHER *EVP_aes_256_cfb128(void); |
906 | # define EVP_aes_256_cfb EVP_aes_256_cfb128 |
907 | const EVP_CIPHER *EVP_aes_256_ofb(void); |
908 | const EVP_CIPHER *EVP_aes_256_ctr(void); |
909 | const EVP_CIPHER *EVP_aes_256_ccm(void); |
910 | const EVP_CIPHER *EVP_aes_256_gcm(void); |
911 | const EVP_CIPHER *EVP_aes_256_xts(void); |
912 | const EVP_CIPHER *EVP_aes_256_wrap(void); |
913 | const EVP_CIPHER *EVP_aes_256_wrap_pad(void); |
914 | # ifndef OPENSSL_NO_OCB |
915 | const EVP_CIPHER *EVP_aes_256_ocb(void); |
916 | # endif |
917 | const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void); |
918 | const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void); |
919 | const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha256(void); |
920 | const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void); |
921 | # ifndef OPENSSL_NO_SIV |
922 | const EVP_CIPHER *EVP_aes_128_siv(void); |
923 | const EVP_CIPHER *EVP_aes_192_siv(void); |
924 | const EVP_CIPHER *EVP_aes_256_siv(void); |
925 | # endif |
926 | # ifndef OPENSSL_NO_ARIA |
927 | const EVP_CIPHER *EVP_aria_128_ecb(void); |
928 | const EVP_CIPHER *EVP_aria_128_cbc(void); |
929 | const EVP_CIPHER *EVP_aria_128_cfb1(void); |
930 | const EVP_CIPHER *EVP_aria_128_cfb8(void); |
931 | const EVP_CIPHER *EVP_aria_128_cfb128(void); |
932 | # define EVP_aria_128_cfb EVP_aria_128_cfb128 |
933 | const EVP_CIPHER *EVP_aria_128_ctr(void); |
934 | const EVP_CIPHER *EVP_aria_128_ofb(void); |
935 | const EVP_CIPHER *EVP_aria_128_gcm(void); |
936 | const EVP_CIPHER *EVP_aria_128_ccm(void); |
937 | const EVP_CIPHER *EVP_aria_192_ecb(void); |
938 | const EVP_CIPHER *EVP_aria_192_cbc(void); |
939 | const EVP_CIPHER *EVP_aria_192_cfb1(void); |
940 | const EVP_CIPHER *EVP_aria_192_cfb8(void); |
941 | const EVP_CIPHER *EVP_aria_192_cfb128(void); |
942 | # define EVP_aria_192_cfb EVP_aria_192_cfb128 |
943 | const EVP_CIPHER *EVP_aria_192_ctr(void); |
944 | const EVP_CIPHER *EVP_aria_192_ofb(void); |
945 | const EVP_CIPHER *EVP_aria_192_gcm(void); |
946 | const EVP_CIPHER *EVP_aria_192_ccm(void); |
947 | const EVP_CIPHER *EVP_aria_256_ecb(void); |
948 | const EVP_CIPHER *EVP_aria_256_cbc(void); |
949 | const EVP_CIPHER *EVP_aria_256_cfb1(void); |
950 | const EVP_CIPHER *EVP_aria_256_cfb8(void); |
951 | const EVP_CIPHER *EVP_aria_256_cfb128(void); |
952 | # define EVP_aria_256_cfb EVP_aria_256_cfb128 |
953 | const EVP_CIPHER *EVP_aria_256_ctr(void); |
954 | const EVP_CIPHER *EVP_aria_256_ofb(void); |
955 | const EVP_CIPHER *EVP_aria_256_gcm(void); |
956 | const EVP_CIPHER *EVP_aria_256_ccm(void); |
957 | # endif |
958 | # ifndef OPENSSL_NO_CAMELLIA |
959 | const EVP_CIPHER *EVP_camellia_128_ecb(void); |
960 | const EVP_CIPHER *EVP_camellia_128_cbc(void); |
961 | const EVP_CIPHER *EVP_camellia_128_cfb1(void); |
962 | const EVP_CIPHER *EVP_camellia_128_cfb8(void); |
963 | const EVP_CIPHER *EVP_camellia_128_cfb128(void); |
964 | # define EVP_camellia_128_cfb EVP_camellia_128_cfb128 |
965 | const EVP_CIPHER *EVP_camellia_128_ofb(void); |
966 | const EVP_CIPHER *EVP_camellia_128_ctr(void); |
967 | const EVP_CIPHER *EVP_camellia_192_ecb(void); |
968 | const EVP_CIPHER *EVP_camellia_192_cbc(void); |
969 | const EVP_CIPHER *EVP_camellia_192_cfb1(void); |
970 | const EVP_CIPHER *EVP_camellia_192_cfb8(void); |
971 | const EVP_CIPHER *EVP_camellia_192_cfb128(void); |
972 | # define EVP_camellia_192_cfb EVP_camellia_192_cfb128 |
973 | const EVP_CIPHER *EVP_camellia_192_ofb(void); |
974 | const EVP_CIPHER *EVP_camellia_192_ctr(void); |
975 | const EVP_CIPHER *EVP_camellia_256_ecb(void); |
976 | const EVP_CIPHER *EVP_camellia_256_cbc(void); |
977 | const EVP_CIPHER *EVP_camellia_256_cfb1(void); |
978 | const EVP_CIPHER *EVP_camellia_256_cfb8(void); |
979 | const EVP_CIPHER *EVP_camellia_256_cfb128(void); |
980 | # define EVP_camellia_256_cfb EVP_camellia_256_cfb128 |
981 | const EVP_CIPHER *EVP_camellia_256_ofb(void); |
982 | const EVP_CIPHER *EVP_camellia_256_ctr(void); |
983 | # endif |
984 | # ifndef OPENSSL_NO_CHACHA |
985 | const EVP_CIPHER *EVP_chacha20(void); |
986 | # ifndef OPENSSL_NO_POLY1305 |
987 | const EVP_CIPHER *EVP_chacha20_poly1305(void); |
988 | # endif |
989 | # endif |
990 | |
991 | # ifndef OPENSSL_NO_SEED |
992 | const EVP_CIPHER *EVP_seed_ecb(void); |
993 | const EVP_CIPHER *EVP_seed_cbc(void); |
994 | const EVP_CIPHER *EVP_seed_cfb128(void); |
995 | # define EVP_seed_cfb EVP_seed_cfb128 |
996 | const EVP_CIPHER *EVP_seed_ofb(void); |
997 | # endif |
998 | |
999 | # ifndef OPENSSL_NO_SM4 |
1000 | const EVP_CIPHER *EVP_sm4_ecb(void); |
1001 | const EVP_CIPHER *EVP_sm4_cbc(void); |
1002 | const EVP_CIPHER *EVP_sm4_cfb128(void); |
1003 | # define EVP_sm4_cfb EVP_sm4_cfb128 |
1004 | const EVP_CIPHER *EVP_sm4_ofb(void); |
1005 | const EVP_CIPHER *EVP_sm4_ctr(void); |
1006 | # endif |
1007 | |
1008 | # ifndef OPENSSL_NO_DEPRECATED_1_1_0 |
1009 | # define OPENSSL_add_all_algorithms_conf() \ |
1010 | OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ |
1011 | | OPENSSL_INIT_ADD_ALL_DIGESTS \ |
1012 | | OPENSSL_INIT_LOAD_CONFIG, NULL) |
1013 | # define OPENSSL_add_all_algorithms_noconf() \ |
1014 | OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ |
1015 | | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL) |
1016 | |
1017 | # ifdef OPENSSL_LOAD_CONF |
1018 | # define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_conf() |
1019 | # else |
1020 | # define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_noconf() |
1021 | # endif |
1022 | |
1023 | # define OpenSSL_add_all_ciphers() \ |
1024 | OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, NULL) |
1025 | # define OpenSSL_add_all_digests() \ |
1026 | OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL) |
1027 | |
1028 | # define EVP_cleanup() while(0) continue |
1029 | # endif |
1030 | |
1031 | int EVP_add_cipher(const EVP_CIPHER *cipher); |
1032 | int EVP_add_digest(const EVP_MD *digest); |
1033 | |
1034 | const EVP_CIPHER *EVP_get_cipherbyname(const char *name); |
1035 | const EVP_MD *EVP_get_digestbyname(const char *name); |
1036 | |
1037 | void EVP_CIPHER_do_all(void (*fn) (const EVP_CIPHER *ciph, |
1038 | const char *from, const char *to, void *x), |
1039 | void *arg); |
1040 | void EVP_CIPHER_do_all_sorted(void (*fn) |
1041 | (const EVP_CIPHER *ciph, const char *from, |
1042 | const char *to, void *x), void *arg); |
1043 | void EVP_CIPHER_do_all_provided(OPENSSL_CTX *libctx, |
1044 | void (*fn)(EVP_CIPHER *cipher, void *arg), |
1045 | void *arg); |
1046 | |
1047 | void EVP_MD_do_all(void (*fn) (const EVP_MD *ciph, |
1048 | const char *from, const char *to, void *x), |
1049 | void *arg); |
1050 | void EVP_MD_do_all_sorted(void (*fn) |
1051 | (const EVP_MD *ciph, const char *from, |
1052 | const char *to, void *x), void *arg); |
1053 | void EVP_MD_do_all_provided(OPENSSL_CTX *libctx, |
1054 | void (*fn)(EVP_MD *md, void *arg), |
1055 | void *arg); |
1056 | |
1057 | /* MAC stuff */ |
1058 | |
1059 | EVP_MAC *EVP_MAC_fetch(OPENSSL_CTX *libctx, const char *algorithm, |
1060 | const char *properties); |
1061 | int EVP_MAC_up_ref(EVP_MAC *mac); |
1062 | void EVP_MAC_free(EVP_MAC *mac); |
1063 | int EVP_MAC_number(const EVP_MAC *mac); |
1064 | int EVP_MAC_is_a(const EVP_MAC *mac, const char *name); |
1065 | const OSSL_PROVIDER *EVP_MAC_provider(const EVP_MAC *mac); |
1066 | int EVP_MAC_get_params(EVP_MAC *mac, OSSL_PARAM params[]); |
1067 | |
1068 | EVP_MAC_CTX *EVP_MAC_CTX_new(EVP_MAC *mac); |
1069 | void EVP_MAC_CTX_free(EVP_MAC_CTX *ctx); |
1070 | EVP_MAC_CTX *EVP_MAC_CTX_dup(const EVP_MAC_CTX *src); |
1071 | EVP_MAC *EVP_MAC_CTX_mac(EVP_MAC_CTX *ctx); |
1072 | int EVP_MAC_CTX_get_params(EVP_MAC_CTX *ctx, OSSL_PARAM params[]); |
1073 | int EVP_MAC_CTX_set_params(EVP_MAC_CTX *ctx, const OSSL_PARAM params[]); |
1074 | |
1075 | size_t EVP_MAC_size(EVP_MAC_CTX *ctx); |
1076 | int EVP_MAC_init(EVP_MAC_CTX *ctx); |
1077 | int EVP_MAC_update(EVP_MAC_CTX *ctx, const unsigned char *data, size_t datalen); |
1078 | int EVP_MAC_final(EVP_MAC_CTX *ctx, |
1079 | unsigned char *out, size_t *outl, size_t outsize); |
1080 | const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac); |
1081 | const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac); |
1082 | const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac); |
1083 | |
1084 | void EVP_MAC_do_all_provided(OPENSSL_CTX *libctx, |
1085 | void (*fn)(EVP_MAC *mac, void *arg), |
1086 | void *arg); |
1087 | void EVP_MAC_names_do_all(const EVP_MAC *mac, |
1088 | void (*fn)(const char *name, void *data), |
1089 | void *data); |
1090 | |
1091 | /* PKEY stuff */ |
1092 | int EVP_PKEY_decrypt_old(unsigned char *dec_key, |
1093 | const unsigned char *enc_key, int enc_key_len, |
1094 | EVP_PKEY *private_key); |
1095 | int EVP_PKEY_encrypt_old(unsigned char *enc_key, |
1096 | const unsigned char *key, int key_len, |
1097 | EVP_PKEY *pub_key); |
1098 | int EVP_PKEY_type(int type); |
1099 | int EVP_PKEY_id(const EVP_PKEY *pkey); |
1100 | int EVP_PKEY_base_id(const EVP_PKEY *pkey); |
1101 | int EVP_PKEY_bits(const EVP_PKEY *pkey); |
1102 | int EVP_PKEY_security_bits(const EVP_PKEY *pkey); |
1103 | int EVP_PKEY_size(const EVP_PKEY *pkey); |
1104 | int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); |
1105 | int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); |
1106 | int EVP_PKEY_set_alias_type(EVP_PKEY *pkey, int type); |
1107 | # ifndef OPENSSL_NO_ENGINE |
1108 | int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e); |
1109 | ENGINE *EVP_PKEY_get0_engine(const EVP_PKEY *pkey); |
1110 | # endif |
1111 | int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); |
1112 | void *EVP_PKEY_get0(const EVP_PKEY *pkey); |
1113 | const unsigned char *EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len); |
1114 | # ifndef OPENSSL_NO_POLY1305 |
1115 | const unsigned char *EVP_PKEY_get0_poly1305(const EVP_PKEY *pkey, size_t *len); |
1116 | # endif |
1117 | # ifndef OPENSSL_NO_SIPHASH |
1118 | const unsigned char *EVP_PKEY_get0_siphash(const EVP_PKEY *pkey, size_t *len); |
1119 | # endif |
1120 | |
1121 | # ifndef OPENSSL_NO_RSA |
1122 | struct rsa_st; |
1123 | int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, struct rsa_st *key); |
1124 | struct rsa_st *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey); |
1125 | struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); |
1126 | # endif |
1127 | # ifndef OPENSSL_NO_DSA |
1128 | struct dsa_st; |
1129 | int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, struct dsa_st *key); |
1130 | struct dsa_st *EVP_PKEY_get0_DSA(const EVP_PKEY *pkey); |
1131 | struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); |
1132 | # endif |
1133 | # ifndef OPENSSL_NO_DH |
1134 | struct dh_st; |
1135 | int EVP_PKEY_set1_DH(EVP_PKEY *pkey, struct dh_st *key); |
1136 | struct dh_st *EVP_PKEY_get0_DH(const EVP_PKEY *pkey); |
1137 | struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey); |
1138 | # endif |
1139 | # ifndef OPENSSL_NO_EC |
1140 | struct ec_key_st; |
1141 | int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key); |
1142 | struct ec_key_st *EVP_PKEY_get0_EC_KEY(const EVP_PKEY *pkey); |
1143 | struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); |
1144 | # endif |
1145 | |
1146 | EVP_PKEY *EVP_PKEY_new(void); |
1147 | int EVP_PKEY_up_ref(EVP_PKEY *pkey); |
1148 | void EVP_PKEY_free(EVP_PKEY *pkey); |
1149 | |
1150 | EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, |
1151 | long length); |
1152 | int i2d_PublicKey(const EVP_PKEY *a, unsigned char **pp); |
1153 | |
1154 | EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, |
1155 | long length); |
1156 | EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, |
1157 | long length); |
1158 | int i2d_PrivateKey(const EVP_PKEY *a, unsigned char **pp); |
1159 | |
1160 | int i2d_KeyParams(const EVP_PKEY *a, unsigned char **pp); |
1161 | EVP_PKEY *d2i_KeyParams(int type, EVP_PKEY **a, const unsigned char **pp, |
1162 | long length); |
1163 | int i2d_KeyParams_bio(BIO *bp, const EVP_PKEY *pkey); |
1164 | EVP_PKEY *d2i_KeyParams_bio(int type, EVP_PKEY **a, BIO *in); |
1165 | |
1166 | int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from); |
1167 | int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey); |
1168 | int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode); |
1169 | int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b); |
1170 | |
1171 | int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b); |
1172 | |
1173 | int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey, |
1174 | int indent, ASN1_PCTX *pctx); |
1175 | int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, |
1176 | int indent, ASN1_PCTX *pctx); |
1177 | int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, |
1178 | int indent, ASN1_PCTX *pctx); |
1179 | |
1180 | int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid); |
1181 | int EVP_PKEY_supports_digest_nid(EVP_PKEY *pkey, int nid); |
1182 | |
1183 | int EVP_PKEY_set1_tls_encodedpoint(EVP_PKEY *pkey, |
1184 | const unsigned char *pt, size_t ptlen); |
1185 | size_t EVP_PKEY_get1_tls_encodedpoint(EVP_PKEY *pkey, unsigned char **ppt); |
1186 | |
1187 | int EVP_CIPHER_type(const EVP_CIPHER *ctx); |
1188 | |
1189 | /* calls methods */ |
1190 | int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); |
1191 | int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); |
1192 | |
1193 | /* These are used by EVP_CIPHER methods */ |
1194 | int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); |
1195 | int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); |
1196 | |
1197 | /* PKCS5 password based encryption */ |
1198 | int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
1199 | ASN1_TYPE *param, const EVP_CIPHER *cipher, |
1200 | const EVP_MD *md, int en_de); |
1201 | int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, |
1202 | const unsigned char *salt, int saltlen, int iter, |
1203 | int keylen, unsigned char *out); |
1204 | int PKCS5_PBKDF2_HMAC(const char *pass, int passlen, |
1205 | const unsigned char *salt, int saltlen, int iter, |
1206 | const EVP_MD *digest, int keylen, unsigned char *out); |
1207 | int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
1208 | ASN1_TYPE *param, const EVP_CIPHER *cipher, |
1209 | const EVP_MD *md, int en_de); |
1210 | |
1211 | #ifndef OPENSSL_NO_SCRYPT |
1212 | int EVP_PBE_scrypt(const char *pass, size_t passlen, |
1213 | const unsigned char *salt, size_t saltlen, |
1214 | uint64_t N, uint64_t r, uint64_t p, uint64_t maxmem, |
1215 | unsigned char *key, size_t keylen); |
1216 | |
1217 | int PKCS5_v2_scrypt_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, |
1218 | int passlen, ASN1_TYPE *param, |
1219 | const EVP_CIPHER *c, const EVP_MD *md, int en_de); |
1220 | #endif |
1221 | |
1222 | void PKCS5_PBE_add(void); |
1223 | |
1224 | int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen, |
1225 | ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); |
1226 | |
1227 | /* PBE type */ |
1228 | |
1229 | /* Can appear as the outermost AlgorithmIdentifier */ |
1230 | # define EVP_PBE_TYPE_OUTER 0x0 |
1231 | /* Is an PRF type OID */ |
1232 | # define EVP_PBE_TYPE_PRF 0x1 |
1233 | /* Is a PKCS#5 v2.0 KDF */ |
1234 | # define EVP_PBE_TYPE_KDF 0x2 |
1235 | |
1236 | int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, |
1237 | int md_nid, EVP_PBE_KEYGEN *keygen); |
1238 | int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, |
1239 | EVP_PBE_KEYGEN *keygen); |
1240 | int EVP_PBE_find(int type, int pbe_nid, int *pcnid, int *pmnid, |
1241 | EVP_PBE_KEYGEN **pkeygen); |
1242 | void EVP_PBE_cleanup(void); |
1243 | int EVP_PBE_get(int *ptype, int *ppbe_nid, size_t num); |
1244 | |
1245 | # define ASN1_PKEY_ALIAS 0x1 |
1246 | # define ASN1_PKEY_DYNAMIC 0x2 |
1247 | # define ASN1_PKEY_SIGPARAM_NULL 0x4 |
1248 | |
1249 | # define ASN1_PKEY_CTRL_PKCS7_SIGN 0x1 |
1250 | # define ASN1_PKEY_CTRL_PKCS7_ENCRYPT 0x2 |
1251 | # define ASN1_PKEY_CTRL_DEFAULT_MD_NID 0x3 |
1252 | # define ASN1_PKEY_CTRL_CMS_SIGN 0x5 |
1253 | # define ASN1_PKEY_CTRL_CMS_ENVELOPE 0x7 |
1254 | # define ASN1_PKEY_CTRL_CMS_RI_TYPE 0x8 |
1255 | |
1256 | # define ASN1_PKEY_CTRL_SET1_TLS_ENCPT 0x9 |
1257 | # define ASN1_PKEY_CTRL_GET1_TLS_ENCPT 0xa |
1258 | # define ASN1_PKEY_CTRL_SUPPORTS_MD_NID 0xb |
1259 | |
1260 | int EVP_PKEY_asn1_get_count(void); |
1261 | const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx); |
1262 | const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type); |
1263 | const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe, |
1264 | const char *str, int len); |
1265 | int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth); |
1266 | int EVP_PKEY_asn1_add_alias(int to, int from); |
1267 | int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id, |
1268 | int *ppkey_flags, const char **pinfo, |
1269 | const char **ppem_str, |
1270 | const EVP_PKEY_ASN1_METHOD *ameth); |
1271 | |
1272 | const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(const EVP_PKEY *pkey); |
1273 | EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags, |
1274 | const char *pem_str, |
1275 | const char *info); |
1276 | void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, |
1277 | const EVP_PKEY_ASN1_METHOD *src); |
1278 | void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth); |
1279 | void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth, |
1280 | int (*pub_decode) (EVP_PKEY *pk, |
1281 | X509_PUBKEY *pub), |
1282 | int (*pub_encode) (X509_PUBKEY *pub, |
1283 | const EVP_PKEY *pk), |
1284 | int (*pub_cmp) (const EVP_PKEY *a, |
1285 | const EVP_PKEY *b), |
1286 | int (*pub_print) (BIO *out, |
1287 | const EVP_PKEY *pkey, |
1288 | int indent, ASN1_PCTX *pctx), |
1289 | int (*pkey_size) (const EVP_PKEY *pk), |
1290 | int (*pkey_bits) (const EVP_PKEY *pk)); |
1291 | void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, |
1292 | int (*priv_decode) (EVP_PKEY *pk, |
1293 | const PKCS8_PRIV_KEY_INFO |
1294 | *p8inf), |
1295 | int (*priv_encode) (PKCS8_PRIV_KEY_INFO *p8, |
1296 | const EVP_PKEY *pk), |
1297 | int (*priv_print) (BIO *out, |
1298 | const EVP_PKEY *pkey, |
1299 | int indent, |
1300 | ASN1_PCTX *pctx)); |
1301 | void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth, |
1302 | int (*param_decode) (EVP_PKEY *pkey, |
1303 | const unsigned char **pder, |
1304 | int derlen), |
1305 | int (*param_encode) (const EVP_PKEY *pkey, |
1306 | unsigned char **pder), |
1307 | int (*param_missing) (const EVP_PKEY *pk), |
1308 | int (*param_copy) (EVP_PKEY *to, |
1309 | const EVP_PKEY *from), |
1310 | int (*param_cmp) (const EVP_PKEY *a, |
1311 | const EVP_PKEY *b), |
1312 | int (*param_print) (BIO *out, |
1313 | const EVP_PKEY *pkey, |
1314 | int indent, |
1315 | ASN1_PCTX *pctx)); |
1316 | |
1317 | void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth, |
1318 | void (*pkey_free) (EVP_PKEY *pkey)); |
1319 | void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, |
1320 | int (*pkey_ctrl) (EVP_PKEY *pkey, int op, |
1321 | long arg1, void *arg2)); |
1322 | void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth, |
1323 | int (*item_verify) (EVP_MD_CTX *ctx, |
1324 | const ASN1_ITEM *it, |
1325 | void *asn, |
1326 | X509_ALGOR *a, |
1327 | ASN1_BIT_STRING *sig, |
1328 | EVP_PKEY *pkey), |
1329 | int (*item_sign) (EVP_MD_CTX *ctx, |
1330 | const ASN1_ITEM *it, |
1331 | void *asn, |
1332 | X509_ALGOR *alg1, |
1333 | X509_ALGOR *alg2, |
1334 | ASN1_BIT_STRING *sig)); |
1335 | |
1336 | void EVP_PKEY_asn1_set_siginf(EVP_PKEY_ASN1_METHOD *ameth, |
1337 | int (*siginf_set) (X509_SIG_INFO *siginf, |
1338 | const X509_ALGOR *alg, |
1339 | const ASN1_STRING *sig)); |
1340 | |
1341 | void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth, |
1342 | int (*pkey_check) (const EVP_PKEY *pk)); |
1343 | |
1344 | void EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth, |
1345 | int (*pkey_pub_check) (const EVP_PKEY *pk)); |
1346 | |
1347 | void EVP_PKEY_asn1_set_param_check(EVP_PKEY_ASN1_METHOD *ameth, |
1348 | int (*pkey_param_check) (const EVP_PKEY *pk)); |
1349 | |
1350 | void EVP_PKEY_asn1_set_set_priv_key(EVP_PKEY_ASN1_METHOD *ameth, |
1351 | int (*set_priv_key) (EVP_PKEY *pk, |
1352 | const unsigned char |
1353 | *priv, |
1354 | size_t len)); |
1355 | void EVP_PKEY_asn1_set_set_pub_key(EVP_PKEY_ASN1_METHOD *ameth, |
1356 | int (*set_pub_key) (EVP_PKEY *pk, |
1357 | const unsigned char *pub, |
1358 | size_t len)); |
1359 | void EVP_PKEY_asn1_set_get_priv_key(EVP_PKEY_ASN1_METHOD *ameth, |
1360 | int (*get_priv_key) (const EVP_PKEY *pk, |
1361 | unsigned char *priv, |
1362 | size_t *len)); |
1363 | void EVP_PKEY_asn1_set_get_pub_key(EVP_PKEY_ASN1_METHOD *ameth, |
1364 | int (*get_pub_key) (const EVP_PKEY *pk, |
1365 | unsigned char *pub, |
1366 | size_t *len)); |
1367 | |
1368 | void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth, |
1369 | int (*pkey_security_bits) (const EVP_PKEY |
1370 | *pk)); |
1371 | |
1372 | int EVP_PKEY_CTX_get_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD **md); |
1373 | int EVP_PKEY_CTX_set_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD *md); |
1374 | |
1375 | # define EVP_PKEY_OP_UNDEFINED 0 |
1376 | # define EVP_PKEY_OP_PARAMGEN (1<<1) |
1377 | # define EVP_PKEY_OP_KEYGEN (1<<2) |
1378 | # define EVP_PKEY_OP_PARAMFROMDATA (1<<3) |
1379 | # define EVP_PKEY_OP_KEYFROMDATA (1<<4) |
1380 | # define EVP_PKEY_OP_SIGN (1<<5) |
1381 | # define EVP_PKEY_OP_VERIFY (1<<6) |
1382 | # define EVP_PKEY_OP_VERIFYRECOVER (1<<7) |
1383 | # define EVP_PKEY_OP_SIGNCTX (1<<8) |
1384 | # define EVP_PKEY_OP_VERIFYCTX (1<<9) |
1385 | # define EVP_PKEY_OP_ENCRYPT (1<<10) |
1386 | # define EVP_PKEY_OP_DECRYPT (1<<11) |
1387 | # define EVP_PKEY_OP_DERIVE (1<<12) |
1388 | |
1389 | # define EVP_PKEY_OP_TYPE_SIG \ |
1390 | (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER \ |
1391 | | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX) |
1392 | |
1393 | # define EVP_PKEY_OP_TYPE_CRYPT \ |
1394 | (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT) |
1395 | |
1396 | # define EVP_PKEY_OP_TYPE_NOGEN \ |
1397 | (EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT | EVP_PKEY_OP_DERIVE) |
1398 | |
1399 | # define EVP_PKEY_OP_TYPE_GEN \ |
1400 | (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN) |
1401 | |
1402 | # define EVP_PKEY_OP_TYPE_FROMDATA \ |
1403 | (EVP_PKEY_OP_PARAMFROMDATA | EVP_PKEY_OP_KEYFROMDATA) |
1404 | |
1405 | # define EVP_PKEY_CTX_set_mac_key(ctx, key, len) \ |
1406 | EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_KEYGEN, \ |
1407 | EVP_PKEY_CTRL_SET_MAC_KEY, len, (void *)(key)) |
1408 | |
1409 | # define EVP_PKEY_CTRL_MD 1 |
1410 | # define EVP_PKEY_CTRL_PEER_KEY 2 |
1411 | |
1412 | # define EVP_PKEY_CTRL_PKCS7_ENCRYPT 3 |
1413 | # define EVP_PKEY_CTRL_PKCS7_DECRYPT 4 |
1414 | |
1415 | # define EVP_PKEY_CTRL_PKCS7_SIGN 5 |
1416 | |
1417 | # define EVP_PKEY_CTRL_SET_MAC_KEY 6 |
1418 | |
1419 | # define EVP_PKEY_CTRL_DIGESTINIT 7 |
1420 | |
1421 | /* Used by GOST key encryption in TLS */ |
1422 | # define EVP_PKEY_CTRL_SET_IV 8 |
1423 | |
1424 | # define EVP_PKEY_CTRL_CMS_ENCRYPT 9 |
1425 | # define EVP_PKEY_CTRL_CMS_DECRYPT 10 |
1426 | # define EVP_PKEY_CTRL_CMS_SIGN 11 |
1427 | |
1428 | # define EVP_PKEY_CTRL_CIPHER 12 |
1429 | |
1430 | # define EVP_PKEY_CTRL_GET_MD 13 |
1431 | |
1432 | # define EVP_PKEY_CTRL_SET_DIGEST_SIZE 14 |
1433 | |
1434 | # define EVP_PKEY_ALG_CTRL 0x1000 |
1435 | |
1436 | # define EVP_PKEY_FLAG_AUTOARGLEN 2 |
1437 | /* |
1438 | * Method handles all operations: don't assume any digest related defaults. |
1439 | */ |
1440 | # define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4 |
1441 | |
1442 | const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type); |
1443 | EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags); |
1444 | void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags, |
1445 | const EVP_PKEY_METHOD *meth); |
1446 | void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src); |
1447 | void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth); |
1448 | int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth); |
1449 | int EVP_PKEY_meth_remove(const EVP_PKEY_METHOD *pmeth); |
1450 | size_t EVP_PKEY_meth_get_count(void); |
1451 | const EVP_PKEY_METHOD *EVP_PKEY_meth_get0(size_t idx); |
1452 | |
1453 | EVP_KEYMGMT *EVP_KEYMGMT_fetch(OPENSSL_CTX *ctx, const char *algorithm, |
1454 | const char *properties); |
1455 | int EVP_KEYMGMT_up_ref(EVP_KEYMGMT *keymgmt); |
1456 | void EVP_KEYMGMT_free(EVP_KEYMGMT *keymgmt); |
1457 | const OSSL_PROVIDER *EVP_KEYMGMT_provider(const EVP_KEYMGMT *keymgmt); |
1458 | int EVP_KEYMGMT_number(const EVP_KEYMGMT *keymgmt); |
1459 | int EVP_KEYMGMT_is_a(const EVP_KEYMGMT *keymgmt, const char *name); |
1460 | void EVP_KEYMGMT_do_all_provided(OPENSSL_CTX *libctx, |
1461 | void (*fn)(EVP_KEYMGMT *keymgmt, void *arg), |
1462 | void *arg); |
1463 | void EVP_KEYMGMT_names_do_all(const EVP_KEYMGMT *keymgmt, |
1464 | void (*fn)(const char *name, void *data), |
1465 | void *data); |
1466 | |
1467 | EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e); |
1468 | EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e); |
1469 | EVP_PKEY_CTX *EVP_PKEY_CTX_new_provided(OPENSSL_CTX *libctx, |
1470 | const char *name, |
1471 | const char *propquery); |
1472 | EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *ctx); |
1473 | void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx); |
1474 | |
1475 | int EVP_PKEY_CTX_get_params(EVP_PKEY_CTX *ctx, OSSL_PARAM *params); |
1476 | const OSSL_PARAM *EVP_PKEY_CTX_gettable_params(EVP_PKEY_CTX *ctx); |
1477 | int EVP_PKEY_CTX_set_params(EVP_PKEY_CTX *ctx, OSSL_PARAM *params); |
1478 | const OSSL_PARAM *EVP_PKEY_CTX_settable_params(EVP_PKEY_CTX *ctx); |
1479 | int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, |
1480 | int cmd, int p1, void *p2); |
1481 | int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, |
1482 | const char *value); |
1483 | int EVP_PKEY_CTX_ctrl_uint64(EVP_PKEY_CTX *ctx, int keytype, int optype, |
1484 | int cmd, uint64_t value); |
1485 | |
1486 | int EVP_PKEY_CTX_str2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *str); |
1487 | int EVP_PKEY_CTX_hex2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *hex); |
1488 | |
1489 | int EVP_PKEY_CTX_md(EVP_PKEY_CTX *ctx, int optype, int cmd, const char *md); |
1490 | |
1491 | int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx); |
1492 | void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen); |
1493 | |
1494 | EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, |
1495 | const unsigned char *key, int keylen); |
1496 | EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e, |
1497 | const unsigned char *priv, |
1498 | size_t len); |
1499 | EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e, |
1500 | const unsigned char *pub, |
1501 | size_t len); |
1502 | int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, unsigned char *priv, |
1503 | size_t *len); |
1504 | int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, unsigned char *pub, |
1505 | size_t *len); |
1506 | |
1507 | EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv, |
1508 | size_t len, const EVP_CIPHER *cipher); |
1509 | |
1510 | void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data); |
1511 | void *EVP_PKEY_CTX_get_data(const EVP_PKEY_CTX *ctx); |
1512 | EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx); |
1513 | |
1514 | EVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx); |
1515 | |
1516 | void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data); |
1517 | void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx); |
1518 | |
1519 | void EVP_SIGNATURE_free(EVP_SIGNATURE *signature); |
1520 | int EVP_SIGNATURE_up_ref(EVP_SIGNATURE *signature); |
1521 | OSSL_PROVIDER *EVP_SIGNATURE_provider(const EVP_SIGNATURE *signature); |
1522 | EVP_SIGNATURE *EVP_SIGNATURE_fetch(OPENSSL_CTX *ctx, const char *algorithm, |
1523 | const char *properties); |
1524 | int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name); |
1525 | int EVP_SIGNATURE_number(const EVP_SIGNATURE *signature); |
1526 | void EVP_SIGNATURE_do_all_provided(OPENSSL_CTX *libctx, |
1527 | void (*fn)(EVP_SIGNATURE *signature, |
1528 | void *data), |
1529 | void *data); |
1530 | void EVP_SIGNATURE_names_do_all(const EVP_SIGNATURE *signature, |
1531 | void (*fn)(const char *name, void *data), |
1532 | void *data); |
1533 | |
1534 | void EVP_ASYM_CIPHER_free(EVP_ASYM_CIPHER *cipher); |
1535 | int EVP_ASYM_CIPHER_up_ref(EVP_ASYM_CIPHER *cipher); |
1536 | OSSL_PROVIDER *EVP_ASYM_CIPHER_provider(const EVP_ASYM_CIPHER *cipher); |
1537 | EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm, |
1538 | const char *properties); |
1539 | int EVP_ASYM_CIPHER_is_a(const EVP_ASYM_CIPHER *cipher, const char *name); |
1540 | int EVP_ASYM_CIPHER_number(const EVP_ASYM_CIPHER *cipher); |
1541 | void EVP_ASYM_CIPHER_do_all_provided(OPENSSL_CTX *libctx, |
1542 | void (*fn)(EVP_ASYM_CIPHER *cipher, |
1543 | void *arg), |
1544 | void *arg); |
1545 | void EVP_ASYM_CIPHER_names_do_all(const EVP_ASYM_CIPHER *cipher, |
1546 | void (*fn)(const char *name, void *data), |
1547 | void *data); |
1548 | |
1549 | int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx); |
1550 | int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, |
1551 | unsigned char *sig, size_t *siglen, |
1552 | const unsigned char *tbs, size_t tbslen); |
1553 | int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx); |
1554 | int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, |
1555 | const unsigned char *sig, size_t siglen, |
1556 | const unsigned char *tbs, size_t tbslen); |
1557 | int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx); |
1558 | int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, |
1559 | unsigned char *rout, size_t *routlen, |
1560 | const unsigned char *sig, size_t siglen); |
1561 | int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx); |
1562 | int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, |
1563 | unsigned char *out, size_t *outlen, |
1564 | const unsigned char *in, size_t inlen); |
1565 | int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx); |
1566 | int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, |
1567 | unsigned char *out, size_t *outlen, |
1568 | const unsigned char *in, size_t inlen); |
1569 | |
1570 | int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx); |
1571 | int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer); |
1572 | int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen); |
1573 | |
1574 | typedef int EVP_PKEY_gen_cb(EVP_PKEY_CTX *ctx); |
1575 | |
1576 | int EVP_PKEY_param_fromdata_init(EVP_PKEY_CTX *ctx); |
1577 | int EVP_PKEY_key_fromdata_init(EVP_PKEY_CTX *ctx); |
1578 | int EVP_PKEY_fromdata(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey, OSSL_PARAM param[]); |
1579 | const OSSL_PARAM *EVP_PKEY_param_fromdata_settable(EVP_PKEY_CTX *ctx); |
1580 | const OSSL_PARAM *EVP_PKEY_key_fromdata_settable(EVP_PKEY_CTX *ctx); |
1581 | int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx); |
1582 | int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); |
1583 | int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx); |
1584 | int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); |
1585 | int EVP_PKEY_check(EVP_PKEY_CTX *ctx); |
1586 | int EVP_PKEY_public_check(EVP_PKEY_CTX *ctx); |
1587 | int EVP_PKEY_param_check(EVP_PKEY_CTX *ctx); |
1588 | |
1589 | void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb); |
1590 | EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx); |
1591 | |
1592 | int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx); |
1593 | |
1594 | void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth, |
1595 | int (*init) (EVP_PKEY_CTX *ctx)); |
1596 | |
1597 | void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth, |
1598 | int (*copy) (EVP_PKEY_CTX *dst, |
1599 | const EVP_PKEY_CTX *src)); |
1600 | |
1601 | void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth, |
1602 | void (*cleanup) (EVP_PKEY_CTX *ctx)); |
1603 | |
1604 | void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth, |
1605 | int (*paramgen_init) (EVP_PKEY_CTX *ctx), |
1606 | int (*paramgen) (EVP_PKEY_CTX *ctx, |
1607 | EVP_PKEY *pkey)); |
1608 | |
1609 | void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth, |
1610 | int (*keygen_init) (EVP_PKEY_CTX *ctx), |
1611 | int (*keygen) (EVP_PKEY_CTX *ctx, |
1612 | EVP_PKEY *pkey)); |
1613 | |
1614 | void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth, |
1615 | int (*sign_init) (EVP_PKEY_CTX *ctx), |
1616 | int (*sign) (EVP_PKEY_CTX *ctx, |
1617 | unsigned char *sig, size_t *siglen, |
1618 | const unsigned char *tbs, |
1619 | size_t tbslen)); |
1620 | |
1621 | void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth, |
1622 | int (*verify_init) (EVP_PKEY_CTX *ctx), |
1623 | int (*verify) (EVP_PKEY_CTX *ctx, |
1624 | const unsigned char *sig, |
1625 | size_t siglen, |
1626 | const unsigned char *tbs, |
1627 | size_t tbslen)); |
1628 | |
1629 | void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth, |
1630 | int (*verify_recover_init) (EVP_PKEY_CTX |
1631 | *ctx), |
1632 | int (*verify_recover) (EVP_PKEY_CTX |
1633 | *ctx, |
1634 | unsigned char |
1635 | *sig, |
1636 | size_t *siglen, |
1637 | const unsigned |
1638 | char *tbs, |
1639 | size_t tbslen)); |
1640 | |
1641 | void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth, |
1642 | int (*signctx_init) (EVP_PKEY_CTX *ctx, |
1643 | EVP_MD_CTX *mctx), |
1644 | int (*signctx) (EVP_PKEY_CTX *ctx, |
1645 | unsigned char *sig, |
1646 | size_t *siglen, |
1647 | EVP_MD_CTX *mctx)); |
1648 | |
1649 | void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth, |
1650 | int (*verifyctx_init) (EVP_PKEY_CTX *ctx, |
1651 | EVP_MD_CTX *mctx), |
1652 | int (*verifyctx) (EVP_PKEY_CTX *ctx, |
1653 | const unsigned char *sig, |
1654 | int siglen, |
1655 | EVP_MD_CTX *mctx)); |
1656 | |
1657 | void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth, |
1658 | int (*encrypt_init) (EVP_PKEY_CTX *ctx), |
1659 | int (*encryptfn) (EVP_PKEY_CTX *ctx, |
1660 | unsigned char *out, |
1661 | size_t *outlen, |
1662 | const unsigned char *in, |
1663 | size_t inlen)); |
1664 | |
1665 | void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth, |
1666 | int (*decrypt_init) (EVP_PKEY_CTX *ctx), |
1667 | int (*decrypt) (EVP_PKEY_CTX *ctx, |
1668 | unsigned char *out, |
1669 | size_t *outlen, |
1670 | const unsigned char *in, |
1671 | size_t inlen)); |
1672 | |
1673 | void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth, |
1674 | int (*derive_init) (EVP_PKEY_CTX *ctx), |
1675 | int (*derive) (EVP_PKEY_CTX *ctx, |
1676 | unsigned char *key, |
1677 | size_t *keylen)); |
1678 | |
1679 | void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, |
1680 | int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1, |
1681 | void *p2), |
1682 | int (*ctrl_str) (EVP_PKEY_CTX *ctx, |
1683 | const char *type, |
1684 | const char *value)); |
1685 | |
1686 | void EVP_PKEY_meth_set_digestsign(EVP_PKEY_METHOD *pmeth, |
1687 | int (*digestsign) (EVP_MD_CTX *ctx, |
1688 | unsigned char *sig, |
1689 | size_t *siglen, |
1690 | const unsigned char *tbs, |
1691 | size_t tbslen)); |
1692 | |
1693 | void EVP_PKEY_meth_set_digestverify(EVP_PKEY_METHOD *pmeth, |
1694 | int (*digestverify) (EVP_MD_CTX *ctx, |
1695 | const unsigned char *sig, |
1696 | size_t siglen, |
1697 | const unsigned char *tbs, |
1698 | size_t tbslen)); |
1699 | |
1700 | void EVP_PKEY_meth_set_check(EVP_PKEY_METHOD *pmeth, |
1701 | int (*check) (EVP_PKEY *pkey)); |
1702 | |
1703 | void EVP_PKEY_meth_set_public_check(EVP_PKEY_METHOD *pmeth, |
1704 | int (*check) (EVP_PKEY *pkey)); |
1705 | |
1706 | void EVP_PKEY_meth_set_param_check(EVP_PKEY_METHOD *pmeth, |
1707 | int (*check) (EVP_PKEY *pkey)); |
1708 | |
1709 | void EVP_PKEY_meth_set_digest_custom(EVP_PKEY_METHOD *pmeth, |
1710 | int (*digest_custom) (EVP_PKEY_CTX *ctx, |
1711 | EVP_MD_CTX *mctx)); |
1712 | |
1713 | void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth, |
1714 | int (**pinit) (EVP_PKEY_CTX *ctx)); |
1715 | |
1716 | void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth, |
1717 | int (**pcopy) (EVP_PKEY_CTX *dst, |
1718 | const EVP_PKEY_CTX *src)); |
1719 | |
1720 | void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth, |
1721 | void (**pcleanup) (EVP_PKEY_CTX *ctx)); |
1722 | |
1723 | void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth, |
1724 | int (**pparamgen_init) (EVP_PKEY_CTX *ctx), |
1725 | int (**pparamgen) (EVP_PKEY_CTX *ctx, |
1726 | EVP_PKEY *pkey)); |
1727 | |
1728 | void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth, |
1729 | int (**pkeygen_init) (EVP_PKEY_CTX *ctx), |
1730 | int (**pkeygen) (EVP_PKEY_CTX *ctx, |
1731 | EVP_PKEY *pkey)); |
1732 | |
1733 | void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth, |
1734 | int (**psign_init) (EVP_PKEY_CTX *ctx), |
1735 | int (**psign) (EVP_PKEY_CTX *ctx, |
1736 | unsigned char *sig, size_t *siglen, |
1737 | const unsigned char *tbs, |
1738 | size_t tbslen)); |
1739 | |
1740 | void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth, |
1741 | int (**pverify_init) (EVP_PKEY_CTX *ctx), |
1742 | int (**pverify) (EVP_PKEY_CTX *ctx, |
1743 | const unsigned char *sig, |
1744 | size_t siglen, |
1745 | const unsigned char *tbs, |
1746 | size_t tbslen)); |
1747 | |
1748 | void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth, |
1749 | int (**pverify_recover_init) (EVP_PKEY_CTX |
1750 | *ctx), |
1751 | int (**pverify_recover) (EVP_PKEY_CTX |
1752 | *ctx, |
1753 | unsigned char |
1754 | *sig, |
1755 | size_t *siglen, |
1756 | const unsigned |
1757 | char *tbs, |
1758 | size_t tbslen)); |
1759 | |
1760 | void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth, |
1761 | int (**psignctx_init) (EVP_PKEY_CTX *ctx, |
1762 | EVP_MD_CTX *mctx), |
1763 | int (**psignctx) (EVP_PKEY_CTX *ctx, |
1764 | unsigned char *sig, |
1765 | size_t *siglen, |
1766 | EVP_MD_CTX *mctx)); |
1767 | |
1768 | void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth, |
1769 | int (**pverifyctx_init) (EVP_PKEY_CTX *ctx, |
1770 | EVP_MD_CTX *mctx), |
1771 | int (**pverifyctx) (EVP_PKEY_CTX *ctx, |
1772 | const unsigned char *sig, |
1773 | int siglen, |
1774 | EVP_MD_CTX *mctx)); |
1775 | |
1776 | void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth, |
1777 | int (**pencrypt_init) (EVP_PKEY_CTX *ctx), |
1778 | int (**pencryptfn) (EVP_PKEY_CTX *ctx, |
1779 | unsigned char *out, |
1780 | size_t *outlen, |
1781 | const unsigned char *in, |
1782 | size_t inlen)); |
1783 | |
1784 | void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth, |
1785 | int (**pdecrypt_init) (EVP_PKEY_CTX *ctx), |
1786 | int (**pdecrypt) (EVP_PKEY_CTX *ctx, |
1787 | unsigned char *out, |
1788 | size_t *outlen, |
1789 | const unsigned char *in, |
1790 | size_t inlen)); |
1791 | |
1792 | void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth, |
1793 | int (**pderive_init) (EVP_PKEY_CTX *ctx), |
1794 | int (**pderive) (EVP_PKEY_CTX *ctx, |
1795 | unsigned char *key, |
1796 | size_t *keylen)); |
1797 | |
1798 | void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth, |
1799 | int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1, |
1800 | void *p2), |
1801 | int (**pctrl_str) (EVP_PKEY_CTX *ctx, |
1802 | const char *type, |
1803 | const char *value)); |
1804 | |
1805 | void EVP_PKEY_meth_get_digestsign(EVP_PKEY_METHOD *pmeth, |
1806 | int (**digestsign) (EVP_MD_CTX *ctx, |
1807 | unsigned char *sig, |
1808 | size_t *siglen, |
1809 | const unsigned char *tbs, |
1810 | size_t tbslen)); |
1811 | |
1812 | void EVP_PKEY_meth_get_digestverify(EVP_PKEY_METHOD *pmeth, |
1813 | int (**digestverify) (EVP_MD_CTX *ctx, |
1814 | const unsigned char *sig, |
1815 | size_t siglen, |
1816 | const unsigned char *tbs, |
1817 | size_t tbslen)); |
1818 | |
1819 | void EVP_PKEY_meth_get_check(const EVP_PKEY_METHOD *pmeth, |
1820 | int (**pcheck) (EVP_PKEY *pkey)); |
1821 | |
1822 | void EVP_PKEY_meth_get_public_check(const EVP_PKEY_METHOD *pmeth, |
1823 | int (**pcheck) (EVP_PKEY *pkey)); |
1824 | |
1825 | void EVP_PKEY_meth_get_param_check(const EVP_PKEY_METHOD *pmeth, |
1826 | int (**pcheck) (EVP_PKEY *pkey)); |
1827 | |
1828 | void EVP_PKEY_meth_get_digest_custom(EVP_PKEY_METHOD *pmeth, |
1829 | int (**pdigest_custom) (EVP_PKEY_CTX *ctx, |
1830 | EVP_MD_CTX *mctx)); |
1831 | |
1832 | void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange); |
1833 | int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange); |
1834 | EVP_KEYEXCH *EVP_KEYEXCH_fetch(OPENSSL_CTX *ctx, const char *algorithm, |
1835 | const char *properties); |
1836 | OSSL_PROVIDER *EVP_KEYEXCH_provider(const EVP_KEYEXCH *exchange); |
1837 | int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *keyexch, const char *name); |
1838 | int EVP_KEYEXCH_number(const EVP_KEYEXCH *keyexch); |
1839 | void EVP_KEYEXCH_do_all_provided(OPENSSL_CTX *libctx, |
1840 | void (*fn)(EVP_KEYEXCH *keyexch, void *data), |
1841 | void *data); |
1842 | void EVP_KEYEXCH_names_do_all(const EVP_KEYEXCH *keyexch, |
1843 | void (*fn)(const char *name, void *data), |
1844 | void *data); |
1845 | |
1846 | void EVP_add_alg_module(void); |
1847 | |
1848 | /* |
1849 | * Convenient helper functions to transfer string based controls. |
1850 | * The callback gets called with the parsed value. |
1851 | */ |
1852 | int EVP_str2ctrl(int (*cb)(void *ctx, int cmd, void *buf, size_t buflen), |
1853 | void *ctx, int cmd, const char *value); |
1854 | int EVP_hex2ctrl(int (*cb)(void *ctx, int cmd, void *buf, size_t buflen), |
1855 | void *ctx, int cmd, const char *hex); |
1856 | |
1857 | # ifdef __cplusplus |
1858 | } |
1859 | # endif |
1860 | #endif |
1861 | |