diff options
Diffstat (limited to 'src/lib/libcrypto/conf/conf.h')
-rw-r--r-- | src/lib/libcrypto/conf/conf.h | 111 |
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 |
69 | extern "C" { | 69 | extern "C" { |
@@ -77,6 +77,8 @@ typedef struct | |||
77 | } CONF_VALUE; | 77 | } CONF_VALUE; |
78 | 78 | ||
79 | DECLARE_STACK_OF(CONF_VALUE) | 79 | DECLARE_STACK_OF(CONF_VALUE) |
80 | DECLARE_STACK_OF(CONF_MODULE) | ||
81 | DECLARE_STACK_OF(CONF_IMODULE) | ||
80 | 82 | ||
81 | struct conf_st; | 83 | struct conf_st; |
82 | typedef struct conf_st CONF; | 84 | typedef struct conf_st CONF; |
@@ -86,29 +88,47 @@ typedef struct conf_method_st CONF_METHOD; | |||
86 | struct conf_method_st | 88 | struct 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 | |||
104 | typedef struct conf_imodule_st CONF_IMODULE; | ||
105 | typedef struct conf_module_st CONF_MODULE; | ||
106 | |||
107 | /* DSO module function typedefs */ | ||
108 | typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf); | ||
109 | typedef 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 | |||
99 | int CONF_set_default_method(CONF_METHOD *meth); | 117 | int CONF_set_default_method(CONF_METHOD *meth); |
118 | void CONF_set_nconf(CONF *conf,LHASH *hash); | ||
100 | LHASH *CONF_load(LHASH *conf,const char *file,long *eline); | 119 | LHASH *CONF_load(LHASH *conf,const char *file,long *eline); |
101 | #ifndef NO_FP_API | 120 | #ifndef OPENSSL_NO_FP_API |
102 | LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline); | 121 | LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline); |
103 | #endif | 122 | #endif |
104 | LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline); | 123 | LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline); |
105 | STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,char *section); | 124 | STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section); |
106 | char *CONF_get_string(LHASH *conf,char *group,char *name); | 125 | char *CONF_get_string(LHASH *conf,const char *group,const char *name); |
107 | long CONF_get_number(LHASH *conf,char *group,char *name); | 126 | long CONF_get_number(LHASH *conf,const char *group,const char *name); |
108 | void CONF_free(LHASH *conf); | 127 | void CONF_free(LHASH *conf); |
109 | int CONF_dump_fp(LHASH *conf, FILE *out); | 128 | int CONF_dump_fp(LHASH *conf, FILE *out); |
110 | int CONF_dump_bio(LHASH *conf, BIO *out); | 129 | int CONF_dump_bio(LHASH *conf, BIO *out); |
111 | void ERR_load_CONF_strings(void ); | 130 | |
131 | void 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); | |||
130 | void NCONF_free_data(CONF *conf); | 150 | void NCONF_free_data(CONF *conf); |
131 | 151 | ||
132 | int NCONF_load(CONF *conf,const char *file,long *eline); | 152 | int NCONF_load(CONF *conf,const char *file,long *eline); |
133 | #ifndef NO_FP_API | 153 | #ifndef OPENSSL_NO_FP_API |
134 | int NCONF_load_fp(CONF *conf, FILE *fp,long *eline); | 154 | int NCONF_load_fp(CONF *conf, FILE *fp,long *eline); |
135 | #endif | 155 | #endif |
136 | int NCONF_load_bio(CONF *conf, BIO *bp,long *eline); | 156 | int NCONF_load_bio(CONF *conf, BIO *bp,long *eline); |
137 | STACK_OF(CONF_VALUE) *NCONF_get_section(CONF *conf,char *section); | 157 | STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,const char *section); |
138 | char *NCONF_get_string(CONF *conf,char *group,char *name); | 158 | char *NCONF_get_string(const CONF *conf,const char *group,const char *name); |
159 | int NCONF_get_number_e(const CONF *conf,const char *group,const char *name, | ||
160 | long *result); | ||
161 | int NCONF_dump_fp(const CONF *conf, FILE *out); | ||
162 | int 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 */ | ||
139 | long NCONF_get_number(CONF *conf,char *group,char *name); | 166 | long NCONF_get_number(CONF *conf,char *group,char *name); |
140 | int NCONF_dump_fp(CONF *conf, FILE *out); | 167 | #else |
141 | int 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 | |||
173 | int CONF_modules_load(const CONF *cnf, const char *appname, | ||
174 | unsigned long flags); | ||
175 | int CONF_modules_load_file(const char *filename, const char *appname, | ||
176 | unsigned long flags); | ||
177 | void CONF_modules_unload(int all); | ||
178 | void CONF_modules_finish(void); | ||
179 | int CONF_module_add(const char *name, conf_init_func *ifunc, | ||
180 | conf_finish_func *ffunc); | ||
181 | |||
182 | const char *CONF_imodule_get_name(const CONF_IMODULE *md); | ||
183 | const char *CONF_imodule_get_value(const CONF_IMODULE *md); | ||
184 | void *CONF_imodule_get_usr_data(const CONF_IMODULE *md); | ||
185 | void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data); | ||
186 | CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md); | ||
187 | unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md); | ||
188 | void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags); | ||
189 | void *CONF_module_get_usr_data(CONF_MODULE *pmod); | ||
190 | void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data); | ||
191 | |||
192 | char *CONF_get1_default_config_file(void); | ||
193 | |||
194 | int CONF_parse_list(const char *list, int sep, int nospc, | ||
195 | int (*list_cb)(const char *elem, int len, void *usr), void *arg); | ||
196 | |||
197 | void 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 | */ |
203 | void 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 | |||