1/*
2 * Copyright 2001-2026 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/*
11 * Unfortunate workaround to avoid symbol conflict with wincrypt.h
12 * See https://github.com/openssl/openssl/issues/9981
13 */
14
15#ifdef _WIN32
16#define WINCRYPT_USE_SYMBOL_PREFIX
17#undef X509_NAME
18#undef X509_EXTENSIONS
19#undef PKCS7_SIGNER_INFO
20#undef OCSP_REQUEST
21#undef OCSP_RESPONSE
22#endif
23
24#ifndef OPENSSL_TYPES_H
25#define OPENSSL_TYPES_H
26
27#include <limits.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include <openssl/e_os2.h>
34#include <openssl/safestack.h>
35#include <openssl/macros.h>
36
37typedef struct ossl_provider_st OSSL_PROVIDER; /* Provider Object */
38
39#ifdef NO_ASN1_TYPEDEFS
40typedef ASN1_STRING ASN1_INTEGER;
41typedef ASN1_STRING ASN1_ENUMERATED;
42typedef ASN1_STRING ASN1_BIT_STRING;
43typedef ASN1_STRING ASN1_OCTET_STRING;
44typedef ASN1_STRING ASN1_PRINTABLESTRING;
45typedef ASN1_STRING ASN1_T61STRING;
46typedef ASN1_STRING ASN1_IA5STRING;
47typedef ASN1_STRING ASN1_UTCTIME;
48typedef ASN1_STRING ASN1_GENERALIZEDTIME;
49typedef ASN1_STRING ASN1_TIME;
50typedef ASN1_STRING ASN1_GENERALSTRING;
51typedef ASN1_STRING ASN1_UNIVERSALSTRING;
52typedef ASN1_STRING ASN1_BMPSTRING;
53typedef ASN1_STRING ASN1_VISIBLESTRING;
54typedef ASN1_STRING ASN1_UTF8STRING;
55typedef int ASN1_BOOLEAN;
56typedef int ASN1_NULL;
57#else
58typedef struct asn1_string_st ASN1_INTEGER;
59typedef struct asn1_string_st ASN1_ENUMERATED;
60typedef struct asn1_string_st ASN1_BIT_STRING;
61typedef struct asn1_string_st ASN1_OCTET_STRING;
62typedef struct asn1_string_st ASN1_PRINTABLESTRING;
63typedef struct asn1_string_st ASN1_T61STRING;
64typedef struct asn1_string_st ASN1_IA5STRING;
65typedef struct asn1_string_st ASN1_GENERALSTRING;
66typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
67typedef struct asn1_string_st ASN1_BMPSTRING;
68typedef struct asn1_string_st ASN1_UTCTIME;
69typedef struct asn1_string_st ASN1_TIME;
70typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
71typedef struct asn1_string_st ASN1_VISIBLESTRING;
72typedef struct asn1_string_st ASN1_UTF8STRING;
73typedef struct asn1_string_st ASN1_STRING;
74typedef int ASN1_BOOLEAN;
75typedef int ASN1_NULL;
76#endif
77
78typedef struct asn1_type_st ASN1_TYPE;
79typedef struct asn1_object_st ASN1_OBJECT;
80typedef struct asn1_string_table_st ASN1_STRING_TABLE;
81
82typedef struct ASN1_ITEM_st ASN1_ITEM;
83typedef struct asn1_pctx_st ASN1_PCTX;
84typedef struct asn1_sctx_st ASN1_SCTX;
85
86#ifdef BIGNUM
87#undef BIGNUM
88#endif
89
90typedef struct bio_st BIO;
91typedef struct bignum_st BIGNUM;
92typedef struct bignum_ctx BN_CTX;
93typedef struct bn_blinding_st BN_BLINDING;
94typedef struct bn_mont_ctx_st BN_MONT_CTX;
95typedef struct bn_recp_ctx_st BN_RECP_CTX;
96typedef struct bn_gencb_st BN_GENCB;
97
98typedef struct buf_mem_st BUF_MEM;
99
100STACK_OF(BIGNUM);
101STACK_OF(BIGNUM_const);
102
103typedef struct err_state_st ERR_STATE;
104
105typedef struct evp_cipher_st EVP_CIPHER;
106typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
107typedef struct evp_md_st EVP_MD;
108typedef struct evp_md_ctx_st EVP_MD_CTX;
109typedef struct evp_mac_st EVP_MAC;
110typedef struct evp_mac_ctx_st EVP_MAC_CTX;
111typedef struct evp_pkey_st EVP_PKEY;
112typedef struct evp_skey_st EVP_SKEY;
113
114typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;
115
116typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
117typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
118
119typedef struct evp_keymgmt_st EVP_KEYMGMT;
120
121typedef struct evp_kdf_st EVP_KDF;
122typedef struct evp_kdf_ctx_st EVP_KDF_CTX;
123
124typedef struct evp_rand_st EVP_RAND;
125typedef struct evp_rand_ctx_st EVP_RAND_CTX;
126
127typedef struct evp_keyexch_st EVP_KEYEXCH;
128
129typedef struct evp_signature_st EVP_SIGNATURE;
130
131typedef struct evp_skeymgmt_st EVP_SKEYMGMT;
132
133typedef struct evp_asym_cipher_st EVP_ASYM_CIPHER;
134
135typedef struct evp_kem_st EVP_KEM;
136
137typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX;
138
139typedef struct hmac_ctx_st HMAC_CTX;
140
141typedef struct dh_st DH;
142typedef struct dh_method DH_METHOD;
143
144#ifndef OPENSSL_NO_DEPRECATED_3_0
145typedef struct dsa_st DSA;
146typedef struct dsa_method DSA_METHOD;
147#endif
148
149#ifndef OPENSSL_NO_DEPRECATED_3_0
150typedef struct rsa_st RSA;
151typedef struct rsa_meth_st RSA_METHOD;
152#endif
153
154typedef struct rsa_pss_params_st RSA_PSS_PARAMS;
155typedef struct rsa_oaep_params_st RSA_OAEP_PARAMS;
156
157#ifndef OPENSSL_NO_DEPRECATED_3_0
158typedef struct ec_key_st EC_KEY;
159typedef struct ec_key_method_st EC_KEY_METHOD;
160#endif
161
162typedef struct rand_meth_st RAND_METHOD;
163
164typedef struct ssl_dane_st SSL_DANE;
165typedef struct x509_st X509;
166typedef struct X509_algor_st X509_ALGOR;
167typedef struct X509_crl_st X509_CRL;
168typedef struct x509_crl_method_st X509_CRL_METHOD;
169typedef struct x509_revoked_st X509_REVOKED;
170typedef struct X509_name_st X509_NAME;
171typedef struct X509_pubkey_st X509_PUBKEY;
172typedef struct x509_store_st X509_STORE;
173typedef struct x509_store_ctx_st X509_STORE_CTX;
174
175typedef struct x509_object_st X509_OBJECT;
176typedef struct x509_lookup_st X509_LOOKUP;
177typedef struct x509_lookup_method_st X509_LOOKUP_METHOD;
178typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM;
179
180typedef struct x509_sig_info_st X509_SIG_INFO;
181
182typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
183
184typedef struct v3_ext_ctx X509V3_CTX;
185typedef struct conf_st CONF;
186typedef struct ossl_init_settings_st OPENSSL_INIT_SETTINGS;
187
188typedef struct ui_st UI;
189typedef struct ui_method_st UI_METHOD;
190
191typedef struct engine_st ENGINE;
192typedef struct ssl_st SSL;
193typedef struct ssl_ctx_st SSL_CTX;
194
195typedef struct comp_ctx_st COMP_CTX;
196typedef struct comp_method_st COMP_METHOD;
197
198typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
199typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
200typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
201typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
202
203typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID;
204typedef struct DIST_POINT_st DIST_POINT;
205typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
206typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
207
208typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
209
210typedef struct ossl_http_req_ctx_st OSSL_HTTP_REQ_CTX;
211typedef struct ocsp_response_st OCSP_RESPONSE;
212typedef struct ocsp_responder_id_st OCSP_RESPID;
213
214typedef struct sct_st SCT;
215typedef struct sct_ctx_st SCT_CTX;
216typedef struct ctlog_st CTLOG;
217typedef struct ctlog_store_st CTLOG_STORE;
218typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX;
219
220typedef struct ossl_store_info_st OSSL_STORE_INFO;
221typedef struct ossl_store_search_st OSSL_STORE_SEARCH;
222typedef struct ossl_store_loader_st OSSL_STORE_LOADER;
223
224typedef struct ossl_lib_ctx_st OSSL_LIB_CTX;
225
226typedef struct ossl_dispatch_st OSSL_DISPATCH;
227typedef struct ossl_item_st OSSL_ITEM;
228typedef struct ossl_algorithm_st OSSL_ALGORITHM;
229typedef struct ossl_param_st OSSL_PARAM;
230typedef struct ossl_param_bld_st OSSL_PARAM_BLD;
231
232typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata);
233
234typedef struct ossl_encoder_st OSSL_ENCODER;
235typedef struct ossl_encoder_ctx_st OSSL_ENCODER_CTX;
236typedef struct ossl_decoder_st OSSL_DECODER;
237typedef struct ossl_decoder_ctx_st OSSL_DECODER_CTX;
238
239typedef struct ossl_self_test_st OSSL_SELF_TEST;
240
241#ifndef OPENSSL_NO_ECH
242/* opaque type for ECH related information */
243typedef struct ossl_echstore_st OSSL_ECHSTORE;
244#endif
245
246#ifdef __cplusplus
247}
248#endif
249
250#endif /* OPENSSL_TYPES_H */
251