summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/conf/conf.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/conf/conf.h')
-rw-r--r--src/lib/libcrypto/conf/conf.h111
1 files changed, 90 insertions, 21 deletions
diff --git a/src/lib/libcrypto/conf/conf.h b/src/lib/libcrypto/conf/conf.h
index cd40a0db21..3c03fb19c0 100644
--- a/src/lib/libcrypto/conf/conf.h
+++ b/src/lib/libcrypto/conf/conf.h
@@ -63,7 +63,7 @@
63#include <openssl/lhash.h> 63#include <openssl/lhash.h>
64#include <openssl/stack.h> 64#include <openssl/stack.h>
65#include <openssl/safestack.h> 65#include <openssl/safestack.h>
66#include <openssl/e_os.h> 66#include <openssl/e_os2.h>
67 67
68#ifdef __cplusplus 68#ifdef __cplusplus
69extern "C" { 69extern "C" {
@@ -77,6 +77,8 @@ typedef struct
77 } CONF_VALUE; 77 } CONF_VALUE;
78 78
79DECLARE_STACK_OF(CONF_VALUE) 79DECLARE_STACK_OF(CONF_VALUE)
80DECLARE_STACK_OF(CONF_MODULE)
81DECLARE_STACK_OF(CONF_IMODULE)
80 82
81struct conf_st; 83struct conf_st;
82typedef struct conf_st CONF; 84typedef struct conf_st CONF;
@@ -86,29 +88,47 @@ typedef struct conf_method_st CONF_METHOD;
86struct conf_method_st 88struct conf_method_st
87 { 89 {
88 const char *name; 90 const char *name;
89 CONF *(MS_FAR *create)(CONF_METHOD *meth); 91 CONF *(*create)(CONF_METHOD *meth);
90 int (MS_FAR *init)(CONF *conf); 92 int (*init)(CONF *conf);
91 int (MS_FAR *destroy)(CONF *conf); 93 int (*destroy)(CONF *conf);
92 int (MS_FAR *destroy_data)(CONF *conf); 94 int (*destroy_data)(CONF *conf);
93 int (MS_FAR *load)(CONF *conf, BIO *bp, long *eline); 95 int (*load_bio)(CONF *conf, BIO *bp, long *eline);
94 int (MS_FAR *dump)(CONF *conf, BIO *bp); 96 int (*dump)(const CONF *conf, BIO *bp);
95 int (MS_FAR *is_number)(CONF *conf, char c); 97 int (*is_number)(const CONF *conf, char c);
96 int (MS_FAR *to_int)(CONF *conf, char c); 98 int (*to_int)(const CONF *conf, char c);
99 int (*load)(CONF *conf, const char *name, long *eline);
97 }; 100 };
98 101
102/* Module definitions */
103
104typedef struct conf_imodule_st CONF_IMODULE;
105typedef struct conf_module_st CONF_MODULE;
106
107/* DSO module function typedefs */
108typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf);
109typedef void conf_finish_func(CONF_IMODULE *md);
110
111#define CONF_MFLAGS_IGNORE_ERRORS 0x1
112#define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
113#define CONF_MFLAGS_SILENT 0x4
114#define CONF_MFLAGS_NO_DSO 0x8
115#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
116
99int CONF_set_default_method(CONF_METHOD *meth); 117int CONF_set_default_method(CONF_METHOD *meth);
118void CONF_set_nconf(CONF *conf,LHASH *hash);
100LHASH *CONF_load(LHASH *conf,const char *file,long *eline); 119LHASH *CONF_load(LHASH *conf,const char *file,long *eline);
101#ifndef NO_FP_API 120#ifndef OPENSSL_NO_FP_API
102LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline); 121LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline);
103#endif 122#endif
104LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline); 123LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline);
105STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,char *section); 124STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section);
106char *CONF_get_string(LHASH *conf,char *group,char *name); 125char *CONF_get_string(LHASH *conf,const char *group,const char *name);
107long CONF_get_number(LHASH *conf,char *group,char *name); 126long CONF_get_number(LHASH *conf,const char *group,const char *name);
108void CONF_free(LHASH *conf); 127void CONF_free(LHASH *conf);
109int CONF_dump_fp(LHASH *conf, FILE *out); 128int CONF_dump_fp(LHASH *conf, FILE *out);
110int CONF_dump_bio(LHASH *conf, BIO *out); 129int CONF_dump_bio(LHASH *conf, BIO *out);
111void ERR_load_CONF_strings(void ); 130
131void OPENSSL_config(const char *config_name);
112 132
113/* New conf code. The semantics are different from the functions above. 133/* New conf code. The semantics are different from the functions above.
114 If that wasn't the case, the above functions would have been replaced */ 134 If that wasn't the case, the above functions would have been replaced */
@@ -130,21 +150,57 @@ void NCONF_free(CONF *conf);
130void NCONF_free_data(CONF *conf); 150void NCONF_free_data(CONF *conf);
131 151
132int NCONF_load(CONF *conf,const char *file,long *eline); 152int NCONF_load(CONF *conf,const char *file,long *eline);
133#ifndef NO_FP_API 153#ifndef OPENSSL_NO_FP_API
134int NCONF_load_fp(CONF *conf, FILE *fp,long *eline); 154int NCONF_load_fp(CONF *conf, FILE *fp,long *eline);
135#endif 155#endif
136int NCONF_load_bio(CONF *conf, BIO *bp,long *eline); 156int NCONF_load_bio(CONF *conf, BIO *bp,long *eline);
137STACK_OF(CONF_VALUE) *NCONF_get_section(CONF *conf,char *section); 157STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,const char *section);
138char *NCONF_get_string(CONF *conf,char *group,char *name); 158char *NCONF_get_string(const CONF *conf,const char *group,const char *name);
159int NCONF_get_number_e(const CONF *conf,const char *group,const char *name,
160 long *result);
161int NCONF_dump_fp(const CONF *conf, FILE *out);
162int NCONF_dump_bio(const CONF *conf, BIO *out);
163
164#if 0 /* The following function has no error checking,
165 and should therefore be avoided */
139long NCONF_get_number(CONF *conf,char *group,char *name); 166long NCONF_get_number(CONF *conf,char *group,char *name);
140int NCONF_dump_fp(CONF *conf, FILE *out); 167#else
141int NCONF_dump_bio(CONF *conf, BIO *out); 168#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
142 169#endif
170
171/* Module functions */
172
173int CONF_modules_load(const CONF *cnf, const char *appname,
174 unsigned long flags);
175int CONF_modules_load_file(const char *filename, const char *appname,
176 unsigned long flags);
177void CONF_modules_unload(int all);
178void CONF_modules_finish(void);
179int CONF_module_add(const char *name, conf_init_func *ifunc,
180 conf_finish_func *ffunc);
181
182const char *CONF_imodule_get_name(const CONF_IMODULE *md);
183const char *CONF_imodule_get_value(const CONF_IMODULE *md);
184void *CONF_imodule_get_usr_data(const CONF_IMODULE *md);
185void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);
186CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md);
187unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md);
188void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags);
189void *CONF_module_get_usr_data(CONF_MODULE *pmod);
190void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
191
192char *CONF_get1_default_config_file(void);
193
194int CONF_parse_list(const char *list, int sep, int nospc,
195 int (*list_cb)(const char *elem, int len, void *usr), void *arg);
196
197void OPENSSL_load_builtin_modules(void);
143 198
144/* BEGIN ERROR CODES */ 199/* BEGIN ERROR CODES */
145/* The following lines are auto generated by the script mkerr.pl. Any changes 200/* The following lines are auto generated by the script mkerr.pl. Any changes
146 * made after this point may be overwritten when the script is next run. 201 * made after this point may be overwritten when the script is next run.
147 */ 202 */
203void ERR_load_CONF_strings(void);
148 204
149/* Error codes for the CONF functions. */ 205/* Error codes for the CONF functions. */
150 206
@@ -153,27 +209,40 @@ int NCONF_dump_bio(CONF *conf, BIO *out);
153#define CONF_F_CONF_LOAD 100 209#define CONF_F_CONF_LOAD 100
154#define CONF_F_CONF_LOAD_BIO 102 210#define CONF_F_CONF_LOAD_BIO 102
155#define CONF_F_CONF_LOAD_FP 103 211#define CONF_F_CONF_LOAD_FP 103
212#define CONF_F_CONF_MODULES_LOAD 116
213#define CONF_F_MODULE_INIT 115
214#define CONF_F_MODULE_LOAD_DSO 117
215#define CONF_F_MODULE_RUN 118
156#define CONF_F_NCONF_DUMP_BIO 105 216#define CONF_F_NCONF_DUMP_BIO 105
157#define CONF_F_NCONF_DUMP_FP 106 217#define CONF_F_NCONF_DUMP_FP 106
158#define CONF_F_NCONF_GET_NUMBER 107 218#define CONF_F_NCONF_GET_NUMBER 107
219#define CONF_F_NCONF_GET_NUMBER_E 112
159#define CONF_F_NCONF_GET_SECTION 108 220#define CONF_F_NCONF_GET_SECTION 108
160#define CONF_F_NCONF_GET_STRING 109 221#define CONF_F_NCONF_GET_STRING 109
222#define CONF_F_NCONF_LOAD 113
161#define CONF_F_NCONF_LOAD_BIO 110 223#define CONF_F_NCONF_LOAD_BIO 110
224#define CONF_F_NCONF_LOAD_FP 114
162#define CONF_F_NCONF_NEW 111 225#define CONF_F_NCONF_NEW 111
163#define CONF_F_STR_COPY 101 226#define CONF_F_STR_COPY 101
164 227
165/* Reason codes. */ 228/* Reason codes. */
229#define CONF_R_ERROR_LOADING_DSO 110
166#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 230#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100
167#define CONF_R_MISSING_EQUAL_SIGN 101 231#define CONF_R_MISSING_EQUAL_SIGN 101
232#define CONF_R_MISSING_FINISH_FUNCTION 111
233#define CONF_R_MISSING_INIT_FUNCTION 112
234#define CONF_R_MODULE_INITIALIZATION_ERROR 109
168#define CONF_R_NO_CLOSE_BRACE 102 235#define CONF_R_NO_CLOSE_BRACE 102
169#define CONF_R_NO_CONF 105 236#define CONF_R_NO_CONF 105
170#define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106 237#define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106
171#define CONF_R_NO_SECTION 107 238#define CONF_R_NO_SECTION 107
239#define CONF_R_NO_SUCH_FILE 114
240#define CONF_R_NO_VALUE 108
172#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 241#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
242#define CONF_R_UNKNOWN_MODULE_NAME 113
173#define CONF_R_VARIABLE_HAS_NO_VALUE 104 243#define CONF_R_VARIABLE_HAS_NO_VALUE 104
174 244
175#ifdef __cplusplus 245#ifdef __cplusplus
176} 246}
177#endif 247#endif
178#endif 248#endif
179