OLD | NEW |
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 |
9 Currently the routines should be called at most once when an application | 4 Currently the routines should be called at most once when an application |
10 starts up: that is before it starts any threads. | 5 starts up: that is before it starts any threads. |
11 | 6 |
12 The routines read a configuration file set up like this: | 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 |
20 module1=value1 | 15 module1=value1 |
21 #Second instance of module1 | 16 #Second instance of module1 |
22 module1.1=valueX | 17 module1.1=valueX |
23 module2=value2 | 18 module2=value2 |
24 module3=dso_literal | 19 module3=dso_literal |
25 module4=dso_section | 20 module4=dso_section |
26 | 21 |
27 [dso_section] | 22 [dso_section] |
28 | 23 |
29 path=/some/path/to/some/dso.so | 24 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 |
59 int OPENSSL_init(CONF_IMODULE *md, CONF *cnf); | 52 int OPENSSL_init(CONF_IMODULE *md, CONF *cnf); |
60 | 53 |
61 and may also include a finish function: | 54 and may also include a finish function: |
62 | 55 |
63 void OPENSSL_finish(CONF_IMODULE *md); | 56 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 *f
func); | 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 tha
t | 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 |
OLD | NEW |