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