diff options
| author | djm <> | 2010-10-01 22:59:01 +0000 |
|---|---|---|
| committer | djm <> | 2010-10-01 22:59:01 +0000 |
| commit | 8922d4bc4a8b8893d72a48deb2cdf58215f98505 (patch) | |
| tree | 939b752540947d33507b3acc48d76a8bfb7c3dc3 /src/lib/libcrypto/conf | |
| parent | 76262f7bf9262f965142b1b2b2105cb279c5c696 (diff) | |
| download | openbsd-8922d4bc4a8b8893d72a48deb2cdf58215f98505.tar.gz openbsd-8922d4bc4a8b8893d72a48deb2cdf58215f98505.tar.bz2 openbsd-8922d4bc4a8b8893d72a48deb2cdf58215f98505.zip | |
resolve conflicts, fix local changes
Diffstat (limited to 'src/lib/libcrypto/conf')
| -rw-r--r-- | src/lib/libcrypto/conf/Makefile.ssl | 183 | ||||
| -rw-r--r-- | src/lib/libcrypto/conf/README | 47 | ||||
| -rw-r--r-- | src/lib/libcrypto/conf/conf.h | 35 | ||||
| -rw-r--r-- | src/lib/libcrypto/conf/conf_api.c | 134 | ||||
| -rw-r--r-- | src/lib/libcrypto/conf/conf_def.c | 11 | ||||
| -rw-r--r-- | src/lib/libcrypto/conf/conf_err.c | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/conf/conf_lib.c | 30 | ||||
| -rw-r--r-- | src/lib/libcrypto/conf/conf_mall.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/conf/conf_mod.c | 8 |
9 files changed, 140 insertions, 314 deletions
diff --git a/src/lib/libcrypto/conf/Makefile.ssl b/src/lib/libcrypto/conf/Makefile.ssl deleted file mode 100644 index c5873bc6e7..0000000000 --- a/src/lib/libcrypto/conf/Makefile.ssl +++ /dev/null | |||
| @@ -1,183 +0,0 @@ | |||
| 1 | # | ||
| 2 | # SSLeay/crypto/conf/Makefile | ||
| 3 | # | ||
| 4 | |||
| 5 | DIR= conf | ||
| 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= conf_err.c conf_lib.c conf_api.c conf_def.c conf_mod.c \ | ||
| 27 | conf_mall.c conf_sap.c | ||
| 28 | |||
| 29 | LIBOBJ= conf_err.o conf_lib.o conf_api.o conf_def.o conf_mod.o \ | ||
| 30 | conf_mall.o conf_sap.o | ||
| 31 | |||
| 32 | SRC= $(LIBSRC) | ||
| 33 | |||
| 34 | EXHEADER= conf.h conf_api.h | ||
| 35 | HEADER= conf_def.h $(EXHEADER) | ||
| 36 | |||
| 37 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
| 38 | |||
| 39 | top: | ||
| 40 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) | ||
| 41 | |||
| 42 | all: lib | ||
| 43 | |||
| 44 | lib: $(LIBOBJ) | ||
| 45 | $(AR) $(LIB) $(LIBOBJ) | ||
| 46 | $(RANLIB) $(LIB) || echo Never mind. | ||
| 47 | @touch lib | ||
| 48 | |||
| 49 | files: | ||
| 50 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | ||
| 51 | |||
| 52 | links: | ||
| 53 | @sh $(TOP)/util/point.sh Makefile.ssl Makefile | ||
| 54 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) | ||
| 55 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) | ||
| 56 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) | ||
| 57 | |||
| 58 | install: | ||
| 59 | @for i in $(EXHEADER) ; \ | ||
| 60 | do \ | ||
| 61 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | ||
| 62 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | ||
| 63 | done; | ||
| 64 | |||
| 65 | tags: | ||
| 66 | ctags $(SRC) | ||
| 67 | |||
| 68 | tests: | ||
| 69 | |||
| 70 | lint: | ||
| 71 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
| 72 | |||
| 73 | depend: | ||
| 74 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC) | ||
| 75 | |||
| 76 | dclean: | ||
| 77 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
| 78 | mv -f Makefile.new $(MAKEFILE) | ||
| 79 | |||
| 80 | clean: | ||
| 81 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
| 82 | |||
| 83 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
| 84 | |||
| 85 | conf_api.o: ../../e_os.h ../../include/openssl/bio.h | ||
| 86 | conf_api.o: ../../include/openssl/conf.h ../../include/openssl/conf_api.h | ||
| 87 | conf_api.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
| 88 | conf_api.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
| 89 | conf_api.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
| 90 | conf_api.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 91 | conf_api.o: conf_api.c | ||
| 92 | conf_def.o: ../../e_os.h ../../include/openssl/bio.h | ||
| 93 | conf_def.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
| 94 | conf_def.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h | ||
| 95 | conf_def.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
| 96 | conf_def.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
| 97 | conf_def.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
| 98 | conf_def.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 99 | conf_def.o: ../cryptlib.h conf_def.c conf_def.h | ||
| 100 | conf_err.o: ../../include/openssl/bio.h ../../include/openssl/conf.h | ||
| 101 | conf_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
| 102 | conf_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
| 103 | conf_err.o: ../../include/openssl/opensslconf.h | ||
| 104 | conf_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
| 105 | conf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 106 | conf_err.o: conf_err.c | ||
| 107 | conf_lib.o: ../../include/openssl/bio.h ../../include/openssl/conf.h | ||
| 108 | conf_lib.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h | ||
| 109 | conf_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
| 110 | conf_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
| 111 | conf_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
| 112 | conf_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 113 | conf_lib.o: conf_lib.c | ||
| 114 | conf_mall.o: ../../e_os.h ../../include/openssl/aes.h | ||
| 115 | conf_mall.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 116 | conf_mall.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 117 | conf_mall.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 118 | conf_mall.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
| 119 | conf_mall.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | ||
| 120 | conf_mall.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 121 | conf_mall.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h | ||
| 122 | conf_mall.o: ../../include/openssl/engine.h ../../include/openssl/err.h | ||
| 123 | conf_mall.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
| 124 | conf_mall.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
| 125 | conf_mall.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
| 126 | conf_mall.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
| 127 | conf_mall.o: ../../include/openssl/objects.h | ||
| 128 | conf_mall.o: ../../include/openssl/opensslconf.h | ||
| 129 | conf_mall.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
| 130 | conf_mall.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
| 131 | conf_mall.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
| 132 | conf_mall.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
| 133 | conf_mall.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
| 134 | conf_mall.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
| 135 | conf_mall.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
| 136 | conf_mall.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
| 137 | conf_mall.o: ../../include/openssl/x509_vfy.h ../cryptlib.h conf_mall.c | ||
| 138 | conf_mod.o: ../../e_os.h ../../include/openssl/aes.h | ||
| 139 | conf_mod.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 140 | conf_mod.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 141 | conf_mod.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 142 | conf_mod.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
| 143 | conf_mod.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | ||
| 144 | conf_mod.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 145 | conf_mod.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h | ||
| 146 | conf_mod.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
| 147 | conf_mod.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 148 | conf_mod.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 149 | conf_mod.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 150 | conf_mod.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
| 151 | conf_mod.o: ../../include/openssl/opensslconf.h | ||
| 152 | conf_mod.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
| 153 | conf_mod.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
| 154 | conf_mod.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
| 155 | conf_mod.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
| 156 | conf_mod.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
| 157 | conf_mod.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 158 | conf_mod.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
| 159 | conf_mod.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
| 160 | conf_mod.o: ../cryptlib.h conf_mod.c | ||
| 161 | conf_sap.o: ../../e_os.h ../../include/openssl/aes.h | ||
| 162 | conf_sap.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 163 | conf_sap.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 164 | conf_sap.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 165 | conf_sap.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
| 166 | conf_sap.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | ||
| 167 | conf_sap.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 168 | conf_sap.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h | ||
| 169 | conf_sap.o: ../../include/openssl/engine.h ../../include/openssl/err.h | ||
| 170 | conf_sap.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
| 171 | conf_sap.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
| 172 | conf_sap.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
| 173 | conf_sap.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
| 174 | conf_sap.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
| 175 | conf_sap.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
| 176 | conf_sap.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
| 177 | conf_sap.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
| 178 | conf_sap.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
| 179 | conf_sap.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
| 180 | conf_sap.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
| 181 | conf_sap.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
| 182 | conf_sap.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
| 183 | conf_sap.o: ../../include/openssl/x509_vfy.h ../cryptlib.h conf_sap.c | ||
diff --git a/src/lib/libcrypto/conf/README b/src/lib/libcrypto/conf/README index ca58d0240f..96e53b34ed 100644 --- a/src/lib/libcrypto/conf/README +++ b/src/lib/libcrypto/conf/README | |||
| @@ -1,8 +1,3 @@ | |||
| 1 | WARNING WARNING WARNING!!! | ||
| 2 | |||
| 3 | This stuff is experimental, may change radically or be deleted altogether | ||
| 4 | before OpenSSL 0.9.7 release. You have been warned! | ||
| 5 | |||
| 6 | Configuration modules. These are a set of modules which can perform | 1 | Configuration modules. These are a set of modules which can perform |
| 7 | various configuration functions. | 2 | various configuration functions. |
| 8 | 3 | ||
| @@ -13,7 +8,7 @@ The routines read a configuration file set up like this: | |||
| 13 | 8 | ||
| 14 | ----- | 9 | ----- |
| 15 | #default section | 10 | #default section |
| 16 | openssl_init=init_section | 11 | openssl_conf=init_section |
| 17 | 12 | ||
| 18 | [init_section] | 13 | [init_section] |
| 19 | 14 | ||
| @@ -30,29 +25,27 @@ path=/some/path/to/some/dso.so | |||
| 30 | other_stuff=other_value | 25 | other_stuff=other_value |
| 31 | ---- | 26 | ---- |
| 32 | 27 | ||
| 33 | When this file is loaded a configuration module with the specified | 28 | When this file is loaded a configuration module with the specified string |
| 34 | string (module* in the above example) is looked up and its init | 29 | (module* in the above example) is looked up and its init function called as: |
| 35 | function called as: | ||
| 36 | 30 | ||
| 37 | int conf_init_func(CONF_IMODULE *md, CONF *cnf); | 31 | int conf_init_func(CONF_IMODULE *md, CONF *cnf); |
| 38 | 32 | ||
| 39 | The function can then take whatever action is appropriate, for example | 33 | The function can then take whatever action is appropriate, for example further |
| 40 | further lookups based on the value. Multiple instances of the same | 34 | lookups based on the value. Multiple instances of the same config module can be |
| 41 | config module can be loaded. | 35 | loaded. |
| 42 | 36 | ||
| 43 | When the application closes down the modules are cleaned up by calling | 37 | When the application closes down the modules are cleaned up by calling an |
| 44 | an optional finish function: | 38 | optional finish function: |
| 45 | 39 | ||
| 46 | void conf_finish_func(CONF_IMODULE *md); | 40 | void conf_finish_func(CONF_IMODULE *md); |
| 47 | 41 | ||
| 48 | The finish functions are called in reverse order: that is the last module | 42 | The finish functions are called in reverse order: that is the last module |
| 49 | loaded is the first one cleaned up. | 43 | loaded is the first one cleaned up. |
| 50 | 44 | ||
| 51 | If no module exists with a given name then an attempt is made to load | 45 | If no module exists with a given name then an attempt is made to load a DSO |
| 52 | a DSO with the supplied name. This might mean that "module3" attempts | 46 | with the supplied name. This might mean that "module3" attempts to load a DSO |
| 53 | to load a DSO called libmodule3.so or module3.dll for example. An explicit | 47 | called libmodule3.so or module3.dll for example. An explicit DSO name can be |
| 54 | DSO name can be given by including a separate section as in the module4 example | 48 | given by including a separate section as in the module4 example above. |
| 55 | above. | ||
| 56 | 49 | ||
| 57 | The DSO is expected to at least contain an initialization function: | 50 | The DSO is expected to at least contain an initialization function: |
| 58 | 51 | ||
| @@ -64,15 +57,17 @@ void OPENSSL_finish(CONF_IMODULE *md); | |||
| 64 | 57 | ||
| 65 | Static modules can also be added using, | 58 | Static modules can also be added using, |
| 66 | 59 | ||
| 67 | int CONF_module_add(char *name, dso_mod_init_func *ifunc, dso_mod_finish_func *ffunc); | 60 | int CONF_module_add(char *name, dso_mod_init_func *ifunc, dso_mod_finish_func |
| 61 | *ffunc); | ||
| 68 | 62 | ||
| 69 | where "name" is the name in the configuration file this function corresponds to. | 63 | where "name" is the name in the configuration file this function corresponds |
| 64 | to. | ||
| 70 | 65 | ||
| 71 | A set of builtin modules (currently only an ASN1 non functional test module) can be | 66 | A set of builtin modules (currently only an ASN1 non functional test module) |
| 72 | added by calling OPENSSL_load_builtin_modules(). | 67 | can be added by calling OPENSSL_load_builtin_modules(). |
| 73 | 68 | ||
| 74 | The function OPENSSL_config() is intended as a simple configuration function that | 69 | The function OPENSSL_config() is intended as a simple configuration function |
| 75 | any application can call to perform various default configuration tasks. It uses the | 70 | that any application can call to perform various default configuration tasks. |
| 76 | file openssl.cnf in the usual locations. | 71 | It uses the file openssl.cnf in the usual locations. |
| 77 | 72 | ||
| 78 | 73 | ||
diff --git a/src/lib/libcrypto/conf/conf.h b/src/lib/libcrypto/conf/conf.h index 8aa06bc5ec..c2199978a3 100644 --- a/src/lib/libcrypto/conf/conf.h +++ b/src/lib/libcrypto/conf/conf.h | |||
| @@ -79,8 +79,7 @@ typedef struct | |||
| 79 | } CONF_VALUE; | 79 | } CONF_VALUE; |
| 80 | 80 | ||
| 81 | DECLARE_STACK_OF(CONF_VALUE) | 81 | DECLARE_STACK_OF(CONF_VALUE) |
| 82 | DECLARE_STACK_OF(CONF_MODULE) | 82 | DECLARE_LHASH_OF(CONF_VALUE); |
| 83 | DECLARE_STACK_OF(CONF_IMODULE) | ||
| 84 | 83 | ||
| 85 | struct conf_st; | 84 | struct conf_st; |
| 86 | struct conf_method_st; | 85 | struct conf_method_st; |
| @@ -105,6 +104,9 @@ struct conf_method_st | |||
| 105 | typedef struct conf_imodule_st CONF_IMODULE; | 104 | typedef struct conf_imodule_st CONF_IMODULE; |
| 106 | typedef struct conf_module_st CONF_MODULE; | 105 | typedef struct conf_module_st CONF_MODULE; |
| 107 | 106 | ||
| 107 | DECLARE_STACK_OF(CONF_MODULE) | ||
| 108 | DECLARE_STACK_OF(CONF_IMODULE) | ||
| 109 | |||
| 108 | /* DSO module function typedefs */ | 110 | /* DSO module function typedefs */ |
| 109 | typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf); | 111 | typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf); |
| 110 | typedef void conf_finish_func(CONF_IMODULE *md); | 112 | typedef void conf_finish_func(CONF_IMODULE *md); |
| @@ -117,18 +119,23 @@ typedef void conf_finish_func(CONF_IMODULE *md); | |||
| 117 | #define CONF_MFLAGS_DEFAULT_SECTION 0x20 | 119 | #define CONF_MFLAGS_DEFAULT_SECTION 0x20 |
| 118 | 120 | ||
| 119 | int CONF_set_default_method(CONF_METHOD *meth); | 121 | int CONF_set_default_method(CONF_METHOD *meth); |
| 120 | void CONF_set_nconf(CONF *conf,LHASH *hash); | 122 | void CONF_set_nconf(CONF *conf,LHASH_OF(CONF_VALUE) *hash); |
| 121 | LHASH *CONF_load(LHASH *conf,const char *file,long *eline); | 123 | LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf,const char *file, |
| 124 | long *eline); | ||
| 122 | #ifndef OPENSSL_NO_FP_API | 125 | #ifndef OPENSSL_NO_FP_API |
| 123 | LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline); | 126 | LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, |
| 127 | long *eline); | ||
| 124 | #endif | 128 | #endif |
| 125 | LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline); | 129 | LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,long *eline); |
| 126 | STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section); | 130 | STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, |
| 127 | char *CONF_get_string(LHASH *conf,const char *group,const char *name); | 131 | const char *section); |
| 128 | long CONF_get_number(LHASH *conf,const char *group,const char *name); | 132 | char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf,const char *group, |
| 129 | void CONF_free(LHASH *conf); | 133 | const char *name); |
| 130 | int CONF_dump_fp(LHASH *conf, FILE *out); | 134 | long CONF_get_number(LHASH_OF(CONF_VALUE) *conf,const char *group, |
| 131 | int CONF_dump_bio(LHASH *conf, BIO *out); | 135 | const char *name); |
| 136 | void CONF_free(LHASH_OF(CONF_VALUE) *conf); | ||
| 137 | int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); | ||
| 138 | int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); | ||
| 132 | 139 | ||
| 133 | void OPENSSL_config(const char *config_name); | 140 | void OPENSSL_config(const char *config_name); |
| 134 | void OPENSSL_no_config(void); | 141 | void OPENSSL_no_config(void); |
| @@ -140,7 +147,7 @@ struct conf_st | |||
| 140 | { | 147 | { |
| 141 | CONF_METHOD *meth; | 148 | CONF_METHOD *meth; |
| 142 | void *meth_data; | 149 | void *meth_data; |
| 143 | LHASH *data; | 150 | LHASH_OF(CONF_VALUE) *data; |
| 144 | }; | 151 | }; |
| 145 | 152 | ||
| 146 | CONF *NCONF_new(CONF_METHOD *meth); | 153 | CONF *NCONF_new(CONF_METHOD *meth); |
| @@ -214,6 +221,7 @@ void ERR_load_CONF_strings(void); | |||
| 214 | #define CONF_F_CONF_LOAD_BIO 102 | 221 | #define CONF_F_CONF_LOAD_BIO 102 |
| 215 | #define CONF_F_CONF_LOAD_FP 103 | 222 | #define CONF_F_CONF_LOAD_FP 103 |
| 216 | #define CONF_F_CONF_MODULES_LOAD 116 | 223 | #define CONF_F_CONF_MODULES_LOAD 116 |
| 224 | #define CONF_F_CONF_PARSE_LIST 119 | ||
| 217 | #define CONF_F_DEF_LOAD 120 | 225 | #define CONF_F_DEF_LOAD 120 |
| 218 | #define CONF_F_DEF_LOAD_BIO 121 | 226 | #define CONF_F_DEF_LOAD_BIO 121 |
| 219 | #define CONF_F_MODULE_INIT 115 | 227 | #define CONF_F_MODULE_INIT 115 |
| @@ -233,6 +241,7 @@ void ERR_load_CONF_strings(void); | |||
| 233 | 241 | ||
| 234 | /* Reason codes. */ | 242 | /* Reason codes. */ |
| 235 | #define CONF_R_ERROR_LOADING_DSO 110 | 243 | #define CONF_R_ERROR_LOADING_DSO 110 |
| 244 | #define CONF_R_LIST_CANNOT_BE_NULL 115 | ||
| 236 | #define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 | 245 | #define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 |
| 237 | #define CONF_R_MISSING_EQUAL_SIGN 101 | 246 | #define CONF_R_MISSING_EQUAL_SIGN 101 |
| 238 | #define CONF_R_MISSING_FINISH_FUNCTION 111 | 247 | #define CONF_R_MISSING_FINISH_FUNCTION 111 |
diff --git a/src/lib/libcrypto/conf/conf_api.c b/src/lib/libcrypto/conf/conf_api.c index 909d72b4b8..22617e5fa1 100644 --- a/src/lib/libcrypto/conf/conf_api.c +++ b/src/lib/libcrypto/conf/conf_api.c | |||
| @@ -69,16 +69,12 @@ | |||
| 69 | #include <openssl/conf_api.h> | 69 | #include <openssl/conf_api.h> |
| 70 | #include "e_os.h" | 70 | #include "e_os.h" |
| 71 | 71 | ||
| 72 | static void value_free_hash(CONF_VALUE *a, LHASH *conf); | 72 | static void value_free_hash_doall_arg(CONF_VALUE *a, |
| 73 | static void value_free_stack(CONF_VALUE *a,LHASH *conf); | 73 | LHASH_OF(CONF_VALUE) *conf); |
| 74 | static IMPLEMENT_LHASH_DOALL_ARG_FN(value_free_hash, CONF_VALUE *, LHASH *) | 74 | static void value_free_stack_doall(CONF_VALUE *a); |
| 75 | static IMPLEMENT_LHASH_DOALL_ARG_FN(value_free_stack, CONF_VALUE *, LHASH *) | 75 | static IMPLEMENT_LHASH_DOALL_ARG_FN(value_free_hash, CONF_VALUE, |
| 76 | /* We don't use function pointer casting or wrapper functions - but cast each | 76 | LHASH_OF(CONF_VALUE)) |
| 77 | * callback parameter inside the callback functions. */ | 77 | static IMPLEMENT_LHASH_DOALL_FN(value_free_stack, CONF_VALUE) |
| 78 | /* static unsigned long hash(CONF_VALUE *v); */ | ||
| 79 | static unsigned long hash(const void *v_void); | ||
| 80 | /* static int cmp_conf(CONF_VALUE *a,CONF_VALUE *b); */ | ||
| 81 | static int cmp_conf(const void *a_void,const void *b_void); | ||
| 82 | 78 | ||
| 83 | /* Up until OpenSSL 0.9.5a, this was get_section */ | 79 | /* Up until OpenSSL 0.9.5a, this was get_section */ |
| 84 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section) | 80 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section) |
| @@ -88,7 +84,7 @@ CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section) | |||
| 88 | if ((conf == NULL) || (section == NULL)) return(NULL); | 84 | if ((conf == NULL) || (section == NULL)) return(NULL); |
| 89 | vv.name=NULL; | 85 | vv.name=NULL; |
| 90 | vv.section=(char *)section; | 86 | vv.section=(char *)section; |
| 91 | v=(CONF_VALUE *)lh_retrieve(conf->data,&vv); | 87 | v=lh_CONF_VALUE_retrieve(conf->data,&vv); |
| 92 | return(v); | 88 | return(v); |
| 93 | } | 89 | } |
| 94 | 90 | ||
| @@ -118,7 +114,7 @@ int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value) | |||
| 118 | return 0; | 114 | return 0; |
| 119 | } | 115 | } |
| 120 | 116 | ||
| 121 | v = (CONF_VALUE *)lh_insert(conf->data, value); | 117 | v = lh_CONF_VALUE_insert(conf->data, value); |
| 122 | if (v != NULL) | 118 | if (v != NULL) |
| 123 | { | 119 | { |
| 124 | (void)sk_CONF_VALUE_delete_ptr(ts,v); | 120 | (void)sk_CONF_VALUE_delete_ptr(ts,v); |
| @@ -141,24 +137,24 @@ char *_CONF_get_string(const CONF *conf, const char *section, const char *name) | |||
| 141 | { | 137 | { |
| 142 | vv.name=(char *)name; | 138 | vv.name=(char *)name; |
| 143 | vv.section=(char *)section; | 139 | vv.section=(char *)section; |
| 144 | v=(CONF_VALUE *)lh_retrieve(conf->data,&vv); | 140 | v=lh_CONF_VALUE_retrieve(conf->data,&vv); |
| 145 | if (v != NULL) return(v->value); | 141 | if (v != NULL) return(v->value); |
| 146 | if (strcmp(section,"ENV") == 0) | 142 | if (strcmp(section,"ENV") == 0) |
| 147 | { | 143 | { |
| 148 | p=Getenv(name); | 144 | p=getenv(name); |
| 149 | if (p != NULL) return(p); | 145 | if (p != NULL) return(p); |
| 150 | } | 146 | } |
| 151 | } | 147 | } |
| 152 | vv.section="default"; | 148 | vv.section="default"; |
| 153 | vv.name=(char *)name; | 149 | vv.name=(char *)name; |
| 154 | v=(CONF_VALUE *)lh_retrieve(conf->data,&vv); | 150 | v=lh_CONF_VALUE_retrieve(conf->data,&vv); |
| 155 | if (v != NULL) | 151 | if (v != NULL) |
| 156 | return(v->value); | 152 | return(v->value); |
| 157 | else | 153 | else |
| 158 | return(NULL); | 154 | return(NULL); |
| 159 | } | 155 | } |
| 160 | else | 156 | else |
| 161 | return(Getenv(name)); | 157 | return(getenv(name)); |
| 162 | } | 158 | } |
| 163 | 159 | ||
| 164 | #if 0 /* There's no way to provide error checking with this function, so | 160 | #if 0 /* There's no way to provide error checking with this function, so |
| @@ -182,6 +178,34 @@ long _CONF_get_number(CONF *conf, char *section, char *name) | |||
| 182 | } | 178 | } |
| 183 | #endif | 179 | #endif |
| 184 | 180 | ||
| 181 | static unsigned long conf_value_hash(const CONF_VALUE *v) | ||
| 182 | { | ||
| 183 | return (lh_strhash(v->section)<<2)^lh_strhash(v->name); | ||
| 184 | } | ||
| 185 | static IMPLEMENT_LHASH_HASH_FN(conf_value, CONF_VALUE) | ||
| 186 | |||
| 187 | static int conf_value_cmp(const CONF_VALUE *a, const CONF_VALUE *b) | ||
| 188 | { | ||
| 189 | int i; | ||
| 190 | |||
| 191 | if (a->section != b->section) | ||
| 192 | { | ||
| 193 | i=strcmp(a->section,b->section); | ||
| 194 | if (i) return(i); | ||
| 195 | } | ||
| 196 | |||
| 197 | if ((a->name != NULL) && (b->name != NULL)) | ||
| 198 | { | ||
| 199 | i=strcmp(a->name,b->name); | ||
| 200 | return(i); | ||
| 201 | } | ||
| 202 | else if (a->name == b->name) | ||
| 203 | return(0); | ||
| 204 | else | ||
| 205 | return((a->name == NULL)?-1:1); | ||
| 206 | } | ||
| 207 | static IMPLEMENT_LHASH_COMP_FN(conf_value, CONF_VALUE) | ||
| 208 | |||
| 185 | int _CONF_new_data(CONF *conf) | 209 | int _CONF_new_data(CONF *conf) |
| 186 | { | 210 | { |
| 187 | if (conf == NULL) | 211 | if (conf == NULL) |
| @@ -189,7 +213,7 @@ int _CONF_new_data(CONF *conf) | |||
| 189 | return 0; | 213 | return 0; |
| 190 | } | 214 | } |
| 191 | if (conf->data == NULL) | 215 | if (conf->data == NULL) |
| 192 | if ((conf->data = lh_new(hash, cmp_conf)) == NULL) | 216 | if ((conf->data = lh_CONF_VALUE_new()) == NULL) |
| 193 | { | 217 | { |
| 194 | return 0; | 218 | return 0; |
| 195 | } | 219 | } |
| @@ -200,105 +224,73 @@ void _CONF_free_data(CONF *conf) | |||
| 200 | { | 224 | { |
| 201 | if (conf == NULL || conf->data == NULL) return; | 225 | if (conf == NULL || conf->data == NULL) return; |
| 202 | 226 | ||
| 203 | conf->data->down_load=0; /* evil thing to make sure the 'OPENSSL_free()' | 227 | lh_CONF_VALUE_down_load(conf->data)=0; /* evil thing to make |
| 204 | * works as expected */ | 228 | * sure the 'OPENSSL_free()' works as |
| 205 | lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(value_free_hash), | 229 | * expected */ |
| 206 | conf->data); | 230 | lh_CONF_VALUE_doall_arg(conf->data, |
| 231 | LHASH_DOALL_ARG_FN(value_free_hash), | ||
| 232 | LHASH_OF(CONF_VALUE), conf->data); | ||
| 207 | 233 | ||
| 208 | /* We now have only 'section' entries in the hash table. | 234 | /* We now have only 'section' entries in the hash table. |
| 209 | * Due to problems with */ | 235 | * Due to problems with */ |
| 210 | 236 | ||
| 211 | lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(value_free_stack), | 237 | lh_CONF_VALUE_doall(conf->data, LHASH_DOALL_FN(value_free_stack)); |
| 212 | conf->data); | 238 | lh_CONF_VALUE_free(conf->data); |
| 213 | lh_free(conf->data); | ||
| 214 | } | 239 | } |
| 215 | 240 | ||
| 216 | static void value_free_hash(CONF_VALUE *a, LHASH *conf) | 241 | static void value_free_hash_doall_arg(CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf) |
| 217 | { | 242 | { |
| 218 | if (a->name != NULL) | 243 | if (a->name != NULL) |
| 219 | { | 244 | (void)lh_CONF_VALUE_delete(conf,a); |
| 220 | a=(CONF_VALUE *)lh_delete(conf,a); | ||
| 221 | } | ||
| 222 | } | 245 | } |
| 223 | 246 | ||
| 224 | static void value_free_stack(CONF_VALUE *a, LHASH *conf) | 247 | static void value_free_stack_doall(CONF_VALUE *a) |
| 225 | { | 248 | { |
| 226 | CONF_VALUE *vv; | 249 | CONF_VALUE *vv; |
| 227 | STACK *sk; | 250 | STACK_OF(CONF_VALUE) *sk; |
| 228 | int i; | 251 | int i; |
| 229 | 252 | ||
| 230 | if (a->name != NULL) return; | 253 | if (a->name != NULL) return; |
| 231 | 254 | ||
| 232 | sk=(STACK *)a->value; | 255 | sk=(STACK_OF(CONF_VALUE) *)a->value; |
| 233 | for (i=sk_num(sk)-1; i>=0; i--) | 256 | for (i=sk_CONF_VALUE_num(sk)-1; i>=0; i--) |
| 234 | { | 257 | { |
| 235 | vv=(CONF_VALUE *)sk_value(sk,i); | 258 | vv=sk_CONF_VALUE_value(sk,i); |
| 236 | OPENSSL_free(vv->value); | 259 | OPENSSL_free(vv->value); |
| 237 | OPENSSL_free(vv->name); | 260 | OPENSSL_free(vv->name); |
| 238 | OPENSSL_free(vv); | 261 | OPENSSL_free(vv); |
| 239 | } | 262 | } |
| 240 | if (sk != NULL) sk_free(sk); | 263 | if (sk != NULL) sk_CONF_VALUE_free(sk); |
| 241 | OPENSSL_free(a->section); | 264 | OPENSSL_free(a->section); |
| 242 | OPENSSL_free(a); | 265 | OPENSSL_free(a); |
| 243 | } | 266 | } |
| 244 | 267 | ||
| 245 | /* static unsigned long hash(CONF_VALUE *v) */ | ||
| 246 | static unsigned long hash(const void *v_void) | ||
| 247 | { | ||
| 248 | CONF_VALUE *v = (CONF_VALUE *)v_void; | ||
| 249 | return((lh_strhash(v->section)<<2)^lh_strhash(v->name)); | ||
| 250 | } | ||
| 251 | |||
| 252 | /* static int cmp_conf(CONF_VALUE *a, CONF_VALUE *b) */ | ||
| 253 | static int cmp_conf(const void *a_void,const void *b_void) | ||
| 254 | { | ||
| 255 | int i; | ||
| 256 | CONF_VALUE *a = (CONF_VALUE *)a_void; | ||
| 257 | CONF_VALUE *b = (CONF_VALUE *)b_void; | ||
| 258 | |||
| 259 | if (a->section != b->section) | ||
| 260 | { | ||
| 261 | i=strcmp(a->section,b->section); | ||
| 262 | if (i) return(i); | ||
| 263 | } | ||
| 264 | |||
| 265 | if ((a->name != NULL) && (b->name != NULL)) | ||
| 266 | { | ||
| 267 | i=strcmp(a->name,b->name); | ||
| 268 | return(i); | ||
| 269 | } | ||
| 270 | else if (a->name == b->name) | ||
| 271 | return(0); | ||
| 272 | else | ||
| 273 | return((a->name == NULL)?-1:1); | ||
| 274 | } | ||
| 275 | |||
| 276 | /* Up until OpenSSL 0.9.5a, this was new_section */ | 268 | /* Up until OpenSSL 0.9.5a, this was new_section */ |
| 277 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section) | 269 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section) |
| 278 | { | 270 | { |
| 279 | STACK *sk=NULL; | 271 | STACK_OF(CONF_VALUE) *sk=NULL; |
| 280 | int ok=0,i; | 272 | int ok=0,i; |
| 281 | CONF_VALUE *v=NULL,*vv; | 273 | CONF_VALUE *v=NULL,*vv; |
| 282 | 274 | ||
| 283 | if ((sk=sk_new_null()) == NULL) | 275 | if ((sk=sk_CONF_VALUE_new_null()) == NULL) |
| 284 | goto err; | 276 | goto err; |
| 285 | if ((v=(CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_VALUE))) == NULL) | 277 | if ((v=OPENSSL_malloc(sizeof(CONF_VALUE))) == NULL) |
| 286 | goto err; | 278 | goto err; |
| 287 | i=strlen(section)+1; | 279 | i=strlen(section)+1; |
| 288 | if ((v->section=(char *)OPENSSL_malloc(i)) == NULL) | 280 | if ((v->section=OPENSSL_malloc(i)) == NULL) |
| 289 | goto err; | 281 | goto err; |
| 290 | 282 | ||
| 291 | memcpy(v->section,section,i); | 283 | memcpy(v->section,section,i); |
| 292 | v->name=NULL; | 284 | v->name=NULL; |
| 293 | v->value=(char *)sk; | 285 | v->value=(char *)sk; |
| 294 | 286 | ||
| 295 | vv=(CONF_VALUE *)lh_insert(conf->data,v); | 287 | vv=lh_CONF_VALUE_insert(conf->data,v); |
| 296 | assert(vv == NULL); | 288 | assert(vv == NULL); |
| 297 | ok=1; | 289 | ok=1; |
| 298 | err: | 290 | err: |
| 299 | if (!ok) | 291 | if (!ok) |
| 300 | { | 292 | { |
| 301 | if (sk != NULL) sk_free(sk); | 293 | if (sk != NULL) sk_CONF_VALUE_free(sk); |
| 302 | if (v != NULL) OPENSSL_free(v); | 294 | if (v != NULL) OPENSSL_free(v); |
| 303 | v=NULL; | 295 | v=NULL; |
| 304 | } | 296 | } |
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c index d8bce8732a..0b571b0394 100644 --- a/src/lib/libcrypto/conf/conf_def.c +++ b/src/lib/libcrypto/conf/conf_def.c | |||
| @@ -129,7 +129,7 @@ static CONF *def_create(CONF_METHOD *meth) | |||
| 129 | { | 129 | { |
| 130 | CONF *ret; | 130 | CONF *ret; |
| 131 | 131 | ||
| 132 | ret = (CONF *)OPENSSL_malloc(sizeof(CONF) + sizeof(unsigned short *)); | 132 | ret = OPENSSL_malloc(sizeof(CONF) + sizeof(unsigned short *)); |
| 133 | if (ret) | 133 | if (ret) |
| 134 | if (meth->init(ret) == 0) | 134 | if (meth->init(ret) == 0) |
| 135 | { | 135 | { |
| @@ -145,7 +145,7 @@ static int def_init_default(CONF *conf) | |||
| 145 | return 0; | 145 | return 0; |
| 146 | 146 | ||
| 147 | conf->meth = &default_method; | 147 | conf->meth = &default_method; |
| 148 | conf->meth_data = (void *)CONF_type_default; | 148 | conf->meth_data = CONF_type_default; |
| 149 | conf->data = NULL; | 149 | conf->data = NULL; |
| 150 | 150 | ||
| 151 | return 1; | 151 | return 1; |
| @@ -722,7 +722,7 @@ static char *scan_dquote(CONF *conf, char *p) | |||
| 722 | return(p); | 722 | return(p); |
| 723 | } | 723 | } |
| 724 | 724 | ||
| 725 | static void dump_value(CONF_VALUE *a, BIO *out) | 725 | static void dump_value_doall_arg(CONF_VALUE *a, BIO *out) |
| 726 | { | 726 | { |
| 727 | if (a->name) | 727 | if (a->name) |
| 728 | BIO_printf(out, "[%s] %s=%s\n", a->section, a->name, a->value); | 728 | BIO_printf(out, "[%s] %s=%s\n", a->section, a->name, a->value); |
| @@ -730,11 +730,12 @@ static void dump_value(CONF_VALUE *a, BIO *out) | |||
| 730 | BIO_printf(out, "[[%s]]\n", a->section); | 730 | BIO_printf(out, "[[%s]]\n", a->section); |
| 731 | } | 731 | } |
| 732 | 732 | ||
| 733 | static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_value, CONF_VALUE *, BIO *) | 733 | static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_value, CONF_VALUE, BIO) |
| 734 | 734 | ||
| 735 | static int def_dump(const CONF *conf, BIO *out) | 735 | static int def_dump(const CONF *conf, BIO *out) |
| 736 | { | 736 | { |
| 737 | lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(dump_value), out); | 737 | lh_CONF_VALUE_doall_arg(conf->data, LHASH_DOALL_ARG_FN(dump_value), |
| 738 | BIO, out); | ||
| 738 | return 1; | 739 | return 1; |
| 739 | } | 740 | } |
| 740 | 741 | ||
diff --git a/src/lib/libcrypto/conf/conf_err.c b/src/lib/libcrypto/conf/conf_err.c index a16a5e0bd4..25bb5dc9aa 100644 --- a/src/lib/libcrypto/conf/conf_err.c +++ b/src/lib/libcrypto/conf/conf_err.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* crypto/conf/conf_err.c */ | 1 | /* crypto/conf/conf_err.c */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
| @@ -75,6 +75,7 @@ static ERR_STRING_DATA CONF_str_functs[]= | |||
| 75 | {ERR_FUNC(CONF_F_CONF_LOAD_BIO), "CONF_load_bio"}, | 75 | {ERR_FUNC(CONF_F_CONF_LOAD_BIO), "CONF_load_bio"}, |
| 76 | {ERR_FUNC(CONF_F_CONF_LOAD_FP), "CONF_load_fp"}, | 76 | {ERR_FUNC(CONF_F_CONF_LOAD_FP), "CONF_load_fp"}, |
| 77 | {ERR_FUNC(CONF_F_CONF_MODULES_LOAD), "CONF_modules_load"}, | 77 | {ERR_FUNC(CONF_F_CONF_MODULES_LOAD), "CONF_modules_load"}, |
| 78 | {ERR_FUNC(CONF_F_CONF_PARSE_LIST), "CONF_parse_list"}, | ||
| 78 | {ERR_FUNC(CONF_F_DEF_LOAD), "DEF_LOAD"}, | 79 | {ERR_FUNC(CONF_F_DEF_LOAD), "DEF_LOAD"}, |
| 79 | {ERR_FUNC(CONF_F_DEF_LOAD_BIO), "DEF_LOAD_BIO"}, | 80 | {ERR_FUNC(CONF_F_DEF_LOAD_BIO), "DEF_LOAD_BIO"}, |
| 80 | {ERR_FUNC(CONF_F_MODULE_INIT), "MODULE_INIT"}, | 81 | {ERR_FUNC(CONF_F_MODULE_INIT), "MODULE_INIT"}, |
| @@ -97,6 +98,7 @@ static ERR_STRING_DATA CONF_str_functs[]= | |||
| 97 | static ERR_STRING_DATA CONF_str_reasons[]= | 98 | static ERR_STRING_DATA CONF_str_reasons[]= |
| 98 | { | 99 | { |
| 99 | {ERR_REASON(CONF_R_ERROR_LOADING_DSO) ,"error loading dso"}, | 100 | {ERR_REASON(CONF_R_ERROR_LOADING_DSO) ,"error loading dso"}, |
| 101 | {ERR_REASON(CONF_R_LIST_CANNOT_BE_NULL) ,"list cannot be null"}, | ||
| 100 | {ERR_REASON(CONF_R_MISSING_CLOSE_SQUARE_BRACKET),"missing close square bracket"}, | 102 | {ERR_REASON(CONF_R_MISSING_CLOSE_SQUARE_BRACKET),"missing close square bracket"}, |
| 101 | {ERR_REASON(CONF_R_MISSING_EQUAL_SIGN) ,"missing equal sign"}, | 103 | {ERR_REASON(CONF_R_MISSING_EQUAL_SIGN) ,"missing equal sign"}, |
| 102 | {ERR_REASON(CONF_R_MISSING_FINISH_FUNCTION),"missing finish function"}, | 104 | {ERR_REASON(CONF_R_MISSING_FINISH_FUNCTION),"missing finish function"}, |
diff --git a/src/lib/libcrypto/conf/conf_lib.c b/src/lib/libcrypto/conf/conf_lib.c index 2a3399d269..54046defca 100644 --- a/src/lib/libcrypto/conf/conf_lib.c +++ b/src/lib/libcrypto/conf/conf_lib.c | |||
| @@ -69,7 +69,7 @@ static CONF_METHOD *default_CONF_method=NULL; | |||
| 69 | 69 | ||
| 70 | /* Init a 'CONF' structure from an old LHASH */ | 70 | /* Init a 'CONF' structure from an old LHASH */ |
| 71 | 71 | ||
| 72 | void CONF_set_nconf(CONF *conf, LHASH *hash) | 72 | void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash) |
| 73 | { | 73 | { |
| 74 | if (default_CONF_method == NULL) | 74 | if (default_CONF_method == NULL) |
| 75 | default_CONF_method = NCONF_default(); | 75 | default_CONF_method = NCONF_default(); |
| @@ -87,9 +87,10 @@ int CONF_set_default_method(CONF_METHOD *meth) | |||
| 87 | return 1; | 87 | return 1; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | LHASH *CONF_load(LHASH *conf, const char *file, long *eline) | 90 | LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, |
| 91 | long *eline) | ||
| 91 | { | 92 | { |
| 92 | LHASH *ltmp; | 93 | LHASH_OF(CONF_VALUE) *ltmp; |
| 93 | BIO *in=NULL; | 94 | BIO *in=NULL; |
| 94 | 95 | ||
| 95 | #ifdef OPENSSL_SYS_VMS | 96 | #ifdef OPENSSL_SYS_VMS |
| @@ -110,10 +111,11 @@ LHASH *CONF_load(LHASH *conf, const char *file, long *eline) | |||
| 110 | } | 111 | } |
| 111 | 112 | ||
| 112 | #ifndef OPENSSL_NO_FP_API | 113 | #ifndef OPENSSL_NO_FP_API |
| 113 | LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline) | 114 | LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, |
| 115 | long *eline) | ||
| 114 | { | 116 | { |
| 115 | BIO *btmp; | 117 | BIO *btmp; |
| 116 | LHASH *ltmp; | 118 | LHASH_OF(CONF_VALUE) *ltmp; |
| 117 | if(!(btmp = BIO_new_fp(fp, BIO_NOCLOSE))) { | 119 | if(!(btmp = BIO_new_fp(fp, BIO_NOCLOSE))) { |
| 118 | CONFerr(CONF_F_CONF_LOAD_FP,ERR_R_BUF_LIB); | 120 | CONFerr(CONF_F_CONF_LOAD_FP,ERR_R_BUF_LIB); |
| 119 | return NULL; | 121 | return NULL; |
| @@ -124,7 +126,8 @@ LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline) | |||
| 124 | } | 126 | } |
| 125 | #endif | 127 | #endif |
| 126 | 128 | ||
| 127 | LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline) | 129 | LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, |
| 130 | long *eline) | ||
| 128 | { | 131 | { |
| 129 | CONF ctmp; | 132 | CONF ctmp; |
| 130 | int ret; | 133 | int ret; |
| @@ -137,7 +140,8 @@ LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline) | |||
| 137 | return NULL; | 140 | return NULL; |
| 138 | } | 141 | } |
| 139 | 142 | ||
| 140 | STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section) | 143 | STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, |
| 144 | const char *section) | ||
| 141 | { | 145 | { |
| 142 | if (conf == NULL) | 146 | if (conf == NULL) |
| 143 | { | 147 | { |
| @@ -151,7 +155,8 @@ STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section) | |||
| 151 | } | 155 | } |
| 152 | } | 156 | } |
| 153 | 157 | ||
| 154 | char *CONF_get_string(LHASH *conf,const char *group,const char *name) | 158 | char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf,const char *group, |
| 159 | const char *name) | ||
| 155 | { | 160 | { |
| 156 | if (conf == NULL) | 161 | if (conf == NULL) |
| 157 | { | 162 | { |
| @@ -165,7 +170,8 @@ char *CONF_get_string(LHASH *conf,const char *group,const char *name) | |||
| 165 | } | 170 | } |
| 166 | } | 171 | } |
| 167 | 172 | ||
| 168 | long CONF_get_number(LHASH *conf,const char *group,const char *name) | 173 | long CONF_get_number(LHASH_OF(CONF_VALUE) *conf,const char *group, |
| 174 | const char *name) | ||
| 169 | { | 175 | { |
| 170 | int status; | 176 | int status; |
| 171 | long result = 0; | 177 | long result = 0; |
| @@ -189,7 +195,7 @@ long CONF_get_number(LHASH *conf,const char *group,const char *name) | |||
| 189 | return result; | 195 | return result; |
| 190 | } | 196 | } |
| 191 | 197 | ||
| 192 | void CONF_free(LHASH *conf) | 198 | void CONF_free(LHASH_OF(CONF_VALUE) *conf) |
| 193 | { | 199 | { |
| 194 | CONF ctmp; | 200 | CONF ctmp; |
| 195 | CONF_set_nconf(&ctmp, conf); | 201 | CONF_set_nconf(&ctmp, conf); |
| @@ -197,7 +203,7 @@ void CONF_free(LHASH *conf) | |||
| 197 | } | 203 | } |
| 198 | 204 | ||
| 199 | #ifndef OPENSSL_NO_FP_API | 205 | #ifndef OPENSSL_NO_FP_API |
| 200 | int CONF_dump_fp(LHASH *conf, FILE *out) | 206 | int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out) |
| 201 | { | 207 | { |
| 202 | BIO *btmp; | 208 | BIO *btmp; |
| 203 | int ret; | 209 | int ret; |
| @@ -212,7 +218,7 @@ int CONF_dump_fp(LHASH *conf, FILE *out) | |||
| 212 | } | 218 | } |
| 213 | #endif | 219 | #endif |
| 214 | 220 | ||
| 215 | int CONF_dump_bio(LHASH *conf, BIO *out) | 221 | int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out) |
| 216 | { | 222 | { |
| 217 | CONF ctmp; | 223 | CONF ctmp; |
| 218 | CONF_set_nconf(&ctmp, conf); | 224 | CONF_set_nconf(&ctmp, conf); |
diff --git a/src/lib/libcrypto/conf/conf_mall.c b/src/lib/libcrypto/conf/conf_mall.c index 1cc1fd5534..c6f4cb2d55 100644 --- a/src/lib/libcrypto/conf/conf_mall.c +++ b/src/lib/libcrypto/conf/conf_mall.c | |||
| @@ -63,7 +63,6 @@ | |||
| 63 | #include <openssl/dso.h> | 63 | #include <openssl/dso.h> |
| 64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
| 65 | #include <openssl/asn1.h> | 65 | #include <openssl/asn1.h> |
| 66 | #include <openssl/evp.h> | ||
| 67 | #ifndef OPENSSL_NO_ENGINE | 66 | #ifndef OPENSSL_NO_ENGINE |
| 68 | #include <openssl/engine.h> | 67 | #include <openssl/engine.h> |
| 69 | #endif | 68 | #endif |
| @@ -77,6 +76,5 @@ void OPENSSL_load_builtin_modules(void) | |||
| 77 | #ifndef OPENSSL_NO_ENGINE | 76 | #ifndef OPENSSL_NO_ENGINE |
| 78 | ENGINE_add_conf_module(); | 77 | ENGINE_add_conf_module(); |
| 79 | #endif | 78 | #endif |
| 80 | EVP_add_alg_module(); | ||
| 81 | } | 79 | } |
| 82 | 80 | ||
diff --git a/src/lib/libcrypto/conf/conf_mod.c b/src/lib/libcrypto/conf/conf_mod.c index ee9c677d9b..df1642a0a5 100644 --- a/src/lib/libcrypto/conf/conf_mod.c +++ b/src/lib/libcrypto/conf/conf_mod.c | |||
| @@ -582,8 +582,14 @@ int CONF_parse_list(const char *list_, int sep, int nospc, | |||
| 582 | { | 582 | { |
| 583 | int ret; | 583 | int ret; |
| 584 | const char *lstart, *tmpend, *p; | 584 | const char *lstart, *tmpend, *p; |
| 585 | lstart = list_; | ||
| 586 | 585 | ||
| 586 | if(list_ == NULL) | ||
| 587 | { | ||
| 588 | CONFerr(CONF_F_CONF_PARSE_LIST, CONF_R_LIST_CANNOT_BE_NULL); | ||
| 589 | return 0; | ||
| 590 | } | ||
| 591 | |||
| 592 | lstart = list_; | ||
| 587 | for(;;) | 593 | for(;;) |
| 588 | { | 594 | { |
| 589 | if (nospc) | 595 | if (nospc) |
