From de8f24ea083384bb66b32ec105dc4743c5663cdf Mon Sep 17 00:00:00 2001 From: beck <> Date: Wed, 29 Sep 1999 04:37:45 +0000 Subject: OpenSSL 0.9.4 merge --- src/lib/libcrypto/err/Makefile.ssl | 60 ++++++++--- src/lib/libcrypto/err/err.c | 185 +++++++++++++++++----------------- src/lib/libcrypto/err/err.h | 82 ++++++--------- src/lib/libcrypto/err/err_all.c | 34 ++++--- src/lib/libcrypto/err/err_code.pl | 105 -------------------- src/lib/libcrypto/err/err_genc.pl | 198 ------------------------------------- src/lib/libcrypto/err/err_prn.c | 20 ++-- src/lib/libcrypto/err/error.err | 13 --- src/lib/libcrypto/err/openssl.ec | 71 +++++++++++++ src/lib/libcrypto/err/ssleay.ec | 57 ----------- 10 files changed, 266 insertions(+), 559 deletions(-) delete mode 100644 src/lib/libcrypto/err/err_code.pl delete mode 100644 src/lib/libcrypto/err/err_genc.pl delete mode 100644 src/lib/libcrypto/err/error.err create mode 100644 src/lib/libcrypto/err/openssl.ec delete mode 100644 src/lib/libcrypto/err/ssleay.ec (limited to 'src/lib/libcrypto/err') diff --git a/src/lib/libcrypto/err/Makefile.ssl b/src/lib/libcrypto/err/Makefile.ssl index 57c87eb041..e0f5128f43 100644 --- a/src/lib/libcrypto/err/Makefile.ssl +++ b/src/lib/libcrypto/err/Makefile.ssl @@ -7,9 +7,11 @@ TOP= ../.. CC= cc INCLUDES= -I.. -I../../include CFLAG=-g +INSTALL_PREFIX= +OPENSSLDIR= /usr/local/ssl INSTALLTOP=/usr/local/ssl MAKE= make -f Makefile.ssl -MAKEDEPEND= makedepend -f Makefile.ssl +MAKEDEPEND= $(TOP)/util/domd $(TOP) MAKEFILE= Makefile.ssl AR= ar r @@ -37,24 +39,23 @@ all: lib lib: $(LIBOBJ) $(AR) $(LIB) $(LIBOBJ) - sh $(TOP)/util/ranlib.sh $(LIB) + $(RANLIB) $(LIB) @touch lib files: - perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO + $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO links: - /bin/rm -f Makefile - $(TOP)/util/point.sh Makefile.ssl Makefile ; - $(TOP)/util/mklink.sh ../../include $(EXHEADER) - $(TOP)/util/mklink.sh ../../test $(TEST) - $(TOP)/util/mklink.sh ../../apps $(APPS) + @$(TOP)/util/point.sh Makefile.ssl Makefile + @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) + @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) + @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) install: @for i in $(EXHEADER) ; \ do \ - (cp $$i $(INSTALLTOP)/include/$$i; \ - chmod 644 $(INSTALLTOP)/include/$$i ); \ + (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ + chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ done; tags: @@ -66,15 +67,44 @@ lint: lint -DLINT $(INCLUDES) $(SRC)>fluff depend: - $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) + $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC) dclean: - perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new + $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new mv -f Makefile.new $(MAKEFILE) clean: - /bin/rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff - -errors: + rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff # DO NOT DELETE THIS LINE -- make depend depends on it. + +err.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h +err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h +err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h +err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h +err.o: ../../include/openssl/opensslv.h ../../include/openssl/stack.h +err.o: ../cryptlib.h +err_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h +err_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h +err_all.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h +err_all.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h +err_all.o: ../../include/openssl/des.h ../../include/openssl/dh.h +err_all.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h +err_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h +err_all.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h +err_all.o: ../../include/openssl/md2.h ../../include/openssl/md5.h +err_all.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h +err_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +err_all.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h +err_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h +err_all.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +err_all.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +err_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +err_all.o: ../../include/openssl/stack.h ../../include/openssl/x509.h +err_all.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h +err_prn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h +err_prn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h +err_prn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h +err_prn.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h +err_prn.o: ../../include/openssl/opensslv.h ../../include/openssl/stack.h +err_prn.o: ../cryptlib.h diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c index 5aef6a1259..8810d838c6 100644 --- a/src/lib/libcrypto/err/err.c +++ b/src/lib/libcrypto/err/err.c @@ -57,34 +57,25 @@ */ #include -#include "lhash.h" -#include "crypto.h" +#include +#include +#include #include "cryptlib.h" -#include "buffer.h" -#include "err.h" -#include "crypto.h" +#include +#include +#include static LHASH *error_hash=NULL; static LHASH *thread_hash=NULL; -#ifndef NOPROTO static unsigned long err_hash(ERR_STRING_DATA *a); static int err_cmp(ERR_STRING_DATA *a, ERR_STRING_DATA *b); static unsigned long pid_hash(ERR_STATE *pid); static int pid_cmp(ERR_STATE *a,ERR_STATE *pid); -static unsigned long get_error_values(int inc,char **file,int *line, - char **data,int *flags); +static unsigned long get_error_values(int inc,const char **file,int *line, + const char **data,int *flags); static void ERR_STATE_free(ERR_STATE *s); -#else -static unsigned long err_hash(); -static int err_cmp(); -static unsigned long pid_hash(); -static int pid_cmp(); -static void ERR_STATE_free(); -ERR_STATE *s; -#endif - #ifndef NO_ERR static ERR_STRING_DATA ERR_str_libraries[]= { @@ -107,6 +98,8 @@ static ERR_STRING_DATA ERR_str_libraries[]= {ERR_PACK(ERR_LIB_PROXY,0,0) ,"Proxy routines"}, {ERR_PACK(ERR_LIB_BIO,0,0) ,"BIO routines"}, {ERR_PACK(ERR_LIB_PKCS7,0,0) ,"PKCS7 routines"}, +{ERR_PACK(ERR_LIB_X509V3,0,0) ,"X509 V3 routines"}, +{ERR_PACK(ERR_LIB_PKCS12,0,0) ,"PKCS12 routines"}, {0,NULL}, }; @@ -123,6 +116,7 @@ static ERR_STRING_DATA ERR_str_functs[]= #ifdef WINDOWS {ERR_PACK(0,SYS_F_WSASTARTUP,0), "WSAstartup"}, #endif + {ERR_PACK(0,SYS_F_OPENDIR,0), "opendir"}, {0,NULL}, }; @@ -146,8 +140,17 @@ static ERR_STRING_DATA ERR_str_reasons[]= {ERR_R_PROXY_LIB ,"PROXY lib"}, {ERR_R_BIO_LIB ,"BIO lib"}, {ERR_R_PKCS7_LIB ,"PKCS7 lib"}, +{ERR_R_PKCS12_LIB ,"PKCS12 lib"}, {ERR_R_MALLOC_FAILURE ,"Malloc failure"}, -{ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED ,"called a fuction you should not call"}, +{ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED ,"called a function you should not call"}, +{ERR_R_PASSED_NULL_PARAMETER ,"passed a null parameter"}, +{ERR_R_NESTED_ASN1_ERROR ,"nested asn1 error"}, +{ERR_R_BAD_ASN1_OBJECT_HEADER ,"bad asn1 object header"}, +{ERR_R_BAD_GET_ASN1_OBJECT_CALL ,"bad get asn1 object call"}, +{ERR_R_EXPECTING_AN_ASN1_SEQUENCE ,"expecting an asn1 sequence"}, +{ERR_R_ASN1_LENGTH_MISMATCH ,"asn1 length mismatch"}, +{ERR_R_MISSING_ASN1_EOS ,"missing asn1 eos"}, + {0,NULL}, }; #endif @@ -161,11 +164,13 @@ static ERR_STRING_DATA ERR_str_reasons[]= } \ (p)->err_data_flags[i]=0; -static void ERR_STATE_free(s) -ERR_STATE *s; +static void ERR_STATE_free(ERR_STATE *s) { int i; + if(s == NULL) + return; + for (i=0; itop=(es->top+1)%ERR_NUM_ERRORS; @@ -257,7 +277,7 @@ int line; err_clear_data(es,es->top); } -void ERR_clear_error() +void ERR_clear_error(void) { ERR_STATE *es; @@ -277,42 +297,32 @@ void ERR_clear_error() } -unsigned long ERR_get_error() +unsigned long ERR_get_error(void) { return(get_error_values(1,NULL,NULL,NULL,NULL)); } -unsigned long ERR_get_error_line(file,line) -char **file; -int *line; +unsigned long ERR_get_error_line(const char **file, + int *line) { return(get_error_values(1,file,line,NULL,NULL)); } -unsigned long ERR_get_error_line_data(file,line,data,flags) -char **file; -int *line; -char **data; -int *flags; - { return(get_error_values(1,file,line,data,flags)); } +unsigned long ERR_get_error_line_data(const char **file, int *line, + const char **data, int *flags) + { return(get_error_values(1,file,line, + data,flags)); } -unsigned long ERR_peek_error() +unsigned long ERR_peek_error(void) { return(get_error_values(0,NULL,NULL,NULL,NULL)); } -unsigned long ERR_peek_error_line(file,line) -char **file; -int *line; +unsigned long ERR_peek_error_line(const char **file, + int *line) { return(get_error_values(0,file,line,NULL,NULL)); } -unsigned long ERR_peek_error_line_data(file,line,data,flags) -char **file; -int *line; -char **data; -int *flags; - { return(get_error_values(0,file,line,data,flags)); } - -static unsigned long get_error_values(inc,file,line,data,flags) -int inc; -char **file; -int *line; -char **data; -int *flags; +unsigned long ERR_peek_error_line_data(const char **file, int *line, + const char **data, int *flags) + { return(get_error_values(0,file,line, + data,flags)); } + +static unsigned long get_error_values(int inc, const char **file, int *line, + const char **data, int *flags) { int i=0; ERR_STATE *es; @@ -361,12 +371,10 @@ int *flags; } /* BAD for multi-threaded, uses a local buffer if ret == NULL */ -char *ERR_error_string(e,ret) -unsigned long e; -char *ret; +char *ERR_error_string(unsigned long e, char *ret) { static char buf[256]; - char *ls,*fs,*rs; + const char *ls,*fs,*rs; unsigned long l,f,r; int i; @@ -397,18 +405,17 @@ char *ret; return(ret); } -LHASH *ERR_get_string_table() +LHASH *ERR_get_string_table(void) { return(error_hash); } -LHASH *ERR_get_err_state_table() +LHASH *ERR_get_err_state_table(void) { return(thread_hash); } -char *ERR_lib_error_string(e) -unsigned long e; +const char *ERR_lib_error_string(unsigned long e) { ERR_STRING_DATA d,*p=NULL; unsigned long l; @@ -428,8 +435,7 @@ unsigned long e; return((p == NULL)?NULL:p->string); } -char *ERR_func_error_string(e) -unsigned long e; +const char *ERR_func_error_string(unsigned long e) { ERR_STRING_DATA d,*p=NULL; unsigned long l,f; @@ -450,8 +456,7 @@ unsigned long e; return((p == NULL)?NULL:p->string); } -char *ERR_reason_error_string(e) -unsigned long e; +const char *ERR_reason_error_string(unsigned long e) { ERR_STRING_DATA d,*p=NULL; unsigned long l,r; @@ -478,8 +483,7 @@ unsigned long e; return((p == NULL)?NULL:p->string); } -static unsigned long err_hash(a) -ERR_STRING_DATA *a; +static unsigned long err_hash(ERR_STRING_DATA *a) { unsigned long ret,l; @@ -488,26 +492,22 @@ ERR_STRING_DATA *a; return(ret^ret%19*13); } -static int err_cmp(a,b) -ERR_STRING_DATA *a,*b; +static int err_cmp(ERR_STRING_DATA *a, ERR_STRING_DATA *b) { return((int)(a->error-b->error)); } -static unsigned long pid_hash(a) -ERR_STATE *a; +static unsigned long pid_hash(ERR_STATE *a) { return(a->pid*13); } -static int pid_cmp(a,b) -ERR_STATE *a,*b; +static int pid_cmp(ERR_STATE *a, ERR_STATE *b) { return((int)((long)a->pid - (long)b->pid)); } -void ERR_remove_state(pid) -unsigned long pid; +void ERR_remove_state(unsigned long pid) { ERR_STATE *p,tmp; @@ -523,7 +523,7 @@ unsigned long pid; if (p != NULL) ERR_STATE_free(p); } -ERR_STATE *ERR_get_state() +ERR_STATE *ERR_get_state(void) { static ERR_STATE fallback; ERR_STATE *ret=NULL,tmp,*tmpp; @@ -539,7 +539,9 @@ ERR_STATE *ERR_get_state() CRYPTO_w_lock(CRYPTO_LOCK_ERR); if (thread_hash == NULL) { + MemCheck_off(); thread_hash=lh_new(pid_hash,pid_cmp); + MemCheck_on(); CRYPTO_w_unlock(CRYPTO_LOCK_ERR); if (thread_hash == NULL) return(&fallback); } @@ -577,16 +579,14 @@ ERR_STATE *ERR_get_state() return(ret); } -int ERR_get_next_error_library() +int ERR_get_next_error_library(void) { static int value=ERR_LIB_USER; return(value++); } -void ERR_set_error_data(data,flags) -char *data; -int flags; +void ERR_set_error_data(char *data, int flags) { ERR_STATE *es; int i; @@ -601,10 +601,9 @@ int flags; es->err_data_flags[es->top]=flags; } -void ERR_add_error_data( VAR_PLIST(int , num)) -VAR_ALIST - { - VAR_BDEFN(args, int, num); +void ERR_add_error_data(int num, ...) + { + va_list args; int i,n,s; char *str,*p,*a; @@ -613,12 +612,14 @@ VAR_ALIST if (str == NULL) return; str[0]='\0'; - VAR_INIT(args,int,num); + va_start(args, num); n=0; for (i=0; i */ + if (a != NULL) + { n+=strlen(a); if (n > s) { @@ -637,6 +638,6 @@ VAR_ALIST } ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING); - VAR_END( args ); + va_end(args); } diff --git a/src/lib/libcrypto/err/err.h b/src/lib/libcrypto/err/err.h index 75f931be11..9411fb3568 100644 --- a/src/lib/libcrypto/err/err.h +++ b/src/lib/libcrypto/err/err.h @@ -63,6 +63,10 @@ extern "C" { #endif +#ifndef NO_FP_API +#include +#endif + /* The following is a bit of a trick to help the object files only contain * the 'name of the file' string once. Since 'err.h' is protected by the * HEADER_ERR_H stuff, this should be included only once per file. */ @@ -87,7 +91,7 @@ typedef struct err_state_st unsigned long err_buffer[ERR_NUM_ERRORS]; char *err_data[ERR_NUM_ERRORS]; int err_data_flags[ERR_NUM_ERRORS]; - char *err_file[ERR_NUM_ERRORS]; + const char *err_file[ERR_NUM_ERRORS]; int err_line[ERR_NUM_ERRORS]; int top,bottom; } ERR_STATE; @@ -116,6 +120,8 @@ typedef struct err_state_st #define ERR_LIB_PROXY 31 #define ERR_LIB_BIO 32 #define ERR_LIB_PKCS7 33 +#define ERR_LIB_X509V3 34 +#define ERR_LIB_PKCS12 35 #define ERR_LIB_USER 128 @@ -141,6 +147,8 @@ typedef struct err_state_st #define RSAREFerr(f,r) ERR_PUT_error(ERR_LIB_RSAREF,(f),(r),ERR_file_name,__LINE__) #define PROXYerr(f,r) ERR_PUT_error(ERR_LIB_PROXY,(f),(r),ERR_file_name,__LINE__) #define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),ERR_file_name,__LINE__) +#define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),ERR_file_name,__LINE__) +#define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),ERR_file_name,__LINE__) /* Borland C seems too stupid to be able to shift and do longs in * the pre-processor :-( */ @@ -162,6 +170,7 @@ typedef struct err_state_st #define SYS_F_LISTEN 7 #define SYS_F_ACCEPT 8 #define SYS_F_WSASTARTUP 9 /* Winsock stuff */ +#define SYS_F_OPENDIR 10 #define ERR_R_FATAL 32 /* reasons */ @@ -187,41 +196,47 @@ typedef struct err_state_st #define ERR_R_PROXY_LIB ERR_LIB_PROXY #define ERR_R_BIO_LIB ERR_LIB_BIO #define ERR_R_PKCS7_LIB ERR_LIB_PKCS7 +#define ERR_R_PKCS12_LIB ERR_LIB_PKCS12 /* fatal error */ #define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL) #define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL) #define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL) +#define ERR_R_NESTED_ASN1_ERROR (4) +#define ERR_R_BAD_ASN1_OBJECT_HEADER (5) +#define ERR_R_BAD_GET_ASN1_OBJECT_CALL (6) +#define ERR_R_EXPECTING_AN_ASN1_SEQUENCE (7) +#define ERR_R_ASN1_LENGTH_MISMATCH (8) +#define ERR_R_MISSING_ASN1_EOS (9) typedef struct ERR_string_data_st { unsigned long error; - char *string; + const char *string; } ERR_STRING_DATA; -#ifndef NOPROTO -void ERR_put_error(int lib, int func,int reason,char *file,int line); +void ERR_put_error(int lib, int func,int reason,const char *file,int line); void ERR_set_error_data(char *data,int flags); unsigned long ERR_get_error(void ); -unsigned long ERR_get_error_line(char **file,int *line); -unsigned long ERR_get_error_line_data(char **file,int *line, - char **data, int *flags); +unsigned long ERR_get_error_line(const char **file,int *line); +unsigned long ERR_get_error_line_data(const char **file,int *line, + const char **data, int *flags); unsigned long ERR_peek_error(void ); -unsigned long ERR_peek_error_line(char **file,int *line); -unsigned long ERR_peek_error_line_data(char **file,int *line, - char **data,int *flags); +unsigned long ERR_peek_error_line(const char **file,int *line); +unsigned long ERR_peek_error_line_data(const char **file,int *line, + const char **data,int *flags); void ERR_clear_error(void ); char *ERR_error_string(unsigned long e,char *buf); -char *ERR_lib_error_string(unsigned long e); -char *ERR_func_error_string(unsigned long e); -char *ERR_reason_error_string(unsigned long e); +const char *ERR_lib_error_string(unsigned long e); +const char *ERR_func_error_string(unsigned long e); +const char *ERR_reason_error_string(unsigned long e); #ifndef NO_FP_API void ERR_print_errors_fp(FILE *fp); #endif #ifdef HEADER_BIO_H void ERR_print_errors(BIO *bp); -void ERR_add_error_data( VAR_PLIST( int, num ) ); +void ERR_add_error_data(int num, ...); #endif void ERR_load_strings(int lib,ERR_STRING_DATA str[]); void ERR_load_ERR_strings(void ); @@ -241,45 +256,6 @@ char *ERR_get_err_state_table(void ); int ERR_get_next_error_library(void ); -#else - -void ERR_put_error(); -void ERR_set_error_data(); - -unsigned long ERR_get_error(); -unsigned long ERR_get_error_line(); -unsigned long ERR_peek_error(); -unsigned long ERR_peek_error_line(); -void ERR_clear_error(); -char *ERR_error_string(); -char *ERR_lib_error_string(); -char *ERR_func_error_string(); -char *ERR_reason_error_string(); -#ifndef NO_FP_API -void ERR_print_errors_fp(); -#endif -void ERR_print_errors(); -void ERR_add_error_data(); -void ERR_load_strings(); -void ERR_load_ERR_strings(); -void ERR_load_crypto_strings(); -void ERR_free_strings(); - -void ERR_remove_state(); -ERR_STATE *ERR_get_state(); - -#ifdef HEADER_LHASH_H -LHASH *ERR_get_string_table(); -LHASH *ERR_get_err_state_table(); -#else -char *ERR_get_string_table(); -char *ERR_get_err_state_table(); -#endif - -int ERR_get_next_error_library(); - -#endif - #ifdef __cplusplus } #endif diff --git a/src/lib/libcrypto/err/err_all.c b/src/lib/libcrypto/err/err_all.c index f874268e1a..ad820227d2 100644 --- a/src/lib/libcrypto/err/err_all.c +++ b/src/lib/libcrypto/err/err_all.c @@ -57,30 +57,32 @@ */ #include -#include "asn1.h" -#include "bn.h" -#include "buffer.h" -#include "bio.h" +#include +#include +#include +#include #ifndef NO_RSA -#include "rsa.h" +#include #endif #ifdef RSAref -#include "rsaref.h" +#include #endif #ifndef NO_DH -#include "dh.h" +#include #endif #ifndef NO_DSA -#include "dsa.h" +#include #endif -#include "evp.h" -#include "objects.h" -#include "pem.h" -#include "x509.h" -#include "conf.h" -#include "err.h" +#include +#include +#include +#include +#include +#include +#include +#include -void ERR_load_crypto_strings() +void ERR_load_crypto_strings(void) { static int done=0; @@ -110,7 +112,9 @@ void ERR_load_crypto_strings() ERR_load_OBJ_strings(); ERR_load_PEM_strings(); ERR_load_X509_strings(); + ERR_load_X509V3_strings(); ERR_load_CRYPTO_strings(); ERR_load_PKCS7_strings(); + ERR_load_PKCS12_strings(); #endif } diff --git a/src/lib/libcrypto/err/err_code.pl b/src/lib/libcrypto/err/err_code.pl deleted file mode 100644 index ebc8eef913..0000000000 --- a/src/lib/libcrypto/err/err_code.pl +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/perl - -while (@ARGV) - { - $in=shift(@ARGV); - if ($in =~ /^-conf$/) - { - $in=shift(@ARGV); - open(IN,"<$in") || die "unable to open '$in'\n"; - while () - { - s/#.*$//; - s/\s+$//; - next if (/^$/); - if (/^L\s+(\S+)\s+(\S+)$/) - { $errfile{$1}=$2; } - elsif (/^F\s+(\S+)$/) - { $function{$1}=1; } - elsif (/^R\s+(\S+)\s+(\S+)$/) - { $r_value{$1}=$2; } - else { die "bad input line: $in:$.\n"; } - } - close(IN); - next; - } - - open(IN,"<$in") || die "unable to open '$in'\n"; - $last=""; - while () - { - if (/err\(([A-Z0-9]+_F_[0-9A-Z_]+)\s*,\s*([0-9A-Z]+_R_[0-9A-Z_]+)\s*\)/) - { - if ($1 != $last) - { - if ($function{$1} == 0) - { - printf STDERR "$. $1 is bad\n"; - } - } - $function{$1}++; - $last=$1; - $reason{$2}++; - } - } - close(IN); - } - -foreach (keys %function,keys %reason) - { - /^([A-Z0-9]+)_/; - $prefix{$1}++; - } - -@F=sort keys %function; -@R=sort keys %reason; -foreach $j (sort keys %prefix) - { - next if $errfile{$j} eq "NONE"; - printf STDERR "doing %-6s - ",$j; - if (defined($errfile{$j})) - { - open(OUT,">$errfile{$j}") || - die "unable to open '$errfile{$j}':$!\n"; - $close_file=1; - } - else - { - *OUT=*STDOUT; - $close=0; - } - @f=grep(/^${j}_/,@F); - @r=grep(/^${j}_/,@R); - $num=100; - print OUT "/* Error codes for the $j functions. */\n\n"; - print OUT "/* Function codes. */\n"; - $f_count=0; - foreach $i (@f) - { - $z=6-int(length($i)/8); - printf OUT "#define $i%s $num\n","\t" x $z; - $num++; - $f_count++; - } - $num=100; - print OUT "\n/* Reason codes. */\n"; - $r_count=0; - foreach $i (@r) - { - $z=6-int(length($i)/8); - if (defined($r_value{$i})) - { - printf OUT "#define $i%s $r_value{$i}\n","\t" x $z; - } - else - { - printf OUT "#define $i%s $num\n","\t" x $z; - $num++; - } - $r_count++; - } - close(OUT) if $close_file; - - printf STDERR "%3d functions, %3d reasons\n",$f_count,$r_count; - } - diff --git a/src/lib/libcrypto/err/err_genc.pl b/src/lib/libcrypto/err/err_genc.pl deleted file mode 100644 index a8e36c2f0c..0000000000 --- a/src/lib/libcrypto/err/err_genc.pl +++ /dev/null @@ -1,198 +0,0 @@ -#!/usr/bin/perl - -if ($ARGV[0] eq "-s") { $static=1; shift @ARGV; } - -($#ARGV == 1) || die "usage: $0 [-s]
\n"; -open(IN,"<$ARGV[0]") || die "unable to open $ARGV[0]:$!\n"; -open(STDOUT,">$ARGV[1]") || die "unable to open $ARGV[1]:$!\n"; - -$Func=0; -$Reas=0; -$fuction{'FOPEN'}='fopen'; -while () - { - if (/(\S+)\s*\(\);/) - { - $t=$1; - $t =~ s/\*//; - ($upper=$t) =~ tr/a-z/A-Z/; - $fuction{$upper}=$t; - } - next unless (/^#define\s+(\S+)\s/); - - $o=$1; - if ($o =~ /^([^_]+)_F_(.*)/) - { - $type=$1; - $Func++; - $n=$2; - $n=$fuction{$n} if (defined($fuction{$n})); - $out{$1."_str_functs"}.= - sprintf("{ERR_PACK(0,%s,0),\t\"$n\"},\n",$o); - } - elsif ($o =~ /^([^_]+)_R_(.*)/) - { - $type=$1; - $Reas++; - $r=$2; - $r =~ tr/A-Z_/a-z /; - $pkg{$type."_str_reasons"}=$type; - $out{$type."_str_reasons"}.=sprintf("{%-40s,\"$r\"},\n",$o); - } - elsif ($ARGV[0] =~ /rsaref/ && $o =~ /^RE_(.*)/) - { - $type="RSAREF"; - $Reas++; - $r=$1; - $r =~ tr/A-Z_/a-z /; - $pkg{$type."_str_reasons"}=$type; - $out{$type."_str_reasons"}.=sprintf("{%-40s,\"$r\"},\n",$o); - } - } -close(IN); - -&header($type,$ARGV[0]); - -foreach (sort keys %out) - { - print "static ERR_STRING_DATA ${_}[]=\n\t{\n"; - print $out{$_}; - print "{0,NULL},\n"; - print "\t};\n\n"; - } -print "#endif\n"; - -if ($static) - { $lib="ERR_LIB_$type"; } -else - { $lib="${type}_lib_error_code"; } - -$str=""; -$str.="#ifndef NO_ERR\n"; -$str.="\t\tERR_load_strings($lib,${type}_str_functs);\n" if $Func; -$str.="\t\tERR_load_strings($lib,${type}_str_reasons);\n" if $Reas; -$str.="#endif\n"; - -if (!$static) - { -print <<"EOF"; - -static int ${type}_lib_error_code=0; - -void ERR_load_${type}_strings() - { - static int init=1; - - if (${type}_lib_error_code == 0) - ${type}_lib_error_code=ERR_get_next_error_library(); - - if (init); - {; - init=0; -$str - } - } - -void ERR_${type}_error(function,reason,file,line) -int function; -int reason; -char *file; -int line; - { - if (${type}_lib_error_code == 0) - ${type}_lib_error_code=ERR_get_next_error_library(); - ERR_PUT_error(${type}_lib_error_code,function,reason,file,line); - } -EOF - } -else # $static - { - print <<"EOF"; - -void ERR_load_${type}_strings() - { - static int init=1; - - if (init); - {; - init=0; -$str - } - } -EOF - } - -sub header - { - ($type,$header)=@_; - - ($lc=$type) =~ tr/A-Z/a-z/; - $header =~ s/^.*\///; - - print "/* lib/$lc/${lc}\_err.c */\n"; - print <<'EOF'; -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -EOF - - print "#include \n"; - print "#include \"err.h\"\n"; - print "#include \"$header\"\n"; - print "\n/* BEGIN ERROR CODES */\n"; - print "#ifndef NO_ERR\n"; - } - diff --git a/src/lib/libcrypto/err/err_prn.c b/src/lib/libcrypto/err/err_prn.c index ecd0e7c4fa..0999ff214b 100644 --- a/src/lib/libcrypto/err/err_prn.c +++ b/src/lib/libcrypto/err/err_prn.c @@ -57,20 +57,19 @@ */ #include -#include "lhash.h" -#include "crypto.h" +#include +#include #include "cryptlib.h" -#include "buffer.h" -#include "err.h" -#include "crypto.h" +#include +#include +#include #ifndef NO_FP_API -void ERR_print_errors_fp(fp) -FILE *fp; +void ERR_print_errors_fp(FILE *fp) { unsigned long l; char buf[200]; - char *file,*data; + const char *file,*data; int line,flags; unsigned long es; @@ -83,13 +82,12 @@ FILE *fp; } #endif -void ERR_print_errors(bp) -BIO *bp; +void ERR_print_errors(BIO *bp) { unsigned long l; char buf[256]; char buf2[256]; - char *file,*data; + const char *file,*data; int line,flags; unsigned long es; diff --git a/src/lib/libcrypto/err/error.err b/src/lib/libcrypto/err/error.err deleted file mode 100644 index f09557d8d9..0000000000 --- a/src/lib/libcrypto/err/error.err +++ /dev/null @@ -1,13 +0,0 @@ -/* Error codes for the ERR functions. */ - -/* Function codes. */ - -/* Reason codes. */ -#define ERR_R_BN_LIB 100 -#define ERR_R_DER_LIB 101 -#define ERR_R_MALLOC_FAILURE 102 -#define ERR_R_PEM_LIB 103 -#define ERR_R_RSA_LIB 104 -#define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED 105 -#define ERR_R_SYS_LIB 106 -#define ERR_R_X509_LIB 107 diff --git a/src/lib/libcrypto/err/openssl.ec b/src/lib/libcrypto/err/openssl.ec new file mode 100644 index 0000000000..c2a8acff0c --- /dev/null +++ b/src/lib/libcrypto/err/openssl.ec @@ -0,0 +1,71 @@ +L ERR NONE NONE +L CRYPTO crypto/crypto.h crypto/cpt_err.c +L BN crypto/bn/bn.h crypto/bn/bn_err.c +L RSA crypto/rsa/rsa.h crypto/rsa/rsa_err.c +L DSA crypto/dsa/dsa.h crypto/dsa/dsa_err.c +L DH crypto/dh/dh.h crypto/dh/dh_err.c +L EVP crypto/evp/evp.h crypto/evp/evp_err.c +L BUF crypto/buffer/buffer.h crypto/buffer/buf_err.c +L BIO crypto/bio/bio.h crypto/bio/bio_err.c +L OBJ crypto/objects/objects.h crypto/objects/obj_err.c +L PEM crypto/pem/pem.h crypto/pem/pem_err.c +L X509 crypto/x509/x509.h crypto/x509/x509_err.c +L NONE crypto/x509/x509_vfy.h NONE +L X509V3 crypto/x509v3/x509v3.h crypto/x509v3/v3err.c +#L METH crypto/meth/meth.h crypto/meth/meth_err.c +L ASN1 crypto/asn1/asn1.h crypto/asn1/asn1_err.c +L CONF crypto/conf/conf.h crypto/conf/conf_err.c +#L PROXY crypto/proxy/proxy.h crypto/proxy/proxy_err.c +L PKCS7 crypto/pkcs7/pkcs7.h crypto/pkcs7/pkcs7err.c +L PKCS12 crypto/pkcs12/pkcs12.h crypto/pkcs12/pk12err.c +L RSAREF rsaref/rsaref.h rsaref/rsar_err.c +L SSL ssl/ssl.h ssl/ssl_err.c +L COMP crypto/comp/comp.h crypto/comp/comp_err.c + + +F RSAREF_F_RSA_BN2BIN +F RSAREF_F_RSA_PRIVATE_DECRYPT +F RSAREF_F_RSA_PRIVATE_ENCRYPT +F RSAREF_F_RSA_PUBLIC_DECRYPT +F RSAREF_F_RSA_PUBLIC_ENCRYPT +#F SSL_F_CLIENT_CERTIFICATE + +R SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 +R SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 +R SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021 +R SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022 +R SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030 +R SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 +R SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 +R SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 +R SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 +R SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044 +R SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 +R SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046 +R SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 +R SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048 +R SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049 +R SSL_R_TLSV1_ALERT_DECODE_ERROR 1050 +R SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051 +R SSL_R_TLSV1_ALERT_EXPORT_RESTRICION 1060 +R SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070 +R SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071 +R SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080 +R SSL_R_TLSV1_ALERT_USER_CANCLED 1090 +R SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100 + +R RSAREF_R_CONTENT_ENCODING 0x0400 +R RSAREF_R_DATA 0x0401 +R RSAREF_R_DIGEST_ALGORITHM 0x0402 +R RSAREF_R_ENCODING 0x0403 +R RSAREF_R_KEY 0x0404 +R RSAREF_R_KEY_ENCODING 0x0405 +R RSAREF_R_LEN 0x0406 +R RSAREF_R_MODULUS_LEN 0x0407 +R RSAREF_R_NEED_RANDOM 0x0408 +R RSAREF_R_PRIVATE_KEY 0x0409 +R RSAREF_R_PUBLIC_KEY 0x040a +R RSAREF_R_SIGNATURE 0x040b +R RSAREF_R_SIGNATURE_ENCODING 0x040c +R RSAREF_R_ENCRYPTION_ALGORITHM 0x040d + diff --git a/src/lib/libcrypto/err/ssleay.ec b/src/lib/libcrypto/err/ssleay.ec deleted file mode 100644 index 10b5dbb59d..0000000000 --- a/src/lib/libcrypto/err/ssleay.ec +++ /dev/null @@ -1,57 +0,0 @@ -L ERR NONE -L CRYPTO crypto.err -L BN bn/bn.err -L RSA rsa/rsa.err -L DSA dsa/dsa.err -L DH dh/dh.err -L EVP evp/evp.err -L BUF buffer/buffer.err -L BIO bio/bio.err -L OBJ objects/objects.err -L PEM pem/pem.err -L X509 x509/x509.err -L METH meth/meth.err -L ASN1 asn1/asn1.err -L CONF conf/conf.err -L PROXY proxy/proxy.err -L PKCS7 pkcs7/pkcs7.err -L RSAREF ../rsaref/rsaref.err -L SSL ../ssl/ssl.err -L SSL2 ../ssl/ssl2.err -L SSL3 ../ssl/ssl3.err -L SSL23 ../ssl/ssl23.err - -F RSAREF_F_RSA_BN2BIN -F RSAREF_F_RSA_PRIVATE_DECRYPT -F RSAREF_F_RSA_PRIVATE_ENCRYPT -F RSAREF_F_RSA_PUBLIC_DECRYPT -F RSAREF_F_RSA_PUBLIC_ENCRYPT -#F SSL_F_CLIENT_CERTIFICATE - -R SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 -R SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 -R SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030 -R SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 -R SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 -R SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 -R SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 -R SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044 -R SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 -R SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046 -R SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 - -R RSAREF_R_CONTENT_ENCODING 0x0400 -R RSAREF_R_DATA 0x0401 -R RSAREF_R_DIGEST_ALGORITHM 0x0402 -R RSAREF_R_ENCODING 0x0403 -R RSAREF_R_KEY 0x0404 -R RSAREF_R_KEY_ENCODING 0x0405 -R RSAREF_R_LEN 0x0406 -R RSAREF_R_MODULUS_LEN 0x0407 -R RSAREF_R_NEED_RANDOM 0x0408 -R RSAREF_R_PRIVATE_KEY 0x0409 -R RSAREF_R_PUBLIC_KEY 0x040a -R RSAREF_R_SIGNATURE 0x040b -R RSAREF_R_SIGNATURE_ENCODING 0x040c -R RSAREF_R_ENCRYPTION_ALGORITHM 0x040d - -- cgit v1.2.3-55-g6feb