10Sstevel@tonic-gate /* crypto/err/err.h */ 20Sstevel@tonic-gate /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 30Sstevel@tonic-gate * All rights reserved. 40Sstevel@tonic-gate * 50Sstevel@tonic-gate * This package is an SSL implementation written 60Sstevel@tonic-gate * by Eric Young (eay@cryptsoft.com). 70Sstevel@tonic-gate * The implementation was written so as to conform with Netscapes SSL. 80Sstevel@tonic-gate * 90Sstevel@tonic-gate * This library is free for commercial and non-commercial use as long as 100Sstevel@tonic-gate * the following conditions are aheared to. The following conditions 110Sstevel@tonic-gate * apply to all code found in this distribution, be it the RC4, RSA, 120Sstevel@tonic-gate * lhash, DES, etc., code; not just the SSL code. The SSL documentation 130Sstevel@tonic-gate * included with this distribution is covered by the same copyright terms 140Sstevel@tonic-gate * except that the holder is Tim Hudson (tjh@cryptsoft.com). 150Sstevel@tonic-gate * 160Sstevel@tonic-gate * Copyright remains Eric Young's, and as such any Copyright notices in 170Sstevel@tonic-gate * the code are not to be removed. 180Sstevel@tonic-gate * If this package is used in a product, Eric Young should be given attribution 190Sstevel@tonic-gate * as the author of the parts of the library used. 200Sstevel@tonic-gate * This can be in the form of a textual message at program startup or 210Sstevel@tonic-gate * in documentation (online or textual) provided with the package. 220Sstevel@tonic-gate * 230Sstevel@tonic-gate * Redistribution and use in source and binary forms, with or without 240Sstevel@tonic-gate * modification, are permitted provided that the following conditions 250Sstevel@tonic-gate * are met: 260Sstevel@tonic-gate * 1. Redistributions of source code must retain the copyright 270Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer. 280Sstevel@tonic-gate * 2. Redistributions in binary form must reproduce the above copyright 290Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer in the 300Sstevel@tonic-gate * documentation and/or other materials provided with the distribution. 310Sstevel@tonic-gate * 3. All advertising materials mentioning features or use of this software 320Sstevel@tonic-gate * must display the following acknowledgement: 330Sstevel@tonic-gate * "This product includes cryptographic software written by 340Sstevel@tonic-gate * Eric Young (eay@cryptsoft.com)" 350Sstevel@tonic-gate * The word 'cryptographic' can be left out if the rouines from the library 360Sstevel@tonic-gate * being used are not cryptographic related :-). 370Sstevel@tonic-gate * 4. If you include any Windows specific code (or a derivative thereof) from 380Sstevel@tonic-gate * the apps directory (application code) you must include an acknowledgement: 390Sstevel@tonic-gate * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 400Sstevel@tonic-gate * 410Sstevel@tonic-gate * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 420Sstevel@tonic-gate * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 430Sstevel@tonic-gate * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 440Sstevel@tonic-gate * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 450Sstevel@tonic-gate * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 460Sstevel@tonic-gate * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 470Sstevel@tonic-gate * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 480Sstevel@tonic-gate * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 490Sstevel@tonic-gate * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 500Sstevel@tonic-gate * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 510Sstevel@tonic-gate * SUCH DAMAGE. 520Sstevel@tonic-gate * 530Sstevel@tonic-gate * The licence and distribution terms for any publically available version or 540Sstevel@tonic-gate * derivative of this code cannot be changed. i.e. this code cannot simply be 550Sstevel@tonic-gate * copied and put under another distribution licence 560Sstevel@tonic-gate * [including the GNU Public Licence.] 570Sstevel@tonic-gate */ 580Sstevel@tonic-gate 590Sstevel@tonic-gate #ifndef HEADER_ERR_H 600Sstevel@tonic-gate #define HEADER_ERR_H 610Sstevel@tonic-gate 62*2139Sjp161948 #include <openssl/e_os2.h> 63*2139Sjp161948 640Sstevel@tonic-gate #ifndef OPENSSL_NO_FP_API 650Sstevel@tonic-gate #include <stdio.h> 660Sstevel@tonic-gate #include <stdlib.h> 670Sstevel@tonic-gate #endif 680Sstevel@tonic-gate 69*2139Sjp161948 #include <openssl/ossl_typ.h> 700Sstevel@tonic-gate #ifndef OPENSSL_NO_BIO 710Sstevel@tonic-gate #include <openssl/bio.h> 720Sstevel@tonic-gate #endif 730Sstevel@tonic-gate #ifndef OPENSSL_NO_LHASH 740Sstevel@tonic-gate #include <openssl/lhash.h> 750Sstevel@tonic-gate #endif 760Sstevel@tonic-gate 770Sstevel@tonic-gate #ifdef __cplusplus 780Sstevel@tonic-gate extern "C" { 790Sstevel@tonic-gate #endif 800Sstevel@tonic-gate 810Sstevel@tonic-gate #ifndef OPENSSL_NO_ERR 820Sstevel@tonic-gate #define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e) 830Sstevel@tonic-gate #else 840Sstevel@tonic-gate #define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0) 850Sstevel@tonic-gate #endif 860Sstevel@tonic-gate 870Sstevel@tonic-gate #include <errno.h> 880Sstevel@tonic-gate 890Sstevel@tonic-gate #define ERR_TXT_MALLOCED 0x01 900Sstevel@tonic-gate #define ERR_TXT_STRING 0x02 910Sstevel@tonic-gate 92*2139Sjp161948 #define ERR_FLAG_MARK 0x01 93*2139Sjp161948 940Sstevel@tonic-gate #define ERR_NUM_ERRORS 16 950Sstevel@tonic-gate typedef struct err_state_st 960Sstevel@tonic-gate { 970Sstevel@tonic-gate unsigned long pid; 98*2139Sjp161948 int err_flags[ERR_NUM_ERRORS]; 990Sstevel@tonic-gate unsigned long err_buffer[ERR_NUM_ERRORS]; 1000Sstevel@tonic-gate char *err_data[ERR_NUM_ERRORS]; 1010Sstevel@tonic-gate int err_data_flags[ERR_NUM_ERRORS]; 1020Sstevel@tonic-gate const char *err_file[ERR_NUM_ERRORS]; 1030Sstevel@tonic-gate int err_line[ERR_NUM_ERRORS]; 1040Sstevel@tonic-gate int top,bottom; 1050Sstevel@tonic-gate } ERR_STATE; 1060Sstevel@tonic-gate 1070Sstevel@tonic-gate /* library */ 1080Sstevel@tonic-gate #define ERR_LIB_NONE 1 1090Sstevel@tonic-gate #define ERR_LIB_SYS 2 1100Sstevel@tonic-gate #define ERR_LIB_BN 3 1110Sstevel@tonic-gate #define ERR_LIB_RSA 4 1120Sstevel@tonic-gate #define ERR_LIB_DH 5 1130Sstevel@tonic-gate #define ERR_LIB_EVP 6 1140Sstevel@tonic-gate #define ERR_LIB_BUF 7 1150Sstevel@tonic-gate #define ERR_LIB_OBJ 8 1160Sstevel@tonic-gate #define ERR_LIB_PEM 9 1170Sstevel@tonic-gate #define ERR_LIB_DSA 10 1180Sstevel@tonic-gate #define ERR_LIB_X509 11 1190Sstevel@tonic-gate /* #define ERR_LIB_METH 12 */ 1200Sstevel@tonic-gate #define ERR_LIB_ASN1 13 1210Sstevel@tonic-gate #define ERR_LIB_CONF 14 1220Sstevel@tonic-gate #define ERR_LIB_CRYPTO 15 1230Sstevel@tonic-gate #define ERR_LIB_EC 16 1240Sstevel@tonic-gate #define ERR_LIB_SSL 20 1250Sstevel@tonic-gate /* #define ERR_LIB_SSL23 21 */ 1260Sstevel@tonic-gate /* #define ERR_LIB_SSL2 22 */ 1270Sstevel@tonic-gate /* #define ERR_LIB_SSL3 23 */ 1280Sstevel@tonic-gate /* #define ERR_LIB_RSAREF 30 */ 1290Sstevel@tonic-gate /* #define ERR_LIB_PROXY 31 */ 1300Sstevel@tonic-gate #define ERR_LIB_BIO 32 1310Sstevel@tonic-gate #define ERR_LIB_PKCS7 33 1320Sstevel@tonic-gate #define ERR_LIB_X509V3 34 1330Sstevel@tonic-gate #define ERR_LIB_PKCS12 35 1340Sstevel@tonic-gate #define ERR_LIB_RAND 36 1350Sstevel@tonic-gate #define ERR_LIB_DSO 37 1360Sstevel@tonic-gate #define ERR_LIB_ENGINE 38 1370Sstevel@tonic-gate #define ERR_LIB_OCSP 39 1380Sstevel@tonic-gate #define ERR_LIB_UI 40 1390Sstevel@tonic-gate #define ERR_LIB_COMP 41 140*2139Sjp161948 #define ERR_LIB_ECDSA 42 141*2139Sjp161948 #define ERR_LIB_ECDH 43 142*2139Sjp161948 #define ERR_LIB_STORE 44 1430Sstevel@tonic-gate 1440Sstevel@tonic-gate #define ERR_LIB_USER 128 1450Sstevel@tonic-gate 1460Sstevel@tonic-gate #define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__) 1470Sstevel@tonic-gate #define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__) 1480Sstevel@tonic-gate #define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),__FILE__,__LINE__) 1490Sstevel@tonic-gate #define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),__FILE__,__LINE__) 1500Sstevel@tonic-gate #define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),__FILE__,__LINE__) 1510Sstevel@tonic-gate #define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),__FILE__,__LINE__) 1520Sstevel@tonic-gate #define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),__FILE__,__LINE__) 1530Sstevel@tonic-gate #define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),__FILE__,__LINE__) 1540Sstevel@tonic-gate #define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),__FILE__,__LINE__) 1550Sstevel@tonic-gate #define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),__FILE__,__LINE__) 1560Sstevel@tonic-gate #define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),__FILE__,__LINE__) 1570Sstevel@tonic-gate #define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),__FILE__,__LINE__) 1580Sstevel@tonic-gate #define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),__FILE__,__LINE__) 1590Sstevel@tonic-gate #define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),__FILE__,__LINE__) 1600Sstevel@tonic-gate #define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),__FILE__,__LINE__) 1610Sstevel@tonic-gate #define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),__FILE__,__LINE__) 1620Sstevel@tonic-gate #define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),__FILE__,__LINE__) 1630Sstevel@tonic-gate #define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),__FILE__,__LINE__) 1640Sstevel@tonic-gate #define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),__FILE__,__LINE__) 1650Sstevel@tonic-gate #define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),__FILE__,__LINE__) 1660Sstevel@tonic-gate #define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),__FILE__,__LINE__) 1670Sstevel@tonic-gate #define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),__FILE__,__LINE__) 1680Sstevel@tonic-gate #define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__) 1690Sstevel@tonic-gate #define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__) 1700Sstevel@tonic-gate #define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__) 171*2139Sjp161948 #define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__) 172*2139Sjp161948 #define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__) 173*2139Sjp161948 #define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__) 1740Sstevel@tonic-gate 1750Sstevel@tonic-gate /* Borland C seems too stupid to be able to shift and do longs in 1760Sstevel@tonic-gate * the pre-processor :-( */ 1770Sstevel@tonic-gate #define ERR_PACK(l,f,r) (((((unsigned long)l)&0xffL)*0x1000000)| \ 1780Sstevel@tonic-gate ((((unsigned long)f)&0xfffL)*0x1000)| \ 1790Sstevel@tonic-gate ((((unsigned long)r)&0xfffL))) 1800Sstevel@tonic-gate #define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL) 1810Sstevel@tonic-gate #define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL) 1820Sstevel@tonic-gate #define ERR_GET_REASON(l) (int)((l)&0xfffL) 1830Sstevel@tonic-gate #define ERR_FATAL_ERROR(l) (int)((l)&ERR_R_FATAL) 1840Sstevel@tonic-gate 1850Sstevel@tonic-gate 1860Sstevel@tonic-gate /* OS functions */ 1870Sstevel@tonic-gate #define SYS_F_FOPEN 1 1880Sstevel@tonic-gate #define SYS_F_CONNECT 2 1890Sstevel@tonic-gate #define SYS_F_GETSERVBYNAME 3 1900Sstevel@tonic-gate #define SYS_F_SOCKET 4 1910Sstevel@tonic-gate #define SYS_F_IOCTLSOCKET 5 1920Sstevel@tonic-gate #define SYS_F_BIND 6 1930Sstevel@tonic-gate #define SYS_F_LISTEN 7 1940Sstevel@tonic-gate #define SYS_F_ACCEPT 8 1950Sstevel@tonic-gate #define SYS_F_WSASTARTUP 9 /* Winsock stuff */ 1960Sstevel@tonic-gate #define SYS_F_OPENDIR 10 1970Sstevel@tonic-gate #define SYS_F_FREAD 11 1980Sstevel@tonic-gate 1990Sstevel@tonic-gate 2000Sstevel@tonic-gate /* reasons */ 2010Sstevel@tonic-gate #define ERR_R_SYS_LIB ERR_LIB_SYS /* 2 */ 2020Sstevel@tonic-gate #define ERR_R_BN_LIB ERR_LIB_BN /* 3 */ 2030Sstevel@tonic-gate #define ERR_R_RSA_LIB ERR_LIB_RSA /* 4 */ 2040Sstevel@tonic-gate #define ERR_R_DH_LIB ERR_LIB_DH /* 5 */ 2050Sstevel@tonic-gate #define ERR_R_EVP_LIB ERR_LIB_EVP /* 6 */ 2060Sstevel@tonic-gate #define ERR_R_BUF_LIB ERR_LIB_BUF /* 7 */ 2070Sstevel@tonic-gate #define ERR_R_OBJ_LIB ERR_LIB_OBJ /* 8 */ 2080Sstevel@tonic-gate #define ERR_R_PEM_LIB ERR_LIB_PEM /* 9 */ 2090Sstevel@tonic-gate #define ERR_R_DSA_LIB ERR_LIB_DSA /* 10 */ 2100Sstevel@tonic-gate #define ERR_R_X509_LIB ERR_LIB_X509 /* 11 */ 2110Sstevel@tonic-gate #define ERR_R_ASN1_LIB ERR_LIB_ASN1 /* 13 */ 2120Sstevel@tonic-gate #define ERR_R_CONF_LIB ERR_LIB_CONF /* 14 */ 2130Sstevel@tonic-gate #define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO /* 15 */ 2140Sstevel@tonic-gate #define ERR_R_EC_LIB ERR_LIB_EC /* 16 */ 2150Sstevel@tonic-gate #define ERR_R_SSL_LIB ERR_LIB_SSL /* 20 */ 2160Sstevel@tonic-gate #define ERR_R_BIO_LIB ERR_LIB_BIO /* 32 */ 2170Sstevel@tonic-gate #define ERR_R_PKCS7_LIB ERR_LIB_PKCS7 /* 33 */ 2180Sstevel@tonic-gate #define ERR_R_X509V3_LIB ERR_LIB_X509V3 /* 34 */ 2190Sstevel@tonic-gate #define ERR_R_PKCS12_LIB ERR_LIB_PKCS12 /* 35 */ 2200Sstevel@tonic-gate #define ERR_R_RAND_LIB ERR_LIB_RAND /* 36 */ 2210Sstevel@tonic-gate #define ERR_R_DSO_LIB ERR_LIB_DSO /* 37 */ 2220Sstevel@tonic-gate #define ERR_R_ENGINE_LIB ERR_LIB_ENGINE /* 38 */ 2230Sstevel@tonic-gate #define ERR_R_OCSP_LIB ERR_LIB_OCSP /* 39 */ 2240Sstevel@tonic-gate #define ERR_R_UI_LIB ERR_LIB_UI /* 40 */ 2250Sstevel@tonic-gate #define ERR_R_COMP_LIB ERR_LIB_COMP /* 41 */ 226*2139Sjp161948 #define ERR_R_ECDSA_LIB ERR_LIB_ECDSA /* 42 */ 227*2139Sjp161948 #define ERR_R_ECDH_LIB ERR_LIB_ECDH /* 43 */ 228*2139Sjp161948 #define ERR_R_STORE_LIB ERR_LIB_STORE /* 44 */ 2290Sstevel@tonic-gate 2300Sstevel@tonic-gate #define ERR_R_NESTED_ASN1_ERROR 58 2310Sstevel@tonic-gate #define ERR_R_BAD_ASN1_OBJECT_HEADER 59 2320Sstevel@tonic-gate #define ERR_R_BAD_GET_ASN1_OBJECT_CALL 60 2330Sstevel@tonic-gate #define ERR_R_EXPECTING_AN_ASN1_SEQUENCE 61 2340Sstevel@tonic-gate #define ERR_R_ASN1_LENGTH_MISMATCH 62 2350Sstevel@tonic-gate #define ERR_R_MISSING_ASN1_EOS 63 2360Sstevel@tonic-gate 2370Sstevel@tonic-gate /* fatal error */ 2380Sstevel@tonic-gate #define ERR_R_FATAL 64 2390Sstevel@tonic-gate #define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL) 2400Sstevel@tonic-gate #define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL) 2410Sstevel@tonic-gate #define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL) 2420Sstevel@tonic-gate #define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL) 243*2139Sjp161948 #define ERR_R_DISABLED (5|ERR_R_FATAL) 2440Sstevel@tonic-gate 2450Sstevel@tonic-gate /* 99 is the maximum possible ERR_R_... code, higher values 2460Sstevel@tonic-gate * are reserved for the individual libraries */ 2470Sstevel@tonic-gate 2480Sstevel@tonic-gate 2490Sstevel@tonic-gate typedef struct ERR_string_data_st 2500Sstevel@tonic-gate { 2510Sstevel@tonic-gate unsigned long error; 2520Sstevel@tonic-gate const char *string; 2530Sstevel@tonic-gate } ERR_STRING_DATA; 2540Sstevel@tonic-gate 2550Sstevel@tonic-gate void ERR_put_error(int lib, int func,int reason,const char *file,int line); 2560Sstevel@tonic-gate void ERR_set_error_data(char *data,int flags); 2570Sstevel@tonic-gate 2580Sstevel@tonic-gate unsigned long ERR_get_error(void); 2590Sstevel@tonic-gate unsigned long ERR_get_error_line(const char **file,int *line); 2600Sstevel@tonic-gate unsigned long ERR_get_error_line_data(const char **file,int *line, 2610Sstevel@tonic-gate const char **data, int *flags); 2620Sstevel@tonic-gate unsigned long ERR_peek_error(void); 2630Sstevel@tonic-gate unsigned long ERR_peek_error_line(const char **file,int *line); 2640Sstevel@tonic-gate unsigned long ERR_peek_error_line_data(const char **file,int *line, 2650Sstevel@tonic-gate const char **data,int *flags); 2660Sstevel@tonic-gate unsigned long ERR_peek_last_error(void); 2670Sstevel@tonic-gate unsigned long ERR_peek_last_error_line(const char **file,int *line); 2680Sstevel@tonic-gate unsigned long ERR_peek_last_error_line_data(const char **file,int *line, 2690Sstevel@tonic-gate const char **data,int *flags); 2700Sstevel@tonic-gate void ERR_clear_error(void ); 2710Sstevel@tonic-gate char *ERR_error_string(unsigned long e,char *buf); 2720Sstevel@tonic-gate void ERR_error_string_n(unsigned long e, char *buf, size_t len); 2730Sstevel@tonic-gate const char *ERR_lib_error_string(unsigned long e); 2740Sstevel@tonic-gate const char *ERR_func_error_string(unsigned long e); 2750Sstevel@tonic-gate const char *ERR_reason_error_string(unsigned long e); 2760Sstevel@tonic-gate void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), 2770Sstevel@tonic-gate void *u); 2780Sstevel@tonic-gate #ifndef OPENSSL_NO_FP_API 2790Sstevel@tonic-gate void ERR_print_errors_fp(FILE *fp); 2800Sstevel@tonic-gate #endif 2810Sstevel@tonic-gate #ifndef OPENSSL_NO_BIO 2820Sstevel@tonic-gate void ERR_print_errors(BIO *bp); 2830Sstevel@tonic-gate void ERR_add_error_data(int num, ...); 2840Sstevel@tonic-gate #endif 2850Sstevel@tonic-gate void ERR_load_strings(int lib,ERR_STRING_DATA str[]); 2860Sstevel@tonic-gate void ERR_unload_strings(int lib,ERR_STRING_DATA str[]); 2870Sstevel@tonic-gate void ERR_load_ERR_strings(void); 2880Sstevel@tonic-gate void ERR_load_crypto_strings(void); 2890Sstevel@tonic-gate void ERR_free_strings(void); 2900Sstevel@tonic-gate 2910Sstevel@tonic-gate void ERR_remove_state(unsigned long pid); /* if zero we look it up */ 2920Sstevel@tonic-gate ERR_STATE *ERR_get_state(void); 2930Sstevel@tonic-gate 2940Sstevel@tonic-gate #ifndef OPENSSL_NO_LHASH 2950Sstevel@tonic-gate LHASH *ERR_get_string_table(void); 2960Sstevel@tonic-gate LHASH *ERR_get_err_state_table(void); 2970Sstevel@tonic-gate void ERR_release_err_state_table(LHASH **hash); 2980Sstevel@tonic-gate #endif 2990Sstevel@tonic-gate 3000Sstevel@tonic-gate int ERR_get_next_error_library(void); 3010Sstevel@tonic-gate 302*2139Sjp161948 int ERR_set_mark(void); 303*2139Sjp161948 int ERR_pop_to_mark(void); 304*2139Sjp161948 305*2139Sjp161948 /* Already defined in ossl_typ.h */ 306*2139Sjp161948 /* typedef struct st_ERR_FNS ERR_FNS; */ 3070Sstevel@tonic-gate /* An application can use this function and provide the return value to loaded 3080Sstevel@tonic-gate * modules that should use the application's ERR state/functionality */ 3090Sstevel@tonic-gate const ERR_FNS *ERR_get_implementation(void); 3100Sstevel@tonic-gate /* A loaded module should call this function prior to any ERR operations using 3110Sstevel@tonic-gate * the application's "ERR_FNS". */ 3120Sstevel@tonic-gate int ERR_set_implementation(const ERR_FNS *fns); 3130Sstevel@tonic-gate 3140Sstevel@tonic-gate #ifdef __cplusplus 3150Sstevel@tonic-gate } 3160Sstevel@tonic-gate #endif 3170Sstevel@tonic-gate 3180Sstevel@tonic-gate #endif 319