1 /* crypto/err/err.h */
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3  * All rights reserved.
4  *
5  * This package is an SSL implementation written
6  * by Eric Young (eay@cryptsoft.com).
7  * The implementation was written so as to conform with Netscapes SSL.
8  *
9  * This library is free for commercial and non-commercial use as long as
10  * the following conditions are aheared to.  The following conditions
11  * apply to all code found in this distribution, be it the RC4, RSA,
12  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
13  * included with this distribution is covered by the same copyright terms
14  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15  *
16  * Copyright remains Eric Young's, and as such any Copyright notices in
17  * the code are not to be removed.
18  * If this package is used in a product, Eric Young should be given attribution
19  * as the author of the parts of the library used.
20  * This can be in the form of a textual message at program startup or
21  * in documentation (online or textual) provided with the package.
22  *
23  * Redistribution and use in source and binary forms, with or without
24  * modification, are permitted provided that the following conditions
25  * are met:
26  * 1. Redistributions of source code must retain the copyright
27  *   notice, this list of conditions and the following disclaimer.
28  * 2. Redistributions in binary form must reproduce the above copyright
29  *   notice, this list of conditions and the following disclaimer in the
30  *   documentation and/or other materials provided with the distribution.
31  * 3. All advertising materials mentioning features or use of this software
32  *   must display the following acknowledgement:
33  *   "This product includes cryptographic software written by
34  *    Eric Young (eay@cryptsoft.com)"
35  *   The word 'cryptographic' can be left out if the rouines from the library
36  *   being used are not cryptographic related :-).
37  * 4. If you include any Windows specific code (or a derivative thereof) from
38  *   the apps directory (application code) you must include an acknowledgement:
39  *   "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40  *
41  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51  * SUCH DAMAGE.
52  *
53  * The licence and distribution terms for any publically available version or
54  * derivative of this code cannot be changed.  i.e. this code cannot simply be
55  * copied and put under another distribution licence
56  * [including the GNU Public Licence.]
57  */
58 /* ====================================================================
59  * Copyright (c) 1998-2006 The OpenSSL Project.  All rights reserved.
60  *
61  * Redistribution and use in source and binary forms, with or without
62  * modification, are permitted provided that the following conditions
63  * are met:
64  *
65  * 1. Redistributions of source code must retain the above copyright
66  *   notice, this list of conditions and the following disclaimer.
67  *
68  * 2. Redistributions in binary form must reproduce the above copyright
69  *   notice, this list of conditions and the following disclaimer in
70  *   the documentation and/or other materials provided with the
71  *   distribution.
72  *
73  * 3. All advertising materials mentioning features or use of this
74  *   software must display the following acknowledgment:
75  *   "This product includes software developed by the OpenSSL Project
76  *   for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77  *
78  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79  *   endorse or promote products derived from this software without
80  *   prior written permission. For written permission, please contact
81  *   openssl-core@openssl.org.
82  *
83  * 5. Products derived from this software may not be called "OpenSSL"
84  *   nor may "OpenSSL" appear in their names without prior written
85  *   permission of the OpenSSL Project.
86  *
87  * 6. Redistributions of any form whatsoever must retain the following
88  *   acknowledgment:
89  *   "This product includes software developed by the OpenSSL Project
90  *   for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91  *
92  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
96  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103  * OF THE POSSIBILITY OF SUCH DAMAGE.
104  * ====================================================================
105  *
106  * This product includes cryptographic software written by Eric Young
107  * (eay@cryptsoft.com).  This product includes software written by Tim
108  * Hudson (tjh@cryptsoft.com).
109  *
110  */
111 
112 module deimos.openssl.err;
113 
114 import deimos.openssl._d_util;
115 
116 public import deimos.openssl.e_os2;
117 
118 version(OPENSSL_NO_FP_API) {} else {
119 import core.stdc.stdio;
120 import core.stdc.stdlib;
121 }
122 
123 public import deimos.openssl.ossl_typ;
124 version(OPENSSL_NO_BIO) {} else {
125 public import deimos.openssl.bio;
126 }
127 version(OPENSSL_NO_LHASH) {} else {
128 public import deimos.openssl.lhash;
129 }
130 
131 import core.vararg : va_list;
132 
133 extern (C):
134 nothrow:
135 
136 // #ifndef OPENSSL_NO_ERR
137 // #define ERR_PUT_error(a,b,c,d,e)	ERR_put_error(a,b,c,d,e)
138 // #else
139 // #define ERR_PUT_error(a,b,c,d,e)	ERR_put_error(a,b,c,NULL,0)
140 // #endif
141 version (OPENSSL_NO_ERR) {
142 	void ERR_PUT_error()(int a, int b,int c,const(char)* d,int e) {
143 		ERR_put_error(a,b,c,null,0);
144 	}
145 } else {
146 	alias ERR_put_error ERR_PUT_error;
147 }
148 
149 // #include <errno.h>
150 
151 enum ERR_TXT_MALLOCED = 0x01;
152 enum ERR_TXT_STRING = 0x02;
153 
154 enum ERR_FLAG_MARK = 0x01;
155 
156 enum ERR_NUM_ERRORS = 16;
157 struct err_state_st {
158 	CRYPTO_THREADID tid;
159 	int[ERR_NUM_ERRORS] err_flags;
160 	c_ulong[ERR_NUM_ERRORS] err_buffer;
161 	char*[ERR_NUM_ERRORS] err_data;
162 	int[ERR_NUM_ERRORS] err_data_flags;
163 	const(char)*[ERR_NUM_ERRORS] err_file;
164 	int[ERR_NUM_ERRORS] err_line;
165 	int top,bottom;
166 	}
167 alias err_state_st ERR_STATE;
168 
169 /* library */
170 enum ERR_LIB_NONE = 1;
171 enum ERR_LIB_SYS = 2;
172 enum ERR_LIB_BN = 3;
173 enum ERR_LIB_RSA = 4;
174 enum ERR_LIB_DH = 5;
175 enum ERR_LIB_EVP = 6;
176 enum ERR_LIB_BUF = 7;
177 enum ERR_LIB_OBJ = 8;
178 enum ERR_LIB_PEM = 9;
179 enum ERR_LIB_DSA = 10;
180 enum ERR_LIB_X509 = 11;
181 /* enum ERR_LIB_METH = 12; */
182 enum ERR_LIB_ASN1 = 13;
183 enum ERR_LIB_CONF = 14;
184 enum ERR_LIB_CRYPTO = 15;
185 enum ERR_LIB_EC = 16;
186 enum ERR_LIB_SSL = 20;
187 /* enum ERR_LIB_SSL23 = 21; */
188 /* enum ERR_LIB_SSL2 = 22; */
189 /* enum ERR_LIB_SSL3 = 23; */
190 /* enum ERR_LIB_RSAREF = 30; */
191 /* enum ERR_LIB_PROXY = 31; */
192 enum ERR_LIB_BIO = 32;
193 enum ERR_LIB_PKCS7 = 33;
194 enum ERR_LIB_X509V3 = 34;
195 enum ERR_LIB_PKCS12 = 35;
196 enum ERR_LIB_RAND = 36;
197 enum ERR_LIB_DSO = 37;
198 enum ERR_LIB_ENGINE = 38;
199 enum ERR_LIB_OCSP = 39;
200 enum ERR_LIB_UI = 40;
201 enum ERR_LIB_COMP = 41;
202 enum ERR_LIB_ECDSA = 42;
203 enum ERR_LIB_ECDH = 43;
204 enum ERR_LIB_STORE = 44;
205 enum ERR_LIB_FIPS = 45;
206 enum ERR_LIB_CMS = 46;
207 enum ERR_LIB_TS = 47;
208 enum ERR_LIB_HMAC = 48;
209 enum ERR_LIB_JPAKE = 49;
210 
211 enum ERR_LIB_USER = 128;
212 
213 void SYSerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_SYS,f,r,file,line); }
214 void BNerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_BN,f,r,file,line); }
215 void RSAerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_RSA,f,r,file,line); }
216 void DHerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_DH,f,r,file,line); }
217 void EVPerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_EVP,f,r,file,line); }
218 void BUFerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_BUF,f,r,file,line); }
219 void OBJerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_OBJ,f,r,file,line); }
220 void PEMerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_PEM,f,r,file,line); }
221 void DSAerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_DSA,f,r,file,line); }
222 void X509err_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_X509,f,r,file,line); }
223 void ASN1err_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_ASN1,f,r,file,line); }
224 void CONFerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_CONF,f,r,file,line); }
225 void CRYPTOerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_CRYPTO,f,r,file,line); }
226 void ECerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_EC,f,r,file,line); }
227 void SSLerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_SSL,f,r,file,line); }
228 void BIOerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_BIO,f,r,file,line); }
229 void PKCS7err_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_PKCS7,f,r,file,line); }
230 void X509V3err_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_X509V3,f,r,file,line); }
231 void PKCS12err_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_PKCS12,f,r,file,line); }
232 void RANDerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_RAND,f,r,file,line); }
233 void DSOerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_DSO,f,r,file,line); }
234 void ENGINEerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_ENGINE,f,r,file,line); }
235 void OCSPerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_OCSP,f,r,file,line); }
236 void UIerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_UI,f,r,file,line); }
237 void COMPerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_COMP,f,r,file,line); }
238 void ECDSAerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_ECDSA,f,r,file,line); }
239 void ECDHerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_ECDH,f,r,file,line); }
240 void STOREerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_STORE,f,r,file,line); }
241 void FIPSerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_FIPS,f,r,file,line); }
242 void CMSerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_CMS,f,r,file,line); }
243 void TSerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_TS,f,r,file,line); }
244 void HMACerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_HMAC,f,r,file,line); }
245 void JPAKEerr_err(string file = __FILE__, size_t line = __LINE__)(int f, int r){ ERR_PUT_error(ERR_LIB_JPAKE,f,r,file,line); }
246 
247 /* Borland C seems too stupid to be able to shift and do longs in
248  * the pre-processor :-( */
249 auto ERR_PACK()(c_ulong l, c_ulong f, c_ulong r) {
250 	return ((((l)&0xffL)*0x1000000)|
251 					(((f)&0xfffL)*0x1000)|
252 					(((r)&0xfffL)));
253 }
254 auto ERR_GET_LIB()(c_ulong l) { return cast(int)(((l)>>24L)&0xffL); }
255 auto ERR_GET_FUNC()(c_ulong l) { return cast(int)(((l)>>12L)&0xfffL); }
256 auto ERR_GET_REASON()(c_ulong l) { return cast(int)((l)&0xfffL); }
257 auto ERR_FATAL_ERROR()(c_ulong l) { return cast(int)((l)&ERR_R_FATAL); }
258 
259 
260 /* OS functions */
261 enum SYS_F_FOPEN = 1;
262 enum SYS_F_CONNECT = 2;
263 enum SYS_F_GETSERVBYNAME = 3;
264 enum SYS_F_SOCKET = 4;
265 enum SYS_F_IOCTLSOCKET = 5;
266 enum SYS_F_BIND = 6;
267 enum SYS_F_LISTEN = 7;
268 enum SYS_F_ACCEPT = 8;
269 enum SYS_F_WSASTARTUP = 9; /* Winsock stuff */
270 enum SYS_F_OPENDIR = 10;
271 enum SYS_F_FREAD = 11;
272 
273 
274 /* reasons */
275 alias ERR_LIB_SYS ERR_R_SYS_LIB ; /* 2 */
276 alias ERR_LIB_BN ERR_R_BN_LIB ; /* 3 */
277 alias ERR_LIB_RSA ERR_R_RSA_LIB ; /* 4 */
278 alias ERR_LIB_DH ERR_R_DH_LIB ; /* 5 */
279 alias ERR_LIB_EVP ERR_R_EVP_LIB ; /* 6 */
280 alias ERR_LIB_BUF ERR_R_BUF_LIB ; /* 7 */
281 alias ERR_LIB_OBJ ERR_R_OBJ_LIB ; /* 8 */
282 alias ERR_LIB_PEM ERR_R_PEM_LIB ; /* 9 */
283 alias ERR_LIB_DSA ERR_R_DSA_LIB ; /* 10 */
284 alias ERR_LIB_X509 ERR_R_X509_LIB ; /* 11 */
285 alias ERR_LIB_ASN1 ERR_R_ASN1_LIB ; /* 13 */
286 alias ERR_LIB_CONF ERR_R_CONF_LIB ; /* 14 */
287 alias ERR_LIB_CRYPTO ERR_R_CRYPTO_LIB ; /* 15 */
288 alias ERR_LIB_EC ERR_R_EC_LIB ; /* 16 */
289 alias ERR_LIB_SSL ERR_R_SSL_LIB ; /* 20 */
290 alias ERR_LIB_BIO ERR_R_BIO_LIB ; /* 32 */
291 alias ERR_LIB_PKCS7 ERR_R_PKCS7_LIB ; /* 33 */
292 alias ERR_LIB_X509V3 ERR_R_X509V3_LIB ; /* 34 */
293 alias ERR_LIB_PKCS12 ERR_R_PKCS12_LIB ; /* 35 */
294 alias ERR_LIB_RAND ERR_R_RAND_LIB ; /* 36 */
295 alias ERR_LIB_DSO ERR_R_DSO_LIB ; /* 37 */
296 alias ERR_LIB_ENGINE ERR_R_ENGINE_LIB ; /* 38 */
297 alias ERR_LIB_OCSP ERR_R_OCSP_LIB ; /* 39 */
298 alias ERR_LIB_UI ERR_R_UI_LIB ; /* 40 */
299 alias ERR_LIB_COMP ERR_R_COMP_LIB ; /* 41 */
300 alias ERR_LIB_ECDSA ERR_R_ECDSA_LIB ; /* 42 */
301 alias ERR_LIB_ECDH ERR_R_ECDH_LIB ; /* 43 */
302 alias ERR_LIB_STORE ERR_R_STORE_LIB ; /* 44 */
303 alias ERR_LIB_TS ERR_R_TS_LIB ; /* 45 */
304 
305 enum ERR_R_NESTED_ASN1_ERROR = 58;
306 enum ERR_R_BAD_ASN1_OBJECT_HEADER = 59;
307 enum ERR_R_BAD_GET_ASN1_OBJECT_CALL = 60;
308 enum ERR_R_EXPECTING_AN_ASN1_SEQUENCE = 61;
309 enum ERR_R_ASN1_LENGTH_MISMATCH = 62;
310 enum ERR_R_MISSING_ASN1_EOS = 63;
311 
312 /* fatal error */
313 enum ERR_R_FATAL = 64;
314 enum ERR_R_MALLOC_FAILURE = (1|ERR_R_FATAL);
315 enum ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED = (2|ERR_R_FATAL);
316 enum ERR_R_PASSED_NULL_PARAMETER = (3|ERR_R_FATAL);
317 enum ERR_R_INTERNAL_ERROR = (4|ERR_R_FATAL);
318 enum ERR_R_DISABLED = (5|ERR_R_FATAL);
319 
320 /* 99 is the maximum possible ERR_R_... code, higher values
321  * are reserved for the individual libraries */
322 
323 
324 struct ERR_string_data_st {
325 	c_ulong error;
326 	const(char)* string;
327 	}
328 alias ERR_string_data_st ERR_STRING_DATA;
329 
330 void ERR_put_error(int lib, int func,int reason,const(char)* file,int line);
331 void ERR_set_error_data(char* data,int flags);
332 
333 c_ulong ERR_get_error();
334 c_ulong ERR_get_error_line(const(char)** file,int* line);
335 c_ulong ERR_get_error_line_data(const(char)** file,int* line,
336 				      const(char)** data, int* flags);
337 c_ulong ERR_peek_error();
338 c_ulong ERR_peek_error_line(const(char)** file,int* line);
339 c_ulong ERR_peek_error_line_data(const(char)** file,int* line,
340 				       const(char)** data,int* flags);
341 c_ulong ERR_peek_last_error();
342 c_ulong ERR_peek_last_error_line(const(char)** file,int* line);
343 c_ulong ERR_peek_last_error_line_data(const(char)** file,int* line,
344 				       const(char)** data,int* flags);
345 void ERR_clear_error();
346 char* ERR_error_string(c_ulong e,char* buf);
347 void ERR_error_string_n(c_ulong e, char* buf, size_t len);
348 const(char)* ERR_lib_error_string(c_ulong e);
349 const(char)* ERR_func_error_string(c_ulong e);
350 const(char)* ERR_reason_error_string(c_ulong e);
351 void ERR_print_errors_cb(ExternC!(int function(const(char)* str, size_t len, void* u)) cb,
352 			 void* u);
353 version(OPENSSL_NO_FP_API) {} else {
354 void ERR_print_errors_fp(FILE* fp);
355 }
356 version(OPENSSL_NO_BIO) {} else {
357 void ERR_print_errors(BIO* bp);
358 }
359 void ERR_add_error_data(int num, ...);
360 void ERR_add_error_vdata(int num, va_list args);
361 void ERR_load_strings(int lib,ERR_STRING_DATA[] str);
362 void ERR_unload_strings(int lib,ERR_STRING_DATA[] str);
363 void ERR_load_ERR_strings();
364 void ERR_load_crypto_strings();
365 void ERR_free_strings();
366 
367 void ERR_remove_thread_state(const(CRYPTO_THREADID)* tid);
368 version(OPENSSL_NO_DEPRECATED) {} else {
369 void ERR_remove_state(c_ulong pid); /* if zero we look it up */
370 }
371 ERR_STATE* ERR_get_state();
372 
373 version(OPENSSL_NO_LHASH) {} else {
374 LHASH_OF!(ERR_STRING_DATA) *ERR_get_string_table();
375 LHASH_OF!(ERR_STATE) *ERR_get_err_state_table();
376 void ERR_release_err_state_table(LHASH_OF!(ERR_STATE) **hash);
377 }
378 
379 int ERR_get_next_error_library();
380 
381 int ERR_set_mark();
382 int ERR_pop_to_mark();
383 
384 /* Already defined in ossl_typ.h */
385 /* typedef st_ERR_FNS ERR_FNS; */
386 /* An application can use this function and provide the return value to loaded
387  * modules that should use the application's ERR state/functionality */
388 const(ERR_FNS)* ERR_get_implementation();
389 /* A loaded module should call this function prior to any ERR operations using
390  * the application's "ERR_FNS". */
391 int ERR_set_implementation(const(ERR_FNS)* fns);