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