diff options
Diffstat (limited to 'src/lib/libcrypto/err')
| -rw-r--r-- | src/lib/libcrypto/err/Makefile.ssl | 119 | ||||
| -rw-r--r-- | src/lib/libcrypto/err/err.c | 416 | ||||
| -rw-r--r-- | src/lib/libcrypto/err/err.h | 330 | ||||
| -rw-r--r-- | src/lib/libcrypto/err/err_all.c | 161 | ||||
| -rw-r--r-- | src/lib/libcrypto/err/err_prn.c | 157 | ||||
| -rw-r--r-- | src/lib/libcrypto/err/openssl.ec | 89 |
6 files changed, 1272 insertions, 0 deletions
diff --git a/src/lib/libcrypto/err/Makefile.ssl b/src/lib/libcrypto/err/Makefile.ssl new file mode 100644 index 0000000000..b253061d07 --- /dev/null +++ b/src/lib/libcrypto/err/Makefile.ssl | |||
| @@ -0,0 +1,119 @@ | |||
| 1 | # | ||
| 2 | # SSLeay/crypto/err/Makefile | ||
| 3 | # | ||
| 4 | |||
| 5 | DIR= err | ||
| 6 | TOP= ../.. | ||
| 7 | CC= cc | ||
| 8 | INCLUDES= -I.. -I$(TOP) -I../../include | ||
| 9 | CFLAG=-g | ||
| 10 | INSTALL_PREFIX= | ||
| 11 | OPENSSLDIR= /usr/local/ssl | ||
| 12 | INSTALLTOP=/usr/local/ssl | ||
| 13 | MAKE= make -f Makefile.ssl | ||
| 14 | MAKEDEPPROG= makedepend | ||
| 15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
| 16 | MAKEFILE= Makefile.ssl | ||
| 17 | AR= ar r | ||
| 18 | |||
| 19 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
| 20 | |||
| 21 | GENERAL=Makefile | ||
| 22 | TEST= | ||
| 23 | APPS= | ||
| 24 | |||
| 25 | LIB=$(TOP)/libcrypto.a | ||
| 26 | LIBSRC=err.c err_all.c err_prn.c | ||
| 27 | LIBOBJ=err.o err_all.o err_prn.o | ||
| 28 | |||
| 29 | SRC= $(LIBSRC) | ||
| 30 | |||
| 31 | EXHEADER= err.h | ||
| 32 | HEADER= $(EXHEADER) | ||
| 33 | |||
| 34 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
| 35 | |||
| 36 | top: | ||
| 37 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) | ||
| 38 | |||
| 39 | all: lib | ||
| 40 | |||
| 41 | lib: $(LIBOBJ) | ||
| 42 | $(AR) $(LIB) $(LIBOBJ) | ||
| 43 | $(RANLIB) $(LIB) || echo Never mind. | ||
| 44 | @touch lib | ||
| 45 | |||
| 46 | files: | ||
| 47 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | ||
| 48 | |||
| 49 | links: | ||
| 50 | @sh $(TOP)/util/point.sh Makefile.ssl Makefile | ||
| 51 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) | ||
| 52 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) | ||
| 53 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) | ||
| 54 | |||
| 55 | install: | ||
| 56 | @for i in $(EXHEADER) ; \ | ||
| 57 | do \ | ||
| 58 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | ||
| 59 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | ||
| 60 | done; | ||
| 61 | |||
| 62 | tags: | ||
| 63 | ctags $(SRC) | ||
| 64 | |||
| 65 | tests: | ||
| 66 | |||
| 67 | lint: | ||
| 68 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
| 69 | |||
| 70 | depend: | ||
| 71 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) | ||
| 72 | |||
| 73 | dclean: | ||
| 74 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
| 75 | mv -f Makefile.new $(MAKEFILE) | ||
| 76 | |||
| 77 | clean: | ||
| 78 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
| 79 | |||
| 80 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
| 81 | |||
| 82 | err.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
| 83 | err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
| 84 | err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
| 85 | err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 86 | err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
| 87 | err.o: ../../include/openssl/symhacks.h ../cryptlib.h err.c | ||
| 88 | err_all.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h | ||
| 89 | err_all.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
| 90 | err_all.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
| 91 | err_all.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
| 92 | err_all.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 93 | err_all.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
| 94 | err_all.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h | ||
| 95 | err_all.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
| 96 | err_all.o: ../../include/openssl/engine.h ../../include/openssl/err.h | ||
| 97 | err_all.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
| 98 | err_all.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
| 99 | err_all.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
| 100 | err_all.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
| 101 | err_all.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h | ||
| 102 | err_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 103 | err_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem2.h | ||
| 104 | err_all.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
| 105 | err_all.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h | ||
| 106 | err_all.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
| 107 | err_all.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
| 108 | err_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
| 109 | err_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 110 | err_all.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
| 111 | err_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
| 112 | err_all.o: ../../include/openssl/x509v3.h err_all.c | ||
| 113 | err_prn.o: ../../e_os.h ../../include/openssl/bio.h | ||
| 114 | err_prn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
| 115 | err_prn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
| 116 | err_prn.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
| 117 | err_prn.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
| 118 | err_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 119 | err_prn.o: ../cryptlib.h err_prn.c | ||
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c new file mode 100644 index 0000000000..292404a2fb --- /dev/null +++ b/src/lib/libcrypto/err/err.c | |||
| @@ -0,0 +1,416 @@ | |||
| 1 | /* crypto/err/err.c */ | ||
| 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-2001 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 | #include <stdio.h> | ||
| 113 | #include <stdarg.h> | ||
| 114 | #include <string.h> | ||
| 115 | #include "cryptlib.h" | ||
| 116 | #include <openssl/lhash.h> | ||
| 117 | #include <openssl/crypto.h> | ||
| 118 | #include <openssl/buffer.h> | ||
| 119 | #include <openssl/bio.h> | ||
| 120 | #include <openssl/err.h> | ||
| 121 | |||
| 122 | static unsigned long get_error_values(int inc,int top, | ||
| 123 | const char **file,int *line, | ||
| 124 | const char **data,int *flags); | ||
| 125 | |||
| 126 | #define err_clear_data(p,i) \ | ||
| 127 | do { \ | ||
| 128 | if (((p)->err_data[i] != NULL) && \ | ||
| 129 | (p)->err_data_flags[i] & ERR_TXT_MALLOCED) \ | ||
| 130 | { \ | ||
| 131 | OPENSSL_free((p)->err_data[i]); \ | ||
| 132 | (p)->err_data[i]=NULL; \ | ||
| 133 | } \ | ||
| 134 | (p)->err_data_flags[i]=0; \ | ||
| 135 | } while(0) | ||
| 136 | |||
| 137 | #define err_clear(p,i) \ | ||
| 138 | do { \ | ||
| 139 | (p)->err_flags[i]=0; \ | ||
| 140 | (p)->err_buffer[i]=0; \ | ||
| 141 | err_clear_data(p,i); \ | ||
| 142 | (p)->err_file[i]=NULL; \ | ||
| 143 | (p)->err_line[i]= -1; \ | ||
| 144 | } while(0) | ||
| 145 | |||
| 146 | void ERR_put_error(int lib, int func, int reason, const char *file, | ||
| 147 | int line) | ||
| 148 | { | ||
| 149 | ERR_STATE *es; | ||
| 150 | |||
| 151 | #ifdef _OSD_POSIX | ||
| 152 | /* In the BS2000-OSD POSIX subsystem, the compiler generates | ||
| 153 | * path names in the form "*POSIX(/etc/passwd)". | ||
| 154 | * This dirty hack strips them to something sensible. | ||
| 155 | * @@@ We shouldn't modify a const string, though. | ||
| 156 | */ | ||
| 157 | if (strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) { | ||
| 158 | char *end; | ||
| 159 | |||
| 160 | /* Skip the "*POSIX(" prefix */ | ||
| 161 | file += sizeof("*POSIX(")-1; | ||
| 162 | end = &file[strlen(file)-1]; | ||
| 163 | if (*end == ')') | ||
| 164 | *end = '\0'; | ||
| 165 | /* Optional: use the basename of the path only. */ | ||
| 166 | if ((end = strrchr(file, '/')) != NULL) | ||
| 167 | file = &end[1]; | ||
| 168 | } | ||
| 169 | #endif | ||
| 170 | es=ERR_get_state(); | ||
| 171 | |||
| 172 | es->top=(es->top+1)%ERR_NUM_ERRORS; | ||
| 173 | if (es->top == es->bottom) | ||
| 174 | es->bottom=(es->bottom+1)%ERR_NUM_ERRORS; | ||
| 175 | es->err_flags[es->top]=0; | ||
| 176 | es->err_buffer[es->top]=ERR_PACK(lib,func,reason); | ||
| 177 | es->err_file[es->top]=file; | ||
| 178 | es->err_line[es->top]=line; | ||
| 179 | err_clear_data(es,es->top); | ||
| 180 | } | ||
| 181 | |||
| 182 | void ERR_clear_error(void) | ||
| 183 | { | ||
| 184 | int i; | ||
| 185 | ERR_STATE *es; | ||
| 186 | |||
| 187 | es=ERR_get_state(); | ||
| 188 | |||
| 189 | for (i=0; i<ERR_NUM_ERRORS; i++) | ||
| 190 | { | ||
| 191 | err_clear(es,i); | ||
| 192 | } | ||
| 193 | es->top=es->bottom=0; | ||
| 194 | } | ||
| 195 | |||
| 196 | |||
| 197 | unsigned long ERR_get_error(void) | ||
| 198 | { return(get_error_values(1,0,NULL,NULL,NULL,NULL)); } | ||
| 199 | |||
| 200 | unsigned long ERR_get_error_line(const char **file, | ||
| 201 | int *line) | ||
| 202 | { return(get_error_values(1,0,file,line,NULL,NULL)); } | ||
| 203 | |||
| 204 | unsigned long ERR_get_error_line_data(const char **file, int *line, | ||
| 205 | const char **data, int *flags) | ||
| 206 | { return(get_error_values(1,0,file,line,data,flags)); } | ||
| 207 | |||
| 208 | |||
| 209 | unsigned long ERR_peek_error(void) | ||
| 210 | { return(get_error_values(0,0,NULL,NULL,NULL,NULL)); } | ||
| 211 | |||
| 212 | unsigned long ERR_peek_error_line(const char **file, int *line) | ||
| 213 | { return(get_error_values(0,0,file,line,NULL,NULL)); } | ||
| 214 | |||
| 215 | unsigned long ERR_peek_error_line_data(const char **file, int *line, | ||
| 216 | const char **data, int *flags) | ||
| 217 | { return(get_error_values(0,0,file,line,data,flags)); } | ||
| 218 | |||
| 219 | |||
| 220 | unsigned long ERR_peek_last_error(void) | ||
| 221 | { return(get_error_values(0,1,NULL,NULL,NULL,NULL)); } | ||
| 222 | |||
| 223 | unsigned long ERR_peek_last_error_line(const char **file, int *line) | ||
| 224 | { return(get_error_values(0,1,file,line,NULL,NULL)); } | ||
| 225 | |||
| 226 | unsigned long ERR_peek_last_error_line_data(const char **file, int *line, | ||
| 227 | const char **data, int *flags) | ||
| 228 | { return(get_error_values(0,1,file,line,data,flags)); } | ||
| 229 | |||
| 230 | |||
| 231 | static unsigned long get_error_values(int inc, int top, const char **file, int *line, | ||
| 232 | const char **data, int *flags) | ||
| 233 | { | ||
| 234 | int i=0; | ||
| 235 | ERR_STATE *es; | ||
| 236 | unsigned long ret; | ||
| 237 | |||
| 238 | es=ERR_get_state(); | ||
| 239 | |||
| 240 | if (inc && top) | ||
| 241 | { | ||
| 242 | if (file) *file = ""; | ||
| 243 | if (line) *line = 0; | ||
| 244 | if (data) *data = ""; | ||
| 245 | if (flags) *flags = 0; | ||
| 246 | |||
| 247 | return ERR_R_INTERNAL_ERROR; | ||
| 248 | } | ||
| 249 | |||
| 250 | if (es->bottom == es->top) return 0; | ||
| 251 | if (top) | ||
| 252 | i=es->top; /* last error */ | ||
| 253 | else | ||
| 254 | i=(es->bottom+1)%ERR_NUM_ERRORS; /* first error */ | ||
| 255 | |||
| 256 | ret=es->err_buffer[i]; | ||
| 257 | if (inc) | ||
| 258 | { | ||
| 259 | es->bottom=i; | ||
| 260 | es->err_buffer[i]=0; | ||
| 261 | } | ||
| 262 | |||
| 263 | if ((file != NULL) && (line != NULL)) | ||
| 264 | { | ||
| 265 | if (es->err_file[i] == NULL) | ||
| 266 | { | ||
| 267 | *file="NA"; | ||
| 268 | if (line != NULL) *line=0; | ||
| 269 | } | ||
| 270 | else | ||
| 271 | { | ||
| 272 | *file=es->err_file[i]; | ||
| 273 | if (line != NULL) *line=es->err_line[i]; | ||
| 274 | } | ||
| 275 | } | ||
| 276 | |||
| 277 | if (data == NULL) | ||
| 278 | { | ||
| 279 | if (inc) | ||
| 280 | { | ||
| 281 | err_clear_data(es, i); | ||
| 282 | } | ||
| 283 | } | ||
| 284 | else | ||
| 285 | { | ||
| 286 | if (es->err_data[i] == NULL) | ||
| 287 | { | ||
| 288 | *data=""; | ||
| 289 | if (flags != NULL) *flags=0; | ||
| 290 | } | ||
| 291 | else | ||
| 292 | { | ||
| 293 | *data=es->err_data[i]; | ||
| 294 | if (flags != NULL) *flags=es->err_data_flags[i]; | ||
| 295 | } | ||
| 296 | } | ||
| 297 | return ret; | ||
| 298 | } | ||
| 299 | |||
| 300 | void ERR_set_error_data(char *data, int flags) | ||
| 301 | { | ||
| 302 | ERR_STATE *es; | ||
| 303 | int i; | ||
| 304 | |||
| 305 | es=ERR_get_state(); | ||
| 306 | |||
| 307 | i=es->top; | ||
| 308 | if (i == 0) | ||
| 309 | i=ERR_NUM_ERRORS-1; | ||
| 310 | |||
| 311 | err_clear_data(es,i); | ||
| 312 | es->err_data[i]=data; | ||
| 313 | es->err_data_flags[i]=flags; | ||
| 314 | } | ||
| 315 | |||
| 316 | void ERR_add_error_data(int num, ...) | ||
| 317 | { | ||
| 318 | va_list args; | ||
| 319 | int i,n,s; | ||
| 320 | char *str,*p,*a; | ||
| 321 | |||
| 322 | s=80; | ||
| 323 | str=OPENSSL_malloc(s+1); | ||
| 324 | if (str == NULL) return; | ||
| 325 | str[0]='\0'; | ||
| 326 | |||
| 327 | va_start(args, num); | ||
| 328 | n=0; | ||
| 329 | for (i=0; i<num; i++) | ||
| 330 | { | ||
| 331 | a=va_arg(args, char*); | ||
| 332 | /* ignore NULLs, thanks to Bob Beck <beck@obtuse.com> */ | ||
| 333 | if (a != NULL) | ||
| 334 | { | ||
| 335 | n+=strlen(a); | ||
| 336 | if (n > s) | ||
| 337 | { | ||
| 338 | s=n+20; | ||
| 339 | p=OPENSSL_realloc(str,s+1); | ||
| 340 | if (p == NULL) | ||
| 341 | { | ||
| 342 | OPENSSL_free(str); | ||
| 343 | goto err; | ||
| 344 | } | ||
| 345 | else | ||
| 346 | str=p; | ||
| 347 | } | ||
| 348 | BUF_strlcat(str,a,(size_t)s+1); | ||
| 349 | } | ||
| 350 | } | ||
| 351 | ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING); | ||
| 352 | |||
| 353 | err: | ||
| 354 | va_end(args); | ||
| 355 | } | ||
| 356 | |||
| 357 | int ERR_set_mark(void) | ||
| 358 | { | ||
| 359 | ERR_STATE *es; | ||
| 360 | |||
| 361 | es=ERR_get_state(); | ||
| 362 | |||
| 363 | if (es->bottom == es->top) return 0; | ||
| 364 | es->err_flags[es->top]|=ERR_FLAG_MARK; | ||
| 365 | return 1; | ||
| 366 | } | ||
| 367 | |||
| 368 | int ERR_pop_to_mark(void) | ||
| 369 | { | ||
| 370 | ERR_STATE *es; | ||
| 371 | |||
| 372 | es=ERR_get_state(); | ||
| 373 | |||
| 374 | while(es->bottom != es->top | ||
| 375 | && (es->err_flags[es->top] & ERR_FLAG_MARK) == 0) | ||
| 376 | { | ||
| 377 | err_clear(es,es->top); | ||
| 378 | es->top-=1; | ||
| 379 | if (es->top == -1) es->top=ERR_NUM_ERRORS-1; | ||
| 380 | } | ||
| 381 | |||
| 382 | if (es->bottom == es->top) return 0; | ||
| 383 | es->err_flags[es->top]&=~ERR_FLAG_MARK; | ||
| 384 | return 1; | ||
| 385 | } | ||
| 386 | |||
| 387 | #ifdef OPENSSL_FIPS | ||
| 388 | |||
| 389 | static ERR_STATE *fget_state(void) | ||
| 390 | { | ||
| 391 | static ERR_STATE fstate; | ||
| 392 | return &fstate; | ||
| 393 | } | ||
| 394 | |||
| 395 | ERR_STATE *(*get_state_func)(void) = fget_state; | ||
| 396 | void (*remove_state_func)(unsigned long pid); | ||
| 397 | |||
| 398 | ERR_STATE *ERR_get_state(void) | ||
| 399 | { | ||
| 400 | return get_state_func(); | ||
| 401 | } | ||
| 402 | |||
| 403 | void int_ERR_set_state_func(ERR_STATE *(*get_func)(void), | ||
| 404 | void (*remove_func)(unsigned long pid)) | ||
| 405 | { | ||
| 406 | get_state_func = get_func; | ||
| 407 | remove_state_func = remove_func; | ||
| 408 | } | ||
| 409 | |||
| 410 | void ERR_remove_state(unsigned long pid) | ||
| 411 | { | ||
| 412 | if (remove_state_func) | ||
| 413 | remove_state_func(pid); | ||
| 414 | } | ||
| 415 | |||
| 416 | #endif | ||
diff --git a/src/lib/libcrypto/err/err.h b/src/lib/libcrypto/err/err.h new file mode 100644 index 0000000000..dcac415231 --- /dev/null +++ b/src/lib/libcrypto/err/err.h | |||
| @@ -0,0 +1,330 @@ | |||
| 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 | #ifndef HEADER_ERR_H | ||
| 60 | #define HEADER_ERR_H | ||
| 61 | |||
| 62 | #include <openssl/e_os2.h> | ||
| 63 | |||
| 64 | #ifndef OPENSSL_NO_FP_API | ||
| 65 | #include <stdio.h> | ||
| 66 | #include <stdlib.h> | ||
| 67 | #endif | ||
| 68 | |||
| 69 | #include <openssl/ossl_typ.h> | ||
| 70 | #ifndef OPENSSL_NO_BIO | ||
| 71 | #include <openssl/bio.h> | ||
| 72 | #endif | ||
| 73 | #ifndef OPENSSL_NO_LHASH | ||
| 74 | #include <openssl/lhash.h> | ||
| 75 | #endif | ||
| 76 | |||
| 77 | #ifdef __cplusplus | ||
| 78 | extern "C" { | ||
| 79 | #endif | ||
| 80 | |||
| 81 | #ifndef OPENSSL_NO_ERR | ||
| 82 | #define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e) | ||
| 83 | #else | ||
| 84 | #define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0) | ||
| 85 | #endif | ||
| 86 | |||
| 87 | #include <errno.h> | ||
| 88 | |||
| 89 | #define ERR_TXT_MALLOCED 0x01 | ||
| 90 | #define ERR_TXT_STRING 0x02 | ||
| 91 | |||
| 92 | #define ERR_FLAG_MARK 0x01 | ||
| 93 | |||
| 94 | #define ERR_NUM_ERRORS 16 | ||
| 95 | typedef struct err_state_st | ||
| 96 | { | ||
| 97 | unsigned long pid; | ||
| 98 | int err_flags[ERR_NUM_ERRORS]; | ||
| 99 | unsigned long err_buffer[ERR_NUM_ERRORS]; | ||
| 100 | char *err_data[ERR_NUM_ERRORS]; | ||
| 101 | int err_data_flags[ERR_NUM_ERRORS]; | ||
| 102 | const char *err_file[ERR_NUM_ERRORS]; | ||
| 103 | int err_line[ERR_NUM_ERRORS]; | ||
| 104 | int top,bottom; | ||
| 105 | } ERR_STATE; | ||
| 106 | |||
| 107 | /* library */ | ||
| 108 | #define ERR_LIB_NONE 1 | ||
| 109 | #define ERR_LIB_SYS 2 | ||
| 110 | #define ERR_LIB_BN 3 | ||
| 111 | #define ERR_LIB_RSA 4 | ||
| 112 | #define ERR_LIB_DH 5 | ||
| 113 | #define ERR_LIB_EVP 6 | ||
| 114 | #define ERR_LIB_BUF 7 | ||
| 115 | #define ERR_LIB_OBJ 8 | ||
| 116 | #define ERR_LIB_PEM 9 | ||
| 117 | #define ERR_LIB_DSA 10 | ||
| 118 | #define ERR_LIB_X509 11 | ||
| 119 | /* #define ERR_LIB_METH 12 */ | ||
| 120 | #define ERR_LIB_ASN1 13 | ||
| 121 | #define ERR_LIB_CONF 14 | ||
| 122 | #define ERR_LIB_CRYPTO 15 | ||
| 123 | #define ERR_LIB_EC 16 | ||
| 124 | #define ERR_LIB_SSL 20 | ||
| 125 | /* #define ERR_LIB_SSL23 21 */ | ||
| 126 | /* #define ERR_LIB_SSL2 22 */ | ||
| 127 | /* #define ERR_LIB_SSL3 23 */ | ||
| 128 | /* #define ERR_LIB_RSAREF 30 */ | ||
| 129 | /* #define ERR_LIB_PROXY 31 */ | ||
| 130 | #define ERR_LIB_BIO 32 | ||
| 131 | #define ERR_LIB_PKCS7 33 | ||
| 132 | #define ERR_LIB_X509V3 34 | ||
| 133 | #define ERR_LIB_PKCS12 35 | ||
| 134 | #define ERR_LIB_RAND 36 | ||
| 135 | #define ERR_LIB_DSO 37 | ||
| 136 | #define ERR_LIB_ENGINE 38 | ||
| 137 | #define ERR_LIB_OCSP 39 | ||
| 138 | #define ERR_LIB_UI 40 | ||
| 139 | #define ERR_LIB_COMP 41 | ||
| 140 | #define ERR_LIB_ECDSA 42 | ||
| 141 | #define ERR_LIB_ECDH 43 | ||
| 142 | #define ERR_LIB_STORE 44 | ||
| 143 | #define ERR_LIB_FIPS 45 | ||
| 144 | #define ERR_LIB_CMS 46 | ||
| 145 | #define ERR_LIB_JPAKE 47 | ||
| 146 | |||
| 147 | #define ERR_LIB_USER 128 | ||
| 148 | |||
| 149 | #define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__) | ||
| 150 | #define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__) | ||
| 151 | #define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),__FILE__,__LINE__) | ||
| 152 | #define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),__FILE__,__LINE__) | ||
| 153 | #define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),__FILE__,__LINE__) | ||
| 154 | #define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),__FILE__,__LINE__) | ||
| 155 | #define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),__FILE__,__LINE__) | ||
| 156 | #define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),__FILE__,__LINE__) | ||
| 157 | #define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),__FILE__,__LINE__) | ||
| 158 | #define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),__FILE__,__LINE__) | ||
| 159 | #define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),__FILE__,__LINE__) | ||
| 160 | #define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),__FILE__,__LINE__) | ||
| 161 | #define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),__FILE__,__LINE__) | ||
| 162 | #define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),__FILE__,__LINE__) | ||
| 163 | #define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),__FILE__,__LINE__) | ||
| 164 | #define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),__FILE__,__LINE__) | ||
| 165 | #define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),__FILE__,__LINE__) | ||
| 166 | #define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),__FILE__,__LINE__) | ||
| 167 | #define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),__FILE__,__LINE__) | ||
| 168 | #define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),__FILE__,__LINE__) | ||
| 169 | #define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),__FILE__,__LINE__) | ||
| 170 | #define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),__FILE__,__LINE__) | ||
| 171 | #define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__) | ||
| 172 | #define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__) | ||
| 173 | #define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__) | ||
| 174 | #define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__) | ||
| 175 | #define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__) | ||
| 176 | #define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__) | ||
| 177 | #define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__) | ||
| 178 | #define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__) | ||
| 179 | #define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__) | ||
| 180 | |||
| 181 | /* Borland C seems too stupid to be able to shift and do longs in | ||
| 182 | * the pre-processor :-( */ | ||
| 183 | #define ERR_PACK(l,f,r) (((((unsigned long)l)&0xffL)*0x1000000)| \ | ||
| 184 | ((((unsigned long)f)&0xfffL)*0x1000)| \ | ||
| 185 | ((((unsigned long)r)&0xfffL))) | ||
| 186 | #define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL) | ||
| 187 | #define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL) | ||
| 188 | #define ERR_GET_REASON(l) (int)((l)&0xfffL) | ||
| 189 | #define ERR_FATAL_ERROR(l) (int)((l)&ERR_R_FATAL) | ||
| 190 | |||
| 191 | |||
| 192 | /* OS functions */ | ||
| 193 | #define SYS_F_FOPEN 1 | ||
| 194 | #define SYS_F_CONNECT 2 | ||
| 195 | #define SYS_F_GETSERVBYNAME 3 | ||
| 196 | #define SYS_F_SOCKET 4 | ||
| 197 | #define SYS_F_IOCTLSOCKET 5 | ||
| 198 | #define SYS_F_BIND 6 | ||
| 199 | #define SYS_F_LISTEN 7 | ||
| 200 | #define SYS_F_ACCEPT 8 | ||
| 201 | #define SYS_F_WSASTARTUP 9 /* Winsock stuff */ | ||
| 202 | #define SYS_F_OPENDIR 10 | ||
| 203 | #define SYS_F_FREAD 11 | ||
| 204 | |||
| 205 | |||
| 206 | /* reasons */ | ||
| 207 | #define ERR_R_SYS_LIB ERR_LIB_SYS /* 2 */ | ||
| 208 | #define ERR_R_BN_LIB ERR_LIB_BN /* 3 */ | ||
| 209 | #define ERR_R_RSA_LIB ERR_LIB_RSA /* 4 */ | ||
| 210 | #define ERR_R_DH_LIB ERR_LIB_DH /* 5 */ | ||
| 211 | #define ERR_R_EVP_LIB ERR_LIB_EVP /* 6 */ | ||
| 212 | #define ERR_R_BUF_LIB ERR_LIB_BUF /* 7 */ | ||
| 213 | #define ERR_R_OBJ_LIB ERR_LIB_OBJ /* 8 */ | ||
| 214 | #define ERR_R_PEM_LIB ERR_LIB_PEM /* 9 */ | ||
| 215 | #define ERR_R_DSA_LIB ERR_LIB_DSA /* 10 */ | ||
| 216 | #define ERR_R_X509_LIB ERR_LIB_X509 /* 11 */ | ||
| 217 | #define ERR_R_ASN1_LIB ERR_LIB_ASN1 /* 13 */ | ||
| 218 | #define ERR_R_CONF_LIB ERR_LIB_CONF /* 14 */ | ||
| 219 | #define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO /* 15 */ | ||
| 220 | #define ERR_R_EC_LIB ERR_LIB_EC /* 16 */ | ||
| 221 | #define ERR_R_SSL_LIB ERR_LIB_SSL /* 20 */ | ||
| 222 | #define ERR_R_BIO_LIB ERR_LIB_BIO /* 32 */ | ||
| 223 | #define ERR_R_PKCS7_LIB ERR_LIB_PKCS7 /* 33 */ | ||
| 224 | #define ERR_R_X509V3_LIB ERR_LIB_X509V3 /* 34 */ | ||
| 225 | #define ERR_R_PKCS12_LIB ERR_LIB_PKCS12 /* 35 */ | ||
| 226 | #define ERR_R_RAND_LIB ERR_LIB_RAND /* 36 */ | ||
| 227 | #define ERR_R_DSO_LIB ERR_LIB_DSO /* 37 */ | ||
| 228 | #define ERR_R_ENGINE_LIB ERR_LIB_ENGINE /* 38 */ | ||
| 229 | #define ERR_R_OCSP_LIB ERR_LIB_OCSP /* 39 */ | ||
| 230 | #define ERR_R_UI_LIB ERR_LIB_UI /* 40 */ | ||
| 231 | #define ERR_R_COMP_LIB ERR_LIB_COMP /* 41 */ | ||
| 232 | #define ERR_R_ECDSA_LIB ERR_LIB_ECDSA /* 42 */ | ||
| 233 | #define ERR_R_ECDH_LIB ERR_LIB_ECDH /* 43 */ | ||
| 234 | #define ERR_R_STORE_LIB ERR_LIB_STORE /* 44 */ | ||
| 235 | |||
| 236 | #define ERR_R_NESTED_ASN1_ERROR 58 | ||
| 237 | #define ERR_R_BAD_ASN1_OBJECT_HEADER 59 | ||
| 238 | #define ERR_R_BAD_GET_ASN1_OBJECT_CALL 60 | ||
| 239 | #define ERR_R_EXPECTING_AN_ASN1_SEQUENCE 61 | ||
| 240 | #define ERR_R_ASN1_LENGTH_MISMATCH 62 | ||
| 241 | #define ERR_R_MISSING_ASN1_EOS 63 | ||
| 242 | |||
| 243 | /* fatal error */ | ||
| 244 | #define ERR_R_FATAL 64 | ||
| 245 | #define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL) | ||
| 246 | #define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL) | ||
| 247 | #define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL) | ||
| 248 | #define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL) | ||
| 249 | #define ERR_R_DISABLED (5|ERR_R_FATAL) | ||
| 250 | |||
| 251 | /* 99 is the maximum possible ERR_R_... code, higher values | ||
| 252 | * are reserved for the individual libraries */ | ||
| 253 | |||
| 254 | |||
| 255 | typedef struct ERR_string_data_st | ||
| 256 | { | ||
| 257 | unsigned long error; | ||
| 258 | const char *string; | ||
| 259 | } ERR_STRING_DATA; | ||
| 260 | |||
| 261 | void ERR_put_error(int lib, int func,int reason,const char *file,int line); | ||
| 262 | void ERR_set_error_data(char *data,int flags); | ||
| 263 | |||
| 264 | unsigned long ERR_get_error(void); | ||
| 265 | unsigned long ERR_get_error_line(const char **file,int *line); | ||
| 266 | unsigned long ERR_get_error_line_data(const char **file,int *line, | ||
| 267 | const char **data, int *flags); | ||
| 268 | unsigned long ERR_peek_error(void); | ||
| 269 | unsigned long ERR_peek_error_line(const char **file,int *line); | ||
| 270 | unsigned long ERR_peek_error_line_data(const char **file,int *line, | ||
| 271 | const char **data,int *flags); | ||
| 272 | unsigned long ERR_peek_last_error(void); | ||
| 273 | unsigned long ERR_peek_last_error_line(const char **file,int *line); | ||
| 274 | unsigned long ERR_peek_last_error_line_data(const char **file,int *line, | ||
| 275 | const char **data,int *flags); | ||
| 276 | void ERR_clear_error(void ); | ||
| 277 | char *ERR_error_string(unsigned long e,char *buf); | ||
| 278 | void ERR_error_string_n(unsigned long e, char *buf, size_t len); | ||
| 279 | const char *ERR_lib_error_string(unsigned long e); | ||
| 280 | const char *ERR_func_error_string(unsigned long e); | ||
| 281 | const char *ERR_reason_error_string(unsigned long e); | ||
| 282 | void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), | ||
| 283 | void *u); | ||
| 284 | #ifndef OPENSSL_NO_FP_API | ||
| 285 | void ERR_print_errors_fp(FILE *fp); | ||
| 286 | #endif | ||
| 287 | #ifndef OPENSSL_NO_BIO | ||
| 288 | void ERR_print_errors(BIO *bp); | ||
| 289 | void ERR_add_error_data(int num, ...); | ||
| 290 | #endif | ||
| 291 | void ERR_load_strings(int lib,ERR_STRING_DATA str[]); | ||
| 292 | void ERR_unload_strings(int lib,ERR_STRING_DATA str[]); | ||
| 293 | void ERR_load_ERR_strings(void); | ||
| 294 | void ERR_load_crypto_strings(void); | ||
| 295 | void ERR_free_strings(void); | ||
| 296 | |||
| 297 | void ERR_remove_state(unsigned long pid); /* if zero we look it up */ | ||
| 298 | ERR_STATE *ERR_get_state(void); | ||
| 299 | |||
| 300 | #ifndef OPENSSL_NO_LHASH | ||
| 301 | LHASH *ERR_get_string_table(void); | ||
| 302 | LHASH *ERR_get_err_state_table(void); | ||
| 303 | void ERR_release_err_state_table(LHASH **hash); | ||
| 304 | #endif | ||
| 305 | |||
| 306 | int ERR_get_next_error_library(void); | ||
| 307 | |||
| 308 | int ERR_set_mark(void); | ||
| 309 | int ERR_pop_to_mark(void); | ||
| 310 | |||
| 311 | #ifdef OPENSSL_FIPS | ||
| 312 | void int_ERR_set_state_func(ERR_STATE *(*get_func)(void), | ||
| 313 | void (*remove_func)(unsigned long pid)); | ||
| 314 | void int_ERR_lib_init(void); | ||
| 315 | #endif | ||
| 316 | |||
| 317 | /* Already defined in ossl_typ.h */ | ||
| 318 | /* typedef struct st_ERR_FNS ERR_FNS; */ | ||
| 319 | /* An application can use this function and provide the return value to loaded | ||
| 320 | * modules that should use the application's ERR state/functionality */ | ||
| 321 | const ERR_FNS *ERR_get_implementation(void); | ||
| 322 | /* A loaded module should call this function prior to any ERR operations using | ||
| 323 | * the application's "ERR_FNS". */ | ||
| 324 | int ERR_set_implementation(const ERR_FNS *fns); | ||
| 325 | |||
| 326 | #ifdef __cplusplus | ||
| 327 | } | ||
| 328 | #endif | ||
| 329 | |||
| 330 | #endif | ||
diff --git a/src/lib/libcrypto/err/err_all.c b/src/lib/libcrypto/err/err_all.c new file mode 100644 index 0000000000..f21a5276ed --- /dev/null +++ b/src/lib/libcrypto/err/err_all.c | |||
| @@ -0,0 +1,161 @@ | |||
| 1 | /* crypto/err/err_all.c */ | ||
| 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 | #include <stdio.h> | ||
| 60 | #include <openssl/asn1.h> | ||
| 61 | #include <openssl/bn.h> | ||
| 62 | #ifndef OPENSSL_NO_EC | ||
| 63 | #include <openssl/ec.h> | ||
| 64 | #endif | ||
| 65 | #include <openssl/buffer.h> | ||
| 66 | #include <openssl/bio.h> | ||
| 67 | #ifndef OPENSSL_NO_RSA | ||
| 68 | #include <openssl/rsa.h> | ||
| 69 | #endif | ||
| 70 | #ifndef OPENSSL_NO_DH | ||
| 71 | #include <openssl/dh.h> | ||
| 72 | #endif | ||
| 73 | #ifndef OPENSSL_NO_DSA | ||
| 74 | #include <openssl/dsa.h> | ||
| 75 | #endif | ||
| 76 | #ifndef OPENSSL_NO_ECDSA | ||
| 77 | #include <openssl/ecdsa.h> | ||
| 78 | #endif | ||
| 79 | #ifndef OPENSSL_NO_ECDH | ||
| 80 | #include <openssl/ecdh.h> | ||
| 81 | #endif | ||
| 82 | #include <openssl/evp.h> | ||
| 83 | #include <openssl/objects.h> | ||
| 84 | #include <openssl/pem2.h> | ||
| 85 | #include <openssl/x509.h> | ||
| 86 | #include <openssl/x509v3.h> | ||
| 87 | #include <openssl/conf.h> | ||
| 88 | #include <openssl/pkcs12.h> | ||
| 89 | #include <openssl/rand.h> | ||
| 90 | #include <openssl/dso.h> | ||
| 91 | #ifndef OPENSSL_NO_ENGINE | ||
| 92 | #include <openssl/engine.h> | ||
| 93 | #endif | ||
| 94 | #include <openssl/ui.h> | ||
| 95 | #include <openssl/ocsp.h> | ||
| 96 | #include <openssl/err.h> | ||
| 97 | #ifdef OPENSSL_FIPS | ||
| 98 | #include <openssl/fips.h> | ||
| 99 | #endif | ||
| 100 | |||
| 101 | #ifndef OPENSSL_NO_CMS | ||
| 102 | #include <openssl/cms.h> | ||
| 103 | #endif | ||
| 104 | #ifndef OPENSSL_NO_JPAKE | ||
| 105 | #include <openssl/jpake.h> | ||
| 106 | #endif | ||
| 107 | |||
| 108 | void ERR_load_crypto_strings(void) | ||
| 109 | { | ||
| 110 | #ifndef OPENSSL_NO_ERR | ||
| 111 | ERR_load_ERR_strings(); /* include error strings for SYSerr */ | ||
| 112 | ERR_load_BN_strings(); | ||
| 113 | #ifndef OPENSSL_NO_RSA | ||
| 114 | ERR_load_RSA_strings(); | ||
| 115 | #endif | ||
| 116 | #ifndef OPENSSL_NO_DH | ||
| 117 | ERR_load_DH_strings(); | ||
| 118 | #endif | ||
| 119 | ERR_load_EVP_strings(); | ||
| 120 | ERR_load_BUF_strings(); | ||
| 121 | ERR_load_OBJ_strings(); | ||
| 122 | ERR_load_PEM_strings(); | ||
| 123 | #ifndef OPENSSL_NO_DSA | ||
| 124 | ERR_load_DSA_strings(); | ||
| 125 | #endif | ||
| 126 | ERR_load_X509_strings(); | ||
| 127 | ERR_load_ASN1_strings(); | ||
| 128 | ERR_load_CONF_strings(); | ||
| 129 | ERR_load_CRYPTO_strings(); | ||
| 130 | #ifndef OPENSSL_NO_EC | ||
| 131 | ERR_load_EC_strings(); | ||
| 132 | #endif | ||
| 133 | #ifndef OPENSSL_NO_ECDSA | ||
| 134 | ERR_load_ECDSA_strings(); | ||
| 135 | #endif | ||
| 136 | #ifndef OPENSSL_NO_ECDH | ||
| 137 | ERR_load_ECDH_strings(); | ||
| 138 | #endif | ||
| 139 | /* skip ERR_load_SSL_strings() because it is not in this library */ | ||
| 140 | ERR_load_BIO_strings(); | ||
| 141 | ERR_load_PKCS7_strings(); | ||
| 142 | ERR_load_X509V3_strings(); | ||
| 143 | ERR_load_PKCS12_strings(); | ||
| 144 | ERR_load_RAND_strings(); | ||
| 145 | ERR_load_DSO_strings(); | ||
| 146 | #ifndef OPENSSL_NO_ENGINE | ||
| 147 | ERR_load_ENGINE_strings(); | ||
| 148 | #endif | ||
| 149 | ERR_load_OCSP_strings(); | ||
| 150 | ERR_load_UI_strings(); | ||
| 151 | #ifdef OPENSSL_FIPS | ||
| 152 | ERR_load_FIPS_strings(); | ||
| 153 | #endif | ||
| 154 | #ifndef OPENSSL_NO_CMS | ||
| 155 | ERR_load_CMS_strings(); | ||
| 156 | #endif | ||
| 157 | #ifndef OPENSSL_NO_JPAKE | ||
| 158 | ERR_load_JPAKE_strings(); | ||
| 159 | #endif | ||
| 160 | #endif | ||
| 161 | } | ||
diff --git a/src/lib/libcrypto/err/err_prn.c b/src/lib/libcrypto/err/err_prn.c new file mode 100644 index 0000000000..4cdf342fa6 --- /dev/null +++ b/src/lib/libcrypto/err/err_prn.c | |||
| @@ -0,0 +1,157 @@ | |||
| 1 | /* crypto/err/err_prn.c */ | ||
| 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 | #include <stdio.h> | ||
| 60 | #include "cryptlib.h" | ||
| 61 | #include <openssl/lhash.h> | ||
| 62 | #include <openssl/crypto.h> | ||
| 63 | #include <openssl/buffer.h> | ||
| 64 | #include <openssl/err.h> | ||
| 65 | |||
| 66 | void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), | ||
| 67 | void *u) | ||
| 68 | { | ||
| 69 | unsigned long l; | ||
| 70 | char buf[256]; | ||
| 71 | char buf2[4096]; | ||
| 72 | const char *file,*data; | ||
| 73 | int line,flags; | ||
| 74 | unsigned long es; | ||
| 75 | |||
| 76 | es=CRYPTO_thread_id(); | ||
| 77 | while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) | ||
| 78 | { | ||
| 79 | ERR_error_string_n(l, buf, sizeof buf); | ||
| 80 | BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf, | ||
| 81 | file, line, (flags & ERR_TXT_STRING) ? data : ""); | ||
| 82 | cb(buf2, strlen(buf2), u); | ||
| 83 | } | ||
| 84 | } | ||
| 85 | |||
| 86 | #ifndef OPENSSL_NO_FP_API | ||
| 87 | static int print_fp(const char *str, size_t len, void *fp) | ||
| 88 | { | ||
| 89 | return fwrite(str, 1, len, fp); | ||
| 90 | } | ||
| 91 | void ERR_print_errors_fp(FILE *fp) | ||
| 92 | { | ||
| 93 | ERR_print_errors_cb(print_fp, fp); | ||
| 94 | } | ||
| 95 | #endif | ||
| 96 | |||
| 97 | void ERR_error_string_n(unsigned long e, char *buf, size_t len) | ||
| 98 | { | ||
| 99 | char lsbuf[64], fsbuf[64], rsbuf[64]; | ||
| 100 | const char *ls,*fs,*rs; | ||
| 101 | unsigned long l,f,r; | ||
| 102 | |||
| 103 | l=ERR_GET_LIB(e); | ||
| 104 | f=ERR_GET_FUNC(e); | ||
| 105 | r=ERR_GET_REASON(e); | ||
| 106 | |||
| 107 | ls=ERR_lib_error_string(e); | ||
| 108 | fs=ERR_func_error_string(e); | ||
| 109 | rs=ERR_reason_error_string(e); | ||
| 110 | |||
| 111 | if (ls == NULL) | ||
| 112 | BIO_snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l); | ||
| 113 | if (fs == NULL) | ||
| 114 | BIO_snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f); | ||
| 115 | if (rs == NULL) | ||
| 116 | BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r); | ||
| 117 | |||
| 118 | BIO_snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf, | ||
| 119 | fs?fs:fsbuf, rs?rs:rsbuf); | ||
| 120 | if (strlen(buf) == len-1) | ||
| 121 | { | ||
| 122 | /* output may be truncated; make sure we always have 5 | ||
| 123 | * colon-separated fields, i.e. 4 colons ... */ | ||
| 124 | #define NUM_COLONS 4 | ||
| 125 | if (len > NUM_COLONS) /* ... if possible */ | ||
| 126 | { | ||
| 127 | int i; | ||
| 128 | char *s = buf; | ||
| 129 | |||
| 130 | for (i = 0; i < NUM_COLONS; i++) | ||
| 131 | { | ||
| 132 | char *colon = strchr(s, ':'); | ||
| 133 | if (colon == NULL || colon > &buf[len-1] - NUM_COLONS + i) | ||
| 134 | { | ||
| 135 | /* set colon no. i at last possible position | ||
| 136 | * (buf[len-1] is the terminating 0)*/ | ||
| 137 | colon = &buf[len-1] - NUM_COLONS + i; | ||
| 138 | *colon = ':'; | ||
| 139 | } | ||
| 140 | s = colon + 1; | ||
| 141 | } | ||
| 142 | } | ||
| 143 | } | ||
| 144 | } | ||
| 145 | |||
| 146 | /* BAD for multi-threading: uses a local buffer if ret == NULL */ | ||
| 147 | /* ERR_error_string_n should be used instead for ret != NULL | ||
| 148 | * as ERR_error_string cannot know how large the buffer is */ | ||
| 149 | char *ERR_error_string(unsigned long e, char *ret) | ||
| 150 | { | ||
| 151 | static char buf[256]; | ||
| 152 | |||
| 153 | if (ret == NULL) ret=buf; | ||
| 154 | ERR_error_string_n(e, ret, 256); | ||
| 155 | |||
| 156 | return ret; | ||
| 157 | } | ||
diff --git a/src/lib/libcrypto/err/openssl.ec b/src/lib/libcrypto/err/openssl.ec new file mode 100644 index 0000000000..868826624d --- /dev/null +++ b/src/lib/libcrypto/err/openssl.ec | |||
| @@ -0,0 +1,89 @@ | |||
| 1 | # crypto/err/openssl.ec | ||
| 2 | |||
| 3 | # configuration file for util/mkerr.pl | ||
| 4 | |||
| 5 | # files that may have to be rewritten by util/mkerr.pl | ||
| 6 | L ERR NONE NONE | ||
| 7 | L BN crypto/bn/bn.h crypto/bn/bn_err.c | ||
| 8 | L RSA crypto/rsa/rsa.h crypto/rsa/rsa_err.c | ||
| 9 | L DH crypto/dh/dh.h crypto/dh/dh_err.c | ||
| 10 | L EVP crypto/evp/evp.h crypto/evp/evp_err.c | ||
| 11 | L BUF crypto/buffer/buffer.h crypto/buffer/buf_err.c | ||
| 12 | L OBJ crypto/objects/objects.h crypto/objects/obj_err.c | ||
| 13 | L PEM crypto/pem/pem.h crypto/pem/pem_err.c | ||
| 14 | L DSA crypto/dsa/dsa.h crypto/dsa/dsa_err.c | ||
| 15 | L X509 crypto/x509/x509.h crypto/x509/x509_err.c | ||
| 16 | L ASN1 crypto/asn1/asn1.h crypto/asn1/asn1_err.c | ||
| 17 | L CONF crypto/conf/conf.h crypto/conf/conf_err.c | ||
| 18 | L CRYPTO crypto/crypto.h crypto/cpt_err.c | ||
| 19 | L EC crypto/ec/ec.h crypto/ec/ec_err.c | ||
| 20 | L SSL ssl/ssl.h ssl/ssl_err.c | ||
| 21 | L BIO crypto/bio/bio.h crypto/bio/bio_err.c | ||
| 22 | L PKCS7 crypto/pkcs7/pkcs7.h crypto/pkcs7/pkcs7err.c | ||
| 23 | L X509V3 crypto/x509v3/x509v3.h crypto/x509v3/v3err.c | ||
| 24 | L PKCS12 crypto/pkcs12/pkcs12.h crypto/pkcs12/pk12err.c | ||
| 25 | L RAND crypto/rand/rand.h crypto/rand/rand_err.c | ||
| 26 | L DSO crypto/dso/dso.h crypto/dso/dso_err.c | ||
| 27 | L ENGINE crypto/engine/engine.h crypto/engine/eng_err.c | ||
| 28 | L OCSP crypto/ocsp/ocsp.h crypto/ocsp/ocsp_err.c | ||
| 29 | L UI crypto/ui/ui.h crypto/ui/ui_err.c | ||
| 30 | L COMP crypto/comp/comp.h crypto/comp/comp_err.c | ||
| 31 | L ECDSA crypto/ecdsa/ecdsa.h crypto/ecdsa/ecs_err.c | ||
| 32 | L ECDH crypto/ecdh/ecdh.h crypto/ecdh/ech_err.c | ||
| 33 | L STORE crypto/store/store.h crypto/store/str_err.c | ||
| 34 | L FIPS fips/fips.h crypto/fips_err.h | ||
| 35 | L CMS crypto/cms/cms.h crypto/cms/cms_err.c | ||
| 36 | L JPAKE crypto/jpake/jpake.h crypto/jpake/jpake_err.c | ||
| 37 | |||
| 38 | # additional header files to be scanned for function names | ||
| 39 | L NONE crypto/x509/x509_vfy.h NONE | ||
| 40 | L NONE crypto/ec/ec_lcl.h NONE | ||
| 41 | L NONE crypto/cms/cms_lcl.h NONE | ||
| 42 | |||
| 43 | |||
| 44 | F RSAREF_F_RSA_BN2BIN | ||
| 45 | F RSAREF_F_RSA_PRIVATE_DECRYPT | ||
| 46 | F RSAREF_F_RSA_PRIVATE_ENCRYPT | ||
| 47 | F RSAREF_F_RSA_PUBLIC_DECRYPT | ||
| 48 | F RSAREF_F_RSA_PUBLIC_ENCRYPT | ||
| 49 | #F SSL_F_CLIENT_CERTIFICATE | ||
| 50 | |||
| 51 | R SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 | ||
| 52 | R SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 | ||
| 53 | R SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021 | ||
| 54 | R SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022 | ||
| 55 | R SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030 | ||
| 56 | R SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 | ||
| 57 | R SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 | ||
| 58 | R SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 | ||
| 59 | R SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 | ||
| 60 | R SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044 | ||
| 61 | R SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 | ||
| 62 | R SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046 | ||
| 63 | R SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 | ||
| 64 | R SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048 | ||
| 65 | R SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049 | ||
| 66 | R SSL_R_TLSV1_ALERT_DECODE_ERROR 1050 | ||
| 67 | R SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051 | ||
| 68 | R SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060 | ||
| 69 | R SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070 | ||
| 70 | R SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071 | ||
| 71 | R SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080 | ||
| 72 | R SSL_R_TLSV1_ALERT_USER_CANCELLED 1090 | ||
| 73 | R SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100 | ||
| 74 | |||
| 75 | R RSAREF_R_CONTENT_ENCODING 0x0400 | ||
| 76 | R RSAREF_R_DATA 0x0401 | ||
| 77 | R RSAREF_R_DIGEST_ALGORITHM 0x0402 | ||
| 78 | R RSAREF_R_ENCODING 0x0403 | ||
| 79 | R RSAREF_R_KEY 0x0404 | ||
| 80 | R RSAREF_R_KEY_ENCODING 0x0405 | ||
| 81 | R RSAREF_R_LEN 0x0406 | ||
| 82 | R RSAREF_R_MODULUS_LEN 0x0407 | ||
| 83 | R RSAREF_R_NEED_RANDOM 0x0408 | ||
| 84 | R RSAREF_R_PRIVATE_KEY 0x0409 | ||
| 85 | R RSAREF_R_PUBLIC_KEY 0x040a | ||
| 86 | R RSAREF_R_SIGNATURE 0x040b | ||
| 87 | R RSAREF_R_SIGNATURE_ENCODING 0x040c | ||
| 88 | R RSAREF_R_ENCRYPTION_ALGORITHM 0x040d | ||
| 89 | |||
