1 /* $OpenBSD: ossl_typ.h,v 1.13 2015/09/30 04:10:07 doug Exp $ */ 2 /* ==================================================================== 3 * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in 14 * the documentation and/or other materials provided with the 15 * distribution. 16 * 17 * 3. All advertising materials mentioning features or use of this 18 * software must display the following acknowledgment: 19 * "This product includes software developed by the OpenSSL Project 20 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 21 * 22 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 23 * endorse or promote products derived from this software without 24 * prior written permission. For written permission, please contact 25 * openssl-core@openssl.org. 26 * 27 * 5. Products derived from this software may not be called "OpenSSL" 28 * nor may "OpenSSL" appear in their names without prior written 29 * permission of the OpenSSL Project. 30 * 31 * 6. Redistributions of any form whatsoever must retain the following 32 * acknowledgment: 33 * "This product includes software developed by the OpenSSL Project 34 * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 35 * 36 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 37 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 39 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 40 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 41 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 42 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 45 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 46 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 47 * OF THE POSSIBILITY OF SUCH DAMAGE. 48 * ==================================================================== 49 * 50 * This product includes cryptographic software written by Eric Young 51 * (eay@cryptsoft.com). This product includes software written by Tim 52 * Hudson (tjh@cryptsoft.com). 53 * 54 */ 55 module libressl_d.openssl.ossl_typ; 56 57 58 private static import core.stdc.config; 59 private static import libressl_d.openssl.asn1; 60 private static import libressl_d.openssl.asn1t; 61 private static import libressl_d.openssl.bn; 62 private static import libressl_d.openssl.buffer; 63 private static import libressl_d.openssl.conf; 64 private static import libressl_d.openssl.crypto; 65 private static import libressl_d.openssl.dh; 66 private static import libressl_d.openssl.dsa; 67 private static import libressl_d.openssl.ecdsa; 68 private static import libressl_d.openssl.evp; 69 private static import libressl_d.openssl.ocsp; 70 private static import libressl_d.openssl.rand; 71 private static import libressl_d.openssl.rsa; 72 private static import libressl_d.openssl.ssl; 73 private static import libressl_d.openssl.x509; 74 private static import libressl_d.openssl.x509_vfy; 75 private static import libressl_d.openssl.x509v3; 76 public import libressl_d.openssl.opensslconf; 77 78 alias ASN1_INTEGER = libressl_d.openssl.asn1.asn1_string_st; 79 alias ASN1_ENUMERATED = libressl_d.openssl.asn1.asn1_string_st; 80 alias ASN1_BIT_STRING = libressl_d.openssl.asn1.asn1_string_st; 81 alias ASN1_OCTET_STRING = libressl_d.openssl.asn1.asn1_string_st; 82 alias ASN1_PRINTABLESTRING = libressl_d.openssl.asn1.asn1_string_st; 83 alias ASN1_T61STRING = libressl_d.openssl.asn1.asn1_string_st; 84 alias ASN1_IA5STRING = libressl_d.openssl.asn1.asn1_string_st; 85 alias ASN1_GENERALSTRING = libressl_d.openssl.asn1.asn1_string_st; 86 alias ASN1_UNIVERSALSTRING = libressl_d.openssl.asn1.asn1_string_st; 87 alias ASN1_BMPSTRING = libressl_d.openssl.asn1.asn1_string_st; 88 alias ASN1_UTCTIME = libressl_d.openssl.asn1.asn1_string_st; 89 alias ASN1_TIME = libressl_d.openssl.asn1.asn1_string_st; 90 alias ASN1_GENERALIZEDTIME = libressl_d.openssl.asn1.asn1_string_st; 91 alias ASN1_VISIBLESTRING = libressl_d.openssl.asn1.asn1_string_st; 92 alias ASN1_UTF8STRING = libressl_d.openssl.asn1.asn1_string_st; 93 alias ASN1_STRING = libressl_d.openssl.asn1.asn1_string_st; 94 alias ASN1_BOOLEAN = int; 95 alias ASN1_NULL = int; 96 97 alias ASN1_ITEM = libressl_d.openssl.asn1t.ASN1_ITEM_st; 98 struct asn1_pctx_st; 99 alias ASN1_PCTX = .asn1_pctx_st; 100 101 //#if defined(_WIN32) && defined(__WINCRYPT_H__) 102 version (LIBRESSL_INTERNAL) { 103 } else { 104 //pragma(msg, "Warning, overriding WinCrypt defines"); 105 } 106 107 //#undef X509_NAME 108 //#undef libressl_d.openssl.x509.X509_CERT_PAIR 109 //#undef X509_EXTENSIONS 110 //#undef OCSP_REQUEST 111 //#undef OCSP_RESPONSE 112 //#undef PKCS7_ISSUER_AND_SERIAL 113 //#endif 114 115 alias BIGNUM = libressl_d.openssl.bn.bignum_st; 116 117 struct bignum_ctx; 118 alias BN_CTX = .bignum_ctx; 119 120 struct bn_blinding_st; 121 alias BN_BLINDING = .bn_blinding_st; 122 123 alias BN_MONT_CTX = libressl_d.openssl.bn.bn_mont_ctx_st; 124 alias BN_RECP_CTX = libressl_d.openssl.bn.bn_recp_ctx_st; 125 alias BN_GENCB = libressl_d.openssl.bn.bn_gencb_st; 126 127 alias BUF_MEM = libressl_d.openssl.buffer.buf_mem_st; 128 129 alias EVP_CIPHER = libressl_d.openssl.evp.evp_cipher_st; 130 131 alias EVP_CIPHER_CTX = libressl_d.openssl.evp.evp_cipher_ctx_st; 132 alias EVP_MD = libressl_d.openssl.evp.env_md_st; 133 alias EVP_MD_CTX = libressl_d.openssl.evp.env_md_ctx_st; 134 alias EVP_PKEY = libressl_d.openssl.evp.evp_pkey_st; 135 136 struct evp_pkey_asn1_method_st; 137 alias EVP_PKEY_ASN1_METHOD = .evp_pkey_asn1_method_st; 138 139 struct evp_pkey_method_st; 140 alias EVP_PKEY_METHOD = .evp_pkey_method_st; 141 142 struct evp_pkey_ctx_st; 143 alias EVP_PKEY_CTX = .evp_pkey_ctx_st; 144 145 alias DH = libressl_d.openssl.dh.dh_st; 146 alias DH_METHOD = libressl_d.openssl.dh.dh_method; 147 148 alias DSA = libressl_d.openssl.dsa.dsa_st; 149 alias DSA_METHOD = libressl_d.openssl.dsa.dsa_method; 150 151 alias RSA = libressl_d.openssl.rsa.rsa_st; 152 alias RSA_METHOD = libressl_d.openssl.rsa.rsa_meth_st; 153 154 alias RAND_METHOD = libressl_d.openssl.rand.rand_meth_st; 155 156 struct ecdh_method; 157 alias ECDH_METHOD = .ecdh_method; 158 159 alias ECDSA_METHOD = libressl_d.openssl.ecdsa.ecdsa_method; 160 161 alias X509 = libressl_d.openssl.x509.x509_st; 162 alias X509_ALGOR = libressl_d.openssl.x509.X509_algor_st; 163 alias X509_CRL = libressl_d.openssl.x509.X509_crl_st; 164 struct x509_crl_method_st; 165 alias X509_CRL_METHOD = .x509_crl_method_st; 166 alias X509_REVOKED = libressl_d.openssl.x509.x509_revoked_st; 167 alias X509_NAME = libressl_d.openssl.x509.X509_name_st; 168 alias X509_PUBKEY = libressl_d.openssl.x509.X509_pubkey_st; 169 alias X509_STORE = libressl_d.openssl.x509_vfy.x509_store_st; 170 alias X509_STORE_CTX = libressl_d.openssl.x509_vfy.x509_store_ctx_st; 171 172 alias PKCS8_PRIV_KEY_INFO = libressl_d.openssl.x509.pkcs8_priv_key_info_st; 173 174 alias X509V3_CTX = libressl_d.openssl.x509v3.v3_ext_ctx; 175 alias CONF = libressl_d.openssl.conf.conf_st; 176 177 struct store_st; 178 alias STORE = .store_st; 179 struct store_method_st; 180 alias STORE_METHOD = .store_method_st; 181 182 struct ui_st; 183 alias UI = .ui_st; 184 struct ui_method_st; 185 alias UI_METHOD = .ui_method_st; 186 187 struct st_ERR_FNS; 188 alias ERR_FNS = .st_ERR_FNS; 189 190 struct engine_st; 191 alias ENGINE = .engine_st; 192 193 alias SSL = libressl_d.openssl.ssl.ssl_st; 194 alias SSL_CTX = libressl_d.openssl.ssl.ssl_ctx_st; 195 196 struct X509_POLICY_NODE_st; 197 alias X509_POLICY_NODE = .X509_POLICY_NODE_st; 198 struct X509_POLICY_LEVEL_st; 199 alias X509_POLICY_LEVEL = .X509_POLICY_LEVEL_st; 200 struct X509_POLICY_TREE_st; 201 alias X509_POLICY_TREE = .X509_POLICY_TREE_st; 202 struct X509_POLICY_CACHE_st; 203 alias X509_POLICY_CACHE = .X509_POLICY_CACHE_st; 204 205 alias AUTHORITY_KEYID = libressl_d.openssl.x509v3.AUTHORITY_KEYID_st; 206 alias DIST_POINT = libressl_d.openssl.x509v3.DIST_POINT_st; 207 alias ISSUING_DIST_POINT = libressl_d.openssl.x509v3.ISSUING_DIST_POINT_st; 208 alias NAME_CONSTRAINTS = libressl_d.openssl.x509v3.NAME_CONSTRAINTS_st; 209 210 /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */ 211 //#define DECLARE_PKCS12_STACK_OF(type) /* Nothing */ 212 //#define IMPLEMENT_PKCS12_STACK_OF(type) /* Nothing */ 213 214 alias CRYPTO_EX_DATA = libressl_d.openssl.crypto.crypto_ex_data_st; 215 216 /* Callback types for crypto.h */ 217 alias CRYPTO_EX_new = extern (C) nothrow @nogc int function(void* parent, void* ptr_, .CRYPTO_EX_DATA* ad, int idx, core.stdc.config.c_long argl, void* argp); 218 alias CRYPTO_EX_free = extern (C) nothrow @nogc void function(void* parent, void* ptr_, .CRYPTO_EX_DATA* ad, int idx, core.stdc.config.c_long argl, void* argp); 219 alias CRYPTO_EX_dup = extern (C) nothrow @nogc int function(.CRYPTO_EX_DATA* to, .CRYPTO_EX_DATA* from, void* from_d, int idx, core.stdc.config.c_long argl, void* argp); 220 221 struct ocsp_req_ctx_st; 222 alias OCSP_REQ_CTX = .ocsp_req_ctx_st; 223 224 alias OCSP_RESPONSE = libressl_d.openssl.ocsp.ocsp_response_st; 225 alias OCSP_RESPID = libressl_d.openssl.ocsp.ocsp_responder_id_st;