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 alias x509_st X509;
175 alias X509_algor_st X509_ALGOR;
176 alias X509_crl_st X509_CRL;
177 struct x509_crl_method_st;
178 alias x509_crl_method_st X509_CRL_METHOD;
179 alias x509_revoked_st X509_REVOKED;
180 alias X509_name_st X509_NAME;
181 alias X509_pubkey_st X509_PUBKEY;
182 alias x509_store_st X509_STORE;
183 /*struct x509_store_ctx_st;*/
184 alias x509_store_ctx_st X509_STORE_CTX;
185 alias pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
186 
187 import deimos.openssl.x509v3;
188 alias v3_ext_ctx X509V3_CTX;
189 import deimos.openssl.conf;
190 alias conf_st CONF;
191 
192 struct store_st;
193 alias store_st STORE;
194 struct store_method_st;
195 alias store_method_st STORE_METHOD;
196 
197 struct ui_st;
198 alias ui_st UI;
199 struct ui_method_st;
200 alias ui_method_st UI_METHOD;
201 
202 struct st_ERR_FNS;
203 alias st_ERR_FNS ERR_FNS;
204 
205 struct engine_st;
206 alias engine_st ENGINE;
207 
208 struct X509_POLICY_NODE_st;
209 alias X509_POLICY_NODE_st X509_POLICY_NODE;
210 struct X509_POLICY_LEVEL_st;
211 alias X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
212 struct X509_POLICY_TREE_st;
213 alias X509_POLICY_TREE_st X509_POLICY_TREE;
214 struct X509_POLICY_CACHE_st;
215 alias X509_POLICY_CACHE_st X509_POLICY_CACHE;
216 
217 alias AUTHORITY_KEYID_st AUTHORITY_KEYID;
218 alias DIST_POINT_st DIST_POINT;
219 alias ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
220 alias NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
221 
222   /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */
223 mixin template DECLARE_PKCS12_STACK_OF (type) { /* Nothing */ }
224 //#define IMPLEMENT_PKCS12_STACK_OF!(type) /* Nothing */
225 
226 import deimos.openssl.crypto;
227 alias crypto_ex_data_st CRYPTO_EX_DATA;
228 /* Callback types for crypto.h */
229 alias typeof(*(ExternC!(int function(void* parent, void* ptr, CRYPTO_EX_DATA* ad,
230 					int idx, c_long argl, void* argp))).init) CRYPTO_EX_new;
231 alias typeof(*(ExternC!(void function(void* parent, void* ptr, CRYPTO_EX_DATA* ad,
232 					int idx, c_long argl, void* argp))).init) CRYPTO_EX_free;
233 alias typeof(*(ExternC!(int function(CRYPTO_EX_DATA* to, CRYPTO_EX_DATA* from, void* from_d,
234 					int idx, c_long argl, void* argp))).init) CRYPTO_EX_dup;
235 
236 import deimos.openssl.ocsp;
237 struct ocsp_req_ctx_st;
238 alias ocsp_req_ctx_st OCSP_REQ_CTX;
239 /*struct ocsp_response_st;*/
240 alias ocsp_response_st OCSP_RESPONSE;
241 /*struct ocsp_responder_id_st;*/
242 alias ocsp_responder_id_st OCSP_RESPID;