rand: core APIs for provider friendly random.
[openssl.git] / include / openssl / types.h
1 /*
2  * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License 2.0 (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 #ifndef OPENSSL_TYPES_H
11 # define OPENSSL_TYPES_H
12
13 #include <limits.h>
14
15 #ifdef  __cplusplus
16 extern "C" {
17 #endif
18
19 # include <openssl/e_os2.h>
20 # include <openssl/safestack.h>
21
22 typedef struct ossl_provider_st OSSL_PROVIDER; /* Provider Object */
23
24 # ifdef NO_ASN1_TYPEDEFS
25 #  define ASN1_INTEGER            ASN1_STRING
26 #  define ASN1_ENUMERATED         ASN1_STRING
27 #  define ASN1_BIT_STRING         ASN1_STRING
28 #  define ASN1_OCTET_STRING       ASN1_STRING
29 #  define ASN1_PRINTABLESTRING    ASN1_STRING
30 #  define ASN1_T61STRING          ASN1_STRING
31 #  define ASN1_IA5STRING          ASN1_STRING
32 #  define ASN1_UTCTIME            ASN1_STRING
33 #  define ASN1_GENERALIZEDTIME    ASN1_STRING
34 #  define ASN1_TIME               ASN1_STRING
35 #  define ASN1_GENERALSTRING      ASN1_STRING
36 #  define ASN1_UNIVERSALSTRING    ASN1_STRING
37 #  define ASN1_BMPSTRING          ASN1_STRING
38 #  define ASN1_VISIBLESTRING      ASN1_STRING
39 #  define ASN1_UTF8STRING         ASN1_STRING
40 #  define ASN1_BOOLEAN            int
41 #  define ASN1_NULL               int
42 # else
43 typedef struct asn1_string_st ASN1_INTEGER;
44 typedef struct asn1_string_st ASN1_ENUMERATED;
45 typedef struct asn1_string_st ASN1_BIT_STRING;
46 typedef struct asn1_string_st ASN1_OCTET_STRING;
47 typedef struct asn1_string_st ASN1_PRINTABLESTRING;
48 typedef struct asn1_string_st ASN1_T61STRING;
49 typedef struct asn1_string_st ASN1_IA5STRING;
50 typedef struct asn1_string_st ASN1_GENERALSTRING;
51 typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
52 typedef struct asn1_string_st ASN1_BMPSTRING;
53 typedef struct asn1_string_st ASN1_UTCTIME;
54 typedef struct asn1_string_st ASN1_TIME;
55 typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
56 typedef struct asn1_string_st ASN1_VISIBLESTRING;
57 typedef struct asn1_string_st ASN1_UTF8STRING;
58 typedef struct asn1_string_st ASN1_STRING;
59 typedef int ASN1_BOOLEAN;
60 typedef int ASN1_NULL;
61 # endif
62
63 typedef struct asn1_type_st ASN1_TYPE;
64 typedef struct asn1_object_st ASN1_OBJECT;
65 typedef struct asn1_string_table_st ASN1_STRING_TABLE;
66
67 typedef struct ASN1_ITEM_st ASN1_ITEM;
68 typedef struct asn1_pctx_st ASN1_PCTX;
69 typedef struct asn1_sctx_st ASN1_SCTX;
70
71 # ifdef _WIN32
72 #  undef X509_NAME
73 #  undef X509_EXTENSIONS
74 #  undef PKCS7_ISSUER_AND_SERIAL
75 #  undef PKCS7_SIGNER_INFO
76 #  undef OCSP_REQUEST
77 #  undef OCSP_RESPONSE
78 # endif
79
80 # ifdef BIGNUM
81 #  undef BIGNUM
82 # endif
83
84 typedef struct bio_st BIO;
85 typedef struct bignum_st BIGNUM;
86 typedef struct bignum_ctx BN_CTX;
87 typedef struct bn_blinding_st BN_BLINDING;
88 typedef struct bn_mont_ctx_st BN_MONT_CTX;
89 typedef struct bn_recp_ctx_st BN_RECP_CTX;
90 typedef struct bn_gencb_st BN_GENCB;
91
92 typedef struct buf_mem_st BUF_MEM;
93
94 STACK_OF(BIGNUM);
95 STACK_OF(BIGNUM_const);
96
97 typedef struct err_state_st ERR_STATE;
98
99 typedef struct evp_cipher_st EVP_CIPHER;
100 typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
101 typedef struct evp_md_st EVP_MD;
102 typedef struct evp_md_ctx_st EVP_MD_CTX;
103 typedef struct evp_mac_st EVP_MAC;
104 typedef struct evp_mac_ctx_st EVP_MAC_CTX;
105 typedef struct evp_pkey_st EVP_PKEY;
106
107 typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;
108
109 typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
110 typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
111
112 typedef struct evp_keymgmt_st EVP_KEYMGMT;
113
114 typedef struct evp_kdf_st EVP_KDF;
115 typedef struct evp_kdf_ctx_st EVP_KDF_CTX;
116
117 typedef struct evp_rand_st EVP_RAND;
118 typedef struct evp_rand_ctx_st EVP_RAND_CTX;
119
120 typedef struct evp_keyexch_st EVP_KEYEXCH;
121
122 typedef struct evp_signature_st EVP_SIGNATURE;
123
124 typedef struct evp_asym_cipher_st EVP_ASYM_CIPHER;
125
126 typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX;
127
128 typedef struct hmac_ctx_st HMAC_CTX;
129
130 typedef struct dh_st DH;
131 typedef struct dh_method DH_METHOD;
132
133 typedef struct dsa_st DSA;
134 typedef struct dsa_method DSA_METHOD;
135
136 typedef struct rsa_st RSA;
137 typedef struct rsa_meth_st RSA_METHOD;
138 typedef struct rsa_pss_params_st RSA_PSS_PARAMS;
139
140 typedef struct ec_key_st EC_KEY;
141 typedef struct ec_key_method_st EC_KEY_METHOD;
142
143 typedef struct rand_meth_st RAND_METHOD;
144 typedef struct rand_drbg_st RAND_DRBG;
145
146 typedef struct ssl_dane_st SSL_DANE;
147 typedef struct x509_st X509;
148 typedef struct X509_algor_st X509_ALGOR;
149 typedef struct X509_crl_st X509_CRL;
150 typedef struct x509_crl_method_st X509_CRL_METHOD;
151 typedef struct x509_revoked_st X509_REVOKED;
152 typedef struct X509_name_st X509_NAME;
153 typedef struct X509_pubkey_st X509_PUBKEY;
154 typedef struct x509_store_st X509_STORE;
155 typedef struct x509_store_ctx_st X509_STORE_CTX;
156
157 typedef struct x509_object_st X509_OBJECT;
158 typedef struct x509_lookup_st X509_LOOKUP;
159 typedef struct x509_lookup_method_st X509_LOOKUP_METHOD;
160 typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM;
161
162 typedef struct x509_sig_info_st X509_SIG_INFO;
163
164 typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
165
166 typedef struct v3_ext_ctx X509V3_CTX;
167 typedef struct conf_st CONF;
168 typedef struct ossl_init_settings_st OPENSSL_INIT_SETTINGS;
169
170 typedef struct ui_st UI;
171 typedef struct ui_method_st UI_METHOD;
172
173 typedef struct engine_st ENGINE;
174 typedef struct ssl_st SSL;
175 typedef struct ssl_ctx_st SSL_CTX;
176
177 typedef struct comp_ctx_st COMP_CTX;
178 typedef struct comp_method_st COMP_METHOD;
179
180 typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
181 typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
182 typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
183 typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
184
185 typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID;
186 typedef struct DIST_POINT_st DIST_POINT;
187 typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
188 typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
189
190 typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
191
192 typedef struct ossl_http_req_ctx_st OCSP_REQ_CTX; /* backward compatibility */
193 typedef struct ocsp_response_st OCSP_RESPONSE;
194 typedef struct ocsp_responder_id_st OCSP_RESPID;
195
196 typedef struct sct_st SCT;
197 typedef struct sct_ctx_st SCT_CTX;
198 typedef struct ctlog_st CTLOG;
199 typedef struct ctlog_store_st CTLOG_STORE;
200 typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX;
201
202 typedef struct ossl_store_info_st OSSL_STORE_INFO;
203 typedef struct ossl_store_search_st OSSL_STORE_SEARCH;
204
205 typedef struct openssl_ctx_st OPENSSL_CTX;
206
207 typedef struct ossl_dispatch_st OSSL_DISPATCH;
208 typedef struct ossl_item_st OSSL_ITEM;
209 typedef struct ossl_algorithm_st OSSL_ALGORITHM;
210 typedef struct ossl_param_st OSSL_PARAM;
211 typedef struct ossl_param_bld_st OSSL_PARAM_BLD;
212
213 typedef int pem_password_cb (char *buf, int size, int rwflag, void *userdata);
214
215 typedef struct ossl_serializer_st OSSL_SERIALIZER;
216 typedef struct ossl_serializer_ctx_st OSSL_SERIALIZER_CTX;
217
218 typedef struct ossl_self_test_st OSSL_SELF_TEST;
219
220 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
221     defined(INTMAX_MAX) && defined(UINTMAX_MAX)
222 typedef intmax_t ossl_intmax_t;
223 typedef uintmax_t ossl_uintmax_t;
224 #else
225 /*
226  * Not long long, because the C-library can only be expected to provide
227  * strtoll(), strtoull() at the same time as intmax_t and strtoimax(),
228  * strtoumax().  Since we use these for parsing arguments, we need the
229  * conversion functions, not just the sizes.
230  */
231 typedef long ossl_intmax_t;
232 typedef unsigned long ossl_uintmax_t;
233 #endif
234
235 #ifdef  __cplusplus
236 }
237 #endif
238
239 #endif /* OPENSSL_TYPES_H */