1 /* 2 * WARNING: do not edit! 3 * Generated by Makefile from include/openssl/conf.h.in 4 * 5 * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. 6 * 7 * Licensed under the Apache License 2.0 (the "License"). You may not use 8 * this file except in compliance with the License. You can obtain a copy 9 * in the file LICENSE in the source distribution or at 10 * https://www.openssl.org/source/license.html 11 */ 12 13 14 15 #ifndef OPENSSL_CONF_H 16 # define OPENSSL_CONF_H 17 # pragma once 18 19 # include <openssl/macros.h> 20 # ifndef OPENSSL_NO_DEPRECATED_3_0 21 # define HEADER_CONF_H 22 # endif 23 24 # include <openssl/bio.h> 25 # include <openssl/lhash.h> 26 # include <openssl/safestack.h> 27 # include <openssl/e_os2.h> 28 # include <openssl/types.h> 29 # include <openssl/conferr.h> 30 31 #ifdef __cplusplus 32 extern "C" { 33 #endif 34 35 typedef struct { 36 char *section; 37 char *name; 38 char *value; 39 } CONF_VALUE; 40 41 SKM_DEFINE_STACK_OF_INTERNAL(CONF_VALUE, CONF_VALUE, CONF_VALUE) 42 #define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk)) 43 #define sk_CONF_VALUE_value(sk, idx) ((CONF_VALUE *)OPENSSL_sk_value(ossl_check_const_CONF_VALUE_sk_type(sk), (idx))) 44 #define sk_CONF_VALUE_new(cmp) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new(ossl_check_CONF_VALUE_compfunc_type(cmp))) 45 #define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_null()) 46 #define sk_CONF_VALUE_new_reserve(cmp, n) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_reserve(ossl_check_CONF_VALUE_compfunc_type(cmp), (n))) 47 #define sk_CONF_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CONF_VALUE_sk_type(sk), (n)) 48 #define sk_CONF_VALUE_free(sk) OPENSSL_sk_free(ossl_check_CONF_VALUE_sk_type(sk)) 49 #define sk_CONF_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_CONF_VALUE_sk_type(sk)) 50 #define sk_CONF_VALUE_delete(sk, i) ((CONF_VALUE *)OPENSSL_sk_delete(ossl_check_CONF_VALUE_sk_type(sk), (i))) 51 #define sk_CONF_VALUE_delete_ptr(sk, ptr) ((CONF_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))) 52 #define sk_CONF_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)) 53 #define sk_CONF_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)) 54 #define sk_CONF_VALUE_pop(sk) ((CONF_VALUE *)OPENSSL_sk_pop(ossl_check_CONF_VALUE_sk_type(sk))) 55 #define sk_CONF_VALUE_shift(sk) ((CONF_VALUE *)OPENSSL_sk_shift(ossl_check_CONF_VALUE_sk_type(sk))) 56 #define sk_CONF_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CONF_VALUE_sk_type(sk),ossl_check_CONF_VALUE_freefunc_type(freefunc)) 57 #define sk_CONF_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), (idx)) 58 #define sk_CONF_VALUE_set(sk, idx, ptr) ((CONF_VALUE *)OPENSSL_sk_set(ossl_check_CONF_VALUE_sk_type(sk), (idx), ossl_check_CONF_VALUE_type(ptr))) 59 #define sk_CONF_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)) 60 #define sk_CONF_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)) 61 #define sk_CONF_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), pnum) 62 #define sk_CONF_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_CONF_VALUE_sk_type(sk)) 63 #define sk_CONF_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CONF_VALUE_sk_type(sk)) 64 #define sk_CONF_VALUE_dup(sk) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_dup(ossl_check_const_CONF_VALUE_sk_type(sk))) 65 #define sk_CONF_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_copyfunc_type(copyfunc), ossl_check_CONF_VALUE_freefunc_type(freefunc))) 66 #define sk_CONF_VALUE_set_cmp_func(sk, cmp) ((sk_CONF_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_compfunc_type(cmp))) 67 DEFINE_LHASH_OF_INTERNAL(CONF_VALUE); 68 #define lh_CONF_VALUE_new(hfn, cmp) ((LHASH_OF(CONF_VALUE) *)OPENSSL_LH_new(ossl_check_CONF_VALUE_lh_hashfunc_type(hfn), ossl_check_CONF_VALUE_lh_compfunc_type(cmp))) 69 #define lh_CONF_VALUE_free(lh) OPENSSL_LH_free(ossl_check_CONF_VALUE_lh_type(lh)) 70 #define lh_CONF_VALUE_flush(lh) OPENSSL_LH_flush(ossl_check_CONF_VALUE_lh_type(lh)) 71 #define lh_CONF_VALUE_insert(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_insert(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_plain_type(ptr))) 72 #define lh_CONF_VALUE_delete(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_delete(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr))) 73 #define lh_CONF_VALUE_retrieve(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_retrieve(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr))) 74 #define lh_CONF_VALUE_error(lh) OPENSSL_LH_error(ossl_check_CONF_VALUE_lh_type(lh)) 75 #define lh_CONF_VALUE_num_items(lh) OPENSSL_LH_num_items(ossl_check_CONF_VALUE_lh_type(lh)) 76 #define lh_CONF_VALUE_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out) 77 #define lh_CONF_VALUE_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out) 78 #define lh_CONF_VALUE_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out) 79 #define lh_CONF_VALUE_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_CONF_VALUE_lh_type(lh)) 80 #define lh_CONF_VALUE_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_CONF_VALUE_lh_type(lh), dl) 81 #define lh_CONF_VALUE_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_doallfunc_type(dfn)) 82 83 84 struct conf_st; 85 struct conf_method_st; 86 typedef struct conf_method_st CONF_METHOD; 87 88 # ifndef OPENSSL_NO_DEPRECATED_3_0 89 # include <openssl/conftypes.h> 90 # endif 91 92 /* Module definitions */ 93 typedef struct conf_imodule_st CONF_IMODULE; 94 typedef struct conf_module_st CONF_MODULE; 95 96 STACK_OF(CONF_MODULE); 97 STACK_OF(CONF_IMODULE); 98 99 /* DSO module function typedefs */ 100 typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf); 101 typedef void conf_finish_func (CONF_IMODULE *md); 102 103 # define CONF_MFLAGS_IGNORE_ERRORS 0x1 104 # define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2 105 # define CONF_MFLAGS_SILENT 0x4 106 # define CONF_MFLAGS_NO_DSO 0x8 107 # define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10 108 # define CONF_MFLAGS_DEFAULT_SECTION 0x20 109 110 int CONF_set_default_method(CONF_METHOD *meth); 111 void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); 112 LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, 113 long *eline); 114 # ifndef OPENSSL_NO_STDIO 115 LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, 116 long *eline); 117 # endif 118 LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, 119 long *eline); 120 STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, 121 const char *section); 122 char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, 123 const char *name); 124 long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, 125 const char *name); 126 void CONF_free(LHASH_OF(CONF_VALUE) *conf); 127 #ifndef OPENSSL_NO_STDIO 128 int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); 129 #endif 130 int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); 131 #ifndef OPENSSL_NO_DEPRECATED_1_1_0 132 OSSL_DEPRECATEDIN_1_1_0 void OPENSSL_config(const char *config_name); 133 #endif 134 135 #ifndef OPENSSL_NO_DEPRECATED_1_1_0 136 # define OPENSSL_no_config() \ 137 OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL) 138 #endif 139 140 /* 141 * New conf code. The semantics are different from the functions above. If 142 * that wasn't the case, the above functions would have been replaced 143 */ 144 145 CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth); 146 OSSL_LIB_CTX *NCONF_get0_libctx(const CONF *conf); 147 CONF *NCONF_new(CONF_METHOD *meth); 148 CONF_METHOD *NCONF_default(void); 149 #ifndef OPENSSL_NO_DEPRECATED_3_0 150 OSSL_DEPRECATEDIN_3_0 CONF_METHOD *NCONF_WIN32(void); 151 #endif 152 void NCONF_free(CONF *conf); 153 void NCONF_free_data(CONF *conf); 154 155 int NCONF_load(CONF *conf, const char *file, long *eline); 156 # ifndef OPENSSL_NO_STDIO 157 int NCONF_load_fp(CONF *conf, FILE *fp, long *eline); 158 # endif 159 int NCONF_load_bio(CONF *conf, BIO *bp, long *eline); 160 STACK_OF(OPENSSL_CSTRING) *NCONF_get_section_names(const CONF *conf); 161 STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, 162 const char *section); 163 char *NCONF_get_string(const CONF *conf, const char *group, const char *name); 164 int NCONF_get_number_e(const CONF *conf, const char *group, const char *name, 165 long *result); 166 #ifndef OPENSSL_NO_STDIO 167 int NCONF_dump_fp(const CONF *conf, FILE *out); 168 #endif 169 int NCONF_dump_bio(const CONF *conf, BIO *out); 170 171 #define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) 172 173 /* Module functions */ 174 175 int CONF_modules_load(const CONF *cnf, const char *appname, 176 unsigned long flags); 177 int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename, 178 const char *appname, unsigned long flags); 179 int CONF_modules_load_file(const char *filename, const char *appname, 180 unsigned long flags); 181 void CONF_modules_unload(int all); 182 void CONF_modules_finish(void); 183 #ifndef OPENSSL_NO_DEPRECATED_1_1_0 184 # define CONF_modules_free() while(0) continue 185 #endif 186 int CONF_module_add(const char *name, conf_init_func *ifunc, 187 conf_finish_func *ffunc); 188 189 const char *CONF_imodule_get_name(const CONF_IMODULE *md); 190 const char *CONF_imodule_get_value(const CONF_IMODULE *md); 191 void *CONF_imodule_get_usr_data(const CONF_IMODULE *md); 192 void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data); 193 CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md); 194 unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md); 195 void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags); 196 void *CONF_module_get_usr_data(CONF_MODULE *pmod); 197 void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data); 198 199 char *CONF_get1_default_config_file(void); 200 201 int CONF_parse_list(const char *list, int sep, int nospc, 202 int (*list_cb) (const char *elem, int len, void *usr), 203 void *arg); 204 205 void OPENSSL_load_builtin_modules(void); 206 207 208 # ifdef __cplusplus 209 } 210 # endif 211 #endif 212