1109998SmarkmConfiguration modules. These are a set of modules which can perform 2109998Smarkmvarious configuration functions. 3109998Smarkm 4109998SmarkmCurrently the routines should be called at most once when an application 5109998Smarkmstarts up: that is before it starts any threads. 6109998Smarkm 7109998SmarkmThe routines read a configuration file set up like this: 8109998Smarkm 9109998Smarkm----- 10109998Smarkm#default section 11238405Sjkimopenssl_conf=init_section 12109998Smarkm 13109998Smarkm[init_section] 14109998Smarkm 15109998Smarkmmodule1=value1 16109998Smarkm#Second instance of module1 17109998Smarkmmodule1.1=valueX 18109998Smarkmmodule2=value2 19109998Smarkmmodule3=dso_literal 20109998Smarkmmodule4=dso_section 21109998Smarkm 22109998Smarkm[dso_section] 23109998Smarkm 24109998Smarkmpath=/some/path/to/some/dso.so 25109998Smarkmother_stuff=other_value 26109998Smarkm---- 27109998Smarkm 28238405SjkimWhen this file is loaded a configuration module with the specified string 29238405Sjkim(module* in the above example) is looked up and its init function called as: 30109998Smarkm 31109998Smarkmint conf_init_func(CONF_IMODULE *md, CONF *cnf); 32109998Smarkm 33238405SjkimThe function can then take whatever action is appropriate, for example further 34238405Sjkimlookups based on the value. Multiple instances of the same config module can be 35238405Sjkimloaded. 36109998Smarkm 37238405SjkimWhen the application closes down the modules are cleaned up by calling an 38238405Sjkimoptional finish function: 39109998Smarkm 40109998Smarkmvoid conf_finish_func(CONF_IMODULE *md); 41109998Smarkm 42109998SmarkmThe finish functions are called in reverse order: that is the last module 43109998Smarkmloaded is the first one cleaned up. 44109998Smarkm 45238405SjkimIf no module exists with a given name then an attempt is made to load a DSO 46238405Sjkimwith the supplied name. This might mean that "module3" attempts to load a DSO 47238405Sjkimcalled libmodule3.so or module3.dll for example. An explicit DSO name can be 48238405Sjkimgiven by including a separate section as in the module4 example above. 49109998Smarkm 50109998SmarkmThe DSO is expected to at least contain an initialization function: 51109998Smarkm 52109998Smarkmint OPENSSL_init(CONF_IMODULE *md, CONF *cnf); 53109998Smarkm 54109998Smarkmand may also include a finish function: 55109998Smarkm 56109998Smarkmvoid OPENSSL_finish(CONF_IMODULE *md); 57109998Smarkm 58109998SmarkmStatic modules can also be added using, 59109998Smarkm 60238405Sjkimint CONF_module_add(char *name, dso_mod_init_func *ifunc, dso_mod_finish_func 61238405Sjkim*ffunc); 62109998Smarkm 63238405Sjkimwhere "name" is the name in the configuration file this function corresponds 64238405Sjkimto. 65109998Smarkm 66238405SjkimA set of builtin modules (currently only an ASN1 non functional test module) 67238405Sjkimcan be added by calling OPENSSL_load_builtin_modules(). 68109998Smarkm 69238405SjkimThe function OPENSSL_config() is intended as a simple configuration function 70238405Sjkimthat any application can call to perform various default configuration tasks. 71238405SjkimIt uses the file openssl.cnf in the usual locations. 72109998Smarkm 73109998Smarkm 74