README revision 238405
1158115SumeConfiguration modules. These are a set of modules which can perform 2158115Sumevarious configuration functions. 3158115Sume 4158115SumeCurrently the routines should be called at most once when an application 5158115Sumestarts up: that is before it starts any threads. 6158115Sume 7158115SumeThe routines read a configuration file set up like this: 8158115Sume 9158115Sume----- 10158115Sume#default section 11158115Sumeopenssl_conf=init_section 12158115Sume 13158115Sume[init_section] 14158115Sume 15158115Sumemodule1=value1 16158115Sume#Second instance of module1 17158115Sumemodule1.1=valueX 18158115Sumemodule2=value2 19158115Sumemodule3=dso_literal 20158115Sumemodule4=dso_section 21158115Sume 22158115Sume[dso_section] 23158115Sume 24158115Sumepath=/some/path/to/some/dso.so 25158115Sumeother_stuff=other_value 26158115Sume---- 27158115Sume 28158115SumeWhen this file is loaded a configuration module with the specified string 29158115Sume(module* in the above example) is looked up and its init function called as: 30158115Sume 31194089Sdesint conf_init_func(CONF_IMODULE *md, CONF *cnf); 32194089Sdes 33194089SdesThe function can then take whatever action is appropriate, for example further 34158115Sumelookups based on the value. Multiple instances of the same config module can be 35158115Sumeloaded. 36194089Sdes 37194089SdesWhen the application closes down the modules are cleaned up by calling an 38158115Sumeoptional finish function: 39158115Sume 40158115Sumevoid conf_finish_func(CONF_IMODULE *md); 41194089Sdes 42158115SumeThe finish functions are called in reverse order: that is the last module 43158115Sumeloaded is the first one cleaned up. 44158115Sume 45158115SumeIf no module exists with a given name then an attempt is made to load a DSO 46158115Sumewith the supplied name. This might mean that "module3" attempts to load a DSO 47158115Sumecalled libmodule3.so or module3.dll for example. An explicit DSO name can be 48158115Sumegiven by including a separate section as in the module4 example above. 49158115Sume 50158115SumeThe DSO is expected to at least contain an initialization function: 51158115Sume 52158115Sumeint OPENSSL_init(CONF_IMODULE *md, CONF *cnf); 53158115Sume 54158115Sumeand may also include a finish function: 55158115Sume 56158115Sumevoid OPENSSL_finish(CONF_IMODULE *md); 57158115Sume 58158115SumeStatic modules can also be added using, 59158115Sume 60158115Sumeint CONF_module_add(char *name, dso_mod_init_func *ifunc, dso_mod_finish_func 61158115Sume*ffunc); 62158115Sume 63158115Sumewhere "name" is the name in the configuration file this function corresponds 64158115Sumeto. 65158115Sume 66158115SumeA set of builtin modules (currently only an ASN1 non functional test module) 67158115Sumecan be added by calling OPENSSL_load_builtin_modules(). 68158115Sume 69158115SumeThe function OPENSSL_config() is intended as a simple configuration function 70158115Sumethat any application can call to perform various default configuration tasks. 71158115SumeIt uses the file openssl.cnf in the usual locations. 72158115Sume 73158115Sume 74158115Sume