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/conf/Makefile.ssl | 49 +++++---- src/lib/libcrypto/conf/cnf_save.c | 7 +- src/lib/libcrypto/conf/conf.c | 211 ++++++++++++++++++------------------ src/lib/libcrypto/conf/conf.err | 12 -- src/lib/libcrypto/conf/conf.h | 32 +++--- src/lib/libcrypto/conf/conf_err.c | 120 ++++++++++---------- src/lib/libcrypto/conf/conf_lcl.h | 14 +++ src/lib/libcrypto/conf/keysets.pl | 2 +- src/lib/libcrypto/conf/test.c | 5 +- 9 files changed, 235 insertions(+), 217 deletions(-) delete mode 100644 src/lib/libcrypto/conf/conf.err (limited to 'src/lib/libcrypto/conf') diff --git a/src/lib/libcrypto/conf/Makefile.ssl b/src/lib/libcrypto/conf/Makefile.ssl index 00e917aa44..64b763f068 100644 --- a/src/lib/libcrypto/conf/Makefile.ssl +++ b/src/lib/libcrypto/conf/Makefile.ssl @@ -7,24 +7,24 @@ 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 CFLAGS= $(INCLUDES) $(CFLAG) -ERR=conf -ERRC=conf_err GENERAL=Makefile TEST= APPS= LIB=$(TOP)/libcrypto.a -LIBSRC= conf.c $(ERRC).c +LIBSRC= conf.c conf_err.c -LIBOBJ= conf.o $(ERRC).o +LIBOBJ= conf.o conf_err.o SRC= $(LIBSRC) @@ -40,24 +40,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: @@ -69,17 +68,25 @@ lint: lint -DLINT $(INCLUDES) $(SRC)>fluff depend: - $(MAKEDEPEND) $(INCLUDES) $(LIBSRC) + $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(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: - perl $(TOP)/util/err-ins.pl $(ERR).err $(ERR).h - perl ../err/err_genc.pl -s $(ERR).h $(ERRC).c + rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff # DO NOT DELETE THIS LINE -- make depend depends on it. + +conf.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h +conf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h +conf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h +conf.o: ../../include/openssl/err.h ../../include/openssl/lhash.h +conf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +conf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h +conf.o: ../cryptlib.h conf_lcl.h +conf_err.o: ../../include/openssl/bio.h ../../include/openssl/conf.h +conf_err.o: ../../include/openssl/crypto.h ../../include/openssl/err.h +conf_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslv.h +conf_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h diff --git a/src/lib/libcrypto/conf/cnf_save.c b/src/lib/libcrypto/conf/cnf_save.c index c9018de10e..e907cc2242 100644 --- a/src/lib/libcrypto/conf/cnf_save.c +++ b/src/lib/libcrypto/conf/cnf_save.c @@ -57,7 +57,7 @@ */ #include -#include "conf.h" +#include void print_conf(CONF_VALUE *cv); @@ -66,7 +66,7 @@ main() LHASH *conf; long l; - conf=CONF_load(NULL,"../../apps/ssleay.cnf",&l); + conf=CONF_load(NULL,"../../apps/openssl.cnf",&l); if (conf == NULL) { fprintf(stderr,"error loading config, line %ld\n",l); @@ -77,8 +77,7 @@ main() } -void print_conf(cv) -CONF_VALUE *cv; +void print_conf(CONF_VALUE *cv) { int i; CONF_VALUE *v; diff --git a/src/lib/libcrypto/conf/conf.c b/src/lib/libcrypto/conf/conf.c index 9e84300c5e..7d8b89168a 100644 --- a/src/lib/libcrypto/conf/conf.c +++ b/src/lib/libcrypto/conf/conf.c @@ -59,19 +59,18 @@ #include #include #include "cryptlib.h" -#include "stack.h" -#include "lhash.h" -#include "conf.h" -#include "buffer.h" -#include "err.h" +#include +#include +#include +#include +#include #include "conf_lcl.h" -#ifndef NOPROTO static void value_free_hash(CONF_VALUE *a, LHASH *conf); static void value_free_stack(CONF_VALUE *a,LHASH *conf); static unsigned long hash(CONF_VALUE *v); -static int cmp(CONF_VALUE *a,CONF_VALUE *b); +static int cmp_conf(CONF_VALUE *a,CONF_VALUE *b); static char *eat_ws(char *p); static char *eat_alpha_numeric(char *p); static void clear_comments(char *p); @@ -79,71 +78,84 @@ static int str_copy(LHASH *conf,char *section,char **to, char *from); static char *scan_quote(char *p); static CONF_VALUE *new_section(LHASH *conf,char *section); static CONF_VALUE *get_section(LHASH *conf,char *section); +#define scan_esc(p) ((((p)[1] == '\0')?(p++):(p+=2)),p) + +const char *CONF_version="CONF" OPENSSL_VERSION_PTEXT; + + +LHASH *CONF_load(LHASH *h, const char *file, long *line) + { + LHASH *ltmp; + FILE *in=NULL; + +#ifdef VMS + in=fopen(file,"r"); #else -static void value_free_hash(); -static void value_free_stack(); -static unsigned long hash(); -static int cmp(); -static char *eat_ws(); -static char *eat_alpha_numeric(); -static void clear_comments(); -static int str_copy(); -static char *scan_quote(); -static CONF_VALUE *new_section(); -static CONF_VALUE *get_section(); + in=fopen(file,"rb"); #endif + if (in == NULL) + { + SYSerr(SYS_F_FOPEN,get_last_sys_error()); + ERR_set_error_data(BUF_strdup(file), + ERR_TXT_MALLOCED|ERR_TXT_STRING); + CONFerr(CONF_F_CONF_LOAD,ERR_R_SYS_LIB); + return NULL; + } -#define scan_esc(p) ((*(++p) == '\0')?(p):(++p)) + ltmp = CONF_load_fp(h, in, line); + fclose(in); -char *CONF_version="CONF part of SSLeay 0.9.0b 29-Jun-1998"; + return ltmp; +} + +LHASH *CONF_load_fp(LHASH *h, FILE *in, long *line) +{ + BIO *btmp; + LHASH *ltmp; + if(!(btmp = BIO_new_fp(in, BIO_NOCLOSE))) { + CONFerr(CONF_F_CONF_LOAD_FP,ERR_R_BUF_LIB); + return NULL; + } + ltmp = CONF_load_bio(h, btmp, line); + BIO_free(btmp); + return ltmp; +} -LHASH *CONF_load(h,file,line) -LHASH *h; -char *file; -long *line; +LHASH *CONF_load_bio(LHASH *h, BIO *in, long *line) { LHASH *ret=NULL; - FILE *in=NULL; #define BUFSIZE 512 + char btmp[16]; int bufnum=0,i,ii; BUF_MEM *buff=NULL; char *s,*p,*end; - int again,n,eline=0; + int again,n; + long eline=0; CONF_VALUE *v=NULL,*vv,*tv; CONF_VALUE *sv=NULL; char *section=NULL,*buf; - STACK *section_sk=NULL,*ts; + STACK_OF(CONF_VALUE) *section_sk=NULL,*ts; char *start,*psection,*pname; if ((buff=BUF_MEM_new()) == NULL) { - CONFerr(CONF_F_CONF_LOAD,ERR_R_BUF_LIB); - goto err; - } - - in=fopen(file,"rb"); - if (in == NULL) - { - SYSerr(SYS_F_FOPEN,get_last_sys_error()); - ERR_set_error_data(BUF_strdup(file), - ERR_TXT_MALLOCED|ERR_TXT_STRING); - CONFerr(CONF_F_CONF_LOAD,ERR_R_SYS_LIB); + CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB); goto err; } section=(char *)Malloc(10); if (section == NULL) { - CONFerr(CONF_F_CONF_LOAD,ERR_R_MALLOC_FAILURE); + CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE); goto err; } strcpy(section,"default"); if (h == NULL) { - if ((ret=lh_new(hash,cmp)) == NULL) + if ((ret=lh_new(hash,cmp_conf)) == NULL) { - CONFerr(CONF_F_CONF_LOAD,ERR_R_MALLOC_FAILURE); + CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE); goto err; } } @@ -153,10 +165,11 @@ long *line; sv=new_section(ret,section); if (sv == NULL) { - CONFerr(CONF_F_CONF_LOAD,CONF_R_UNABLE_TO_CREATE_NEW_SECTION); + CONFerr(CONF_F_CONF_LOAD_BIO, + CONF_R_UNABLE_TO_CREATE_NEW_SECTION); goto err; } - section_sk=(STACK *)sv->value; + section_sk=(STACK_OF(CONF_VALUE) *)sv->value; bufnum=0; for (;;) @@ -164,12 +177,12 @@ long *line; again=0; if (!BUF_MEM_grow(buff,bufnum+BUFSIZE)) { - CONFerr(CONF_F_CONF_LOAD,ERR_R_BUF_LIB); + CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB); goto err; } p= &(buff->data[bufnum]); *p='\0'; - fgets(p,BUFSIZE-1,in); + BIO_gets(in, p, BUFSIZE-1); p[BUFSIZE-1]='\0'; ii=i=strlen(p); if (i == 0) break; @@ -219,13 +232,23 @@ long *line; if (IS_EOF(*s)) continue; /* blank line */ if (*s == '[') { + char *ss; + s++; start=eat_ws(s); - end=eat_alpha_numeric(start); + ss=start; +again: + end=eat_alpha_numeric(ss); p=eat_ws(end); if (*p != ']') { - CONFerr(CONF_F_CONF_LOAD,CONF_R_MISSING_CLOSE_SQUARE_BRACKET); + if (*p != '\0') + { + ss=p; + goto again; + } + CONFerr(CONF_F_CONF_LOAD_BIO, + CONF_R_MISSING_CLOSE_SQUARE_BRACKET); goto err; } *end='\0'; @@ -234,10 +257,11 @@ long *line; sv=new_section(ret,section); if (sv == NULL) { - CONFerr(CONF_F_CONF_LOAD,CONF_R_UNABLE_TO_CREATE_NEW_SECTION); + CONFerr(CONF_F_CONF_LOAD_BIO, + CONF_R_UNABLE_TO_CREATE_NEW_SECTION); goto err; } - section_sk=(STACK *)sv->value; + section_sk=(STACK_OF(CONF_VALUE) *)sv->value; continue; } else @@ -256,7 +280,8 @@ long *line; p=eat_ws(end); if (*p != '=') { - CONFerr(CONF_F_CONF_LOAD,CONF_R_MISSING_EQUAL_SIGN); + CONFerr(CONF_F_CONF_LOAD_BIO, + CONF_R_MISSING_EQUAL_SIGN); goto err; } *end='\0'; @@ -270,9 +295,10 @@ long *line; p++; *p='\0'; - if ((v=(CONF_VALUE *)Malloc(sizeof(CONF_VALUE))) == NULL) + if (!(v=(CONF_VALUE *)Malloc(sizeof(CONF_VALUE)))) { - CONFerr(CONF_F_CONF_LOAD,ERR_R_MALLOC_FAILURE); + CONFerr(CONF_F_CONF_LOAD_BIO, + ERR_R_MALLOC_FAILURE); goto err; } if (psection == NULL) psection=section; @@ -280,7 +306,8 @@ long *line; v->value=NULL; if (v->name == NULL) { - CONFerr(CONF_F_CONF_LOAD,ERR_R_MALLOC_FAILURE); + CONFerr(CONF_F_CONF_LOAD_BIO, + ERR_R_MALLOC_FAILURE); goto err; } strcpy(v->name,pname); @@ -293,10 +320,11 @@ long *line; tv=new_section(ret,psection); if (tv == NULL) { - CONFerr(CONF_F_CONF_LOAD,CONF_R_UNABLE_TO_CREATE_NEW_SECTION); + CONFerr(CONF_F_CONF_LOAD_BIO, + CONF_R_UNABLE_TO_CREATE_NEW_SECTION); goto err; } - ts=(STACK *)tv->value; + ts=(STACK_OF(CONF_VALUE) *)tv->value; } else { @@ -304,15 +332,16 @@ long *line; ts=section_sk; } v->section=tv->section; - if (!sk_push(ts,(char *)v)) + if (!sk_CONF_VALUE_push(ts,v)) { - CONFerr(CONF_F_CONF_LOAD,ERR_R_MALLOC_FAILURE); + CONFerr(CONF_F_CONF_LOAD_BIO, + ERR_R_MALLOC_FAILURE); goto err; } vv=(CONF_VALUE *)lh_insert(ret,(char *)v); if (vv != NULL) { - sk_delete_ptr(ts,(char *)vv); + sk_CONF_VALUE_delete_ptr(ts,vv); Free(vv->name); Free(vv->value); Free(vv); @@ -322,13 +351,13 @@ long *line; } if (buff != NULL) BUF_MEM_free(buff); if (section != NULL) Free(section); - if (in != NULL) fclose(in); return(ret); err: if (buff != NULL) BUF_MEM_free(buff); if (section != NULL) Free(section); if (line != NULL) *line=eline; - if (in != NULL) fclose(in); + sprintf(btmp,"%ld",eline); + ERR_add_error_data(2,"line ",btmp); if ((h != ret) && (ret != NULL)) CONF_free(ret); if (v != NULL) { @@ -338,11 +367,8 @@ err: } return(NULL); } - -char *CONF_get_string(conf,section,name) -LHASH *conf; -char *section; -char *name; + +char *CONF_get_string(LHASH *conf, char *section, char *name) { CONF_VALUE *v,vv; char *p; @@ -374,9 +400,7 @@ char *name; return(Getenv(name)); } -static CONF_VALUE *get_section(conf,section) -LHASH *conf; -char *section; +static CONF_VALUE *get_section(LHASH *conf, char *section) { CONF_VALUE *v,vv; @@ -387,23 +411,18 @@ char *section; return(v); } -STACK *CONF_get_section(conf,section) -LHASH *conf; -char *section; +STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf, char *section) { CONF_VALUE *v; v=get_section(conf,section); if (v != NULL) - return((STACK *)v->value); + return((STACK_OF(CONF_VALUE) *)v->value); else return(NULL); } -long CONF_get_number(conf,section,name) -LHASH *conf; -char *section; -char *name; +long CONF_get_number(LHASH *conf, char *section, char *name) { char *str; long ret=0; @@ -420,8 +439,7 @@ char *name; } } -void CONF_free(conf) -LHASH *conf; +void CONF_free(LHASH *conf) { if (conf == NULL) return; @@ -436,9 +454,7 @@ LHASH *conf; lh_free(conf); } -static void value_free_hash(a,conf) -CONF_VALUE *a; -LHASH *conf; +static void value_free_hash(CONF_VALUE *a, LHASH *conf) { if (a->name != NULL) { @@ -446,9 +462,7 @@ LHASH *conf; } } -static void value_free_stack(a,conf) -CONF_VALUE *a; -LHASH *conf; +static void value_free_stack(CONF_VALUE *a, LHASH *conf) { CONF_VALUE *vv; STACK *sk; @@ -469,8 +483,7 @@ LHASH *conf; Free(a); } -static void clear_comments(p) -char *p; +static void clear_comments(char *p) { char *to; @@ -499,10 +512,7 @@ char *p; } } -static int str_copy(conf,section,pto,from) -LHASH *conf; -char *section; -char **pto,*from; +static int str_copy(LHASH *conf, char *section, char **pto, char *from) { int q,r,rr=0,to=0,len=0; char *s,*e,*rp,*p,*rrp,*np,*cp,v; @@ -616,16 +626,14 @@ err: return(0); } -static char *eat_ws(p) -char *p; +static char *eat_ws(char *p) { while (IS_WS(*p) && (!IS_EOF(*p))) p++; return(p); } -static char *eat_alpha_numeric(p) -char *p; +static char *eat_alpha_numeric(char *p) { for (;;) { @@ -640,14 +648,12 @@ char *p; } } -static unsigned long hash(v) -CONF_VALUE *v; +static unsigned long hash(CONF_VALUE *v) { return((lh_strhash(v->section)<<2)^lh_strhash(v->name)); } -static int cmp(a,b) -CONF_VALUE *a,*b; +static int cmp_conf(CONF_VALUE *a, CONF_VALUE *b) { int i; @@ -668,8 +674,7 @@ CONF_VALUE *a,*b; return((a->name == NULL)?-1:1); } -static char *scan_quote(p) -char *p; +static char *scan_quote(char *p) { int q= *p; @@ -687,9 +692,7 @@ char *p; return(p); } -static CONF_VALUE *new_section(conf,section) -LHASH *conf; -char *section; +static CONF_VALUE *new_section(LHASH *conf, char *section) { STACK *sk=NULL; int ok=0,i; @@ -725,3 +728,5 @@ err: } return(v); } + +IMPLEMENT_STACK_OF(CONF_VALUE) diff --git a/src/lib/libcrypto/conf/conf.err b/src/lib/libcrypto/conf/conf.err deleted file mode 100644 index 933d3d692a..0000000000 --- a/src/lib/libcrypto/conf/conf.err +++ /dev/null @@ -1,12 +0,0 @@ -/* Error codes for the CONF functions. */ - -/* Function codes. */ -#define CONF_F_CONF_LOAD 100 -#define CONF_F_STR_COPY 101 - -/* Reason codes. */ -#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 -#define CONF_R_MISSING_EQUAL_SIGN 101 -#define CONF_R_NO_CLOSE_BRACE 102 -#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 -#define CONF_R_VARIABLE_HAS_NO_VALUE 104 diff --git a/src/lib/libcrypto/conf/conf.h b/src/lib/libcrypto/conf/conf.h index 1446226a16..e7c5150097 100644 --- a/src/lib/libcrypto/conf/conf.h +++ b/src/lib/libcrypto/conf/conf.h @@ -63,8 +63,10 @@ extern "C" { #endif -#include "stack.h" -#include "lhash.h" +#include +#include +#include +#include typedef struct { @@ -73,31 +75,29 @@ typedef struct char *value; } CONF_VALUE; -#ifndef NOPROTO +DECLARE_STACK_OF(CONF_VALUE) -LHASH *CONF_load(LHASH *conf,char *file,long *eline); -STACK *CONF_get_section(LHASH *conf,char *section); +LHASH *CONF_load(LHASH *conf,const char *file,long *eline); +LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline); +LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline); +STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,char *section); char *CONF_get_string(LHASH *conf,char *group,char *name); long CONF_get_number(LHASH *conf,char *group,char *name); void CONF_free(LHASH *conf); void ERR_load_CONF_strings(void ); -#else - -LHASH *CONF_load(); -STACK *CONF_get_section(); -char *CONF_get_string(); -long CONF_get_number(); -void CONF_free(); -void ERR_load_CONF_strings(); - -#endif /* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ + /* Error codes for the CONF functions. */ /* Function codes. */ #define CONF_F_CONF_LOAD 100 +#define CONF_F_CONF_LOAD_BIO 102 +#define CONF_F_CONF_LOAD_FP 103 #define CONF_F_STR_COPY 101 /* Reason codes. */ @@ -106,7 +106,7 @@ void ERR_load_CONF_strings(); #define CONF_R_NO_CLOSE_BRACE 102 #define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 #define CONF_R_VARIABLE_HAS_NO_VALUE 104 - + #ifdef __cplusplus } #endif diff --git a/src/lib/libcrypto/conf/conf_err.c b/src/lib/libcrypto/conf/conf_err.c index a8db8f266f..eb4b3cfc70 100644 --- a/src/lib/libcrypto/conf/conf_err.c +++ b/src/lib/libcrypto/conf/conf_err.c @@ -1,71 +1,75 @@ -/* lib/conf/conf_err.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. +/* crypto/conf/conf_err.c */ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. 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. + * + * 1. Redistributions of source code must retain the above 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.] + * 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 acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED 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 OpenSSL PROJECT OR + * ITS 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. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * */ + +/* NOTE: this file was auto generated by the mkerr.pl script: any changes + * made to it will be overwritten when the script next updates this file. + */ + #include -#include "err.h" -#include "conf.h" +#include +#include /* BEGIN ERROR CODES */ #ifndef NO_ERR static ERR_STRING_DATA CONF_str_functs[]= { {ERR_PACK(0,CONF_F_CONF_LOAD,0), "CONF_load"}, +{ERR_PACK(0,CONF_F_CONF_LOAD_BIO,0), "CONF_load_bio"}, +{ERR_PACK(0,CONF_F_CONF_LOAD_FP,0), "CONF_load_fp"}, {ERR_PACK(0,CONF_F_STR_COPY,0), "STR_COPY"}, -{0,NULL}, +{0,NULL} }; static ERR_STRING_DATA CONF_str_reasons[]= @@ -75,17 +79,17 @@ static ERR_STRING_DATA CONF_str_reasons[]= {CONF_R_NO_CLOSE_BRACE ,"no close brace"}, {CONF_R_UNABLE_TO_CREATE_NEW_SECTION ,"unable to create new section"}, {CONF_R_VARIABLE_HAS_NO_VALUE ,"variable has no value"}, -{0,NULL}, +{0,NULL} }; #endif -void ERR_load_CONF_strings() +void ERR_load_CONF_strings(void) { static int init=1; - if (init); - {; + if (init) + { init=0; #ifndef NO_ERR ERR_load_strings(ERR_LIB_CONF,CONF_str_functs); diff --git a/src/lib/libcrypto/conf/conf_lcl.h b/src/lib/libcrypto/conf/conf_lcl.h index 4e5644ed79..f9a015df57 100644 --- a/src/lib/libcrypto/conf/conf_lcl.h +++ b/src/lib/libcrypto/conf/conf_lcl.h @@ -71,6 +71,7 @@ #define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \ CONF_PUNCTUATION) +#ifndef CHARSET_EBCDIC #define IS_COMMENT(a) (CONF_COMMENT&(CONF_type[(a)&0x7f])) #define IS_EOF(a) ((a) == '\0') #define IS_ESC(a) ((a) == '\\') @@ -81,6 +82,19 @@ (CONF_type[(a)&0x7f]&CONF_ALPHA_NUMERIC_PUNCT) #define IS_QUOTE(a) (CONF_type[(a)&0x7f]&CONF_QUOTE) +#else /*CHARSET_EBCDIC*/ + +#define IS_COMMENT(a) (CONF_COMMENT&(CONF_type[os_toascii[a]&0x7f])) +#define IS_EOF(a) (os_toascii[a] == '\0') +#define IS_ESC(a) (os_toascii[a] == '\\') +#define IS_NUMER(a) (CONF_type[os_toascii[a]&0x7f]&CONF_NUMBER) +#define IS_WS(a) (CONF_type[os_toascii[a]&0x7f]&CONF_WS) +#define IS_ALPHA_NUMERIC(a) (CONF_type[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC) +#define IS_ALPHA_NUMERIC_PUNCT(a) \ + (CONF_type[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC_PUNCT) +#define IS_QUOTE(a) (CONF_type[os_toascii[a]&0x7f]&CONF_QUOTE) +#endif /*CHARSET_EBCDIC*/ + static unsigned short CONF_type[128]={ 0x008,0x000,0x000,0x000,0x000,0x000,0x000,0x000, 0x000,0x010,0x010,0x000,0x000,0x010,0x000,0x000, diff --git a/src/lib/libcrypto/conf/keysets.pl b/src/lib/libcrypto/conf/keysets.pl index e40fed0ca1..1aed0c80c4 100644 --- a/src/lib/libcrypto/conf/keysets.pl +++ b/src/lib/libcrypto/conf/keysets.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl $NUMBER=0x01; $UPPER=0x02; diff --git a/src/lib/libcrypto/conf/test.c b/src/lib/libcrypto/conf/test.c index 899ee2a067..9390a48baf 100644 --- a/src/lib/libcrypto/conf/test.c +++ b/src/lib/libcrypto/conf/test.c @@ -58,7 +58,8 @@ #include #include -#include "conf.h" +#include +#include main() { @@ -66,7 +67,7 @@ main() long eline; char *s,*s2; - conf=CONF_load(NULL,"ssleay.conf",&eline); + conf=CONF_load(NULL,"openssl.conf",&eline); if (conf == NULL) { ERR_load_crypto_strings(); -- cgit v1.2.3-55-g6feb