summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/conf/conf.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/conf/conf.h73
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 @@
71extern "C" { 71extern "C" {
72#endif 72#endif
73 73
74typedef struct 74typedef 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
81DECLARE_STACK_OF(CONF_VALUE) 80DECLARE_STACK_OF(CONF_VALUE)
82DECLARE_LHASH_OF(CONF_VALUE); 81DECLARE_LHASH_OF(CONF_VALUE);
@@ -85,8 +84,7 @@ struct conf_st;
85struct conf_method_st; 84struct conf_method_st;
86typedef struct conf_method_st CONF_METHOD; 85typedef struct conf_method_st CONF_METHOD;
87 86
88struct conf_method_st 87struct 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
121int CONF_set_default_method(CONF_METHOD *meth); 119int CONF_set_default_method(CONF_METHOD *meth);
122void CONF_set_nconf(CONF *conf,LHASH_OF(CONF_VALUE) *hash); 120void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);
123LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf,const char *file, 121LHASH_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
126LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, 124LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
127 long *eline); 125 long *eline);
128#endif 126#endif
129LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,long *eline); 127LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, long *eline);
130STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, 128STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
131 const char *section); 129 const char *section);
132char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf,const char *group, 130char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
133 const char *name); 131 const char *name);
134long CONF_get_number(LHASH_OF(CONF_VALUE) *conf,const char *group, 132long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
135 const char *name); 133 const char *name);
136void CONF_free(LHASH_OF(CONF_VALUE) *conf); 134void CONF_free(LHASH_OF(CONF_VALUE) *conf);
137int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); 135int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
138int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); 136int 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
146struct conf_st 144struct 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
153CONF *NCONF_new(CONF_METHOD *meth); 150CONF *NCONF_new(CONF_METHOD *meth);
154CONF_METHOD *NCONF_default(void); 151CONF_METHOD *NCONF_default(void);
@@ -159,36 +156,36 @@ CONF_METHOD *NCONF_XML(void);
159void NCONF_free(CONF *conf); 156void NCONF_free(CONF *conf);
160void NCONF_free_data(CONF *conf); 157void NCONF_free_data(CONF *conf);
161 158
162int NCONF_load(CONF *conf,const char *file,long *eline); 159int NCONF_load(CONF *conf, const char *file, long *eline);
163#ifndef OPENSSL_NO_FP_API 160#ifndef OPENSSL_NO_FP_API
164int NCONF_load_fp(CONF *conf, FILE *fp,long *eline); 161int NCONF_load_fp(CONF *conf, FILE *fp, long *eline);
165#endif 162#endif
166int NCONF_load_bio(CONF *conf, BIO *bp,long *eline); 163int NCONF_load_bio(CONF *conf, BIO *bp, long *eline);
167STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,const char *section); 164STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section);
168char *NCONF_get_string(const CONF *conf,const char *group,const char *name); 165char *NCONF_get_string(const CONF *conf, const char *group, const char *name);
169int NCONF_get_number_e(const CONF *conf,const char *group,const char *name, 166int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
170 long *result); 167 long *result);
171int NCONF_dump_fp(const CONF *conf, FILE *out); 168int NCONF_dump_fp(const CONF *conf, FILE *out);
172int NCONF_dump_bio(const CONF *conf, BIO *out); 169int 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 */
176long NCONF_get_number(CONF *conf,char *group,char *name); 173long 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
183int CONF_modules_load(const CONF *cnf, const char *appname, 180int CONF_modules_load(const CONF *cnf, const char *appname,
184 unsigned long flags); 181 unsigned long flags);
185int CONF_modules_load_file(const char *filename, const char *appname, 182int CONF_modules_load_file(const char *filename, const char *appname,
186 unsigned long flags); 183 unsigned long flags);
187void CONF_modules_unload(int all); 184void CONF_modules_unload(int all);
188void CONF_modules_finish(void); 185void CONF_modules_finish(void);
189void CONF_modules_free(void); 186void CONF_modules_free(void);
190int CONF_module_add(const char *name, conf_init_func *ifunc, 187int CONF_module_add(const char *name, conf_init_func *ifunc,
191 conf_finish_func *ffunc); 188 conf_finish_func *ffunc);
192 189
193const char *CONF_imodule_get_name(const CONF_IMODULE *md); 190const char *CONF_imodule_get_name(const CONF_IMODULE *md);
194const char *CONF_imodule_get_value(const CONF_IMODULE *md); 191const 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);
203char *CONF_get1_default_config_file(void); 200char *CONF_get1_default_config_file(void);
204 201
205int CONF_parse_list(const char *list, int sep, int nospc, 202int 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
208void OPENSSL_load_builtin_modules(void); 205void OPENSSL_load_builtin_modules(void);
209 206