Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
evp.h
Go to the documentation of this file.
1/*
2 * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the OpenSSL license (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 HEADER_ENVELOPE_H
11# define HEADER_ENVELOPE_H
12
13# include <openssl/opensslconf.h>
14# include <openssl/ossl_typ.h>
15# include <openssl/symhacks.h>
16# include <openssl/bio.h>
17# include <openssl/evperr.h>
18
19# define EVP_MAX_MD_SIZE 64/* longest known is SHA512 */
20# define EVP_MAX_KEY_LENGTH 64
21# define EVP_MAX_IV_LENGTH 16
22# define EVP_MAX_BLOCK_LENGTH 32
23
24# define PKCS5_SALT_LEN 8
25/* Default PKCS#5 iteration count */
26# define PKCS5_DEFAULT_ITER 2048
27
28# include <openssl/objects.h>
29
30# define EVP_PK_RSA 0x0001
31# define EVP_PK_DSA 0x0002
32# define EVP_PK_DH 0x0004
33# define EVP_PK_EC 0x0008
34# define EVP_PKT_SIGN 0x0010
35# define EVP_PKT_ENC 0x0020
36# define EVP_PKT_EXCH 0x0040
37# define EVP_PKS_RSA 0x0100
38# define EVP_PKS_DSA 0x0200
39# define EVP_PKS_EC 0x0400
40
41# define EVP_PKEY_NONE NID_undef
42# define EVP_PKEY_RSA NID_rsaEncryption
43# define EVP_PKEY_RSA2 NID_rsa
44# define EVP_PKEY_RSA_PSS NID_rsassaPss
45# define EVP_PKEY_DSA NID_dsa
46# define EVP_PKEY_DSA1 NID_dsa_2
47# define EVP_PKEY_DSA2 NID_dsaWithSHA
48# define EVP_PKEY_DSA3 NID_dsaWithSHA1
49# define EVP_PKEY_DSA4 NID_dsaWithSHA1_2
50# define EVP_PKEY_DH NID_dhKeyAgreement
51# define EVP_PKEY_DHX NID_dhpublicnumber
52# define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
53# define EVP_PKEY_SM2 NID_sm2
54# define EVP_PKEY_HMAC NID_hmac
55# define EVP_PKEY_CMAC NID_cmac
56# define EVP_PKEY_SCRYPT NID_id_scrypt
57# define EVP_PKEY_TLS1_PRF NID_tls1_prf
58# define EVP_PKEY_HKDF NID_hkdf
59# define EVP_PKEY_POLY1305 NID_poly1305
60# define EVP_PKEY_SIPHASH NID_siphash
61# define EVP_PKEY_X25519 NID_X25519
62# define EVP_PKEY_ED25519 NID_ED25519
63# define EVP_PKEY_X448 NID_X448
64# define EVP_PKEY_ED448 NID_ED448
65
66#ifdef __cplusplus
67extern "C" {
68#endif
69
70# define EVP_PKEY_MO_SIGN 0x0001
71# define EVP_PKEY_MO_VERIFY 0x0002
72# define EVP_PKEY_MO_ENCRYPT 0x0004
73# define EVP_PKEY_MO_DECRYPT 0x0008
74
75# ifndef EVP_MD
76EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type);
79
81int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize);
82int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize);
83int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags);
84int EVP_MD_meth_set_init(EVP_MD *md, int (*init)(EVP_MD_CTX *ctx));
85int EVP_MD_meth_set_update(EVP_MD *md, int (*update)(EVP_MD_CTX *ctx,
86 const void *data,
87 size_t count));
88int EVP_MD_meth_set_final(EVP_MD *md, int (*final)(EVP_MD_CTX *ctx,
89 unsigned char *md));
90int EVP_MD_meth_set_copy(EVP_MD *md, int (*copy)(EVP_MD_CTX *to,
91 const EVP_MD_CTX *from));
92int EVP_MD_meth_set_cleanup(EVP_MD *md, int (*cleanup)(EVP_MD_CTX *ctx));
93int EVP_MD_meth_set_ctrl(EVP_MD *md, int (*ctrl)(EVP_MD_CTX *ctx, int cmd,
94 int p1, void *p2));
95
99unsigned long EVP_MD_meth_get_flags(const EVP_MD *md);
102 const void *data,
103 size_t count);
105 unsigned char *md);
107 const EVP_MD_CTX *from);
109int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd,
110 int p1, void *p2);
111
112/* digest can only handle a single block */
113# define EVP_MD_FLAG_ONESHOT 0x0001
114
115/* digest is extensible-output function, XOF */
116# define EVP_MD_FLAG_XOF 0x0002
117
118/* DigestAlgorithmIdentifier flags... */
119
120# define EVP_MD_FLAG_DIGALGID_MASK 0x0018
121
122/* NULL or absent parameter accepted. Use NULL */
123
124# define EVP_MD_FLAG_DIGALGID_NULL 0x0000
125
126/* NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent */
127
128# define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008
129
130/* Custom handling via ctrl */
131
132# define EVP_MD_FLAG_DIGALGID_CUSTOM 0x0018
133
134/* Note if suitable for use in FIPS mode */
135# define EVP_MD_FLAG_FIPS 0x0400
136
137/* Digest ctrls */
138
139# define EVP_MD_CTRL_DIGALGID 0x1
140# define EVP_MD_CTRL_MICALG 0x2
141# define EVP_MD_CTRL_XOF_LEN 0x3
142
143/* Minimum Algorithm specific ctrl value */
144
145# define EVP_MD_CTRL_ALG_CTRL 0x1000
146
147# endif /* !EVP_MD */
148
149/* values for EVP_MD_CTX flags */
150
151# define EVP_MD_CTX_FLAG_ONESHOT 0x0001/* digest update will be
152 * called once only */
153# define EVP_MD_CTX_FLAG_CLEANED 0x0002/* context has already been
154 * cleaned */
155# define EVP_MD_CTX_FLAG_REUSE 0x0004/* Don't free up ctx->md_data
156 * in EVP_MD_CTX_reset */
157/*
158 * FIPS and pad options are ignored in 1.0.0, definitions are here so we
159 * don't accidentally reuse the values for other purposes.
160 */
161
162# define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008/* Allow use of non FIPS
163 * digest in FIPS mode */
164
165/*
166 * The following PAD options are also currently ignored in 1.0.0, digest
167 * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*()
168 * instead.
169 */
170# define EVP_MD_CTX_FLAG_PAD_MASK 0xF0/* RSA mode to use */
171# define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00/* PKCS#1 v1.5 mode */
172# define EVP_MD_CTX_FLAG_PAD_X931 0x10/* X9.31 mode */
173# define EVP_MD_CTX_FLAG_PAD_PSS 0x20/* PSS mode */
174
175# define EVP_MD_CTX_FLAG_NO_INIT 0x0100/* Don't initialize md_data */
176/*
177 * Some functions such as EVP_DigestSign only finalise copies of internal
178 * contexts so additional data can be included after the finalisation call.
179 * This is inefficient if this functionality is not required: it is disabled
180 * if the following flag is set.
181 */
182# define EVP_MD_CTX_FLAG_FINALISE 0x0200
183/* NOTE: 0x0400 is reserved for internal usage */
184
185EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len);
186EVP_CIPHER *EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher);
187void EVP_CIPHER_meth_free(EVP_CIPHER *cipher);
189int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len);
190int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags);
191int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size);
192int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher,
193 int (*init) (EVP_CIPHER_CTX *ctx,
194 const unsigned char *key,
195 const unsigned char *iv,
196 int enc));
197int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher,
198 int (*do_cipher) (EVP_CIPHER_CTX *ctx,
199 unsigned char *out,
200 const unsigned char *in,
201 size_t inl));
202int EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher,
203 int (*cleanup) (EVP_CIPHER_CTX *));
204int EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher,
205 int (*set_asn1_parameters) (EVP_CIPHER_CTX *,
206 ASN1_TYPE *));
207int EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher,
208 int (*get_asn1_parameters) (EVP_CIPHER_CTX *,
209 ASN1_TYPE *));
211 int (*ctrl) (EVP_CIPHER_CTX *, int type,
212 int arg, void *ptr));
213
215 const unsigned char *key,
216 const unsigned char *iv,
217 int enc);
219 unsigned char *out,
220 const unsigned char *in,
221 size_t inl);
222int (*EVP_CIPHER_meth_get_cleanup(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *);
224 ASN1_TYPE *);
225int (*EVP_CIPHER_meth_get_get_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *,
226 ASN1_TYPE *);
227int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *,
228 int type, int arg,
229 void *ptr);
230
231/* Values for cipher flags */
233/* Modes for ciphers */
235# define EVP_CIPH_STREAM_CIPHER 0x0
236# define EVP_CIPH_ECB_MODE 0x1
237# define EVP_CIPH_CBC_MODE 0x2
238# define EVP_CIPH_CFB_MODE 0x3
239# define EVP_CIPH_OFB_MODE 0x4
240# define EVP_CIPH_CTR_MODE 0x5
241# define EVP_CIPH_GCM_MODE 0x6
242# define EVP_CIPH_CCM_MODE 0x7
243# define EVP_CIPH_XTS_MODE 0x10001
244# define EVP_CIPH_WRAP_MODE 0x10002
245# define EVP_CIPH_OCB_MODE 0x10003
246# define EVP_CIPH_MODE 0xF0007
247/* Set if variable length cipher */
248# define EVP_CIPH_VARIABLE_LENGTH 0x8
249/* Set if the iv handling should be done by the cipher itself */
250# define EVP_CIPH_CUSTOM_IV 0x10
251/* Set if the cipher's init() function should be called if key is NULL */
252# define EVP_CIPH_ALWAYS_CALL_INIT 0x20
253/* Call ctrl() to init cipher parameters */
254# define EVP_CIPH_CTRL_INIT 0x40
255/* Don't use standard key length function */
256# define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80
257/* Don't use standard block padding */
258# define EVP_CIPH_NO_PADDING 0x100
259/* cipher handles random key generation */
260# define EVP_CIPH_RAND_KEY 0x200
261/* cipher has its own additional copying logic */
262# define EVP_CIPH_CUSTOM_COPY 0x400
263/* Don't use standard iv length function */
264# define EVP_CIPH_CUSTOM_IV_LENGTH 0x800
265/* Allow use default ASN1 get/set iv */
266# define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000
267/* Buffer length in bits not bytes: CFB1 mode only */
268# define EVP_CIPH_FLAG_LENGTH_BITS 0x2000
269/* Note if suitable for use in FIPS mode */
270# define EVP_CIPH_FLAG_FIPS 0x4000
271/* Allow non FIPS cipher in FIPS mode */
272# define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x8000
274 * Cipher handles any and all padding logic as well as finalisation.
275 */
276# define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000
277# define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000
278# define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000
279/* Cipher can handle pipeline operations */
280# define EVP_CIPH_FLAG_PIPELINE 0X800000
281
282/*
283 * Cipher context flag to indicate we can handle wrap mode: if allowed in
284 * older applications it could overflow buffers.
285 */
286
287# define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0x1
289/* ctrl() values */
291# define EVP_CTRL_INIT 0x0
292# define EVP_CTRL_SET_KEY_LENGTH 0x1
293# define EVP_CTRL_GET_RC2_KEY_BITS 0x2
294# define EVP_CTRL_SET_RC2_KEY_BITS 0x3
295# define EVP_CTRL_GET_RC5_ROUNDS 0x4
296# define EVP_CTRL_SET_RC5_ROUNDS 0x5
297# define EVP_CTRL_RAND_KEY 0x6
298# define EVP_CTRL_PBE_PRF_NID 0x7
299# define EVP_CTRL_COPY 0x8
300# define EVP_CTRL_AEAD_SET_IVLEN 0x9
301# define EVP_CTRL_AEAD_GET_TAG 0x10
302# define EVP_CTRL_AEAD_SET_TAG 0x11
303# define EVP_CTRL_AEAD_SET_IV_FIXED 0x12
304# define EVP_CTRL_GCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN
305# define EVP_CTRL_GCM_GET_TAG EVP_CTRL_AEAD_GET_TAG
306# define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG
307# define EVP_CTRL_GCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED
308# define EVP_CTRL_GCM_IV_GEN 0x13
309# define EVP_CTRL_CCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN
310# define EVP_CTRL_CCM_GET_TAG EVP_CTRL_AEAD_GET_TAG
311# define EVP_CTRL_CCM_SET_TAG EVP_CTRL_AEAD_SET_TAG
312# define EVP_CTRL_CCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED
313# define EVP_CTRL_CCM_SET_L 0x14
314# define EVP_CTRL_CCM_SET_MSGLEN 0x15
315/*
316 * AEAD cipher deduces payload length and returns number of bytes required to
317 * store MAC and eventual padding. Subsequent call to EVP_Cipher even
318 * appends/verifies MAC.
319 */
320# define EVP_CTRL_AEAD_TLS1_AAD 0x16
321/* Used by composite AEAD ciphers, no-op in GCM, CCM... */
322# define EVP_CTRL_AEAD_SET_MAC_KEY 0x17
323/* Set the GCM invocation field, decrypt only */
324# define EVP_CTRL_GCM_SET_IV_INV 0x18
326# define EVP_CTRL_TLS1_1_MULTIBLOCK_AAD 0x19
327# define EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT 0x1a
328# define EVP_CTRL_TLS1_1_MULTIBLOCK_DECRYPT 0x1b
329# define EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE 0x1c
331# define EVP_CTRL_SSL3_MASTER_SECRET 0x1d
332
333/* EVP_CTRL_SET_SBOX takes the char * specifying S-boxes */
334# define EVP_CTRL_SET_SBOX 0x1e
336 * EVP_CTRL_SBOX_USED takes a 'size_t' and 'char *', pointing at a
337 * pre-allocated buffer with specified size
338 */
339# define EVP_CTRL_SBOX_USED 0x1f
340/* EVP_CTRL_KEY_MESH takes 'size_t' number of bytes to mesh the key after,
341 * 0 switches meshing off
342 */
343# define EVP_CTRL_KEY_MESH 0x20
344/* EVP_CTRL_BLOCK_PADDING_MODE takes the padding mode */
345# define EVP_CTRL_BLOCK_PADDING_MODE 0x21
347/* Set the output buffers to use for a pipelined operation */
348# define EVP_CTRL_SET_PIPELINE_OUTPUT_BUFS 0x22
349/* Set the input buffers to use for a pipelined operation */
350# define EVP_CTRL_SET_PIPELINE_INPUT_BUFS 0x23
351/* Set the input buffer lengths to use for a pipelined operation */
352# define EVP_CTRL_SET_PIPELINE_INPUT_LENS 0x24
354# define EVP_CTRL_GET_IVLEN 0x25
356/* Padding modes */
357#define EVP_PADDING_PKCS7 1
358#define EVP_PADDING_ISO7816_4 2
359#define EVP_PADDING_ANSI923 3
360#define EVP_PADDING_ISO10126 4
361#define EVP_PADDING_ZERO 5
363/* RFC 5246 defines additional data to be 13 bytes in length */
364# define EVP_AEAD_TLS1_AAD_LEN 13
366typedef struct {
367 unsigned char *out;
368 const unsigned char *inp;
369 size_t len;
370 unsigned int interleave;
371} EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM;
372
373/* GCM TLS constants */
374/* Length of fixed part of IV derived from PRF */
375# define EVP_GCM_TLS_FIXED_IV_LEN 4
376/* Length of explicit part of IV part of TLS records */
377# define EVP_GCM_TLS_EXPLICIT_IV_LEN 8
378/* Length of tag for TLS */
379# define EVP_GCM_TLS_TAG_LEN 16
380
381/* CCM TLS constants */
382/* Length of fixed part of IV derived from PRF */
383# define EVP_CCM_TLS_FIXED_IV_LEN 4
384/* Length of explicit part of IV part of TLS records */
385# define EVP_CCM_TLS_EXPLICIT_IV_LEN 8
386/* Total length of CCM IV length for TLS */
387# define EVP_CCM_TLS_IV_LEN 12
388/* Length of tag for TLS */
389# define EVP_CCM_TLS_TAG_LEN 16
390/* Length of CCM8 tag for TLS */
391# define EVP_CCM8_TLS_TAG_LEN 8
393/* Length of tag for TLS */
394# define EVP_CHACHAPOLY_TLS_TAG_LEN 16
396typedef struct evp_cipher_info_st {
397 const EVP_CIPHER *cipher;
398 unsigned char iv[EVP_MAX_IV_LENGTH];
399} EVP_CIPHER_INFO;
400
401
402/* Password based encryption function */
403typedef int (EVP_PBE_KEYGEN) (EVP_CIPHER_CTX *ctx, const char *pass,
404 int passlen, ASN1_TYPE *param,
405 const EVP_CIPHER *cipher, const EVP_MD *md,
406 int en_de);
407
408# ifndef OPENSSL_NO_RSA
409# define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,
410 (char *)(rsa))
411# endif
412
413# ifndef OPENSSL_NO_DSA
414# define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,
415 (char *)(dsa))
416# endif
417
418# ifndef OPENSSL_NO_DH
419# define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,
420 (char *)(dh))
421# endif
422
423# ifndef OPENSSL_NO_EC
424# define EVP_PKEY_assign_EC_KEY(pkey,eckey) EVP_PKEY_assign((pkey),EVP_PKEY_EC,
425 (char *)(eckey))
426# endif
427# ifndef OPENSSL_NO_SIPHASH
428# define EVP_PKEY_assign_SIPHASH(pkey,shkey) EVP_PKEY_assign((pkey),EVP_PKEY_SIPHASH,
429 (char *)(shkey))
430# endif
431
432# ifndef OPENSSL_NO_POLY1305
433# define EVP_PKEY_assign_POLY1305(pkey,polykey) EVP_PKEY_assign((pkey),EVP_PKEY_POLY1305,
434 (char *)(polykey))
435# endif
437/* Add some extra combinations */
438# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))
439# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a))
440# define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a))
441# define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a))
443int EVP_MD_type(const EVP_MD *md);
444# define EVP_MD_nid(e) EVP_MD_type(e)
445# define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e))
446int EVP_MD_pkey_type(const EVP_MD *md);
447int EVP_MD_size(const EVP_MD *md);
449unsigned long EVP_MD_flags(const EVP_MD *md);
451const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx);
452int (*EVP_MD_CTX_update_fn(EVP_MD_CTX *ctx))(EVP_MD_CTX *ctx,
453 const void *data, size_t count);
454void EVP_MD_CTX_set_update_fn(EVP_MD_CTX *ctx,
455 int (*update) (EVP_MD_CTX *ctx,
456 const void *data, size_t count));
457# define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e))
458# define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e))
459# define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e))
460EVP_PKEY_CTX *EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx);
461void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx);
462void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx);
464int EVP_CIPHER_nid(const EVP_CIPHER *cipher);
465# define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e))
466int EVP_CIPHER_block_size(const EVP_CIPHER *cipher);
467int EVP_CIPHER_impl_ctx_size(const EVP_CIPHER *cipher);
468int EVP_CIPHER_key_length(const EVP_CIPHER *cipher);
469int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher);
470unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher);
471# define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE)
473const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx);
474int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx);
475int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx);
476int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx);
477int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx);
478int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx);
479const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx);
480const unsigned char *EVP_CIPHER_CTX_original_iv(const EVP_CIPHER_CTX *ctx);
481unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx);
482unsigned char *EVP_CIPHER_CTX_buf_noconst(EVP_CIPHER_CTX *ctx);
483int EVP_CIPHER_CTX_num(const EVP_CIPHER_CTX *ctx);
484void EVP_CIPHER_CTX_set_num(EVP_CIPHER_CTX *ctx, int num);
485int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
486void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx);
487void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data);
488void *EVP_CIPHER_CTX_get_cipher_data(const EVP_CIPHER_CTX *ctx);
489void *EVP_CIPHER_CTX_set_cipher_data(EVP_CIPHER_CTX *ctx, void *cipher_data);
490# define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
491# if OPENSSL_API_COMPAT < 0x10100000L
492# define EVP_CIPHER_CTX_flags(c) EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(c))
493# endif
494# define EVP_CIPHER_CTX_mode(c) EVP_CIPHER_mode(EVP_CIPHER_CTX_cipher(c))
496# define EVP_ENCODE_LENGTH(l) ((((l)+2)/3*4)+((l)/48+1)*2+80)
497# define EVP_DECODE_LENGTH(l) (((l)+3)/4*3+80)
499# define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c)
500# define EVP_SignInit(a,b) EVP_DigestInit(a,b)
501# define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
502# define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c)
503# define EVP_VerifyInit(a,b) EVP_DigestInit(a,b)
504# define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
505# define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e)
506# define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e)
507# define EVP_DigestSignUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
508# define EVP_DigestVerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
510# ifdef CONST_STRICT
511void BIO_set_md(BIO *, const EVP_MD *md);
512# else
513# define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)(md))
514# endif
515# define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)(mdp))
516# define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,
517 (char *)(mdcp))
518# define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,
519 (char *)(mdcp))
520# define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL)
521# define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,
522 (char *)(c_pp))
523
524/*__owur*/ int EVP_Cipher(EVP_CIPHER_CTX *c,
525 unsigned char *out,
526 const unsigned char *in, unsigned int inl);
527
528# define EVP_add_cipher_alias(n,alias)
529 OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
530# define EVP_add_digest_alias(n,alias)
531 OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
532# define EVP_delete_cipher_alias(alias)
534# define EVP_delete_digest_alias(alias)
535 OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS);
537int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2);
538EVP_MD_CTX *EVP_MD_CTX_new(void);
539int EVP_MD_CTX_reset(EVP_MD_CTX *ctx);
540void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
541# define EVP_MD_CTX_create() EVP_MD_CTX_new()
542# define EVP_MD_CTX_init(ctx) EVP_MD_CTX_reset((ctx))
543# define EVP_MD_CTX_destroy(ctx) EVP_MD_CTX_free((ctx))
544__owur int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in);
545void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags);
546void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags);
547int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags);
548__owur int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type,
549 ENGINE *impl);
550__owur int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d,
551 size_t cnt);
552__owur int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md,
553 unsigned int *s);
554__owur int EVP_Digest(const void *data, size_t count,
555 unsigned char *md, unsigned int *size,
556 const EVP_MD *type, ENGINE *impl);
557
558__owur int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in);
559__owur int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
560__owur int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md,
561 unsigned int *s);
562__owur int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, unsigned char *md,
563 size_t len);
565int EVP_read_pw_string(char *buf, int length, const char *prompt, int verify);
566int EVP_read_pw_string_min(char *buf, int minlen, int maxlen,
567 const char *prompt, int verify);
568void EVP_set_pw_prompt(const char *prompt);
569char *EVP_get_pw_prompt(void);
570
571__owur int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
572 const unsigned char *salt,
573 const unsigned char *data, int datal, int count,
574 unsigned char *key, unsigned char *iv);
575
576void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags);
577void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags);
578int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags);
579
580__owur int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
581 const unsigned char *key, const unsigned char *iv);
582/*__owur*/ int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,
583 const EVP_CIPHER *cipher, ENGINE *impl,
584 const unsigned char *key,
585 const unsigned char *iv);
586/*__owur*/ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
587 int *outl, const unsigned char *in, int inl);
588/*__owur*/ int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out,
589 int *outl);
590/*__owur*/ int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,
591 int *outl);
592
593__owur int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
594 const unsigned char *key, const unsigned char *iv);
595/*__owur*/ int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,
596 const EVP_CIPHER *cipher, ENGINE *impl,
597 const unsigned char *key,
598 const unsigned char *iv);
599/*__owur*/ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
600 int *outl, const unsigned char *in, int inl);
601__owur int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm,
602 int *outl);
603/*__owur*/ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm,
604 int *outl);
606__owur int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
607 const unsigned char *key, const unsigned char *iv,
608 int enc);
609/*__owur*/ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx,
610 const EVP_CIPHER *cipher, ENGINE *impl,
611 const unsigned char *key,
612 const unsigned char *iv, int enc);
613__owur int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
614 int *outl, const unsigned char *in, int inl);
615__owur int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm,
616 int *outl);
617__owur int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm,
618 int *outl);
620__owur int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s,
621 EVP_PKEY *pkey);
622
623__owur int EVP_DigestSign(EVP_MD_CTX *ctx, unsigned char *sigret,
624 size_t *siglen, const unsigned char *tbs,
625 size_t tbslen);
627__owur int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
628 unsigned int siglen, EVP_PKEY *pkey);
629
630__owur int EVP_DigestVerify(EVP_MD_CTX *ctx, const unsigned char *sigret,
631 size_t siglen, const unsigned char *tbs,
632 size_t tbslen);
634/*__owur*/ int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
635 const EVP_MD *type, ENGINE *e,
636 EVP_PKEY *pkey);
637__owur int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
638 size_t *siglen);
640__owur int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
641 const EVP_MD *type, ENGINE *e,
642 EVP_PKEY *pkey);
643__owur int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig,
644 size_t siglen);
645
646# ifndef OPENSSL_NO_RSA
647__owur int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
648 const unsigned char *ek, int ekl,
649 const unsigned char *iv, EVP_PKEY *priv);
650__owur int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
652__owur int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
653 unsigned char **ek, int *ekl, unsigned char *iv,
654 EVP_PKEY **pubk, int npubk);
655__owur int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
656# endif
658EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void);
659void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx);
660int EVP_ENCODE_CTX_copy(EVP_ENCODE_CTX *dctx, EVP_ENCODE_CTX *sctx);
661int EVP_ENCODE_CTX_num(EVP_ENCODE_CTX *ctx);
662void EVP_EncodeInit(EVP_ENCODE_CTX *ctx);
663int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
664 const unsigned char *in, int inl);
665void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl);
666int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n);
668void EVP_DecodeInit(EVP_ENCODE_CTX *ctx);
669int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
670 const unsigned char *in, int inl);
671int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned
672 char *out, int *outl);
673int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n);
674
675# if OPENSSL_API_COMPAT < 0x10100000L
676# define EVP_CIPHER_CTX_init(c) EVP_CIPHER_CTX_reset(c)
677# define EVP_CIPHER_CTX_cleanup(c) EVP_CIPHER_CTX_reset(c)
678# endif
679EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void);
680int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *c);
681void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *c);
682int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
683int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad);
684int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
685int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key);
687const BIO_METHOD *BIO_f_md(void);
688const BIO_METHOD *BIO_f_base64(void);
689const BIO_METHOD *BIO_f_cipher(void);
690const BIO_METHOD *BIO_f_reliable(void);
691__owur int BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k,
692 const unsigned char *i, int enc);
693
694const EVP_MD *EVP_md_null(void);
696const EVP_MD *EVP_md2(void);
697# endif
698# ifndef OPENSSL_NO_MD4
699const EVP_MD *EVP_md4(void);
700# endif
701# ifndef OPENSSL_NO_MD5
702const EVP_MD *EVP_md5(void);
703const EVP_MD *EVP_md5_sha1(void);
704# endif
705# ifndef OPENSSL_NO_BLAKE2
706const EVP_MD *EVP_blake2b512(void);
707const EVP_MD *EVP_blake2s256(void);
708# endif
709const EVP_MD *EVP_sha1(void);
710const EVP_MD *EVP_sha224(void);
711const EVP_MD *EVP_sha256(void);
712const EVP_MD *EVP_sha384(void);
713const EVP_MD *EVP_sha512(void);
714const EVP_MD *EVP_sha512_224(void);
715const EVP_MD *EVP_sha512_256(void);
716const EVP_MD *EVP_sha3_224(void);
717const EVP_MD *EVP_sha3_256(void);
718const EVP_MD *EVP_sha3_384(void);
719const EVP_MD *EVP_sha3_512(void);
720const EVP_MD *EVP_shake128(void);
721const EVP_MD *EVP_shake256(void);
722# ifndef OPENSSL_NO_MDC2
723const EVP_MD *EVP_mdc2(void);
724# endif
725# ifndef OPENSSL_NO_RMD160
726const EVP_MD *EVP_ripemd160(void);
727# endif
728# ifndef OPENSSL_NO_WHIRLPOOL
729const EVP_MD *EVP_whirlpool(void);
730# endif
731# ifndef OPENSSL_NO_SM3
732const EVP_MD *EVP_sm3(void);
733# endif
734const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */
735# ifndef OPENSSL_NO_DES
736const EVP_CIPHER *EVP_des_ecb(void);
737const EVP_CIPHER *EVP_des_ede(void);
738const EVP_CIPHER *EVP_des_ede3(void);
739const EVP_CIPHER *EVP_des_ede_ecb(void);
740const EVP_CIPHER *EVP_des_ede3_ecb(void);
741const EVP_CIPHER *EVP_des_cfb64(void);
742# define EVP_des_cfb EVP_des_cfb64
743const EVP_CIPHER *EVP_des_cfb1(void);
744const EVP_CIPHER *EVP_des_cfb8(void);
745const EVP_CIPHER *EVP_des_ede_cfb64(void);
746# define EVP_des_ede_cfb EVP_des_ede_cfb64
747const EVP_CIPHER *EVP_des_ede3_cfb64(void);
748# define EVP_des_ede3_cfb EVP_des_ede3_cfb64
749const EVP_CIPHER *EVP_des_ede3_cfb1(void);
750const EVP_CIPHER *EVP_des_ede3_cfb8(void);
751const EVP_CIPHER *EVP_des_ofb(void);
752const EVP_CIPHER *EVP_des_ede_ofb(void);
753const EVP_CIPHER *EVP_des_ede3_ofb(void);
754const EVP_CIPHER *EVP_des_cbc(void);
755const EVP_CIPHER *EVP_des_ede_cbc(void);
756const EVP_CIPHER *EVP_des_ede3_cbc(void);
757const EVP_CIPHER *EVP_desx_cbc(void);
758const EVP_CIPHER *EVP_des_ede3_wrap(void);
759/*
760 * This should now be supported through the dev_crypto ENGINE. But also, why
761 * are rc4 and md5 declarations made here inside a "NO_DES" precompiler
762 * branch?
763 */
764# endif
765# ifndef OPENSSL_NO_RC4
766const EVP_CIPHER *EVP_rc4(void);
767const EVP_CIPHER *EVP_rc4_40(void);
768# ifndef OPENSSL_NO_MD5
769const EVP_CIPHER *EVP_rc4_hmac_md5(void);
770# endif
771# endif
772# ifndef OPENSSL_NO_IDEA
773const EVP_CIPHER *EVP_idea_ecb(void);
774const EVP_CIPHER *EVP_idea_cfb64(void);
775# define EVP_idea_cfb EVP_idea_cfb64
776const EVP_CIPHER *EVP_idea_ofb(void);
777const EVP_CIPHER *EVP_idea_cbc(void);
778# endif
779# ifndef OPENSSL_NO_RC2
780const EVP_CIPHER *EVP_rc2_ecb(void);
781const EVP_CIPHER *EVP_rc2_cbc(void);
782const EVP_CIPHER *EVP_rc2_40_cbc(void);
783const EVP_CIPHER *EVP_rc2_64_cbc(void);
784const EVP_CIPHER *EVP_rc2_cfb64(void);
785# define EVP_rc2_cfb EVP_rc2_cfb64
786const EVP_CIPHER *EVP_rc2_ofb(void);
787# endif
788# ifndef OPENSSL_NO_BF
789const EVP_CIPHER *EVP_bf_ecb(void);
790const EVP_CIPHER *EVP_bf_cbc(void);
791const EVP_CIPHER *EVP_bf_cfb64(void);
792# define EVP_bf_cfb EVP_bf_cfb64
793const EVP_CIPHER *EVP_bf_ofb(void);
794# endif
795# ifndef OPENSSL_NO_CAST
796const EVP_CIPHER *EVP_cast5_ecb(void);
797const EVP_CIPHER *EVP_cast5_cbc(void);
798const EVP_CIPHER *EVP_cast5_cfb64(void);
799# define EVP_cast5_cfb EVP_cast5_cfb64
800const EVP_CIPHER *EVP_cast5_ofb(void);
801# endif
803const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void);
804const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void);
805const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void);
806# define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64
807const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void);
808# endif
809const EVP_CIPHER *EVP_aes_128_ecb(void);
810const EVP_CIPHER *EVP_aes_128_cbc(void);
811const EVP_CIPHER *EVP_aes_128_cfb1(void);
812const EVP_CIPHER *EVP_aes_128_cfb8(void);
813const EVP_CIPHER *EVP_aes_128_cfb128(void);
814# define EVP_aes_128_cfb EVP_aes_128_cfb128
815const EVP_CIPHER *EVP_aes_128_ofb(void);
816const EVP_CIPHER *EVP_aes_128_ctr(void);
817const EVP_CIPHER *EVP_aes_128_ccm(void);
818const EVP_CIPHER *EVP_aes_128_gcm(void);
819const EVP_CIPHER *EVP_aes_128_xts(void);
820const EVP_CIPHER *EVP_aes_128_wrap(void);
821const EVP_CIPHER *EVP_aes_128_wrap_pad(void);
822# ifndef OPENSSL_NO_OCB
823const EVP_CIPHER *EVP_aes_128_ocb(void);
824# endif
825const EVP_CIPHER *EVP_aes_192_ecb(void);
826const EVP_CIPHER *EVP_aes_192_cbc(void);
827const EVP_CIPHER *EVP_aes_192_cfb1(void);
828const EVP_CIPHER *EVP_aes_192_cfb8(void);
829const EVP_CIPHER *EVP_aes_192_cfb128(void);
830# define EVP_aes_192_cfb EVP_aes_192_cfb128
831const EVP_CIPHER *EVP_aes_192_ofb(void);
832const EVP_CIPHER *EVP_aes_192_ctr(void);
833const EVP_CIPHER *EVP_aes_192_ccm(void);
834const EVP_CIPHER *EVP_aes_192_gcm(void);
835const EVP_CIPHER *EVP_aes_192_wrap(void);
836const EVP_CIPHER *EVP_aes_192_wrap_pad(void);
837# ifndef OPENSSL_NO_OCB
838const EVP_CIPHER *EVP_aes_192_ocb(void);
839# endif
840const EVP_CIPHER *EVP_aes_256_ecb(void);
841const EVP_CIPHER *EVP_aes_256_cbc(void);
842const EVP_CIPHER *EVP_aes_256_cfb1(void);
843const EVP_CIPHER *EVP_aes_256_cfb8(void);
844const EVP_CIPHER *EVP_aes_256_cfb128(void);
845# define EVP_aes_256_cfb EVP_aes_256_cfb128
846const EVP_CIPHER *EVP_aes_256_ofb(void);
847const EVP_CIPHER *EVP_aes_256_ctr(void);
848const EVP_CIPHER *EVP_aes_256_ccm(void);
849const EVP_CIPHER *EVP_aes_256_gcm(void);
850const EVP_CIPHER *EVP_aes_256_xts(void);
851const EVP_CIPHER *EVP_aes_256_wrap(void);
852const EVP_CIPHER *EVP_aes_256_wrap_pad(void);
853# ifndef OPENSSL_NO_OCB
854const EVP_CIPHER *EVP_aes_256_ocb(void);
855# endif
856const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void);
857const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void);
858const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha256(void);
859const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void);
860# ifndef OPENSSL_NO_ARIA
861const EVP_CIPHER *EVP_aria_128_ecb(void);
862const EVP_CIPHER *EVP_aria_128_cbc(void);
863const EVP_CIPHER *EVP_aria_128_cfb1(void);
864const EVP_CIPHER *EVP_aria_128_cfb8(void);
865const EVP_CIPHER *EVP_aria_128_cfb128(void);
866# define EVP_aria_128_cfb EVP_aria_128_cfb128
867const EVP_CIPHER *EVP_aria_128_ctr(void);
868const EVP_CIPHER *EVP_aria_128_ofb(void);
869const EVP_CIPHER *EVP_aria_128_gcm(void);
870const EVP_CIPHER *EVP_aria_128_ccm(void);
871const EVP_CIPHER *EVP_aria_192_ecb(void);
872const EVP_CIPHER *EVP_aria_192_cbc(void);
873const EVP_CIPHER *EVP_aria_192_cfb1(void);
874const EVP_CIPHER *EVP_aria_192_cfb8(void);
875const EVP_CIPHER *EVP_aria_192_cfb128(void);
876# define EVP_aria_192_cfb EVP_aria_192_cfb128
877const EVP_CIPHER *EVP_aria_192_ctr(void);
878const EVP_CIPHER *EVP_aria_192_ofb(void);
879const EVP_CIPHER *EVP_aria_192_gcm(void);
880const EVP_CIPHER *EVP_aria_192_ccm(void);
881const EVP_CIPHER *EVP_aria_256_ecb(void);
882const EVP_CIPHER *EVP_aria_256_cbc(void);
883const EVP_CIPHER *EVP_aria_256_cfb1(void);
884const EVP_CIPHER *EVP_aria_256_cfb8(void);
885const EVP_CIPHER *EVP_aria_256_cfb128(void);
886# define EVP_aria_256_cfb EVP_aria_256_cfb128
887const EVP_CIPHER *EVP_aria_256_ctr(void);
888const EVP_CIPHER *EVP_aria_256_ofb(void);
889const EVP_CIPHER *EVP_aria_256_gcm(void);
890const EVP_CIPHER *EVP_aria_256_ccm(void);
891# endif
892# ifndef OPENSSL_NO_CAMELLIA
893const EVP_CIPHER *EVP_camellia_128_ecb(void);
894const EVP_CIPHER *EVP_camellia_128_cbc(void);
895const EVP_CIPHER *EVP_camellia_128_cfb1(void);
896const EVP_CIPHER *EVP_camellia_128_cfb8(void);
897const EVP_CIPHER *EVP_camellia_128_cfb128(void);
898# define EVP_camellia_128_cfb EVP_camellia_128_cfb128
899const EVP_CIPHER *EVP_camellia_128_ofb(void);
900const EVP_CIPHER *EVP_camellia_128_ctr(void);
901const EVP_CIPHER *EVP_camellia_192_ecb(void);
902const EVP_CIPHER *EVP_camellia_192_cbc(void);
903const EVP_CIPHER *EVP_camellia_192_cfb1(void);
904const EVP_CIPHER *EVP_camellia_192_cfb8(void);
905const EVP_CIPHER *EVP_camellia_192_cfb128(void);
906# define EVP_camellia_192_cfb EVP_camellia_192_cfb128
907const EVP_CIPHER *EVP_camellia_192_ofb(void);
908const EVP_CIPHER *EVP_camellia_192_ctr(void);
909const EVP_CIPHER *EVP_camellia_256_ecb(void);
910const EVP_CIPHER *EVP_camellia_256_cbc(void);
911const EVP_CIPHER *EVP_camellia_256_cfb1(void);
912const EVP_CIPHER *EVP_camellia_256_cfb8(void);
913const EVP_CIPHER *EVP_camellia_256_cfb128(void);
914# define EVP_camellia_256_cfb EVP_camellia_256_cfb128
915const EVP_CIPHER *EVP_camellia_256_ofb(void);
916const EVP_CIPHER *EVP_camellia_256_ctr(void);
917# endif
918# ifndef OPENSSL_NO_CHACHA
919const EVP_CIPHER *EVP_chacha20(void);
920# ifndef OPENSSL_NO_POLY1305
921const EVP_CIPHER *EVP_chacha20_poly1305(void);
922# endif
923# endif
925# ifndef OPENSSL_NO_SEED
926const EVP_CIPHER *EVP_seed_ecb(void);
927const EVP_CIPHER *EVP_seed_cbc(void);
928const EVP_CIPHER *EVP_seed_cfb128(void);
929# define EVP_seed_cfb EVP_seed_cfb128
930const EVP_CIPHER *EVP_seed_ofb(void);
931# endif
933# ifndef OPENSSL_NO_SM4
934const EVP_CIPHER *EVP_sm4_ecb(void);
935const EVP_CIPHER *EVP_sm4_cbc(void);
936const EVP_CIPHER *EVP_sm4_cfb128(void);
937# define EVP_sm4_cfb EVP_sm4_cfb128
938const EVP_CIPHER *EVP_sm4_ofb(void);
939const EVP_CIPHER *EVP_sm4_ctr(void);
940# endif
941
942# if OPENSSL_API_COMPAT < 0x10100000L
943# define OPENSSL_add_all_algorithms_conf()
944 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS
947# define OPENSSL_add_all_algorithms_noconf()
948 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS
951# ifdef OPENSSL_LOAD_CONF
952# define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_conf()
953# else
954# define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_noconf()
955# endif
956
957# define OpenSSL_add_all_ciphers()
958 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, NULL)
959# define OpenSSL_add_all_digests()
960 OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
962# define EVP_cleanup() while(0) continue
963# endif
965int EVP_add_cipher(const EVP_CIPHER *cipher);
966int EVP_add_digest(const EVP_MD *digest);
968const EVP_CIPHER *EVP_get_cipherbyname(const char *name);
969const EVP_MD *EVP_get_digestbyname(const char *name);
971void EVP_CIPHER_do_all(void (*fn) (const EVP_CIPHER *ciph,
972 const char *from, const char *to, void *x),
973 void *arg);
974void EVP_CIPHER_do_all_sorted(void (*fn)
975 (const EVP_CIPHER *ciph, const char *from,
976 const char *to, void *x), void *arg);
978void EVP_MD_do_all(void (*fn) (const EVP_MD *ciph,
979 const char *from, const char *to, void *x),
980 void *arg);
981void EVP_MD_do_all_sorted(void (*fn)
982 (const EVP_MD *ciph, const char *from,
983 const char *to, void *x), void *arg);
985int EVP_PKEY_decrypt_old(unsigned char *dec_key,
986 const unsigned char *enc_key, int enc_key_len,
987 EVP_PKEY *private_key);
988int EVP_PKEY_encrypt_old(unsigned char *enc_key,
989 const unsigned char *key, int key_len,
990 EVP_PKEY *pub_key);
991int EVP_PKEY_type(int type);
992int EVP_PKEY_id(const EVP_PKEY *pkey);
993int EVP_PKEY_base_id(const EVP_PKEY *pkey);
994int EVP_PKEY_bits(const EVP_PKEY *pkey);
995int EVP_PKEY_security_bits(const EVP_PKEY *pkey);
996int EVP_PKEY_size(const EVP_PKEY *pkey);
997int EVP_PKEY_set_type(EVP_PKEY *pkey, int type);
998int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len);
999int EVP_PKEY_set_alias_type(EVP_PKEY *pkey, int type);
1000# ifndef OPENSSL_NO_ENGINE
1001int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e);
1002ENGINE *EVP_PKEY_get0_engine(const EVP_PKEY *pkey);
1003# endif
1004int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key);
1005void *EVP_PKEY_get0(const EVP_PKEY *pkey);
1006const unsigned char *EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len);
1007# ifndef OPENSSL_NO_POLY1305
1008const unsigned char *EVP_PKEY_get0_poly1305(const EVP_PKEY *pkey, size_t *len);
1009# endif
1010# ifndef OPENSSL_NO_SIPHASH
1011const unsigned char *EVP_PKEY_get0_siphash(const EVP_PKEY *pkey, size_t *len);
1012# endif
1014# ifndef OPENSSL_NO_RSA
1015struct rsa_st;
1016int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, struct rsa_st *key);
1017struct rsa_st *EVP_PKEY_get0_RSA(EVP_PKEY *pkey);
1018struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey);
1019# endif
1020# ifndef OPENSSL_NO_DSA
1021struct dsa_st;
1022int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, struct dsa_st *key);
1023struct dsa_st *EVP_PKEY_get0_DSA(EVP_PKEY *pkey);
1024struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey);
1025# endif
1026# ifndef OPENSSL_NO_DH
1027struct dh_st;
1028int EVP_PKEY_set1_DH(EVP_PKEY *pkey, struct dh_st *key);
1029struct dh_st *EVP_PKEY_get0_DH(EVP_PKEY *pkey);
1030struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey);
1031# endif
1032# ifndef OPENSSL_NO_EC
1033struct ec_key_st;
1034int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key);
1035struct ec_key_st *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey);
1036struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey);
1037# endif
1038
1039EVP_PKEY *EVP_PKEY_new(void);
1040int EVP_PKEY_up_ref(EVP_PKEY *pkey);
1041void EVP_PKEY_free(EVP_PKEY *pkey);
1042
1043EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
1044 long length);
1045int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp);
1046
1047EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
1048 long length);
1049EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
1050 long length);
1051int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp);
1053int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from);
1054int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey);
1055int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode);
1056int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b);
1057
1058int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
1059
1060int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey,
1061 int indent, ASN1_PCTX *pctx);
1062int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey,
1063 int indent, ASN1_PCTX *pctx);
1064int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey,
1065 int indent, ASN1_PCTX *pctx);
1066
1067int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid);
1068
1069int EVP_PKEY_set1_tls_encodedpoint(EVP_PKEY *pkey,
1070 const unsigned char *pt, size_t ptlen);
1071size_t EVP_PKEY_get1_tls_encodedpoint(EVP_PKEY *pkey, unsigned char **ppt);
1073int EVP_CIPHER_type(const EVP_CIPHER *ctx);
1074
1075/* calls methods */
1076int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
1077int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
1078
1079/* These are used by EVP_CIPHER methods */
1080int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
1081int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
1082
1083/* PKCS5 password based encryption */
1084int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
1085 ASN1_TYPE *param, const EVP_CIPHER *cipher,
1086 const EVP_MD *md, int en_de);
1087int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
1088 const unsigned char *salt, int saltlen, int iter,
1089 int keylen, unsigned char *out);
1090int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
1091 const unsigned char *salt, int saltlen, int iter,
1092 const EVP_MD *digest, int keylen, unsigned char *out);
1093int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
1094 ASN1_TYPE *param, const EVP_CIPHER *cipher,
1095 const EVP_MD *md, int en_de);
1096
1097#ifndef OPENSSL_NO_SCRYPT
1098int EVP_PBE_scrypt(const char *pass, size_t passlen,
1099 const unsigned char *salt, size_t saltlen,
1100 uint64_t N, uint64_t r, uint64_t p, uint64_t maxmem,
1101 unsigned char *key, size_t keylen);
1102
1103int PKCS5_v2_scrypt_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass,
1104 int passlen, ASN1_TYPE *param,
1105 const EVP_CIPHER *c, const EVP_MD *md, int en_de);
1106#endif
1107
1108void PKCS5_PBE_add(void);
1109
1110int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
1111 ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de);
1113/* PBE type */
1115/* Can appear as the outermost AlgorithmIdentifier */
1116# define EVP_PBE_TYPE_OUTER 0x0
1117/* Is an PRF type OID */
1118# define EVP_PBE_TYPE_PRF 0x1
1119/* Is a PKCS#5 v2.0 KDF */
1120# define EVP_PBE_TYPE_KDF 0x2
1121
1122int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid,
1123 int md_nid, EVP_PBE_KEYGEN *keygen);
1124int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
1125 EVP_PBE_KEYGEN *keygen);
1126int EVP_PBE_find(int type, int pbe_nid, int *pcnid, int *pmnid,
1127 EVP_PBE_KEYGEN **pkeygen);
1128void EVP_PBE_cleanup(void);
1129int EVP_PBE_get(int *ptype, int *ppbe_nid, size_t num);
1130
1131# define ASN1_PKEY_ALIAS 0x1
1132# define ASN1_PKEY_DYNAMIC 0x2
1133# define ASN1_PKEY_SIGPARAM_NULL 0x4
1135# define ASN1_PKEY_CTRL_PKCS7_SIGN 0x1
1136# define ASN1_PKEY_CTRL_PKCS7_ENCRYPT 0x2
1137# define ASN1_PKEY_CTRL_DEFAULT_MD_NID 0x3
1138# define ASN1_PKEY_CTRL_CMS_SIGN 0x5
1139# define ASN1_PKEY_CTRL_CMS_ENVELOPE 0x7
1140# define ASN1_PKEY_CTRL_CMS_RI_TYPE 0x8
1142# define ASN1_PKEY_CTRL_SET1_TLS_ENCPT 0x9
1143# define ASN1_PKEY_CTRL_GET1_TLS_ENCPT 0xa
1145int EVP_PKEY_asn1_get_count(void);
1146const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx);
1147const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type);
1148const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
1149 const char *str, int len);
1150int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth);
1151int EVP_PKEY_asn1_add_alias(int to, int from);
1152int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id,
1153 int *ppkey_flags, const char **pinfo,
1154 const char **ppem_str,
1155 const EVP_PKEY_ASN1_METHOD *ameth);
1156
1157const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(const EVP_PKEY *pkey);
1158EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,
1159 const char *pem_str,
1160 const char *info);
1161void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
1162 const EVP_PKEY_ASN1_METHOD *src);
1163void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth);
1164void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
1165 int (*pub_decode) (EVP_PKEY *pk,
1166 X509_PUBKEY *pub),
1167 int (*pub_encode) (X509_PUBKEY *pub,
1168 const EVP_PKEY *pk),
1169 int (*pub_cmp) (const EVP_PKEY *a,
1170 const EVP_PKEY *b),
1171 int (*pub_print) (BIO *out,
1172 const EVP_PKEY *pkey,
1173 int indent, ASN1_PCTX *pctx),
1174 int (*pkey_size) (const EVP_PKEY *pk),
1175 int (*pkey_bits) (const EVP_PKEY *pk));
1176void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
1177 int (*priv_decode) (EVP_PKEY *pk,
1179 *p8inf),
1180 int (*priv_encode) (PKCS8_PRIV_KEY_INFO *p8,
1181 const EVP_PKEY *pk),
1182 int (*priv_print) (BIO *out,
1183 const EVP_PKEY *pkey,
1184 int indent,
1185 ASN1_PCTX *pctx));
1186void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
1187 int (*param_decode) (EVP_PKEY *pkey,
1188 const unsigned char **pder,
1189 int derlen),
1190 int (*param_encode) (const EVP_PKEY *pkey,
1191 unsigned char **pder),
1192 int (*param_missing) (const EVP_PKEY *pk),
1193 int (*param_copy) (EVP_PKEY *to,
1194 const EVP_PKEY *from),
1195 int (*param_cmp) (const EVP_PKEY *a,
1196 const EVP_PKEY *b),
1197 int (*param_print) (BIO *out,
1198 const EVP_PKEY *pkey,
1199 int indent,
1200 ASN1_PCTX *pctx));
1201
1202void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
1203 void (*pkey_free) (EVP_PKEY *pkey));
1204void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
1205 int (*pkey_ctrl) (EVP_PKEY *pkey, int op,
1206 long arg1, void *arg2));
1207void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth,
1208 int (*item_verify) (EVP_MD_CTX *ctx,
1209 const ASN1_ITEM *it,
1210 void *asn,
1211 X509_ALGOR *a,
1212 ASN1_BIT_STRING *sig,
1213 EVP_PKEY *pkey),
1214 int (*item_sign) (EVP_MD_CTX *ctx,
1215 const ASN1_ITEM *it,
1216 void *asn,
1218 X509_ALGOR *alg2,
1219 ASN1_BIT_STRING *sig));
1220
1221void EVP_PKEY_asn1_set_siginf(EVP_PKEY_ASN1_METHOD *ameth,
1222 int (*siginf_set) (X509_SIG_INFO *siginf,
1223 const X509_ALGOR *alg,
1224 const ASN1_STRING *sig));
1226void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth,
1227 int (*pkey_check) (const EVP_PKEY *pk));
1229void EVP_PKEY_asn1_set_public_check(EVP_PKEY_ASN1_METHOD *ameth,
1230 int (*pkey_pub_check) (const EVP_PKEY *pk));
1232void EVP_PKEY_asn1_set_param_check(EVP_PKEY_ASN1_METHOD *ameth,
1233 int (*pkey_param_check) (const EVP_PKEY *pk));
1234
1235void EVP_PKEY_asn1_set_set_priv_key(EVP_PKEY_ASN1_METHOD *ameth,
1236 int (*set_priv_key) (EVP_PKEY *pk,
1237 const unsigned char
1238 *priv,
1239 size_t len));
1240void EVP_PKEY_asn1_set_set_pub_key(EVP_PKEY_ASN1_METHOD *ameth,
1241 int (*set_pub_key) (EVP_PKEY *pk,
1242 const unsigned char *pub,
1243 size_t len));
1244void EVP_PKEY_asn1_set_get_priv_key(EVP_PKEY_ASN1_METHOD *ameth,
1245 int (*get_priv_key) (const EVP_PKEY *pk,
1246 unsigned char *priv,
1247 size_t *len));
1248void EVP_PKEY_asn1_set_get_pub_key(EVP_PKEY_ASN1_METHOD *ameth,
1249 int (*get_pub_key) (const EVP_PKEY *pk,
1250 unsigned char *pub,
1251 size_t *len));
1252
1253void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth,
1254 int (*pkey_security_bits) (const EVP_PKEY
1255 *pk));
1257# define EVP_PKEY_OP_UNDEFINED 0
1258# define EVP_PKEY_OP_PARAMGEN (1<<1)
1259# define EVP_PKEY_OP_KEYGEN (1<<2)
1260# define EVP_PKEY_OP_SIGN (1<<3)
1261# define EVP_PKEY_OP_VERIFY (1<<4)
1262# define EVP_PKEY_OP_VERIFYRECOVER (1<<5)
1263# define EVP_PKEY_OP_SIGNCTX (1<<6)
1264# define EVP_PKEY_OP_VERIFYCTX (1<<7)
1265# define EVP_PKEY_OP_ENCRYPT (1<<8)
1266# define EVP_PKEY_OP_DECRYPT (1<<9)
1267# define EVP_PKEY_OP_DERIVE (1<<10)
1268
1269# define EVP_PKEY_OP_TYPE_SIG
1273# define EVP_PKEY_OP_TYPE_CRYPT
1276# define EVP_PKEY_OP_TYPE_NOGEN
1279# define EVP_PKEY_OP_TYPE_GEN
1281
1282# define EVP_PKEY_CTX_set_signature_md(ctx, md)
1283 EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG,
1284 EVP_PKEY_CTRL_MD, 0, (void *)(md))
1285
1286# define EVP_PKEY_CTX_get_signature_md(ctx, pmd)
1287 EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG,
1288 EVP_PKEY_CTRL_GET_MD, 0, (void *)(pmd))
1289
1290# define EVP_PKEY_CTX_set_mac_key(ctx, key, len)
1291 EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_KEYGEN,
1292 EVP_PKEY_CTRL_SET_MAC_KEY, len, (void *)(key))
1294# define EVP_PKEY_CTRL_MD 1
1295# define EVP_PKEY_CTRL_PEER_KEY 2
1297# define EVP_PKEY_CTRL_PKCS7_ENCRYPT 3
1298# define EVP_PKEY_CTRL_PKCS7_DECRYPT 4
1299
1300# define EVP_PKEY_CTRL_PKCS7_SIGN 5
1301
1302# define EVP_PKEY_CTRL_SET_MAC_KEY 6
1304# define EVP_PKEY_CTRL_DIGESTINIT 7
1306/* Used by GOST key encryption in TLS */
1307# define EVP_PKEY_CTRL_SET_IV 8
1308
1309# define EVP_PKEY_CTRL_CMS_ENCRYPT 9
1310# define EVP_PKEY_CTRL_CMS_DECRYPT 10
1311# define EVP_PKEY_CTRL_CMS_SIGN 11
1312
1313# define EVP_PKEY_CTRL_CIPHER 12
1314
1315# define EVP_PKEY_CTRL_GET_MD 13
1316
1317# define EVP_PKEY_CTRL_SET_DIGEST_SIZE 14
1318
1319# define EVP_PKEY_ALG_CTRL 0x1000
1320
1321# define EVP_PKEY_FLAG_AUTOARGLEN 2
1322/*
1323 * Method handles all operations: don't assume any digest related defaults.
1325# define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4
1326
1327const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type);
1328EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags);
1329void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags,
1330 const EVP_PKEY_METHOD *meth);
1331void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src);
1332void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth);
1333int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth);
1334int EVP_PKEY_meth_remove(const EVP_PKEY_METHOD *pmeth);
1335size_t EVP_PKEY_meth_get_count(void);
1336const EVP_PKEY_METHOD *EVP_PKEY_meth_get0(size_t idx);
1338EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
1339EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
1340EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx);
1341void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);
1342
1343int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype,
1344 int cmd, int p1, void *p2);
1345int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
1346 const char *value);
1347int EVP_PKEY_CTX_ctrl_uint64(EVP_PKEY_CTX *ctx, int keytype, int optype,
1348 int cmd, uint64_t value);
1350int EVP_PKEY_CTX_str2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *str);
1351int EVP_PKEY_CTX_hex2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *hex);
1353int EVP_PKEY_CTX_md(EVP_PKEY_CTX *ctx, int optype, int cmd, const char *md);
1355int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx);
1356void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen);
1357
1358EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e,
1359 const unsigned char *key, int keylen);
1360EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e,
1361 const unsigned char *priv,
1362 size_t len);
1363EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e,
1364 const unsigned char *pub,
1365 size_t len);
1366int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, unsigned char *priv,
1367 size_t *len);
1368int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, unsigned char *pub,
1369 size_t *len);
1371EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv,
1372 size_t len, const EVP_CIPHER *cipher);
1373
1374void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data);
1375void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx);
1376EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx);
1378EVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx);
1380void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data);
1381void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx);
1382
1383int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx);
1384int EVP_PKEY_sign(EVP_PKEY_CTX *ctx,
1385 unsigned char *sig, size_t *siglen,
1386 const unsigned char *tbs, size_t tbslen);
1387int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx);
1388int EVP_PKEY_verify(EVP_PKEY_CTX *ctx,
1389 const unsigned char *sig, size_t siglen,
1390 const unsigned char *tbs, size_t tbslen);
1391int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx);
1392int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx,
1393 unsigned char *rout, size_t *routlen,
1394 const unsigned char *sig, size_t siglen);
1395int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx);
1396int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx,
1397 unsigned char *out, size_t *outlen,
1398 const unsigned char *in, size_t inlen);
1399int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx);
1400int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx,
1401 unsigned char *out, size_t *outlen,
1402 const unsigned char *in, size_t inlen);
1403
1404int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx);
1405int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer);
1406int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
1408typedef int EVP_PKEY_gen_cb(EVP_PKEY_CTX *ctx);
1410int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx);
1411int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey);
1412int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx);
1413int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey);
1414int EVP_PKEY_check(EVP_PKEY_CTX *ctx);
1415int EVP_PKEY_public_check(EVP_PKEY_CTX *ctx);
1416int EVP_PKEY_param_check(EVP_PKEY_CTX *ctx);
1418void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb);
1419EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx);
1420
1421int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx);
1423void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth,
1424 int (*init) (EVP_PKEY_CTX *ctx));
1425
1426void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth,
1427 int (*copy) (EVP_PKEY_CTX *dst,
1428 EVP_PKEY_CTX *src));
1430void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth,
1431 void (*cleanup) (EVP_PKEY_CTX *ctx));
1432
1433void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth,
1434 int (*paramgen_init) (EVP_PKEY_CTX *ctx),
1435 int (*paramgen) (EVP_PKEY_CTX *ctx,
1436 EVP_PKEY *pkey));
1437
1438void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth,
1439 int (*keygen_init) (EVP_PKEY_CTX *ctx),
1440 int (*keygen) (EVP_PKEY_CTX *ctx,
1441 EVP_PKEY *pkey));
1442
1443void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth,
1444 int (*sign_init) (EVP_PKEY_CTX *ctx),
1445 int (*sign) (EVP_PKEY_CTX *ctx,
1446 unsigned char *sig, size_t *siglen,
1447 const unsigned char *tbs,
1448 size_t tbslen));
1449
1450void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth,
1451 int (*verify_init) (EVP_PKEY_CTX *ctx),
1452 int (*verify) (EVP_PKEY_CTX *ctx,
1453 const unsigned char *sig,
1454 size_t siglen,
1455 const unsigned char *tbs,
1456 size_t tbslen));
1457
1458void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth,
1459 int (*verify_recover_init) (EVP_PKEY_CTX
1460 *ctx),
1461 int (*verify_recover) (EVP_PKEY_CTX
1462 *ctx,
1463 unsigned char
1464 *sig,
1465 size_t *siglen,
1466 const unsigned
1467 char *tbs,
1468 size_t tbslen));
1469
1470void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth,
1471 int (*signctx_init) (EVP_PKEY_CTX *ctx,
1472 EVP_MD_CTX *mctx),
1473 int (*signctx) (EVP_PKEY_CTX *ctx,
1474 unsigned char *sig,
1475 size_t *siglen,
1476 EVP_MD_CTX *mctx));
1477
1478void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth,
1479 int (*verifyctx_init) (EVP_PKEY_CTX *ctx,
1480 EVP_MD_CTX *mctx),
1481 int (*verifyctx) (EVP_PKEY_CTX *ctx,
1482 const unsigned char *sig,
1483 int siglen,
1484 EVP_MD_CTX *mctx));
1485
1486void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth,
1487 int (*encrypt_init) (EVP_PKEY_CTX *ctx),
1488 int (*encryptfn) (EVP_PKEY_CTX *ctx,
1489 unsigned char *out,
1490 size_t *outlen,
1491 const unsigned char *in,
1492 size_t inlen));
1493
1494void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth,
1495 int (*decrypt_init) (EVP_PKEY_CTX *ctx),
1496 int (*decrypt) (EVP_PKEY_CTX *ctx,
1497 unsigned char *out,
1498 size_t *outlen,
1499 const unsigned char *in,
1500 size_t inlen));
1501
1502void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth,
1503 int (*derive_init) (EVP_PKEY_CTX *ctx),
1504 int (*derive) (EVP_PKEY_CTX *ctx,
1505 unsigned char *key,
1506 size_t *keylen));
1507
1508void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth,
1509 int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1,
1510 void *p2),
1511 int (*ctrl_str) (EVP_PKEY_CTX *ctx,
1512 const char *type,
1513 const char *value));
1514
1515void EVP_PKEY_meth_set_digestsign(EVP_PKEY_METHOD *pmeth,
1516 int (*digestsign) (EVP_MD_CTX *ctx,
1517 unsigned char *sig,
1518 size_t *siglen,
1519 const unsigned char *tbs,
1520 size_t tbslen));
1521
1522void EVP_PKEY_meth_set_digestverify(EVP_PKEY_METHOD *pmeth,
1523 int (*digestverify) (EVP_MD_CTX *ctx,
1524 const unsigned char *sig,
1525 size_t siglen,
1526 const unsigned char *tbs,
1527 size_t tbslen));
1529void EVP_PKEY_meth_set_check(EVP_PKEY_METHOD *pmeth,
1530 int (*check) (EVP_PKEY *pkey));
1532void EVP_PKEY_meth_set_public_check(EVP_PKEY_METHOD *pmeth,
1533 int (*check) (EVP_PKEY *pkey));
1535void EVP_PKEY_meth_set_param_check(EVP_PKEY_METHOD *pmeth,
1536 int (*check) (EVP_PKEY *pkey));
1537
1538void EVP_PKEY_meth_set_digest_custom(EVP_PKEY_METHOD *pmeth,
1539 int (*digest_custom) (EVP_PKEY_CTX *ctx,
1540 EVP_MD_CTX *mctx));
1542void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth,
1543 int (**pinit) (EVP_PKEY_CTX *ctx));
1544
1545void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth,
1546 int (**pcopy) (EVP_PKEY_CTX *dst,
1547 EVP_PKEY_CTX *src));
1549void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth,
1550 void (**pcleanup) (EVP_PKEY_CTX *ctx));
1551
1552void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth,
1553 int (**pparamgen_init) (EVP_PKEY_CTX *ctx),
1554 int (**pparamgen) (EVP_PKEY_CTX *ctx,
1555 EVP_PKEY *pkey));
1556
1557void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth,
1558 int (**pkeygen_init) (EVP_PKEY_CTX *ctx),
1559 int (**pkeygen) (EVP_PKEY_CTX *ctx,
1560 EVP_PKEY *pkey));
1561
1562void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth,
1563 int (**psign_init) (EVP_PKEY_CTX *ctx),
1564 int (**psign) (EVP_PKEY_CTX *ctx,
1565 unsigned char *sig, size_t *siglen,
1566 const unsigned char *tbs,
1567 size_t tbslen));
1568
1569void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth,
1570 int (**pverify_init) (EVP_PKEY_CTX *ctx),
1571 int (**pverify) (EVP_PKEY_CTX *ctx,
1572 const unsigned char *sig,
1573 size_t siglen,
1574 const unsigned char *tbs,
1575 size_t tbslen));
1576
1577void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth,
1578 int (**pverify_recover_init) (EVP_PKEY_CTX
1579 *ctx),
1580 int (**pverify_recover) (EVP_PKEY_CTX
1581 *ctx,
1582 unsigned char
1583 *sig,
1584 size_t *siglen,
1585 const unsigned
1586 char *tbs,
1587 size_t tbslen));
1588
1589void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth,
1590 int (**psignctx_init) (EVP_PKEY_CTX *ctx,
1591 EVP_MD_CTX *mctx),
1592 int (**psignctx) (EVP_PKEY_CTX *ctx,
1593 unsigned char *sig,
1594 size_t *siglen,
1595 EVP_MD_CTX *mctx));
1596
1597void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth,
1598 int (**pverifyctx_init) (EVP_PKEY_CTX *ctx,
1599 EVP_MD_CTX *mctx),
1600 int (**pverifyctx) (EVP_PKEY_CTX *ctx,
1601 const unsigned char *sig,
1602 int siglen,
1603 EVP_MD_CTX *mctx));
1604
1605void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth,
1606 int (**pencrypt_init) (EVP_PKEY_CTX *ctx),
1607 int (**pencryptfn) (EVP_PKEY_CTX *ctx,
1608 unsigned char *out,
1609 size_t *outlen,
1610 const unsigned char *in,
1611 size_t inlen));
1612
1613void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth,
1614 int (**pdecrypt_init) (EVP_PKEY_CTX *ctx),
1615 int (**pdecrypt) (EVP_PKEY_CTX *ctx,
1616 unsigned char *out,
1617 size_t *outlen,
1618 const unsigned char *in,
1619 size_t inlen));
1620
1621void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth,
1622 int (**pderive_init) (EVP_PKEY_CTX *ctx),
1623 int (**pderive) (EVP_PKEY_CTX *ctx,
1624 unsigned char *key,
1625 size_t *keylen));
1626
1627void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth,
1628 int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1,
1629 void *p2),
1630 int (**pctrl_str) (EVP_PKEY_CTX *ctx,
1631 const char *type,
1632 const char *value));
1633
1634void EVP_PKEY_meth_get_digestsign(EVP_PKEY_METHOD *pmeth,
1635 int (**digestsign) (EVP_MD_CTX *ctx,
1636 unsigned char *sig,
1637 size_t *siglen,
1638 const unsigned char *tbs,
1639 size_t tbslen));
1640
1641void EVP_PKEY_meth_get_digestverify(EVP_PKEY_METHOD *pmeth,
1642 int (**digestverify) (EVP_MD_CTX *ctx,
1643 const unsigned char *sig,
1644 size_t siglen,
1645 const unsigned char *tbs,
1646 size_t tbslen));
1648void EVP_PKEY_meth_get_check(const EVP_PKEY_METHOD *pmeth,
1649 int (**pcheck) (EVP_PKEY *pkey));
1651void EVP_PKEY_meth_get_public_check(const EVP_PKEY_METHOD *pmeth,
1652 int (**pcheck) (EVP_PKEY *pkey));
1654void EVP_PKEY_meth_get_param_check(const EVP_PKEY_METHOD *pmeth,
1655 int (**pcheck) (EVP_PKEY *pkey));
1657void EVP_PKEY_meth_get_digest_custom(EVP_PKEY_METHOD *pmeth,
1658 int (**pdigest_custom) (EVP_PKEY_CTX *ctx,
1659 EVP_MD_CTX *mctx));
1660void EVP_add_alg_module(void);
1661
1662
1663# ifdef __cplusplus
1664}
1665# endif
1666#endif
#define ARK_API
Definition Base.h:9
#define poco_unexpected()
Definition Bugcheck.h:140
#define poco_assert_dbg(cond)
Definition Bugcheck.h:113
#define POCO_EXTERNAL_OPENSSL
Definition Config.h:189
#define POCO_NO_SOO
Definition Config.h:82
#define POCO_DECLARE_EXCEPTION(API, CLS, BASE)
Definition Exception.h:157
#define POCO_DECLARE_EXCEPTION_CODE(API, CLS, BASE, CODE)
Definition Exception.h:140
#define POCO_DO_JOIN2(X, Y)
Definition Foundation.h:134
#define POCO_DO_JOIN(X, Y)
Definition Foundation.h:133
#define Foundation_API
Definition Foundation.h:60
#define POCO_JOIN(X, Y)
Definition Foundation.h:132
#define POCO_HAVE_IPv6
Definition Net.h:64
#define Net_API
Definition Net.h:47
#define NetSSL_API
Definition NetSSL.h:48
#define POCO_OS_IRIX
Definition Platform.h:35
#define POCO_OS_TRU64
Definition Platform.h:30
#define POCO_OS_WINDOWS_NT
Definition Platform.h:43
#define POCO_OS_HPUX
Definition Platform.h:29
#define POCO_OS_CYGWIN
Definition Platform.h:39
#define POCO_OS_WINDOWS_CE
Definition Platform.h:44
#define POCO_UNUSED
Definition Platform.h:274
#define POCO_OS_VXWORKS
Definition Platform.h:38
#define POCO_OS_ANDROID
Definition Platform.h:41
#define POCO_OS_QNX
Definition Platform.h:37
#define POCO_OS_AIX
Definition Platform.h:28
#define POCO_OS_LINUX
Definition Platform.h:31
#define POCO_OS_SOLARIS
Definition Platform.h:36
#define POCO_ARCH_AMD64
Definition Platform.h:129
#define OPENSSL_VERSION_PREREQ(maj, min)
Definition Crypto.h:36
#define Crypto_API
Definition Crypto.h:82
RSAPaddingMode
The padding mode used for RSA public key encryption.
Definition Crypto.h:44
@ RSA_PADDING_PKCS1_OAEP
PKCS #1 v1.5 padding. This currently is the most widely used mode.
Definition Crypto.h:48
@ RSA_PADDING_NONE
Definition Crypto.h:52
@ RSA_PADDING_PKCS1
Definition Crypto.h:45
#define POCO_EXTERNAL_OPENSSL_SLPRO
Definition Crypto.h:24
#define poco_ntoh_32(x)
Definition SocketDefs.h:328
#define INADDR_NONE
Definition SocketDefs.h:291
#define INADDR_BROADCAST
Definition SocketDefs.h:299
#define INADDR_ANY
Definition SocketDefs.h:295
#define poco_ntoh_16(x)
Definition SocketDefs.h:326
#define INADDR_LOOPBACK
Definition SocketDefs.h:303
#define ASN1_STRFLGS_ESC_QUOTE
Definition asn1.h:370
#define ASN1_STRFLGS_ESC_CTRL
Definition asn1.h:362
#define ASN1_STRFLGS_ESC_MSB
Definition asn1.h:363
#define ASN1_d2i_bio_of(type, xnew, d2i, in, x)
Definition asn1.h:738
#define DECLARE_ASN1_FUNCTIONS(type)
Definition asn1.h:217
#define ASN1_STRFLGS_RFC2253
Definition asn1.h:431
#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
Definition asn1.h:230
#define ASN1_i2d_bio_of(type, i2d, out, x)
Definition asn1.h:747
#define OSSL_ASYNC_FD
Definition async.h:22
#define BIO_FLAGS_READ
Definition bio.h:144
#define BIO_FLAGS_RWS
Definition bio.h:147
#define BIO_C_SET_WRITE_BUF_SIZE
Definition bio.h:324
#define BIO_C_GET_READ_REQUEST
Definition bio.h:329
int(*)(BIO *, char *, size_t, size_t *) BIO_meth_get_read_ex(const BIO_METHOD *biom)
Definition bio.h:767
#define BIO_C_GET_CIPHER_STATUS
Definition bio.h:300
#define BIO_C_MAKE_BIO_PAIR
Definition bio.h:326
#define BIO_TYPE_FILTER
Definition bio.h:29
#define BIO_FP_READ
Definition bio.h:139
#define BIO_C_SET_SSL
Definition bio.h:296
#define BIO_C_SET_BUFF_SIZE
Definition bio.h:304
#define BIO_C_GET_MD_CTX
Definition bio.h:307
#define BIO_CTRL_INFO
Definition bio.h:73
#define BIO_C_GET_MD
Definition bio.h:299
#define BIO_C_SET_BUFF_READ_DATA
Definition bio.h:309
#define BIO_C_GET_ACCEPT
Definition bio.h:311
#define BIO_CTRL_FLUSH
Definition bio.h:81
int(*)(BIO *, char *, int) BIO_meth_get_read(const BIO_METHOD *biom)
Definition bio.h:766
#define BIO_C_GET_FD
Definition bio.h:292
#define BIO_TYPE_DESCRIPTOR
Definition bio.h:28
#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT
Definition bio.h:314
#define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD
Definition bio.h:118
#define BIO_TYPE_SOURCE_SINK
Definition bio.h:30
#define BIO_C_FILE_SEEK
Definition bio.h:315
#define BIO_C_FILE_TELL
Definition bio.h:320
#define BIO_C_DO_STATE_MACHINE
Definition bio.h:288
#define BIO_C_GET_WRITE_BUF_SIZE
Definition bio.h:325
#define BIO_CTRL_SET_CLOSE
Definition bio.h:79
#define BIO_CB_RETURN
Definition bio.h:225
#define BIO_C_SET_CONNECT_MODE
Definition bio.h:346
int(*)(BIO *, const char *) BIO_meth_get_puts(const BIO_METHOD *biom)
Definition bio.h:772
#define BIO_CTRL_EOF
Definition bio.h:72
#define BIO_FLAGS_IO_SPECIAL
Definition bio.h:146
#define BIO_CTRL_PENDING
Definition bio.h:80
#define BIO_C_SET_ACCEPT
Definition bio.h:305
int(*)(BIO *) BIO_meth_get_destroy(const BIO_METHOD *biom)
Definition bio.h:783
#define BIO_FP_WRITE
Definition bio.h:140
#define BIO_CTRL_WPENDING
Definition bio.h:83
#define BIO_C_SET_FD
Definition bio.h:291
int(*)(BIO *) BIO_meth_get_create(const BIO_METHOD *bion)
Definition bio.h:781
#define BIO_CTRL_SET_CALLBACK
Definition bio.h:84
#define BIO_C_SET_CONNECT
Definition bio.h:287
#define BIO_C_GET_WRITE_GUARANTEE
Definition bio.h:328
#define BIO_do_handshake(b)
Definition bio.h:402
#define BIO_FLAGS_WRITE
Definition bio.h:145
#define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP
Definition bio.h:98
#define BIO_C_SET_BIND_MODE
Definition bio.h:318
#define BIO_C_GET_BIND_MODE
Definition bio.h:319
#define BIO_C_SSL_MODE
Definition bio.h:306
#define ossl_bio__attr__(x)
Definition bio.h:728
#define BIO_C_GET_SSL_NUM_RENEGOTIATES
Definition bio.h:313
#define BIO_C_GET_BUF_MEM_PTR
Definition bio.h:302
#define BIO_C_SET_FILE_PTR
Definition bio.h:293
#define BIO_C_SET_MD
Definition bio.h:298
#define BIO_CTRL_DGRAM_SET_PEER
Definition bio.h:113
#define BIO_C_GET_CONNECT
Definition bio.h:310
#define BIO_C_DESTROY_BIO_PAIR
Definition bio.h:327
#define BIO_SOCK_REUSEADDR
Definition bio.h:694
#define BIO_C_SET_SSL_RENEGOTIATE_BYTES
Definition bio.h:312
#define BIO_C_GET_BUFF_NUM_LINES
Definition bio.h:303
#define BIO_CTRL_DGRAM_GET_PEER
Definition bio.h:112
#define BIO_CTRL_GET_CLOSE
Definition bio.h:78
#define BIO_C_SET_BUF_MEM_EOF_RETURN
Definition bio.h:317
#define BIO_C_GET_SSL
Definition bio.h:297
#define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP
Definition bio.h:99
#define BIO_C_SHUTDOWN_WR
Definition bio.h:330
#define BIO_CTRL_RESET
Definition bio.h:71
#define BIO_CTRL_DUP
Definition bio.h:82
#define BIO_C_SET_NBIO
Definition bio.h:289
#define BIO_C_SET_FILENAME
Definition bio.h:295
#define BIO_CTRL_DGRAM_CONNECT
Definition bio.h:91
#define BIO_CTRL_DGRAM_SET_CONNECTED
Definition bio.h:92
#define BIO_C_GET_CIPHER_CTX
Definition bio.h:316
#define BIO_C_GET_FILE_PTR
Definition bio.h:294
int(*)(BIO *, char *, int) BIO_meth_get_gets(const BIO_METHOD *biom)
Definition bio.h:775
#define BIO_CTRL_PEEK
Definition bio.h:87
#define BIO_C_SET_BUF_MEM
Definition bio.h:301
#define BIO_CLOSE
Definition bio.h:66
#define BIO_FLAGS_SHOULD_RETRY
Definition bio.h:148
#define BIO_CTRL_GET
Definition bio.h:75
#define BIO_FP_APPEND
Definition bio.h:141
#define BIO_C_SET_MD_CTX
Definition bio.h:336
long(*)(BIO *, int, BIO_info_cb *) BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)
Definition bio.h:785
#define BIO_CTRL_GET_CALLBACK
Definition bio.h:85
int ERR_load_BIO_strings(void)
int ERR_load_BUF_strings(void)
virtual std::unique_ptr< ArkApi::ICommands > & GetCommands()=0
std::mutex RequestMutex_
Definition Requests.cpp:47
void WriteRequest(std::function< void(bool, std::string)> callback, bool success, std::string result)
Definition Requests.cpp:73
std::string GetResponse(Poco::Net::HTTPClientSession *session, Poco::Net::HTTPResponse &response)
Definition Requests.cpp:107
Poco::Net::HTTPRequest ConstructRequest(const std::string &url, Poco::Net::HTTPClientSession *&session, const std::vector< std::string > &headers, const std::string &request_type)
Definition Requests.cpp:79
std::vector< RequestData > RequestsVec_
Definition Requests.cpp:46
Requests(Requests &&)=delete
ARK_API bool CreateGetRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, std::vector< std::string > headers={})
Creates an async GET Request that runs in another thread but calls the callback from the main thread.
Definition Requests.cpp:129
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::vector< std::string > &post_ids, const std::vector< std::string > &post_data, std::vector< std::string > headers={})
Creates an async POST Request that runs in another thread but calls the callback from the main thread...
Definition Requests.cpp:238
Requests & operator=(Requests &&)=delete
ARK_API bool CreateDeleteRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, std::vector< std::string > headers={})
Creates an async DELETE Request that runs in another thread but calls the callback from the main thre...
Definition Requests.cpp:292
Requests & operator=(const Requests &)=delete
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::string &post_data, std::vector< std::string > headers={})
Creates an async POST Request with application/x-www-form-urlencoded content type that runs in anothe...
Definition Requests.cpp:162
static ARK_API Requests & Get()
Definition Requests.cpp:67
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::string &post_data, const std::string &content_type, std::vector< std::string > headers={})
Creates an async POST Request that runs in another thread but calls the callback from the main thread...
Definition Requests.cpp:200
std::unique_ptr< impl > pimpl
Definition Requests.h:84
Requests(const Requests &)=delete
virtual void AddOnTickCallback(const FString &id, const std::function< void(float)> &callback)=0
Added function will be called every frame.
virtual bool RemoveOnTickCallback(const FString &id)=0
Removes a on-tick callback.
Definition Logger.h:9
static std::shared_ptr< spdlog::logger > & GetLog()
Definition Logger.h:22
ValueType operator--()
Increments the counter and returns the previous value.
ValueType operator++()
Returns the value of the counter.
ValueType operator++(int)
Increments the counter and returns the result.
AtomicCounter(ValueType initialValue)
Creates a new AtomicCounter and initializes it to zero.
operator ValueType() const
Assigns a value to the counter.
ValueType operator--(int)
Decrements the counter and returns the result.
ValueType value() const
Converts the AtomicCounter to ValueType.
AtomicCounter & operator=(const AtomicCounter &counter)
Destroys the AtomicCounter.
AtomicCounter & operator=(ValueType value)
Assigns the value of another AtomicCounter.
AtomicCounter()
The underlying integer type.
bool operator!() const
Decrements the counter and returns the previous value.
AtomicCounter(const AtomicCounter &counter)
~AtomicCounter()
Creates the counter by copying another one.
std::atomic< int > _counter
Returns true if the counter is zero, false otherwise.
static std::string what(const char *msg, const char *file, int line, const char *text=0)
static void bugcheck(const char *msg, const char *file, int line)
static void nullPointer(const char *ptr, const char *file, int line)
static void debugger(const char *msg, const char *file, int line)
static void debugger(const char *file, int line)
static void bugcheck(const char *file, int line)
static void assertion(const char *cond, const char *file, int line, const char *text=0)
static void unexpected(const char *file, int line)
static struct CRYPTO_dynlock_value * dynlockCreate(const char *file, int line)
static void uninitialize()
Initializes the OpenSSL machinery.
static void initialize()
Automatically shut down OpenSSL on exit.
~OpenSSLInitializer()
Automatically initialize OpenSSL on startup.
static void lock(int mode, int n, const char *file, int line)
static unsigned long id()
static Poco::AtomicCounter _rc
static void enableFIPSMode(bool enabled)
static Poco::FastMutex * _mutexes
static void dynlock(int mode, struct CRYPTO_dynlock_value *lock, const char *file, int line)
static bool isFIPSEnabled()
Shuts down the OpenSSL machinery.
static void dynlockDestroy(struct CRYPTO_dynlock_value *lock, const char *file, int line)
This class represents a X509 Certificate.
void swap(X509Certificate &cert)
Move assignment.
std::string subjectName(NID nid) const
Returns the certificate subject's distinguished name.
bool equals(const X509Certificate &otherCertificate) const
const X509 * certificate() const
Poco::DateTime expiresOn() const
Returns the date and time the certificate is valid from.
X509Certificate(X509 *pCert, bool shared)
std::string issuerName(NID nid) const
Returns the certificate issuer's distinguished name.
const std::string & subjectName() const
X509Certificate(const X509Certificate &cert)
const std::string & serialNumber() const
Returns the version of the certificate.
X509Certificate & operator=(const X509Certificate &cert)
Creates the certificate by moving another one.
X509 * dup() const
Returns the underlying OpenSSL certificate.
~X509Certificate()
Exchanges the certificate with another one.
bool issuedBy(const X509Certificate &issuerCertificate) const
const std::string & issuerName() const
long version() const
Destroys the X509Certificate.
X509Certificate(X509Certificate &&cert) noexcept
Creates the certificate by copying another one.
void load(std::istream &stream)
Writes the list of certificates to the specified PEM file.
std::string signatureAlgorithm() const
void print(std::ostream &out) const
Returns the certificate signature algorithm long name.
Poco::DateTime validFrom() const
X509Certificate(std::istream &istr)
std::string commonName() const
void save(std::ostream &stream) const
OpenSSLInitializer _openSSLInitializer
X509Certificate & operator=(X509Certificate &&cert) noexcept
Assigns a certificate.
void swap(DateTime &dateTime)
bool operator<=(const DateTime &dateTime) const
Definition DateTime.h:410
short _millisecond
Definition DateTime.h:286
DateTime & operator-=(const Timespan &span)
int millisecond() const
Returns the second (0 to 59).
Definition DateTime.h:380
static bool isValid(int year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0, int microsecond=0)
bool operator!=(const DateTime &dateTime) const
Definition DateTime.h:398
static bool isLeapYear(int year)
Converts a UTC time into a local time, by applying the given time zone differential.
Definition DateTime.h:428
void makeUTC(int tzd)
Converts DateTime to tm struct.
DateTime(double julianDay)
int microsecond() const
Returns the millisecond (0 to 999)
Definition DateTime.h:386
Timestamp::UtcTimeVal utcTime() const
Returns the date and time expressed as a Timestamp.
Definition DateTime.h:315
Months
Symbolic names for month numbers (1 to 12).
Definition DateTime.h:66
bool operator<(const DateTime &dateTime) const
Definition DateTime.h:404
void computeDaytime()
int hour() const
Definition DateTime.h:339
DateTime & operator=(double julianDay)
Assigns a Timestamp.
bool operator>(const DateTime &dateTime) const
Definition DateTime.h:416
bool operator>=(const DateTime &dateTime) const
Definition DateTime.h:422
bool isPM() const
Returns true if hour < 12;.
Definition DateTime.h:362
int day() const
Definition DateTime.h:333
short _microsecond
Definition DateTime.h:287
int dayOfYear() const
int hourAMPM() const
Returns the hour (0 to 23).
Definition DateTime.h:345
double julianDay() const
Returns the microsecond (0 to 999)
static double toJulianDay(int year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0, int microsecond=0)
Computes the Julian day for an UTC time.
DaysOfWeek
Symbolic names for week day numbers (0 to 6).
Definition DateTime.h:83
DateTime & operator=(const DateTime &dateTime)
Destroys the DateTime.
void makeLocal(int tzd)
Converts a local time into UTC, by applying the given time zone differential.
DateTime(const Timestamp &timestamp)
Creates a DateTime from tm struct.
static double toJulianDay(Timestamp::UtcTimeVal utcTime)
Definition DateTime.h:296
Timespan operator-(const DateTime &dateTime) const
tm makeTM() const
DateTime operator-(const Timespan &span) const
DateTime & operator+=(const Timespan &span)
static Timestamp::UtcTimeVal toUtcTime(double julianDay)
Definition DateTime.h:303
Timestamp timestamp() const
Returns the julian day for the date and time.
Definition DateTime.h:309
int week(int firstDayOfWeek=MONDAY) const
Returns the month (1 to 12).
int second() const
Returns the minute (0 to 59).
Definition DateTime.h:374
~DateTime()
Copy constructor. Creates the DateTime from another one.
bool operator==(const DateTime &dateTime) const
Definition DateTime.h:392
int year() const
Swaps the DateTime with another one.
Definition DateTime.h:321
static int daysOfMonth(int year, int month)
void computeGregorian(double julianDay)
Computes the UTC time for a Julian day.
int dayOfWeek() const
Returns the day within the month (1 to 31).
DateTime & assign(int year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0, int microseconds=0)
Assigns a Julian day.
void checkLimit(short &lower, short &higher, short limit)
Extracts the daytime (hours, minutes, seconds, etc.) from the stored utcTime.
DateTime(const DateTime &dateTime)
Timestamp::UtcTimeVal _utcTime
utility functions used to correct the overflow in computeGregorian
Definition DateTime.h:279
int month() const
Returns the year.
Definition DateTime.h:327
DateTime(int year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0, int microsecond=0)
DateTime(const tm &tmStruct)
Creates a DateTime for the current date and time.
DateTime(Timestamp::UtcTimeVal utcTime, Timestamp::TimeDiff diff)
Creates a DateTime for the given Julian day.
DateTime & operator=(const Timestamp &timestamp)
Assigns another DateTime.
DateTime operator+(const Timespan &span) const
int minute() const
Returns true if hour >= 12.
Definition DateTime.h:368
bool isAM() const
Returns the hour (0 to 12).
Definition DateTime.h:356
virtual void updateImpl(const void *data, std::size_t length)=0
virtual const Digest & digest()=0
void update(char data)
DigestEngine & operator=(const DigestEngine &)
virtual std::size_t digestLength() const =0
Updates the digest with the given data.
DigestEngine(const DigestEngine &)
void update(const void *data, std::size_t length)
virtual void reset()=0
Returns the length of the digest in bytes.
virtual ~DigestEngine()
Exception(const Exception &exc)
virtual const char * what() const noexcept
Returns the name of the exception class.
const std::string & message() const
Definition Exception.h:116
void message(const std::string &msg)
Standard constructor.
Definition Exception.h:122
Exception(const std::string &msg, const Exception &nested, int code=0)
Creates an exception.
std::string _msg
Sets the extended message for the exception.
Definition Exception.h:101
Exception(const std::string &msg, const std::string &arg, int code=0)
Creates an exception.
const Exception * nested() const
Definition Exception.h:110
Exception * _pNested
Definition Exception.h:102
virtual Exception * clone() const
Exception & operator=(const Exception &exc)
Destroys the exception and deletes the nested exception.
Exception(int code=0)
virtual void rethrow() const
void extendedMessage(const std::string &arg)
Sets the message for the exception.
virtual const char * name() const noexcept
Assignment operator.
int code() const
Returns the message text.
Definition Exception.h:128
~Exception() noexcept
Copy constructor.
std::string displayText() const
Returns the exception code if defined.
Exception(const std::string &msg, int code=0)
virtual const char * className() const noexcept
Returns a static string describing the exception.
void unlock()
Definition Mutex.h:333
bool tryLock(long milliseconds)
Definition Mutex.h:327
~FastMutex()
creates the Mutex.
void lock()
destroys the Mutex.
Definition Mutex.h:308
bool tryLock()
Definition Mutex.h:321
FastMutex(const FastMutex &)
void lock(long milliseconds)
Definition Mutex.h:314
FastMutex & operator=(const FastMutex &)
bool tryLock(long milliseconds)
Definition Mutex.h:292
void lock(long milliseconds)
Definition Mutex.h:279
void unlock()
Definition Mutex.h:298
void lock()
destroys the Mutex.
Definition Mutex.h:273
Mutex & operator=(const Mutex &)
bool tryLock()
Definition Mutex.h:286
Mutex(const Mutex &)
~Mutex()
creates the Mutex.
bool tryLockImpl(long milliseconds)
void init(const Params &params)
void setSessionCacheSize(std::size_t size)
Returns true iff the session cache is enabled.
std::size_t getSessionCacheSize() const
Context::VerificationMode verificationMode() const
Returns true iff the context is for use by a server.
Definition Context.h:466
void requireMinimumProtocol(Protocols protocol)
void enableExtendedCertificateVerification(bool flag=true)
void setInvalidCertificateHandler(InvalidCertificateHandlerPtr pInvalidCertificageHandler)
Usage _usage
Create a SSL_CTX object according to Context configuration.
Definition Context.h:437
Usage usage() const
Returns the underlying OpenSSL SSL Context object.
Definition Context.h:449
SSL_CTX * sslContext() const
Definition Context.h:472
long getSessionTimeout() const
void usePrivateKey(const Poco::Crypto::RSAKey &key)
Add one trusted certification authority to be used by the Context.
void enableSessionCache(bool flag=true)
Returns the verification mode.
void addCertificateAuthority(const Poco::Crypto::X509Certificate &certificate)
Adds a certificate for certificate chain validation.
void usePrivateKey(const Poco::Crypto::EVPPKey &pkey)
bool extendedCertificateVerificationEnabled() const
Definition Context.h:478
bool isForServerUse() const
Definition Context.h:455
void addChainCertificate(const Poco::Crypto::X509Certificate &certificate)
bool _ocspStaplingResponseVerification
Definition Context.h:441
bool ocspStaplingResponseVerificationEnabled() const
Definition Context.h:484
bool _extendedCertificateVerification
Definition Context.h:440
VerificationMode _mode
Definition Context.h:438
@ SERVER_USE
DEPRECATED. Context is used by a client.
Definition Context.h:71
@ TLSV1_2_CLIENT_USE
DEPRECATED. Context is used by a server requiring TLSv1.1 (OpenSSL 1.0.0 or newer).
Definition Context.h:76
@ TLSV1_CLIENT_USE
DEPRECATED. Context is used by a server.
Definition Context.h:72
@ TLSV1_3_SERVER_USE
DEPRECATED. Context is used by a client requiring TLSv1.3 (OpenSSL 1.1.1 or newer).
Definition Context.h:79
@ CLIENT_USE
Context is used by a client for TLSv1 or higher. Use requireMinimumProtocol() or disableProtocols() t...
Definition Context.h:70
@ TLSV1_2_SERVER_USE
DEPRECATED. Context is used by a client requiring TLSv1.2 (OpenSSL 1.0.1 or newer).
Definition Context.h:77
@ TLSV1_SERVER_USE
DEPRECATED. Context is used by a client requiring TLSv1.
Definition Context.h:73
@ TLSV1_3_CLIENT_USE
DEPRECATED. Context is used by a server requiring TLSv1.2 (OpenSSL 1.0.1 or newer).
Definition Context.h:78
@ TLS_SERVER_USE
Context is used by a client for TLSv1 or higher. Use requireMinimumProtocol() or disableProtocols() t...
Definition Context.h:69
@ TLSV1_1_CLIENT_USE
DEPRECATED. Context is used by a server requiring TLSv1.
Definition Context.h:74
@ TLSV1_1_SERVER_USE
DEPRECATED. Context is used by a client requiring TLSv1.1 (OpenSSL 1.0.0 or newer).
Definition Context.h:75
void useCertificate(const Poco::Crypto::X509Certificate &certificate)
Destroys the Context.
void preferServerCiphers()
Context(Usage usage, const Params &params)
InvalidCertificateHandlerPtr _pInvalidCertificateHandler
Definition Context.h:442
void setSessionTimeout(long seconds)
InvalidCertificateHandlerPtr getInvalidCertificateHandler() const
Definition Context.h:490
void disableStatelessSessionResumption()
bool sessionCacheEnabled() const
void disableProtocols(int protocols)
SSL_CTX * _pSSLContext
Definition Context.h:439
virtual std::istream & receiveResponse(HTTPResponse &response)
virtual std::ostream & sendRequest(HTTPRequest &request)
Returns the connection timeout for HTTP connections.
static const std::string HTTP_1_1
void setContentLength(std::streamsize length)
Returns the HTTP version for this message.
HTTPRequest(const std::string &method, const std::string &uri, const std::string &version)
Creates a HTTP/1.0 request with the given method and URI.
static const std::string HTTP_GET
static const std::string HTTP_DELETE
static const std::string HTTP_POST
const std::string & getReason() const
Sets the HTTP reason phrase.
HTTPResponse(HTTPStatus status)
HTTPStatus getStatus() const
HTTPSClientSession(const std::string &host, Poco::UInt16 port, Context::Ptr pContext, Session::Ptr pSession)
std::string proxyRequestPrefix() const
Sends the given HTTPRequest over an existing connection.
HTTPSClientSession(Context::Ptr pContext, Session::Ptr pSession)
HTTPSClientSession(Context::Ptr pContext)
Creates a HTTPSClientSession using the given host and port.
void proxyAuthenticate(HTTPRequest &request)
Checks if we can reuse a persistent connection.
int read(char *buffer, std::streamsize length)
HTTPSClientSession(const HTTPSClientSession &)
void connect(const SocketAddress &address)
Refills the internal buffer.
HTTPSClientSession(const SecureStreamSocket &socket, Session::Ptr pSession)
X509Certificate serverCertificate()
HTTPSClientSession & operator=(const HTTPSClientSession &)
HTTPSClientSession(const std::string &host, Poco::UInt16 port=HTTPS_PORT)
HTTPSClientSession(const SecureStreamSocket &socket)
Creates an unconnected HTTPSClientSession.
HTTPSClientSession(const std::string &host, Poco::UInt16 port, Context::Ptr pContext)
InvalidCertificateHandler(bool handleErrorsOnServerSide)
virtual void onInvalidCertificate(const void *pSender, VerificationErrorArgs &errorCert)=0
Destroys the InvalidCertificateHandler.
RejectCertificateHandler(bool handleErrorsOnServerSide)
void initializeClient(PrivateKeyPassphraseHandlerPtr ptrPassphraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext)
static SSLManager & instance()
static std::string convertCertificateError(long errCode)
static std::string getLastError()
Converts an SSL certificate handling error code into an error message.
static void clearErrorStack()
Returns the last error from the error stack.
A utility class for certificate error handling.
void unlock()
Does nothing.
Definition Mutex.h:258
void lock(long)
Does nothing.
Definition Mutex.h:241
NullMutex()
Creates the NullMutex.
Definition Mutex.h:226
bool tryLock()
Does nothing and always returns true.
Definition Mutex.h:246
void lock()
Does nothing.
Definition Mutex.h:236
~NullMutex()
Destroys the NullMutex.
Definition Mutex.h:231
bool tryLock(long)
Does nothing and always returns true.
Definition Mutex.h:252
This stream discards all characters written to it.
Definition NullStream.h:77
Simple ReferenceCounter object, does not delete itself when count reaches 0.
Definition SharedPtr.h:33
AtomicCounter _cnt
Definition SharedPtr.h:55
int referenceCount() const
Definition SharedPtr.h:49
The release policy for SharedPtr holding arrays.
Definition SharedPtr.h:77
static void release(C *pObj) noexcept
Definition SharedPtr.h:79
static void release(C *pObj) noexcept
Definition SharedPtr.h:65
ScopedLock(M &mutex, long milliseconds)
Definition ScopedLock.h:41
ScopedLock(const ScopedLock &)
ScopedLock(M &mutex)
Definition ScopedLock.h:36
ScopedLock & operator=(const ScopedLock &)
ScopedLockWithUnlock & operator=(const ScopedLockWithUnlock &)
ScopedLockWithUnlock(const ScopedLockWithUnlock &)
ScopedLockWithUnlock(M &mutex, long milliseconds)
Definition ScopedLock.h:83
C * deref() const
Definition SharedPtr.h:431
bool operator!=(const SharedPtr &ptr) const
Definition SharedPtr.h:345
SharedPtr(SharedPtr &&ptr) noexcept
Definition SharedPtr.h:151
SharedPtr & operator=(SharedPtr &&ptr) noexcept
Definition SharedPtr.h:226
const C * get() const
Definition SharedPtr.h:300
SharedPtr< Other, RC, RP > cast() const
Definition SharedPtr.h:249
void release() noexcept
Definition SharedPtr.h:439
SharedPtr(C *ptr)
Definition SharedPtr.h:125
bool operator<=(C *ptr) const
Definition SharedPtr.h:390
bool operator<(const C *ptr) const
Definition SharedPtr.h:370
bool operator<=(const C *ptr) const
Definition SharedPtr.h:385
bool operator>=(C *ptr) const
Definition SharedPtr.h:420
void swap(SharedPtr &ptr)
Definition SharedPtr.h:242
SharedPtr(const SharedPtr< Other, RC, OtherRP > &ptr)
Definition SharedPtr.h:137
void reset(const SharedPtr< Other, RC, OtherRP > &ptr)
Definition SharedPtr.h:211
bool operator==(const SharedPtr &ptr) const
Definition SharedPtr.h:325
bool operator>=(const C *ptr) const
Definition SharedPtr.h:415
bool operator!=(const C *ptr) const
Definition SharedPtr.h:350
bool operator>(C *ptr) const
Definition SharedPtr.h:405
bool operator>(const C *ptr) const
Definition SharedPtr.h:400
void reset(const SharedPtr &ptr)
Definition SharedPtr.h:205
bool operator==(C *ptr) const
Definition SharedPtr.h:335
bool operator<=(const SharedPtr &ptr) const
Definition SharedPtr.h:380
bool operator!=(C *ptr) const
Definition SharedPtr.h:355
bool operator>=(const SharedPtr &ptr) const
Definition SharedPtr.h:410
bool operator==(std::nullptr_t ptr) const
Definition SharedPtr.h:340
SharedPtr(const SharedPtr &ptr)
Definition SharedPtr.h:144
SharedPtr(RC *pCounter, C *ptr)
Definition SharedPtr.h:451
SharedPtr< Other, RC, RP > unsafeCast() const
Definition SharedPtr.h:264
SharedPtr & assign(const SharedPtr &ptr)
Definition SharedPtr.h:174
SharedPtr & operator=(const SharedPtr &ptr)
Definition SharedPtr.h:221
operator const C *() const
Definition SharedPtr.h:310
SharedPtr & assign(C *ptr)
Definition SharedPtr.h:164
const C & operator*() const
Definition SharedPtr.h:290
const C * operator->() const
Definition SharedPtr.h:280
int referenceCount() const
Definition SharedPtr.h:425
SharedPtr & assign(const SharedPtr< Other, RC, OtherRP > &ptr)
Definition SharedPtr.h:185
void reset(C *ptr)
Definition SharedPtr.h:200
bool operator==(const C *ptr) const
Definition SharedPtr.h:330
bool operator>(const SharedPtr &ptr) const
Definition SharedPtr.h:395
bool operator!() const
Definition SharedPtr.h:315
SharedPtr & operator=(const SharedPtr< Other, RC, OtherRP > &ptr)
Definition SharedPtr.h:237
bool isNull() const
Definition SharedPtr.h:320
bool operator<(const SharedPtr &ptr) const
Definition SharedPtr.h:365
SharedPtr & operator=(C *ptr)
Definition SharedPtr.h:216
bool operator<(C *ptr) const
Definition SharedPtr.h:375
bool operator!=(std::nullptr_t ptr) const
Definition SharedPtr.h:360
static std::streamsize copyStream(std::istream &istr, std::ostream &ostr, std::size_t bufferSize=8192)
A class that represents time spans up to microsecond resolution.
Definition Timespan.h:30
int useconds() const
Definition Timespan.h:205
Timespan(const Timespan &timespan)
Creates a Timespan.
int totalMinutes() const
Returns the number of minutes (0 to 59).
Definition Timespan.h:169
static const TimeDiff SECONDS
The number of microseconds in a millisecond.
Definition Timespan.h:132
bool operator>=(TimeDiff microSeconds) const
Definition Timespan.h:271
bool operator>(TimeDiff microSeconds) const
Definition Timespan.h:265
int seconds() const
Returns the total number of minutes.
Definition Timespan.h:175
Timespan(int days, int hours, int minutes, int seconds, int microSeconds)
Timespan & operator=(TimeDiff microseconds)
Assignment operator.
Timespan operator-(TimeDiff microSeconds) const
bool operator<=(const Timespan &ts) const
Definition Timespan.h:247
static const TimeDiff HOURS
The number of microseconds in a minute.
Definition Timespan.h:134
Timespan & assign(long seconds, long microseconds)
Assigns a new span.
bool operator==(const Timespan &ts) const
Swaps the Timespan with another one.
Definition Timespan.h:217
void swap(Timespan &timespan)
bool operator==(TimeDiff microSeconds) const
Definition Timespan.h:253
TimeDiff _span
The number of microseconds in a day.
Definition Timespan.h:138
Timespan & operator-=(TimeDiff microSeconds)
Timespan(long seconds, long microseconds)
Creates a Timespan.
TimeDiff totalMicroseconds() const
Definition Timespan.h:211
int totalHours() const
Returns the number of hours (0 to 23).
Definition Timespan.h:157
Timespan & operator=(const Timespan &timespan)
Destroys the Timespan.
int totalSeconds() const
Returns the number of seconds (0 to 59).
Definition Timespan.h:181
TimeDiff totalMilliseconds() const
Returns the number of milliseconds (0 to 999).
Definition Timespan.h:193
Timespan & operator-=(const Timespan &d)
bool operator>=(const Timespan &ts) const
Definition Timespan.h:235
int hours() const
Returns the number of days.
Definition Timespan.h:151
Timespan(TimeDiff microseconds)
Creates a zero Timespan.
int minutes() const
Returns the total number of hours.
Definition Timespan.h:163
bool operator!=(const Timespan &ts) const
Definition Timespan.h:223
Timespan operator+(TimeDiff microSeconds) const
bool operator>(const Timespan &ts) const
Definition Timespan.h:229
bool operator<(TimeDiff microSeconds) const
Definition Timespan.h:277
int days() const
Definition Timespan.h:145
static const TimeDiff DAYS
The number of microseconds in a hour.
Definition Timespan.h:135
int microseconds() const
Returns the total number of milliseconds.
Definition Timespan.h:199
int milliseconds() const
Returns the total number of seconds.
Definition Timespan.h:187
Timespan & operator+=(TimeDiff microSeconds)
static const TimeDiff MINUTES
The number of microseconds in a second.
Definition Timespan.h:133
~Timespan()
Creates a Timespan from another one.
Definition Timespan.h:295
Timespan & operator+=(const Timespan &d)
static const TimeDiff MILLISECONDS
Returns the total number of microseconds.
Definition Timespan.h:131
bool operator<(const Timespan &ts) const
Definition Timespan.h:241
Timespan operator-(const Timespan &d) const
Timespan & assign(int days, int hours, int minutes, int seconds, int microSeconds)
Assignment operator.
Timespan operator+(const Timespan &d) const
bool operator<=(TimeDiff microSeconds) const
Definition Timespan.h:283
bool operator!=(TimeDiff microSeconds) const
Definition Timespan.h:259
Timestamp & operator=(const Timestamp &other)
Destroys the timestamp.
Timestamp & operator+=(TimeDiff d)
Definition Timestamp.h:210
Timestamp & operator-=(TimeDiff d)
Definition Timestamp.h:217
Timestamp(TimeVal tv)
Creates a timestamp with the current time.
Timestamp & operator=(TimeVal tv)
bool isElapsed(TimeDiff interval) const
Definition Timestamp.h:249
static const TimeVal TIMEVAL_MIN
Difference between two TimeVal values in microseconds.
Definition Timestamp.h:61
TimeVal epochMicroseconds() const
Definition Timestamp.h:236
static Timestamp fromUtcTime(UtcTimeVal val)
Creates a timestamp from a std::time_t.
TimeDiff elapsed() const
Definition Timestamp.h:242
static TimeDiff resolution()
Definition Timestamp.h:257
bool operator<=(const Timestamp &ts) const
Definition Timestamp.h:186
Timestamp operator+(const Timespan &span) const
std::time_t epochTime() const
Definition Timestamp.h:224
~Timestamp()
Copy constructor.
Timestamp operator-(const Timespan &span) const
bool operator==(const Timestamp &ts) const
Updates the Timestamp with the current time.
Definition Timestamp.h:156
bool operator>=(const Timestamp &ts) const
Definition Timestamp.h:174
Timestamp & operator-=(const Timespan &span)
UtcTimeVal utcTime() const
Definition Timestamp.h:230
Timestamp operator+(TimeDiff d) const
Definition Timestamp.h:192
bool operator<(const Timestamp &ts) const
Definition Timestamp.h:180
static Timestamp fromEpochTime(std::time_t t)
Timestamp()
Maximum timestamp value.
bool operator!=(const Timestamp &ts) const
Definition Timestamp.h:162
static const TimeVal TIMEVAL_MAX
Minimum timestamp value.
Definition Timestamp.h:62
TimeDiff operator-(const Timestamp &ts) const
Definition Timestamp.h:204
Timestamp & operator+=(const Timespan &span)
bool operator>(const Timestamp &ts) const
Definition Timestamp.h:168
Timestamp(const Timestamp &other)
void swap(Timestamp &timestamp)
Timestamp operator-(TimeDiff d) const
Definition Timestamp.h:198
TimeVal raw() const
Definition Timestamp.h:269
void update()
Swaps the Timestamp with another one.
const std::string & getHost() const
Sets the user-info part of the URI.
Definition URI.h:385
const std::string & getScheme() const
Definition URI.h:373
URI(const std::string &uri)
Creates an empty URI.
unsigned short getPort() const
Sets the host part of the URI.
std::string getPathAndQuery() const
Returns the encoded path, query and fragment parts of the URI.
FormatError(CStringRef message)
Definition format.h:686
void error(const T &)
int COMP_CTX_get_type(const COMP_CTX *comp)
int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, unsigned char *in, int ilen)
int COMP_get_type(const COMP_METHOD *meth)
int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, unsigned char *in, int ilen)
const COMP_METHOD * COMP_CTX_get_method(const COMP_CTX *ctx)
const char * COMP_get_name(const COMP_METHOD *meth)
COMP_CTX * COMP_CTX_new(COMP_METHOD *meth)
void COMP_CTX_free(COMP_CTX *ctx)
COMP_METHOD * COMP_zlib(void)
int ERR_load_COMP_strings(void)
int ERR_load_CRYPTO_strings(void)
#define ossl_unused
Definition e_os2.h:294
#define ossl_inline
Definition e_os2.h:276
#define ossl_ssize_t
Definition e_os2.h:214
#define __owur
Definition e_os2.h:227
#define ossl_noreturn
Definition e_os2.h:287
int(*)(EVP_MD_CTX *ctx) EVP_MD_meth_get_cleanup(const EVP_MD *md)
Definition evp.h:108
int(*)(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) EVP_CIPHER_meth_get_do_cipher(const EVP_CIPHER *cipher)
Definition evp.h:214
int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize)
#define EVP_get_cipherbynid(a)
Definition evp.h:436
#define EVP_PKEY_OP_DECRYPT
Definition evp.h:1262
EVP_MD * EVP_MD_meth_new(int md_type, int pkey_type)
#define EVP_PKEY_EC
Definition evp.h:52
#define EVP_PKEY_DSA
Definition evp.h:45
#define EVP_PKEY_OP_ENCRYPT
Definition evp.h:1261
int(*)(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc) EVP_CIPHER_meth_get_init(const EVP_CIPHER *cipher)
Definition evp.h:210
int EVP_MD_meth_get_app_datasize(const EVP_MD *md)
#define EVP_CTRL_AEAD_SET_IVLEN
Definition evp.h:296
#define EVP_CIPH_MODE
Definition evp.h:242
#define EVP_PKEY_OP_KEYGEN
Definition evp.h:1255
int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags)
int(*)(EVP_MD_CTX *ctx, const void *data, size_t count) EVP_MD_CTX_update_fn(EVP_MD_CTX *ctx)
Definition evp.h:448
int EVP_MD_meth_set_cleanup(EVP_MD *md, int(*cleanup)(EVP_MD_CTX *ctx))
#define EVP_PKEY_DH
Definition evp.h:50
int EVP_MD_meth_set_ctrl(EVP_MD *md, int(*ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2))
EVP_MD * EVP_MD_meth_dup(const EVP_MD *md)
int EVP_MD_meth_set_final(EVP_MD *md, int(*final)(EVP_MD_CTX *ctx, unsigned char *md))
int EVP_MD_meth_get_result_size(const EVP_MD *md)
int(*)(EVP_MD_CTX *ctx) EVP_MD_meth_get_init(const EVP_MD *md)
Definition evp.h:100
#define EVP_PKEY_SIPHASH
Definition evp.h:60
unsigned long EVP_MD_meth_get_flags(const EVP_MD *md)
#define EVP_MAX_IV_LENGTH
Definition evp.h:21
#define EVP_PKEY_RSA
Definition evp.h:42
int EVP_MD_meth_set_copy(EVP_MD *md, int(*copy)(EVP_MD_CTX *to, const EVP_MD_CTX *from))
int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize)
#define EVP_CIPHER_mode(e)
Definition evp.h:467
int(*)(EVP_MD_CTX *ctx, unsigned char *md) EVP_MD_meth_get_final(const EVP_MD *md)
Definition evp.h:104
int EVP_MD_meth_set_init(EVP_MD *md, int(*init)(EVP_MD_CTX *ctx))
#define EVP_PKEY_OP_VERIFYCTX
Definition evp.h:1260
int EVP_MD_meth_set_update(EVP_MD *md, int(*update)(EVP_MD_CTX *ctx, const void *data, size_t count))
int(*)(EVP_MD_CTX *to, const EVP_MD_CTX *from) EVP_MD_meth_get_copy(const EVP_MD *md)
Definition evp.h:106
#define EVP_PKEY_OP_VERIFY
Definition evp.h:1257
int(*)(EVP_MD_CTX *ctx, const void *data, size_t count) EVP_MD_meth_get_update(const EVP_MD *md)
Definition evp.h:101
#define EVP_PKEY_CTRL_MD
Definition evp.h:1290
int EVP_MD_meth_get_input_blocksize(const EVP_MD *md)
#define EVP_PKEY_CTRL_SET_MAC_KEY
Definition evp.h:1298
int(*)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2) EVP_MD_meth_get_ctrl(const EVP_MD *md)
Definition evp.h:109
int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize)
#define OPENSSL_add_all_algorithms_noconf()
Definition evp.h:943
#define EVP_CTRL_AEAD_GET_TAG
Definition evp.h:297
int(*)(EVP_CIPHER_CTX *, int type, int arg, void *ptr) EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher)
Definition evp.h:223
#define EVP_PKEY_OP_TYPE_CRYPT
Definition evp.h:1269
#define EVP_PKEY_OP_SIGN
Definition evp.h:1256
#define EVP_PKEY_OP_VERIFYRECOVER
Definition evp.h:1258
#define EVP_CTRL_AEAD_SET_TAG
Definition evp.h:298
int(*)(EVP_CIPHER_CTX *) EVP_CIPHER_meth_get_cleanup(const EVP_CIPHER *cipher)
Definition evp.h:218
void EVP_MD_meth_free(EVP_MD *md)
#define EVP_MD_nid(e)
Definition evp.h:440
#define EVP_PKEY_CTRL_GET_MD
Definition evp.h:1311
#define EVP_PKEY_OP_TYPE_SIG
Definition evp.h:1265
#define EVP_PKEY_OP_DERIVE
Definition evp.h:1263
#define EVP_CTRL_AEAD_SET_IV_FIXED
Definition evp.h:299
#define EVP_get_digestbynid(a)
Definition evp.h:434
#define EVP_PKEY_POLY1305
Definition evp.h:59
#define EVP_PKEY_OP_SIGNCTX
Definition evp.h:1259
#define EVP_PKEY_OP_PARAMGEN
Definition evp.h:1254
#define LHASH_OF(type)
Definition lhash.h:119
Definition IBaseApi.h:9
std::unique_ptr< IBaseApi > game_api
Definition IBaseApi.h:25
void Crypto_API uninitializeCrypto()
void Crypto_API initializeCrypto()
std::vector< SocketBuf > SocketBufVec
Definition SocketDefs.h:365
void NetSSL_API initializeSSL()
void Net_API uninitializeNetwork()
void Net_API initializeNetwork()
void NetSSL_API uninitializeSSL()
void swap(Timestamp &s1, Timestamp &s2)
Definition Timestamp.h:263
void swap(SharedPtr< C, RC, RP > &p1, SharedPtr< C, RC, RP > &p2)
Definition SharedPtr.h:467
void swap(DateTime &d1, DateTime &d2)
Definition DateTime.h:434
void swap(Timespan &s1, Timespan &s2)
Definition Timespan.h:289
SharedPtr< T, ReferenceCounter, ReleaseArrayPolicy< T > > makeSharedArray(std::size_t size)
Definition SharedPtr.h:481
MutexImpl FastMutexImpl
Definition Mutex_WIN32.h:44
SharedPtr< T > makeShared(Args &&... args)
Definition SharedPtr.h:474
Null localtime_s(...)
Definition time.h:60
Null gmtime_r(...)
Definition time.h:61
Null localtime_r(...)
Definition time.h:59
Null gmtime_s(...)
Definition time.h:62
Definition format.h:408
void format_arg(BasicFormatter< char, ArgFormatter > &f, const char *&format_str, const std::tm &tm)
Definition time.h:24
Definition json.hpp:4518
#define NID_rsassaPss
Definition obj_mac.h:574
#define NID_tls1_prf
Definition obj_mac.h:4967
#define NID_ED448
Definition obj_mac.h:5000
#define NID_cmac
Definition obj_mac.h:4776
#define NID_X9_62_id_ecPublicKey
Definition obj_mac.h:169
#define NID_siphash
Definition obj_mac.h:5085
#define NID_ED25519
Definition obj_mac.h:4996
#define NID_dsa
Definition obj_mac.h:127
#define NID_dhKeyAgreement
Definition obj_mac.h:612
#define NID_hkdf
Definition obj_mac.h:4971
#define NID_id_scrypt
Definition obj_mac.h:4962
#define NID_dsaWithSHA
Definition obj_mac.h:2045
#define NID_dhpublicnumber
Definition obj_mac.h:4816
#define NID_sm2
Definition obj_mac.h:1169
#define NID_poly1305
Definition obj_mac.h:5081
#define NID_dsaWithSHA1_2
Definition obj_mac.h:2098
#define NID_dsaWithSHA1
Definition obj_mac.h:132
#define NID_rsaEncryption
Definition obj_mac.h:534
#define NID_X448
Definition obj_mac.h:4992
#define NID_dsa_2
Definition obj_mac.h:2040
#define NID_undef
Definition obj_mac.h:14
#define NID_rsa
Definition obj_mac.h:2395
#define NID_X25519
Definition obj_mac.h:4988
#define NID_hmac
Definition obj_mac.h:4772
#define OBJ_NAME_TYPE_CIPHER_METH
Definition objects.h:20
#define OBJ_NAME_TYPE_MD_METH
Definition objects.h:19
#define OBJ_NAME_ALIAS
Definition objects.h:25
BUF_MEM * BUF_MEM_new_ex(unsigned long flags)
void BUF_MEM_free(BUF_MEM *a)
BUF_MEM * BUF_MEM_new(void)
size_t BUF_MEM_grow(BUF_MEM *str, size_t len)
size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz)
int CRYPTO_secure_malloc_done(void)
int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
void OPENSSL_thread_stop(void)
void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
void CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp)
Definition crypto.h:166
size_t OPENSSL_strlcpy(char *dst, const char *src, size_t siz)
int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)
void * CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
int CRYPTO_mem_ctrl(int mode)
void * CRYPTO_clear_realloc(void *addr, size_t old_num, size_t num, const char *file, int line)
void OPENSSL_INIT_set_config_file_flags(OPENSSL_INIT_SETTINGS *settings, unsigned long flags)
int CRYPTO_set_mem_functions(void *(*m)(size_t, const char *, int), void *(*r)(void *, size_t, const char *, int), void(*f)(void *, const char *, int))
#define OPENSSL_INIT_ENGINE_PADLOCK
Definition crypto.h:370
int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec)
#define OPENSSL_INIT_ENGINE_RDRAND
Definition crypto.h:365
void OPENSSL_cleanse(void *ptr, size_t len)
int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
unsigned long OpenSSL_version_num(void)
int OPENSSL_isservice(void)
#define OPENSSL_DIR
Definition crypto.h:161
int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void(*cleanup)(void *))
void CRYPTO_free(void *ptr, const char *file, int line)
int OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings, const char *config_filename)
size_t OPENSSL_strnlen(const char *str, size_t maxlen)
int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock)
unsigned char * OPENSSL_hexstr2buf(const char *str, long *len)
int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
#define CRYPTO_EX_INDEX_SSL_CTX
Definition crypto.h:95
#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS
Definition crypto.h:357
int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
void CRYPTO_get_mem_functions(void *(**m)(size_t, const char *, int), void *(**r)(void *, size_t, const char *, int), void(**f)(void *, const char *, int))
#define OPENSSL_BUILT_ON
Definition crypto.h:159
int OPENSSL_atexit(void(*handler)(void))
#define OPENSSL_CFLAGS
Definition crypto.h:158
void * CRYPTO_malloc(size_t num, const char *file, int line)
int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key)
int CRYPTO_secure_allocated(const void *ptr)
#define OPENSSL_VERSION
Definition crypto.h:157
#define OPENSSL_strndup(str, n)
Definition crypto.h:133
int CRYPTO_secure_malloc_init(size_t sz, int minsize)
int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void(*init)(void))
char * CRYPTO_strdup(const char *str, const char *file, int line)
char * CRYPTO_strndup(const char *str, size_t s, const char *file, int line)
size_t CRYPTO_secure_actual_size(void *ptr)
void * CRYPTO_secure_malloc(size_t num, const char *file, int line)
#define CRYPTO_ONCE_STATIC_INIT
Definition crypto.h:428
int CRYPTO_free_ex_index(int class_index, int idx)
#define CRYPTO_EX_INDEX_SSL_SESSION
Definition crypto.h:96
#define OPENSSL_INIT_LOAD_CONFIG
Definition crypto.h:362
void CRYPTO_clear_free(void *ptr, size_t num, const char *file, int line)
void * CRYPTO_memdup(const void *str, size_t siz, const char *file, int line)
void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp)
Definition crypto.h:168
size_t CRYPTO_secure_used(void)
int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, void *from_d, int idx, long argl, void *argp)
Definition crypto.h:170
void CRYPTO_RWLOCK
Definition crypto.h:67
int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock)
#define OPENSSL_INIT_ADD_ALL_DIGESTS
Definition crypto.h:359
void * CRYPTO_secure_zalloc(size_t num, const char *file, int line)
int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len)
int FIPS_mode(void)
void OPENSSL_INIT_free(OPENSSL_INIT_SETTINGS *settings)
CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void)
char * OPENSSL_buf2hexstr(const unsigned char *buffer, long len)
size_t OPENSSL_strlcat(char *dst, const char *src, size_t siz)
#define OPENSSL_INIT_ENGINE_CAPI
Definition crypto.h:369
#define CRYPTO_EX_INDEX_X509
Definition crypto.h:97
int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from)
__owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
#define OPENSSL_strdup(str)
Definition crypto.h:131
void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock)
void OPENSSL_cleanup(void)
#define CRYPTO_EX_INDEX_SSL
Definition crypto.h:94
void * CRYPTO_realloc(void *addr, size_t num, const char *file, int line)
OPENSSL_INIT_SETTINGS * OPENSSL_INIT_new(void)
void OPENSSL_init(void)
void * CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
int CRYPTO_set_mem_debug(int flag)
int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings, const char *config_appname)
#define OPENSSL_PLATFORM
Definition crypto.h:160
int OPENSSL_hexchar2int(unsigned char c)
#define OPENSSL_memdup(str, s)
Definition crypto.h:129
#define OPENSSL_INIT_ADD_ALL_CIPHERS
Definition crypto.h:358
int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val)
CRYPTO_RWLOCK * CRYPTO_THREAD_lock_new(void)
int OPENSSL_issetugid(void)
#define OPENSSL_INIT_ENGINE_DYNAMIC
Definition crypto.h:366
void CRYPTO_secure_free(void *ptr, const char *file, int line)
void * CRYPTO_zalloc(size_t num, const char *file, int line)
#define CRYPTO_EX_INDEX_BIO
Definition crypto.h:106
int CRYPTO_secure_malloc_initialized(void)
ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line)
int OPENSSL_gmtime_diff(int *pday, int *psec, const struct tm *from, const struct tm *to)
const char * OpenSSL_version(int type)
#define OPENSSL_INIT_ENGINE_CRYPTODEV
Definition crypto.h:368
struct tm * OPENSSL_gmtime(const time_t *timer, struct tm *result)
void CRYPTO_secure_clear_free(void *ptr, size_t num, const char *file, int line)
int FIPS_mode_set(int r)
#define OPENSSL_EXPORT_VAR_AS_FUNCTION
#define OPENSSL_API_COMPAT
#define DEPRECATEDIN_1_1_0(f)
#define OPENSSL_MIN_API
#define OPENSSL_NO_RC5
Definition opensslconf.h:34
#define OPENSSL_THREADS
Definition opensslconf.h:37
#define DECLARE_DEPRECATED(f)
#define OPENSSL_FILE
#define OPENSSL_NO_HEARTBEATS
Definition opensslconf.h:73
#define OPENSSL_NO_SCTP
Definition opensslconf.h:79
#define OPENSSL_NO_UNIT_TEST
Definition opensslconf.h:97
#define OPENSSL_NO_CRYPTO_MDEBUG
Definition opensslconf.h:49
#define OPENSSL_NO_MD2
Definition opensslconf.h:31
#define OPENSSL_NO_SSL3_METHOD
Definition opensslconf.h:88
#define OPENSSL_LINE
#define OPENSSL_NO_SSL_TRACE
Definition opensslconf.h:82
#define OPENSSL_VERSION_NUMBER
Definition opensslv.h:42
struct bignum_ctx BN_CTX
Definition ossl_typ.h:81
struct x509_lookup_method_st X509_LOOKUP_METHOD
Definition ossl_typ.h:133
struct asn1_string_st ASN1_PRINTABLESTRING
Definition ossl_typ.h:44
struct asn1_string_st ASN1_IA5STRING
Definition ossl_typ.h:46
long ossl_intmax_t
Definition ossl_typ.h:190
struct evp_md_ctx_st EVP_MD_CTX
Definition ossl_typ.h:92
struct ocsp_response_st OCSP_RESPONSE
Definition ossl_typ.h:167
struct asn1_string_st ASN1_UNIVERSALSTRING
Definition ossl_typ.h:48
struct ssl_ctx_st SSL_CTX
Definition ossl_typ.h:149
struct asn1_string_st ASN1_T61STRING
Definition ossl_typ.h:45
struct conf_st CONF
Definition ossl_typ.h:141
struct sct_st SCT
Definition ossl_typ.h:170
struct AUTHORITY_KEYID_st AUTHORITY_KEYID
Definition ossl_typ.h:159
struct ctlog_store_st CTLOG_STORE
Definition ossl_typ.h:173
struct evp_pkey_st EVP_PKEY
Definition ossl_typ.h:93
struct bn_blinding_st BN_BLINDING
Definition ossl_typ.h:82
struct v3_ext_ctx X509V3_CTX
Definition ossl_typ.h:140
struct x509_store_st X509_STORE
Definition ossl_typ.h:128
struct X509_POLICY_TREE_st X509_POLICY_TREE
Definition ossl_typ.h:156
struct DIST_POINT_st DIST_POINT
Definition ossl_typ.h:160
struct asn1_string_st ASN1_ENUMERATED
Definition ossl_typ.h:41
struct x509_st X509
Definition ossl_typ.h:121
struct X509_POLICY_NODE_st X509_POLICY_NODE
Definition ossl_typ.h:154
struct evp_cipher_st EVP_CIPHER
Definition ossl_typ.h:89
struct rsa_meth_st RSA_METHOD
Definition ossl_typ.h:111
struct dh_st DH
Definition ossl_typ.h:104
struct X509_name_st X509_NAME
Definition ossl_typ.h:126
struct dh_method DH_METHOD
Definition ossl_typ.h:105
struct sct_ctx_st SCT_CTX
Definition ossl_typ.h:171
struct bn_recp_ctx_st BN_RECP_CTX
Definition ossl_typ.h:84
struct dsa_method DSA_METHOD
Definition ossl_typ.h:108
struct asn1_sctx_st ASN1_SCTX
Definition ossl_typ.h:64
struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS
Definition ossl_typ.h:162
struct ui_st UI
Definition ossl_typ.h:144
struct bignum_st BIGNUM
Definition ossl_typ.h:80
struct ssl_st SSL
Definition ossl_typ.h:148
struct evp_Encode_Ctx_st EVP_ENCODE_CTX
Definition ossl_typ.h:100
struct asn1_string_st ASN1_GENERALSTRING
Definition ossl_typ.h:47
struct ec_key_st EC_KEY
Definition ossl_typ.h:114
struct ossl_store_info_st OSSL_STORE_INFO
Definition ossl_typ.h:176
struct rsa_pss_params_st RSA_PSS_PARAMS
Definition ossl_typ.h:112
struct evp_pkey_method_st EVP_PKEY_METHOD
Definition ossl_typ.h:97
struct x509_revoked_st X509_REVOKED
Definition ossl_typ.h:125
struct crypto_ex_data_st CRYPTO_EX_DATA
Definition ossl_typ.h:164
struct asn1_pctx_st ASN1_PCTX
Definition ossl_typ.h:63
struct ocsp_responder_id_st OCSP_RESPID
Definition ossl_typ.h:168
struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX
Definition ossl_typ.h:174
struct ctlog_st CTLOG
Definition ossl_typ.h:172
struct X509_pubkey_st X509_PUBKEY
Definition ossl_typ.h:127
struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL
Definition ossl_typ.h:155
struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT
Definition ossl_typ.h:161
struct comp_ctx_st COMP_CTX
Definition ossl_typ.h:151
struct rsa_st RSA
Definition ossl_typ.h:110
struct ossl_init_settings_st OPENSSL_INIT_SETTINGS
Definition ossl_typ.h:142
struct comp_method_st COMP_METHOD
Definition ossl_typ.h:152
struct hmac_ctx_st HMAC_CTX
Definition ossl_typ.h:102
struct dsa_st DSA
Definition ossl_typ.h:107
struct X509_algor_st X509_ALGOR
Definition ossl_typ.h:122
struct evp_pkey_ctx_st EVP_PKEY_CTX
Definition ossl_typ.h:98
struct evp_cipher_ctx_st EVP_CIPHER_CTX
Definition ossl_typ.h:90
struct buf_mem_st BUF_MEM
Definition ossl_typ.h:87
struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO
Definition ossl_typ.h:138
int ASN1_BOOLEAN
Definition ossl_typ.h:56
struct engine_st ENGINE
Definition ossl_typ.h:147
struct x509_crl_method_st X509_CRL_METHOD
Definition ossl_typ.h:124
struct asn1_string_st ASN1_BMPSTRING
Definition ossl_typ.h:49
struct asn1_string_st ASN1_GENERALIZEDTIME
Definition ossl_typ.h:52
struct ossl_store_search_st OSSL_STORE_SEARCH
Definition ossl_typ.h:177
struct X509_crl_st X509_CRL
Definition ossl_typ.h:123
struct X509_POLICY_CACHE_st X509_POLICY_CACHE
Definition ossl_typ.h:157
struct ssl_dane_st SSL_DANE
Definition ossl_typ.h:120
struct asn1_string_st ASN1_STRING
Definition ossl_typ.h:55
struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD
Definition ossl_typ.h:95
struct asn1_string_st ASN1_UTF8STRING
Definition ossl_typ.h:54
struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM
Definition ossl_typ.h:134
struct x509_object_st X509_OBJECT
Definition ossl_typ.h:131
struct asn1_string_st ASN1_TIME
Definition ossl_typ.h:51
struct rand_drbg_st RAND_DRBG
Definition ossl_typ.h:118
struct evp_md_st EVP_MD
Definition ossl_typ.h:91
struct bn_gencb_st BN_GENCB
Definition ossl_typ.h:85
struct ui_method_st UI_METHOD
Definition ossl_typ.h:145
struct asn1_object_st ASN1_OBJECT
Definition ossl_typ.h:60
struct x509_store_ctx_st X509_STORE_CTX
Definition ossl_typ.h:129
unsigned long ossl_uintmax_t
Definition ossl_typ.h:191
struct ASN1_ITEM_st ASN1_ITEM
Definition ossl_typ.h:62
struct rand_meth_st RAND_METHOD
Definition ossl_typ.h:117
struct bn_mont_ctx_st BN_MONT_CTX
Definition ossl_typ.h:83
struct x509_sig_info_st X509_SIG_INFO
Definition ossl_typ.h:136
int ASN1_NULL
Definition ossl_typ.h:57
struct bio_st BIO
Definition ossl_typ.h:79
struct asn1_string_st ASN1_INTEGER
Definition ossl_typ.h:40
struct asn1_string_st ASN1_BIT_STRING
Definition ossl_typ.h:42
struct ocsp_req_ctx_st OCSP_REQ_CTX
Definition ossl_typ.h:166
struct asn1_string_st ASN1_UTCTIME
Definition ossl_typ.h:50
struct asn1_string_st ASN1_OCTET_STRING
Definition ossl_typ.h:43
struct ec_key_method_st EC_KEY_METHOD
Definition ossl_typ.h:115
struct asn1_string_st ASN1_VISIBLESTRING
Definition ossl_typ.h:53
struct x509_lookup_st X509_LOOKUP
Definition ossl_typ.h:132
int pem_password_cb(char *buf, int size, int rwflag, void *userdata)
Definition pem.h:231
#define DECLARE_PEM_rw(name, type)
Definition pem.h:222
char * OPENSSL_STRING
Definition safestack.h:149
#define DEFINE_SPECIAL_STACK_OF(t1, t2)
Definition safestack.h:129
#define SKM_DEFINE_STACK_OF(t1, t2, t3)
Definition safestack.h:22
const char * OPENSSL_CSTRING
Definition safestack.h:150
#define DEFINE_STACK_OF(t)
Definition safestack.h:130
#define DEFINE_SPECIAL_STACK_OF_CONST(t1, t2)
Definition safestack.h:131
void * OPENSSL_BLOCK
Definition safestack.h:166
#define STACK_OF(type)
Definition safestack.h:20
#define DEFINE_STACK_OF_CONST(t)
Definition safestack.h:133
#define SSL3_AD_HANDSHAKE_FAILURE
Definition ssl3.h:244
#define SSL3_AD_NO_CERTIFICATE
Definition ssl3.h:245
#define SSL3_AD_CLOSE_NOTIFY
Definition ssl3.h:240
#define SSL3_AD_UNSUPPORTED_CERTIFICATE
Definition ssl3.h:247
#define SSL3_AD_CERTIFICATE_UNKNOWN
Definition ssl3.h:250
#define SSL3_AD_BAD_RECORD_MAC
Definition ssl3.h:242
#define SSL3_AD_CERTIFICATE_EXPIRED
Definition ssl3.h:249
#define SSL3_AD_DECOMPRESSION_FAILURE
Definition ssl3.h:243
#define SSL3_AD_ILLEGAL_PARAMETER
Definition ssl3.h:251
#define SSL3_AD_BAD_CERTIFICATE
Definition ssl3.h:246
#define SSL3_AD_UNEXPECTED_MESSAGE
Definition ssl3.h:241
#define SSL3_AD_CERTIFICATE_REVOKED
Definition ssl3.h:248
#define SSL_get_shared_group(s, n)
void SSL_CTX_set_psk_client_callback(SSL_CTX *ctx, SSL_psk_client_cb_func cb)
void(* SSL_custom_ext_free_cb_ex)(SSL *s, unsigned int ext_type, unsigned int context, const unsigned char *out, void *add_arg)
Definition ssl.h:281
#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS
#define SSL_VERIFY_NONE
Definition ssl.h:1099
#define SSL_SECOP_OTHER_CURVE
Definition ssl.h:2274
#define SSL_CTRL_CERT_FLAGS
#define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
Definition ssl.h:326
#define SSL_CTRL_SET_TMP_DH
void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx, int(*new_session_cb)(struct ssl_st *ssl, SSL_SESSION *sess))
__owur int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e)
#define SSL_CTX_set1_groups(ctx, glist, glistlen)
void(* SSL_CTX_keylog_cb_func)(const SSL *ssl, const char *line)
Definition ssl.h:916
__owur int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos, unsigned int protos_len)
__owur int SSL_extension_supported(unsigned int ext_type)
#define DTLS_CTRL_SET_LINK_MTU
int SSL_in_before(const SSL *s)
#define SSL_CTRL_GET_RI_SUPPORT
#define SSL_CTRL_SET_TMP_ECDH
#define SSL_OP_NO_TLSv1_3
Definition ssl.h:381
#define SSL_CTRL_CHAIN_CERT
#define SSL_CTRL_SET_SPLIT_SEND_FRAGMENT
unsigned long SSL_CTX_clear_options(SSL_CTX *ctx, unsigned long op)
#define SSL_CTRL_SET_CLIENT_CERT_TYPES
int(*)(const SSL *s, const SSL_CTX *ctx, int op, int bits, int nid, void *other, void *ex) SSL_get_security_callback(const SSL *s)
Definition ssl.h:2333
void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, int(*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey))
#define SSL_CTRL_GET_RAW_CIPHERLIST
#define SSL_CTRL_CLEAR_CERT_FLAGS
__owur int SSL_CTX_add_client_custom_ext(SSL_CTX *ctx, unsigned int ext_type, custom_ext_add_cb add_cb, custom_ext_free_cb free_cb, void *add_arg, custom_ext_parse_cb parse_cb, void *parse_arg)
#define SSL_CTRL_GET_NUM_RENEGOTIATIONS
#define SSL_OP_TLSEXT_PADDING
Definition ssl.h:307
#define SSL_CTX_set1_groups_list(ctx, s)
#define SSL_OP_NO_DTLSv1_2
Definition ssl.h:384
uint32_t SSL_get_recv_max_early_data(const SSL *s)
#define SSL_CTRL_SET_SIGALGS
void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx, void(*remove_session_cb)(struct ssl_ctx_st *ctx, SSL_SESSION *sess))
int SSL_in_init(const SSL *s)
#define SSL_WRITING
Definition ssl.h:893
__owur int SSL_set_alpn_protos(SSL *ssl, const unsigned char *protos, unsigned int protos_len)
#define SSL_set1_groups_list(s, str)
#define SSL_CTRL_EXTRA_CHAIN_CERT
void SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data, unsigned *len)
#define SSL_CTRL_GET_PEER_SIGNATURE_NID
void SSL_CTX_set_stateless_cookie_generate_cb(SSL_CTX *ctx, int(*gen_stateless_cookie_cb)(SSL *ssl, unsigned char *cookie, size_t *cookie_len))
#define SSL_CTRL_GET_CLIENT_CERT_TYPES
struct ssl_conf_ctx_st SSL_CONF_CTX
Definition ssl.h:215
#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT
Definition ssl.h:1101
void SSL_CTX_set_stateless_cookie_verify_cb(SSL_CTX *ctx, int(*verify_stateless_cookie_cb)(SSL *ssl, const unsigned char *cookie, size_t cookie_len))
void SSL_set_psk_server_callback(SSL *ssl, SSL_psk_server_cb_func cb)
void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s, SSL_CTX_npn_select_cb_func cb, void *arg)
#define SSL_CTRL_SESS_HIT
void SSL_set_psk_client_callback(SSL *ssl, SSL_psk_client_cb_func cb)
#define SSL_CTX_set_read_ahead(ctx, m)
Definition ssl.h:2039
int SSL_CTX_set_recv_max_early_data(SSL_CTX *ctx, uint32_t recv_max_early_data)
#define SSL_CTRL_SESS_TIMEOUTS
#define SSL_CTRL_MODE
#define SSL_OP_SAFARI_ECDHE_ECDSA_BUG
Definition ssl.h:309
#define SSL_CTRL_GET_TMP_KEY
size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count)
int(* SSL_psk_find_session_cb_func)(SSL *ssl, const unsigned char *identity, size_t identity_len, SSL_SESSION **sess)
Definition ssl.h:845
size_t SSL_get_finished(const SSL *s, void *buf, size_t count)
#define SSL_CTRL_SET_VERIFY_CERT_STORE
struct ssl_comp_st SSL_COMP
Definition ssl.h:216
int(* SSL_custom_ext_parse_cb_ex)(SSL *s, unsigned int ext_type, unsigned int context, const unsigned char *in, size_t inlen, X509 *x, size_t chainidx, int *al, void *parse_arg)
Definition ssl.h:286
#define SSL_CTRL_SET_SESS_CACHE_SIZE
#define SSL_ASYNC_PAUSED
Definition ssl.h:896
#define SSL_CTRL_GET_CHAIN_CERTS
#define SSL_SECOP_OTHER_NONE
Definition ssl.h:2272
#define SSL_CTRL_SESS_ACCEPT
#define SSL_OP_LEGACY_SERVER_CONNECT
Definition ssl.h:304
#define SSL_CTRL_SET_MAX_SEND_FRAGMENT
struct ssl_cipher_st SSL_CIPHER
Definition ssl.h:212
__owur int SSL_select_next_proto(unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, const unsigned char *client, unsigned int client_len)
#define SSL_SECOP_OTHER_PKEY
Definition ssl.h:2276
#define SSL_CTRL_SESS_CONNECT_GOOD
#define SSL_READING
Definition ssl.h:894
void SSL_set_psk_use_session_callback(SSL *s, SSL_psk_use_session_cb_func cb)
int SSL_CTX_set_max_early_data(SSL_CTX *ctx, uint32_t max_early_data)
#define SSL_SECOP_OTHER_CERT
Definition ssl.h:2278
#define SSL_CTRL_SET_READ_AHEAD
#define SSL_NOTHING
Definition ssl.h:892
#define SSL_SECOP_OTHER_CIPHER
Definition ssl.h:2273
unsigned int(* SSL_psk_client_cb_func)(SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)
Definition ssl.h:823
#define SSL_CTRL_GET_SESS_CACHE_MODE
#define SSL_get1_groups(s, glist)
int(* GEN_SESSION_CB)(SSL *ssl, unsigned char *id, unsigned int *id_len)
Definition ssl.h:669
int(* SSL_psk_use_session_cb_func)(SSL *ssl, const EVP_MD *md, const unsigned char **id, size_t *idlen, SSL_SESSION **sess)
Definition ssl.h:849
#define SSL_CB_READ
Definition ssl.h:1059
int(* SSL_CTX_npn_advertised_cb_func)(SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg)
Definition ssl.h:766
void SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data, unsigned int *len)
__owur int SSL_CTX_has_client_custom_ext(const SSL_CTX *ctx, unsigned int ext_type)
#define SSL_set0_chain(s, sk)
__owur int SSL_SRP_CTX_init(SSL *s)
#define SSL_CTRL_GET_SHARED_GROUP
int SSL_SRP_CTX_free(SSL *ctx)
struct tls_session_ticket_ext_st TLS_SESSION_TICKET_EXT
Definition ssl.h:210
@ TLS_ST_CW_KEY_UPDATE
Definition ssl.h:1035
@ TLS_ST_CR_SRVR_HELLO
Definition ssl.h:995
@ TLS_ST_CR_HELLO_REQ
Definition ssl.h:1033
@ TLS_ST_BEFORE
Definition ssl.h:992
@ TLS_ST_SR_KEY_UPDATE
Definition ssl.h:1036
@ TLS_ST_CW_CERT
Definition ssl.h:1005
@ TLS_ST_SR_CERT
Definition ssl.h:1019
@ TLS_ST_CW_CLNT_HELLO
Definition ssl.h:1004
@ TLS_ST_SR_NEXT_PROTO
Definition ssl.h:1022
@ TLS_ST_SW_KEY_UPDATE
Definition ssl.h:1034
@ TLS_ST_SR_CHANGE
Definition ssl.h:1023
@ TLS_ST_SW_CERT_STATUS
Definition ssl.h:1026
@ DTLS_ST_SW_HELLO_VERIFY_REQUEST
Definition ssl.h:1013
@ TLS_ST_CW_CERT_VRFY
Definition ssl.h:1007
@ TLS_ST_SW_SESSION_TICKET
Definition ssl.h:1025
@ TLS_ST_CR_KEY_EXCH
Definition ssl.h:998
@ TLS_ST_SR_FINISHED
Definition ssl.h:1024
@ TLS_ST_PENDING_EARLY_DATA_END
Definition ssl.h:1039
@ TLS_ST_SW_CERT_REQ
Definition ssl.h:1017
@ TLS_ST_CR_KEY_UPDATE
Definition ssl.h:1037
@ TLS_ST_CR_CHANGE
Definition ssl.h:1002
@ TLS_ST_SR_CLNT_HELLO
Definition ssl.h:1012
@ DTLS_ST_CR_HELLO_VERIFY_REQUEST
Definition ssl.h:994
@ TLS_ST_SW_SRVR_HELLO
Definition ssl.h:1014
@ TLS_ST_SW_FINISHED
Definition ssl.h:1028
@ TLS_ST_CR_CERT_REQ
Definition ssl.h:999
@ TLS_ST_CR_ENCRYPTED_EXTENSIONS
Definition ssl.h:1030
@ TLS_ST_CW_END_OF_EARLY_DATA
Definition ssl.h:1040
@ TLS_ST_SW_SRVR_DONE
Definition ssl.h:1018
@ TLS_ST_CR_SRVR_DONE
Definition ssl.h:1000
@ TLS_ST_CR_CERT_STATUS
Definition ssl.h:997
@ TLS_ST_SW_HELLO_REQ
Definition ssl.h:1011
@ TLS_ST_SR_CERT_VRFY
Definition ssl.h:1021
@ TLS_ST_CR_CERT
Definition ssl.h:996
@ TLS_ST_OK
Definition ssl.h:993
@ TLS_ST_SR_KEY_EXCH
Definition ssl.h:1020
@ TLS_ST_SW_CERT_VRFY
Definition ssl.h:1032
@ TLS_ST_CW_NEXT_PROTO
Definition ssl.h:1009
@ TLS_ST_CW_KEY_EXCH
Definition ssl.h:1006
@ TLS_ST_CR_FINISHED
Definition ssl.h:1003
@ TLS_ST_CR_CERT_VRFY
Definition ssl.h:1031
@ TLS_ST_SW_KEY_EXCH
Definition ssl.h:1016
@ TLS_ST_CR_SESSION_TICKET
Definition ssl.h:1001
@ TLS_ST_CW_FINISHED
Definition ssl.h:1010
@ TLS_ST_EARLY_DATA
Definition ssl.h:1038
@ TLS_ST_SW_CERT
Definition ssl.h:1015
@ TLS_ST_SW_CHANGE
Definition ssl.h:1027
@ TLS_ST_CW_CHANGE
Definition ssl.h:1008
@ TLS_ST_SW_ENCRYPTED_EXTENSIONS
Definition ssl.h:1029
@ TLS_ST_SR_END_OF_EARLY_DATA
Definition ssl.h:1041
#define SSL_VERIFY_PEER
Definition ssl.h:1100
#define SSL_CB_EXIT
Definition ssl.h:1058
#define SSL_CTRL_GET_READ_AHEAD
struct ssl_method_st SSL_METHOD
Definition ssl.h:211
#define SSL_ST_ACCEPT
Definition ssl.h:1053
__owur int SSL_srp_server_param_with_username(SSL *s, int *ad)
#define SSL_OP_NO_TLSv1
Definition ssl.h:378
__owur int SSL_CTX_add_custom_ext(SSL_CTX *ctx, unsigned int ext_type, unsigned int context, SSL_custom_ext_add_cb_ex add_cb, SSL_custom_ext_free_cb_ex free_cb, void *add_arg, SSL_custom_ext_parse_cb_ex parse_cb, void *parse_arg)
#define SSL_CTRL_SESS_CB_HIT
void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, SSL_psk_server_cb_func cb)
int(*)(struct ssl_st *ssl, SSL_SESSION *sess) SSL_CTX_sess_get_new_cb(SSL_CTX *ctx)
Definition ssl.h:712
#define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP
Definition ssl.h:678
void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, int(*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len))
#define SSL_VERIFY_CLIENT_ONCE
Definition ssl.h:1102
__owur int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *identity_hint)
#define SSL_CTRL_SET_CURRENT_CERT
#define SSL_get_peer_tmp_key(s, pk)
#define SSL_OP_CRYPTOPRO_TLSEXT_BUG
Definition ssl.h:398
#define SSL_CTRL_SET_MAX_PROTO_VERSION
struct ssl_st * ssl_crock_st
Definition ssl.h:209
int(* tls_session_ticket_ext_cb_fn)(SSL *s, const unsigned char *data, int len, void *arg)
Definition ssl.h:229
#define DTLS_CTRL_GET_LINK_MIN_MTU
#define SSL_SECOP_EE_KEY
Definition ssl.h:2315
#define SSL_CTRL_SESS_CONNECT
#define DTLS_CTRL_GET_TIMEOUT
void SSL_CTX_set_info_callback(SSL_CTX *ctx, void(*cb)(const SSL *ssl, int type, int val))
uint32_t SSL_CTX_get_recv_max_early_data(const SSL_CTX *ctx)
unsigned long SSL_set_options(SSL *s, unsigned long op)
uint32_t SSL_get_max_early_data(const SSL *s)
#define SSL_CTRL_GET_PEER_TMP_KEY
#define SSL_CTRL_GET_GROUPS
#define SSL_CTRL_SESS_NUMBER
struct ssl_session_st SSL_SESSION
Definition ssl.h:213
#define SSL_SECOP_PEER
Definition ssl.h:2281
void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s, SSL_CTX_npn_advertised_cb_func cb, void *arg)
void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void(*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg))
#define SSL_OP_NO_TLSv1_2
Definition ssl.h:379
#define SSL_CTX_set0_chain(ctx, sk)
#define SSL_CTRL_GET_EXTRA_CHAIN_CERTS
int(* SSL_CTX_alpn_select_cb_func)(SSL *ssl, const unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
Definition ssl.h:804
#define SSL_SECOP_CA_MD
Definition ssl.h:2319
#define DTLS_CTRL_HANDLE_TIMEOUT
#define SSL_CTRL_SET_SESS_CACHE_MODE
#define SSL_CTRL_SET_CLIENT_SIGALGS_LIST
unsigned long SSL_get_options(const SSL *s)
#define SSL_CLIENT_HELLO_CB
Definition ssl.h:898
void SSL_set_msg_callback(SSL *ssl, void(*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg))
void SSL_CTX_set_psk_use_session_callback(SSL_CTX *ctx, SSL_psk_use_session_cb_func cb)
#define SSL_CB_WRITE
Definition ssl.h:1060
int(*)(SSL *ssl, X509 **x509, EVP_PKEY **pkey) SSL_CTX_get_client_cert_cb(SSL_CTX *ctx)
Definition ssl.h:736
#define SSL_OP_NO_SSLv3
Definition ssl.h:377
#define SSL_ST_CONNECT
Definition ssl.h:1052
unsigned long SSL_CTX_set_options(SSL_CTX *ctx, unsigned long op)
#define SSL_CTRL_GET_MIN_PROTO_VERSION
void(* custom_ext_free_cb)(SSL *s, unsigned int ext_type, const unsigned char *out, void *add_arg)
Definition ssl.h:266
const char * SSL_get_psk_identity(const SSL *s)
#define SSL_CTRL_SESS_CACHE_FULL
#define SSL_CTRL_GET_MAX_CERT_LIST
void(*)(const SSL *ssl, int type, int val) SSL_CTX_get_info_callback(SSL_CTX *ctx)
Definition ssl.h:731
const char * SSL_get_psk_identity_hint(const SSL *s)
#define SSL_CB_LOOP
Definition ssl.h:1057
#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS
int SSL_is_init_finished(const SSL *s)
#define SSL_CTRL_GET_MAX_PROTO_VERSION
#define SSL_CTRL_SELECT_CURRENT_CERT
#define SSL_CTRL_SESS_ACCEPT_GOOD
#define SSL_CTX_get_read_ahead(ctx)
Definition ssl.h:2037
#define SSL_CTRL_GET_SIGNATURE_NID
#define SSL_CTRL_CHAIN
#define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE
#define SSL_CTRL_SESS_MISSES
#define SSL_CTRL_SET_MSG_CALLBACK_ARG
int(* custom_ext_parse_cb)(SSL *s, unsigned int ext_type, const unsigned char *in, size_t inlen, int *al, void *parse_arg)
Definition ssl.h:269
#define SSL_CTRL_SET_SIGALGS_LIST
SSL_CTX_keylog_cb_func SSL_CTX_get_keylog_callback(const SSL_CTX *ctx)
#define SSL_CTRL_SET_GROUPS_LIST
void SSL_set_psk_find_session_callback(SSL *s, SSL_psk_find_session_cb_func cb)
#define SSL_SESS_CACHE_SERVER
Definition ssl.h:674
void SSL_CTX_set_keylog_callback(SSL_CTX *ctx, SSL_CTX_keylog_cb_func cb)
#define SSL_CTRL_SESS_CONNECT_RENEGOTIATE
#define SSL_CTRL_SET_GROUPS
#define SSL_CTRL_SET_MAX_CERT_LIST
#define SSL_CTRL_GET_EC_POINT_FORMATS
void(*)(struct ssl_ctx_st *ctx, SSL_SESSION *sess) SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx)
Definition ssl.h:718
#define SSL_SESS_CACHE_NO_INTERNAL_STORE
Definition ssl.h:679
#define SSL_X509_LOOKUP
Definition ssl.h:895
#define SSL_CTRL_SET_CLIENT_SIGALGS
int(* SSL_custom_ext_add_cb_ex)(SSL *s, unsigned int ext_type, unsigned int context, const unsigned char **out, size_t *outlen, X509 *x, size_t chainidx, int *al, void *add_arg)
Definition ssl.h:274
void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, const unsigned char *data, int len, int *copy))
#define SSL_CTRL_GET_SESS_CACHE_SIZE
#define SSL_CTRL_SET_MIN_PROTO_VERSION
unsigned long SSL_CTX_get_options(const SSL_CTX *ctx)
#define SSL_CTRL_BUILD_CERT_CHAIN
int(* tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len, STACK_OF(SSL_CIPHER) *peer_ciphers, const SSL_CIPHER **cipher, void *arg)
Definition ssl.h:231
__owur int SRP_Calc_A_param(SSL *s)
#define SSL_CTRL_CLEAR_MODE
struct tls_sigalgs_st TLS_SIGALGS
Definition ssl.h:214
void SSL_CTX_set_psk_find_session_callback(SSL_CTX *ctx, SSL_psk_find_session_cb_func cb)
uint32_t SSL_CTX_get_max_early_data(const SSL_CTX *ctx)
unsigned long SSL_clear_options(SSL *s, unsigned long op)
int SSL_set_recv_max_early_data(SSL *s, uint32_t recv_max_early_data)
#define SSL_CTRL_SET_CHAIN_CERT_STORE
#define SSL_ASYNC_NO_JOBS
Definition ssl.h:897
unsigned int(* SSL_psk_server_cb_func)(SSL *ssl, const char *identity, unsigned char *psk, unsigned int max_psk_len)
Definition ssl.h:832
__owur int SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, unsigned int ext_type, custom_ext_add_cb add_cb, custom_ext_free_cb free_cb, void *add_arg, custom_ext_parse_cb parse_cb, void *parse_arg)
#define SSL_OP_NO_DTLSv1
Definition ssl.h:383
void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, int(*app_verify_cookie_cb)(SSL *ssl, const unsigned char *cookie, unsigned int cookie_len))
#define SSL_CTRL_SET_MAX_PIPELINES
void(*)(const SSL *ssl, int type, int val) SSL_get_info_callback(const SSL *ssl)
Definition ssl.h:1993
#define SSL_library_init()
Definition ssl.h:1956
#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS
#define SSL_CTRL_SET_MTU
__owur int SSL_CTX_SRP_CTX_init(SSL_CTX *ctx)
#define SSL_CTRL_SET_DH_AUTO
#define OPENSSL_INIT_LOAD_SSL_STRINGS
Definition ssl.h:2357
void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx, SSL_CTX_alpn_select_cb_func cb, void *arg)
int SSL_set_max_early_data(SSL *s, uint32_t max_early_data)
int(* custom_ext_add_cb)(SSL *s, unsigned int ext_type, const unsigned char **out, size_t *outlen, int *al, void *add_arg)
Definition ssl.h:262
#define SSL_CTRL_GET_EXTMS_SUPPORT
int(* SSL_CTX_npn_select_cb_func)(SSL *s, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
Definition ssl.h:775
#define SSL_OP_NO_TLSv1_1
Definition ssl.h:380
#define SSL_SECOP_OTHER_SIGALG
Definition ssl.h:2277
#define SSL_set1_groups(s, glist, glistlen)
#define SSL_SECOP_CA_KEY
Definition ssl.h:2317
int SSL_CTX_SRP_CTX_free(SSL_CTX *ctx)
__owur int SSL_use_psk_identity_hint(SSL *s, const char *identity_hint)
#define SSL_SESS_CACHE_CLIENT
Definition ssl.h:673
int(* SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx)
Definition ssl.h:294
#define SSL_CB_ALERT
Definition ssl.h:1061
void(* OPENSSL_sk_freefunc)(void *)
Definition stack.h:20
void * OPENSSL_sk_delete_ptr(OPENSSL_STACK *st, const void *p)
void * OPENSSL_sk_delete(OPENSSL_STACK *st, int loc)
int OPENSSL_sk_reserve(OPENSSL_STACK *st, int n)
void OPENSSL_sk_zero(OPENSSL_STACK *st)
OPENSSL_STACK * OPENSSL_sk_deep_copy(const OPENSSL_STACK *, OPENSSL_sk_copyfunc c, OPENSSL_sk_freefunc f)
int OPENSSL_sk_is_sorted(const OPENSSL_STACK *st)
OPENSSL_STACK * OPENSSL_sk_new(OPENSSL_sk_compfunc cmp)
OPENSSL_STACK * OPENSSL_sk_new_null(void)
struct stack_st OPENSSL_STACK
Definition stack.h:17
int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
int(* OPENSSL_sk_compfunc)(const void *, const void *)
Definition stack.h:19
OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk, OPENSSL_sk_compfunc cmp)
OPENSSL_STACK * OPENSSL_sk_dup(const OPENSSL_STACK *st)
int OPENSSL_sk_insert(OPENSSL_STACK *sk, const void *data, int where)
void * OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data)
int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data)
void * OPENSSL_sk_pop(OPENSSL_STACK *st)
int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data)
int OPENSSL_sk_num(const OPENSSL_STACK *)
void *(* OPENSSL_sk_copyfunc)(const void *)
Definition stack.h:21
void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void(*func)(void *))
void * OPENSSL_sk_shift(OPENSSL_STACK *st)
void OPENSSL_sk_sort(OPENSSL_STACK *st)
OPENSSL_STACK * OPENSSL_sk_new_reserve(OPENSSL_sk_compfunc c, int n)
void * OPENSSL_sk_value(const OPENSSL_STACK *, int)
void OPENSSL_sk_free(OPENSSL_STACK *)
std::function< void(bool, std::string)> callback
Definition Requests.cpp:41
Family
Possible address families for socket addresses.
Definition SocketDefs.h:373
std::string privateKeyFile
Initializes the struct with default values.
Definition Context.h:134
std::string certificateFile
Definition Context.h:138
VerificationMode verificationMode
Definition Context.h:149
static std::string escape(const std::string &s, bool strictJSON=false)
ASN1_TYPE * parameter
Definition x509.h:61
ASN1_OBJECT * algorithm
Definition x509.h:60
ASN1_TIME * notBefore
Definition x509.h:67
ASN1_TIME * notAfter
Definition x509.h:68
unsigned long flags
Definition buffer.h:42
size_t max
Definition buffer.h:41
size_t length
Definition buffer.h:39
char * data
Definition buffer.h:40
const char * name
Definition ssl.h:223
unsigned long id
Definition ssl.h:224
char * name
Definition x509.h:107
int(* check_trust)(struct x509_trust_st *, X509 *, int)
Definition x509.h:106
int trust
Definition x509.h:104
int flags
Definition x509.h:105
void * arg2
Definition x509.h:109
#define TLS1_AD_RECORD_OVERFLOW
Definition tls1.h:52
#define TLS1_AD_EXPORT_RESTRICTION
Definition tls1.h:57
#define TLS1_AD_UNKNOWN_CA
Definition tls1.h:53
#define TLS13_AD_MISSING_EXTENSION
Definition tls1.h:65
#define TLS1_AD_NO_RENEGOTIATION
Definition tls1.h:63
#define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE
Definition tls1.h:71
#define TLS1_AD_UNKNOWN_PSK_IDENTITY
Definition tls1.h:73
#define TLS1_AD_INSUFFICIENT_SECURITY
Definition tls1.h:59
#define TLS1_AD_PROTOCOL_VERSION
Definition tls1.h:58
#define TLS1_AD_USER_CANCELLED
Definition tls1.h:62
#define TLS1_AD_INTERNAL_ERROR
Definition tls1.h:60
#define TLS1_AD_NO_APPLICATION_PROTOCOL
Definition tls1.h:74
#define TLS1_AD_CERTIFICATE_UNOBTAINABLE
Definition tls1.h:69
#define TLS1_AD_UNSUPPORTED_EXTENSION
Definition tls1.h:68
#define TLS1_AD_ACCESS_DENIED
Definition tls1.h:54
#define TLS1_AD_DECODE_ERROR
Definition tls1.h:55
#define TLS1_AD_UNRECOGNIZED_NAME
Definition tls1.h:70
#define TLS1_AD_DECRYPT_ERROR
Definition tls1.h:56
#define TLS13_AD_CERTIFICATE_REQUIRED
Definition tls1.h:66
#define TLS1_AD_INAPPROPRIATE_FALLBACK
Definition tls1.h:61
#define TLS1_AD_DECRYPTION_FAILED
Definition tls1.h:51
#define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE
Definition tls1.h:72
#define FMT_THROW(x)
Definition format.h:222
#define FMT_NULL
Definition format.h:273
#define X509_FILETYPE_PEM
Definition x509.h:44
#define X509_FILETYPE_ASN1
Definition x509.h:45
struct X509_name_entry_st X509_NAME_ENTRY
Definition x509.h:73
#define XN_FLAG_DUMP_UNKNOWN_FIELDS
Definition x509.h:194
struct X509_req_info_st X509_REQ_INFO
Definition x509.h:91
#define XN_FLAG_DN_REV
Definition x509.h:176
#define XN_FLAG_FN_SN
Definition x509.h:182
struct X509_req_st X509_REQ
Definition x509.h:93
#define XN_FLAG_SEP_CPLUS_SPC
Definition x509.h:172
#define XN_FLAG_SEP_MULTILINE
Definition x509.h:174
struct x509_cinf_st X509_CINF
Definition x509.h:97
#define XN_FLAG_SPC_EQ
Definition x509.h:187
#define XN_FLAG_FN_LN
Definition x509.h:183
struct X509_sig_st X509_SIG
Definition x509.h:71
struct X509_extension_st X509_EXTENSION
Definition x509.h:81
struct x509_cert_aux_st X509_CERT_AUX
Definition x509.h:95
#define XN_FLAG_FN_ALIGN
Definition x509.h:196
struct x509_attributes_st X509_ATTRIBUTE
Definition x509.h:87
#define XN_FLAG_SEP_COMMA_PLUS
Definition x509.h:171
int(*)(int, X509 *, int) X509_TRUST_set_default(int(*trust)(int, X509 *, int))
Definition x509.h:580