Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/include/openssl/conf.h |
Source code | Switch to Preprocessed file |
Line | Source | Count |
---|---|---|
1 | /* | - |
2 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. | - |
3 | * | - |
4 | * Licensed under the OpenSSL license (the "License"). You may not use | - |
5 | * this file except in compliance with the License. You can obtain a copy | - |
6 | * in the file LICENSE in the source distribution or at | - |
7 | * https://www.openssl.org/source/license.html | - |
8 | */ | - |
9 | - | |
10 | #ifndef HEADER_CONF_H | - |
11 | # define HEADER_CONF_H | - |
12 | - | |
13 | # include <openssl/bio.h> | - |
14 | # include <openssl/lhash.h> | - |
15 | # include <openssl/safestack.h> | - |
16 | # include <openssl/e_os2.h> | - |
17 | # include <openssl/ossl_typ.h> | - |
18 | # include <openssl/conferr.h> | - |
19 | - | |
20 | #ifdef __cplusplus | - |
21 | extern "C" { | - |
22 | #endif | - |
23 | - | |
24 | typedef struct { | - |
25 | char *section; | - |
26 | char *name; | - |
27 | char *value; | - |
28 | } CONF_VALUE; | - |
29 | - | |
30 | DEFINE_STACK_OF(CONF_VALUE) executed 33216 times by 1 test: end of block Executed by:
never executed: end of block executed 47019 times by 2 tests: end of block Executed by:
never executed: end of block executed 81388 times by 4 tests: return OPENSSL_sk_num((const OPENSSL_STACK *)sk); Executed by:
executed 108200 times by 4 tests: return (CONF_VALUE *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); Executed by:
never executed: return (struct stack_st_CONF_VALUE *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); executed 41969 times by 1 test: return (struct stack_st_CONF_VALUE *)OPENSSL_sk_new_null(); Executed by:
never executed: return (struct stack_st_CONF_VALUE *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); never executed: return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); never executed: return (CONF_VALUE *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); executed 12854 times by 1 test: return (CONF_VALUE *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, (const void *)ptr); Executed by:
executed 103279 times by 1 test: return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); Executed by:
never executed: return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); never executed: return (CONF_VALUE *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); never executed: return (CONF_VALUE *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); never executed: return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); never executed: return (CONF_VALUE *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); never executed: return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); never executed: return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); never executed: return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); never executed: return (struct stack_st_CONF_VALUE *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); never executed: return (struct stack_st_CONF_VALUE *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, (OPENSSL_sk_copyfunc)copyfunc, (OPENSSL_sk_freefunc)freefunc); never executed: return (sk_CONF_VALUE_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); | 0-108200 |
31 | DEFINE_LHASH_OF(CONF_VALUE); executed 2150 times by 1 test: end of block Executed by:
never executed: end of block never executed: end of block never executed: end of block executed 2150 times by 1 test: end of block Executed by:
executed 2150 times by 1 test: end of block Executed by:
executed 2150 times by 1 test: return (struct lhash_st_CONF_VALUE *) OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); Executed by:
executed 120197 times by 1 test: return (CONF_VALUE *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); Executed by:
executed 74127 times by 1 test: return (CONF_VALUE *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); Executed by:
executed 89199 times by 1 test: return (CONF_VALUE *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); Executed by:
executed 33216 times by 1 test: return OPENSSL_LH_error((OPENSSL_LHASH *)lh); Executed by:
never executed: return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); never executed: return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); | 0-120197 |
32 | - | |
33 | struct conf_st; | - |
34 | struct conf_method_st; | - |
35 | typedef struct conf_method_st CONF_METHOD; | - |
36 | - | |
37 | struct conf_method_st { | - |
38 | const char *name; | - |
39 | CONF *(*create) (CONF_METHOD *meth); | - |
40 | int (*init) (CONF *conf); | - |
41 | int (*destroy) (CONF *conf); | - |
42 | int (*destroy_data) (CONF *conf); | - |
43 | int (*load_bio) (CONF *conf, BIO *bp, long *eline); | - |
44 | int (*dump) (const CONF *conf, BIO *bp); | - |
45 | int (*is_number) (const CONF *conf, char c); | - |
46 | int (*to_int) (const CONF *conf, char c); | - |
47 | int (*load) (CONF *conf, const char *name, long *eline); | - |
48 | }; | - |
49 | - | |
50 | /* Module definitions */ | - |
51 | - | |
52 | typedef struct conf_imodule_st CONF_IMODULE; | - |
53 | typedef struct conf_module_st CONF_MODULE; | - |
54 | - | |
55 | DEFINE_STACK_OF(CONF_MODULE) executed 1958 times by 1 test: end of block Executed by:
never executed: end of block never executed: end of block never executed: end of block executed 11920 times by 12 tests: return OPENSSL_sk_num((const OPENSSL_STACK *)sk); Executed by:
executed 20885 times by 1 test: return (CONF_MODULE *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); Executed by:
never executed: return (struct stack_st_CONF_MODULE *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); executed 1958 times by 1 test: return (struct stack_st_CONF_MODULE *)OPENSSL_sk_new_null(); Executed by:
never executed: return (struct stack_st_CONF_MODULE *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); never executed: return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); executed 9790 times by 1 test: return (CONF_MODULE *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); Executed by:
never executed: return (CONF_MODULE *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, (const void *)ptr); executed 9790 times by 1 test: return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); Executed by:
never executed: return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); never executed: return (CONF_MODULE *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); never executed: return (CONF_MODULE *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); never executed: return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); never executed: return (CONF_MODULE *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); never executed: return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); never executed: return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); never executed: return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); never executed: return (struct stack_st_CONF_MODULE *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); never executed: return (struct stack_st_CONF_MODULE *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, (OPENSSL_sk_copyfunc)copyfunc, (OPENSSL_sk_freefunc)freefunc); never executed: return (sk_CONF_MODULE_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); | 0-20885 |
56 | DEFINE_STACK_OF(CONF_IMODULE) executed 5261 times by 12 tests: end of block Executed by:
never executed: end of block never executed: end of block never executed: end of block executed 6371 times by 12 tests: return OPENSSL_sk_num((const OPENSSL_STACK *)sk); Executed by:
never executed: return (CONF_IMODULE *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); never executed: return (struct stack_st_CONF_IMODULE *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); executed 1110 times by 1 test: return (struct stack_st_CONF_IMODULE *)OPENSSL_sk_new_null(); Executed by:
never executed: return (struct stack_st_CONF_IMODULE *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n); never executed: return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); never executed: return (CONF_IMODULE *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); never executed: return (CONF_IMODULE *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, (const void *)ptr); executed 1110 times by 1 test: return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); Executed by:
never executed: return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr); executed 1110 times by 1 test: return (CONF_IMODULE *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); Executed by:
never executed: return (CONF_IMODULE *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); never executed: return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx); never executed: return (CONF_IMODULE *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr); never executed: return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); never executed: return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr); never executed: return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); never executed: return (struct stack_st_CONF_IMODULE *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); never executed: return (struct stack_st_CONF_IMODULE *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, (OPENSSL_sk_copyfunc)copyfunc, (OPENSSL_sk_freefunc)freefunc); never executed: return (sk_CONF_IMODULE_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); | 0-6371 |
57 | - | |
58 | /* DSO module function typedefs */ | - |
59 | typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf); | - |
60 | typedef void conf_finish_func (CONF_IMODULE *md); | - |
61 | - | |
62 | # define CONF_MFLAGS_IGNORE_ERRORS 0x1 | - |
63 | # define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2 | - |
64 | # define CONF_MFLAGS_SILENT 0x4 | - |
65 | # define CONF_MFLAGS_NO_DSO 0x8 | - |
66 | # define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10 | - |
67 | # define CONF_MFLAGS_DEFAULT_SECTION 0x20 | - |
68 | - | |
69 | int CONF_set_default_method(CONF_METHOD *meth); | - |
70 | void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); | - |
71 | LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, | - |
72 | long *eline); | - |
73 | # ifndef OPENSSL_NO_STDIO | - |
74 | LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, | - |
75 | long *eline); | - |
76 | # endif | - |
77 | LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, | - |
78 | long *eline); | - |
79 | STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, | - |
80 | const char *section); | - |
81 | char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, | - |
82 | const char *name); | - |
83 | long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, | - |
84 | const char *name); | - |
85 | void CONF_free(LHASH_OF(CONF_VALUE) *conf); | - |
86 | #ifndef OPENSSL_NO_STDIO | - |
87 | int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); | - |
88 | #endif | - |
89 | int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); | - |
90 | - | |
91 | DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name)) | - |
92 | - | |
93 | #if OPENSSL_API_COMPAT < 0x10100000L | - |
94 | # define OPENSSL_no_config() \ | - |
95 | OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL) | - |
96 | #endif | - |
97 | - | |
98 | /* | - |
99 | * New conf code. The semantics are different from the functions above. If | - |
100 | * that wasn't the case, the above functions would have been replaced | - |
101 | */ | - |
102 | - | |
103 | struct conf_st { | - |
104 | CONF_METHOD *meth; | - |
105 | void *meth_data; | - |
106 | LHASH_OF(CONF_VALUE) *data; | - |
107 | }; | - |
108 | - | |
109 | CONF *NCONF_new(CONF_METHOD *meth); | - |
110 | CONF_METHOD *NCONF_default(void); | - |
111 | CONF_METHOD *NCONF_WIN32(void); | - |
112 | void NCONF_free(CONF *conf); | - |
113 | void NCONF_free_data(CONF *conf); | - |
114 | - | |
115 | int NCONF_load(CONF *conf, const char *file, long *eline); | - |
116 | # ifndef OPENSSL_NO_STDIO | - |
117 | int NCONF_load_fp(CONF *conf, FILE *fp, long *eline); | - |
118 | # endif | - |
119 | int NCONF_load_bio(CONF *conf, BIO *bp, long *eline); | - |
120 | STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, | - |
121 | const char *section); | - |
122 | char *NCONF_get_string(const CONF *conf, const char *group, const char *name); | - |
123 | int NCONF_get_number_e(const CONF *conf, const char *group, const char *name, | - |
124 | long *result); | - |
125 | #ifndef OPENSSL_NO_STDIO | - |
126 | int NCONF_dump_fp(const CONF *conf, FILE *out); | - |
127 | #endif | - |
128 | int NCONF_dump_bio(const CONF *conf, BIO *out); | - |
129 | - | |
130 | #define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) | - |
131 | - | |
132 | /* Module functions */ | - |
133 | - | |
134 | int CONF_modules_load(const CONF *cnf, const char *appname, | - |
135 | unsigned long flags); | - |
136 | int CONF_modules_load_file(const char *filename, const char *appname, | - |
137 | unsigned long flags); | - |
138 | void CONF_modules_unload(int all); | - |
139 | void CONF_modules_finish(void); | - |
140 | #if OPENSSL_API_COMPAT < 0x10100000L | - |
141 | # define CONF_modules_free() while(0) continue | - |
142 | #endif | - |
143 | int CONF_module_add(const char *name, conf_init_func *ifunc, | - |
144 | conf_finish_func *ffunc); | - |
145 | - | |
146 | const char *CONF_imodule_get_name(const CONF_IMODULE *md); | - |
147 | const char *CONF_imodule_get_value(const CONF_IMODULE *md); | - |
148 | void *CONF_imodule_get_usr_data(const CONF_IMODULE *md); | - |
149 | void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data); | - |
150 | CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md); | - |
151 | unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md); | - |
152 | void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags); | - |
153 | void *CONF_module_get_usr_data(CONF_MODULE *pmod); | - |
154 | void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data); | - |
155 | - | |
156 | char *CONF_get1_default_config_file(void); | - |
157 | - | |
158 | int CONF_parse_list(const char *list, int sep, int nospc, | - |
159 | int (*list_cb) (const char *elem, int len, void *usr), | - |
160 | void *arg); | - |
161 | - | |
162 | void OPENSSL_load_builtin_modules(void); | - |
163 | - | |
164 | - | |
165 | # ifdef __cplusplus | - |
166 | } | - |
167 | # endif | - |
168 | #endif | - |
Source code | Switch to Preprocessed file |