diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/conf/conf.h | 73 |
1 files changed, 35 insertions, 38 deletions
diff --git a/src/lib/libcrypto/conf/conf.h b/src/lib/libcrypto/conf/conf.h index c2199978a3..9c392a44ce 100644 --- a/src/lib/libcrypto/conf/conf.h +++ b/src/lib/libcrypto/conf/conf.h | |||
@@ -5,21 +5,21 @@ | |||
5 | * This package is an SSL implementation written | 5 | * This package is an SSL implementation written |
6 | * by Eric Young (eay@cryptsoft.com). | 6 | * by Eric Young (eay@cryptsoft.com). |
7 | * The implementation was written so as to conform with Netscapes SSL. | 7 | * The implementation was written so as to conform with Netscapes SSL. |
8 | * | 8 | * |
9 | * This library is free for commercial and non-commercial use as long as | 9 | * This library is free for commercial and non-commercial use as long as |
10 | * the following conditions are aheared to. The following conditions | 10 | * the following conditions are aheared to. The following conditions |
11 | * apply to all code found in this distribution, be it the RC4, RSA, | 11 | * apply to all code found in this distribution, be it the RC4, RSA, |
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation |
13 | * included with this distribution is covered by the same copyright terms | 13 | * included with this distribution is covered by the same copyright terms |
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). |
15 | * | 15 | * |
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | 16 | * Copyright remains Eric Young's, and as such any Copyright notices in |
17 | * the code are not to be removed. | 17 | * the code are not to be removed. |
18 | * If this package is used in a product, Eric Young should be given attribution | 18 | * If this package is used in a product, Eric Young should be given attribution |
19 | * as the author of the parts of the library used. | 19 | * as the author of the parts of the library used. |
20 | * This can be in the form of a textual message at program startup or | 20 | * This can be in the form of a textual message at program startup or |
21 | * in documentation (online or textual) provided with the package. | 21 | * in documentation (online or textual) provided with the package. |
22 | * | 22 | * |
23 | * Redistribution and use in source and binary forms, with or without | 23 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 24 | * modification, are permitted provided that the following conditions |
25 | * are met: | 25 | * are met: |
@@ -34,10 +34,10 @@ | |||
34 | * Eric Young (eay@cryptsoft.com)" | 34 | * Eric Young (eay@cryptsoft.com)" |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 35 | * The word 'cryptographic' can be left out if the rouines from the library |
36 | * being used are not cryptographic related :-). | 36 | * being used are not cryptographic related :-). |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 37 | * 4. If you include any Windows specific code (or a derivative thereof) from |
38 | * the apps directory (application code) you must include an acknowledgement: | 38 | * the apps directory (application code) you must include an acknowledgement: |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
40 | * | 40 | * |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -49,7 +49,7 @@ | |||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
51 | * SUCH DAMAGE. | 51 | * SUCH DAMAGE. |
52 | * | 52 | * |
53 | * The licence and distribution terms for any publically available version or | 53 | * The licence and distribution terms for any publically available version or |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be |
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
@@ -71,12 +71,11 @@ | |||
71 | extern "C" { | 71 | extern "C" { |
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | typedef struct | 74 | typedef struct { |
75 | { | ||
76 | char *section; | 75 | char *section; |
77 | char *name; | 76 | char *name; |
78 | char *value; | 77 | char *value; |
79 | } CONF_VALUE; | 78 | } CONF_VALUE; |
80 | 79 | ||
81 | DECLARE_STACK_OF(CONF_VALUE) | 80 | DECLARE_STACK_OF(CONF_VALUE) |
82 | DECLARE_LHASH_OF(CONF_VALUE); | 81 | DECLARE_LHASH_OF(CONF_VALUE); |
@@ -85,8 +84,7 @@ struct conf_st; | |||
85 | struct conf_method_st; | 84 | struct conf_method_st; |
86 | typedef struct conf_method_st CONF_METHOD; | 85 | typedef struct conf_method_st CONF_METHOD; |
87 | 86 | ||
88 | struct conf_method_st | 87 | struct conf_method_st { |
89 | { | ||
90 | const char *name; | 88 | const char *name; |
91 | CONF *(*create)(CONF_METHOD *meth); | 89 | CONF *(*create)(CONF_METHOD *meth); |
92 | int (*init)(CONF *conf); | 90 | int (*init)(CONF *conf); |
@@ -97,7 +95,7 @@ struct conf_method_st | |||
97 | int (*is_number)(const CONF *conf, char c); | 95 | int (*is_number)(const CONF *conf, char c); |
98 | int (*to_int)(const CONF *conf, char c); | 96 | int (*to_int)(const CONF *conf, char c); |
99 | int (*load)(CONF *conf, const char *name, long *eline); | 97 | int (*load)(CONF *conf, const char *name, long *eline); |
100 | }; | 98 | }; |
101 | 99 | ||
102 | /* Module definitions */ | 100 | /* Module definitions */ |
103 | 101 | ||
@@ -119,20 +117,20 @@ typedef void conf_finish_func(CONF_IMODULE *md); | |||
119 | #define CONF_MFLAGS_DEFAULT_SECTION 0x20 | 117 | #define CONF_MFLAGS_DEFAULT_SECTION 0x20 |
120 | 118 | ||
121 | int CONF_set_default_method(CONF_METHOD *meth); | 119 | int CONF_set_default_method(CONF_METHOD *meth); |
122 | void CONF_set_nconf(CONF *conf,LHASH_OF(CONF_VALUE) *hash); | 120 | void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); |
123 | LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf,const char *file, | 121 | LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, |
124 | long *eline); | 122 | long *eline); |
125 | #ifndef OPENSSL_NO_FP_API | 123 | #ifndef OPENSSL_NO_FP_API |
126 | LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, | 124 | LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, |
127 | long *eline); | 125 | long *eline); |
128 | #endif | 126 | #endif |
129 | LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,long *eline); | 127 | LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, long *eline); |
130 | STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, | 128 | STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, |
131 | const char *section); | 129 | const char *section); |
132 | char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf,const char *group, | 130 | char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, |
133 | const char *name); | 131 | const char *name); |
134 | long CONF_get_number(LHASH_OF(CONF_VALUE) *conf,const char *group, | 132 | long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, |
135 | const char *name); | 133 | const char *name); |
136 | void CONF_free(LHASH_OF(CONF_VALUE) *conf); | 134 | void CONF_free(LHASH_OF(CONF_VALUE) *conf); |
137 | int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); | 135 | int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); |
138 | int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); | 136 | int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); |
@@ -143,12 +141,11 @@ void OPENSSL_no_config(void); | |||
143 | /* New conf code. The semantics are different from the functions above. | 141 | /* New conf code. The semantics are different from the functions above. |
144 | If that wasn't the case, the above functions would have been replaced */ | 142 | If that wasn't the case, the above functions would have been replaced */ |
145 | 143 | ||
146 | struct conf_st | 144 | struct conf_st { |
147 | { | ||
148 | CONF_METHOD *meth; | 145 | CONF_METHOD *meth; |
149 | void *meth_data; | 146 | void *meth_data; |
150 | LHASH_OF(CONF_VALUE) *data; | 147 | LHASH_OF(CONF_VALUE) *data; |
151 | }; | 148 | }; |
152 | 149 | ||
153 | CONF *NCONF_new(CONF_METHOD *meth); | 150 | CONF *NCONF_new(CONF_METHOD *meth); |
154 | CONF_METHOD *NCONF_default(void); | 151 | CONF_METHOD *NCONF_default(void); |
@@ -159,36 +156,36 @@ CONF_METHOD *NCONF_XML(void); | |||
159 | void NCONF_free(CONF *conf); | 156 | void NCONF_free(CONF *conf); |
160 | void NCONF_free_data(CONF *conf); | 157 | void NCONF_free_data(CONF *conf); |
161 | 158 | ||
162 | int NCONF_load(CONF *conf,const char *file,long *eline); | 159 | int NCONF_load(CONF *conf, const char *file, long *eline); |
163 | #ifndef OPENSSL_NO_FP_API | 160 | #ifndef OPENSSL_NO_FP_API |
164 | int NCONF_load_fp(CONF *conf, FILE *fp,long *eline); | 161 | int NCONF_load_fp(CONF *conf, FILE *fp, long *eline); |
165 | #endif | 162 | #endif |
166 | int NCONF_load_bio(CONF *conf, BIO *bp,long *eline); | 163 | int NCONF_load_bio(CONF *conf, BIO *bp, long *eline); |
167 | STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,const char *section); | 164 | STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section); |
168 | char *NCONF_get_string(const CONF *conf,const char *group,const char *name); | 165 | char *NCONF_get_string(const CONF *conf, const char *group, const char *name); |
169 | int NCONF_get_number_e(const CONF *conf,const char *group,const char *name, | 166 | int NCONF_get_number_e(const CONF *conf, const char *group, const char *name, |
170 | long *result); | 167 | long *result); |
171 | int NCONF_dump_fp(const CONF *conf, FILE *out); | 168 | int NCONF_dump_fp(const CONF *conf, FILE *out); |
172 | int NCONF_dump_bio(const CONF *conf, BIO *out); | 169 | int NCONF_dump_bio(const CONF *conf, BIO *out); |
173 | 170 | ||
174 | #if 0 /* The following function has no error checking, | 171 | #if 0 /* The following function has no error checking, |
175 | and should therefore be avoided */ | 172 | and should therefore be avoided */ |
176 | long NCONF_get_number(CONF *conf,char *group,char *name); | 173 | long NCONF_get_number(CONF *conf, char *group, char *name); |
177 | #else | 174 | #else |
178 | #define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) | 175 | #define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) |
179 | #endif | 176 | #endif |
180 | 177 | ||
181 | /* Module functions */ | 178 | /* Module functions */ |
182 | 179 | ||
183 | int CONF_modules_load(const CONF *cnf, const char *appname, | 180 | int CONF_modules_load(const CONF *cnf, const char *appname, |
184 | unsigned long flags); | 181 | unsigned long flags); |
185 | int CONF_modules_load_file(const char *filename, const char *appname, | 182 | int CONF_modules_load_file(const char *filename, const char *appname, |
186 | unsigned long flags); | 183 | unsigned long flags); |
187 | void CONF_modules_unload(int all); | 184 | void CONF_modules_unload(int all); |
188 | void CONF_modules_finish(void); | 185 | void CONF_modules_finish(void); |
189 | void CONF_modules_free(void); | 186 | void CONF_modules_free(void); |
190 | int CONF_module_add(const char *name, conf_init_func *ifunc, | 187 | int CONF_module_add(const char *name, conf_init_func *ifunc, |
191 | conf_finish_func *ffunc); | 188 | conf_finish_func *ffunc); |
192 | 189 | ||
193 | const char *CONF_imodule_get_name(const CONF_IMODULE *md); | 190 | const char *CONF_imodule_get_name(const CONF_IMODULE *md); |
194 | const char *CONF_imodule_get_value(const CONF_IMODULE *md); | 191 | const char *CONF_imodule_get_value(const CONF_IMODULE *md); |
@@ -203,7 +200,7 @@ void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data); | |||
203 | char *CONF_get1_default_config_file(void); | 200 | char *CONF_get1_default_config_file(void); |
204 | 201 | ||
205 | int CONF_parse_list(const char *list, int sep, int nospc, | 202 | int CONF_parse_list(const char *list, int sep, int nospc, |
206 | int (*list_cb)(const char *elem, int len, void *usr), void *arg); | 203 | int (*list_cb)(const char *elem, int len, void *usr), void *arg); |
207 | 204 | ||
208 | void OPENSSL_load_builtin_modules(void); | 205 | void OPENSSL_load_builtin_modules(void); |
209 | 206 | ||