summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dso/dso.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/dso/dso.h')
-rw-r--r--src/lib/libcrypto/dso/dso.h52
1 files changed, 49 insertions, 3 deletions
diff --git a/src/lib/libcrypto/dso/dso.h b/src/lib/libcrypto/dso/dso.h
index aa721f7feb..3e51913a72 100644
--- a/src/lib/libcrypto/dso/dso.h
+++ b/src/lib/libcrypto/dso/dso.h
@@ -1,4 +1,4 @@
1/* dso.h */ 1/* dso.h -*- mode:C; c-file-style: "eay" -*- */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -95,6 +95,13 @@ extern "C" {
95 */ 95 */
96#define DSO_FLAG_UPCASE_SYMBOL 0x10 96#define DSO_FLAG_UPCASE_SYMBOL 0x10
97 97
98/* This flag loads the library with public symbols.
99 * Meaning: The exported symbols of this library are public
100 * to all libraries loaded after this library.
101 * At the moment only implemented in unix.
102 */
103#define DSO_FLAG_GLOBAL_SYMBOLS 0x20
104
98 105
99typedef void (*DSO_FUNC_TYPE)(void); 106typedef void (*DSO_FUNC_TYPE)(void);
100 107
@@ -107,6 +114,22 @@ typedef struct dso_st DSO;
107 * condition) or a newly allocated string containing the transformed form that 114 * condition) or a newly allocated string containing the transformed form that
108 * the caller will need to free with OPENSSL_free() when done. */ 115 * the caller will need to free with OPENSSL_free() when done. */
109typedef char* (*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *); 116typedef char* (*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *);
117/* The function prototype used for method functions (or caller-provided
118 * callbacks) that merge two file specifications. They are passed a
119 * DSO structure pointer (or NULL if they are to be used independantly of
120 * a DSO object) and two file specifications to merge. They should
121 * either return NULL (if there is an error condition) or a newly allocated
122 * string containing the result of merging that the caller will need
123 * to free with OPENSSL_free() when done.
124 * Here, merging means that bits and pieces are taken from each of the
125 * file specifications and added together in whatever fashion that is
126 * sensible for the DSO method in question. The only rule that really
127 * applies is that if the two specification contain pieces of the same
128 * type, the copy from the first string takes priority. One could see
129 * it as the first specification is the one given by the user and the
130 * second being a bunch of defaults to add on if they're missing in the
131 * first. */
132typedef char* (*DSO_MERGER_FUNC)(DSO *, const char *, const char *);
110 133
111typedef struct dso_meth_st 134typedef struct dso_meth_st
112 { 135 {
@@ -140,6 +163,9 @@ typedef struct dso_meth_st
140 /* The default DSO_METHOD-specific function for converting filenames to 163 /* The default DSO_METHOD-specific function for converting filenames to
141 * a canonical native form. */ 164 * a canonical native form. */
142 DSO_NAME_CONVERTER_FUNC dso_name_converter; 165 DSO_NAME_CONVERTER_FUNC dso_name_converter;
166 /* The default DSO_METHOD-specific function for converting filenames to
167 * a canonical native form. */
168 DSO_MERGER_FUNC dso_merger;
143 169
144 /* [De]Initialisation handlers. */ 170 /* [De]Initialisation handlers. */
145 int (*init)(DSO *dso); 171 int (*init)(DSO *dso);
@@ -164,9 +190,13 @@ struct dso_st
164 * don't touch meth_data! */ 190 * don't touch meth_data! */
165 CRYPTO_EX_DATA ex_data; 191 CRYPTO_EX_DATA ex_data;
166 /* If this callback function pointer is set to non-NULL, then it will 192 /* If this callback function pointer is set to non-NULL, then it will
167 * be used on DSO_load() in place of meth->dso_name_converter. NB: This 193 * be used in DSO_load() in place of meth->dso_name_converter. NB: This
168 * should normally set using DSO_set_name_converter(). */ 194 * should normally set using DSO_set_name_converter(). */
169 DSO_NAME_CONVERTER_FUNC name_converter; 195 DSO_NAME_CONVERTER_FUNC name_converter;
196 /* If this callback function pointer is set to non-NULL, then it will
197 * be used in DSO_load() in place of meth->dso_merger. NB: This
198 * should normally set using DSO_set_merger(). */
199 DSO_MERGER_FUNC merger;
170 /* This is populated with (a copy of) the platform-independant 200 /* This is populated with (a copy of) the platform-independant
171 * filename used for this DSO. */ 201 * filename used for this DSO. */
172 char *filename; 202 char *filename;
@@ -209,6 +239,11 @@ int DSO_set_filename(DSO *dso, const char *filename);
209 * caller-created DSO_METHODs can do the same thing. A non-NULL return value 239 * caller-created DSO_METHODs can do the same thing. A non-NULL return value
210 * will need to be OPENSSL_free()'d. */ 240 * will need to be OPENSSL_free()'d. */
211char *DSO_convert_filename(DSO *dso, const char *filename); 241char *DSO_convert_filename(DSO *dso, const char *filename);
242/* This function will invoke the DSO's merger callback to merge two file
243 * specifications, or if the callback isn't set it will instead use the
244 * DSO_METHOD's merger. A non-NULL return value will need to be
245 * OPENSSL_free()'d. */
246char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2);
212/* If the DSO is currently loaded, this returns the filename that it was loaded 247/* If the DSO is currently loaded, this returns the filename that it was loaded
213 * under, otherwise it returns NULL. So it is also useful as a test as to 248 * under, otherwise it returns NULL. So it is also useful as a test as to
214 * whether the DSO is currently loaded. NB: This will not necessarily return 249 * whether the DSO is currently loaded. NB: This will not necessarily return
@@ -273,11 +308,13 @@ void ERR_load_DSO_strings(void);
273#define DSO_F_DLFCN_BIND_FUNC 100 308#define DSO_F_DLFCN_BIND_FUNC 100
274#define DSO_F_DLFCN_BIND_VAR 101 309#define DSO_F_DLFCN_BIND_VAR 101
275#define DSO_F_DLFCN_LOAD 102 310#define DSO_F_DLFCN_LOAD 102
311#define DSO_F_DLFCN_MERGER 130
276#define DSO_F_DLFCN_NAME_CONVERTER 123 312#define DSO_F_DLFCN_NAME_CONVERTER 123
277#define DSO_F_DLFCN_UNLOAD 103 313#define DSO_F_DLFCN_UNLOAD 103
278#define DSO_F_DL_BIND_FUNC 104 314#define DSO_F_DL_BIND_FUNC 104
279#define DSO_F_DL_BIND_VAR 105 315#define DSO_F_DL_BIND_VAR 105
280#define DSO_F_DL_LOAD 106 316#define DSO_F_DL_LOAD 106
317#define DSO_F_DL_MERGER 131
281#define DSO_F_DL_NAME_CONVERTER 124 318#define DSO_F_DL_NAME_CONVERTER 124
282#define DSO_F_DL_UNLOAD 107 319#define DSO_F_DL_UNLOAD 107
283#define DSO_F_DSO_BIND_FUNC 108 320#define DSO_F_DSO_BIND_FUNC 108
@@ -288,27 +325,36 @@ void ERR_load_DSO_strings(void);
288#define DSO_F_DSO_GET_FILENAME 127 325#define DSO_F_DSO_GET_FILENAME 127
289#define DSO_F_DSO_GET_LOADED_FILENAME 128 326#define DSO_F_DSO_GET_LOADED_FILENAME 128
290#define DSO_F_DSO_LOAD 112 327#define DSO_F_DSO_LOAD 112
328#define DSO_F_DSO_MERGE 132
291#define DSO_F_DSO_NEW_METHOD 113 329#define DSO_F_DSO_NEW_METHOD 113
292#define DSO_F_DSO_SET_FILENAME 129 330#define DSO_F_DSO_SET_FILENAME 129
293#define DSO_F_DSO_SET_NAME_CONVERTER 122 331#define DSO_F_DSO_SET_NAME_CONVERTER 122
294#define DSO_F_DSO_UP_REF 114 332#define DSO_F_DSO_UP_REF 114
295#define DSO_F_VMS_BIND_VAR 115 333#define DSO_F_VMS_BIND_SYM 115
296#define DSO_F_VMS_LOAD 116 334#define DSO_F_VMS_LOAD 116
335#define DSO_F_VMS_MERGER 133
297#define DSO_F_VMS_UNLOAD 117 336#define DSO_F_VMS_UNLOAD 117
298#define DSO_F_WIN32_BIND_FUNC 118 337#define DSO_F_WIN32_BIND_FUNC 118
299#define DSO_F_WIN32_BIND_VAR 119 338#define DSO_F_WIN32_BIND_VAR 119
339#define DSO_F_WIN32_JOINER 135
300#define DSO_F_WIN32_LOAD 120 340#define DSO_F_WIN32_LOAD 120
341#define DSO_F_WIN32_MERGER 134
301#define DSO_F_WIN32_NAME_CONVERTER 125 342#define DSO_F_WIN32_NAME_CONVERTER 125
343#define DSO_F_WIN32_SPLITTER 136
302#define DSO_F_WIN32_UNLOAD 121 344#define DSO_F_WIN32_UNLOAD 121
303 345
304/* Reason codes. */ 346/* Reason codes. */
305#define DSO_R_CTRL_FAILED 100 347#define DSO_R_CTRL_FAILED 100
306#define DSO_R_DSO_ALREADY_LOADED 110 348#define DSO_R_DSO_ALREADY_LOADED 110
349#define DSO_R_EMPTY_FILE_STRUCTURE 113
350#define DSO_R_FAILURE 114
307#define DSO_R_FILENAME_TOO_BIG 101 351#define DSO_R_FILENAME_TOO_BIG 101
308#define DSO_R_FINISH_FAILED 102 352#define DSO_R_FINISH_FAILED 102
353#define DSO_R_INCORRECT_FILE_SYNTAX 115
309#define DSO_R_LOAD_FAILED 103 354#define DSO_R_LOAD_FAILED 103
310#define DSO_R_NAME_TRANSLATION_FAILED 109 355#define DSO_R_NAME_TRANSLATION_FAILED 109
311#define DSO_R_NO_FILENAME 111 356#define DSO_R_NO_FILENAME 111
357#define DSO_R_NO_FILE_SPECIFICATION 116
312#define DSO_R_NULL_HANDLE 104 358#define DSO_R_NULL_HANDLE 104
313#define DSO_R_SET_FILENAME_FAILED 112 359#define DSO_R_SET_FILENAME_FAILED 112
314#define DSO_R_STACK_ERROR 105 360#define DSO_R_STACK_ERROR 105