diff options
Diffstat (limited to 'src/lib/libcrypto/crypto.h')
-rw-r--r-- | src/lib/libcrypto/crypto.h | 430 |
1 files changed, 281 insertions, 149 deletions
diff --git a/src/lib/libcrypto/crypto.h b/src/lib/libcrypto/crypto.h index 0a38b5b87c..fc6ff860af 100644 --- a/src/lib/libcrypto/crypto.h +++ b/src/lib/libcrypto/crypto.h | |||
@@ -59,27 +59,45 @@ | |||
59 | #ifndef HEADER_CRYPTO_H | 59 | #ifndef HEADER_CRYPTO_H |
60 | #define HEADER_CRYPTO_H | 60 | #define HEADER_CRYPTO_H |
61 | 61 | ||
62 | #include <stdlib.h> | ||
63 | |||
64 | #ifndef OPENSSL_NO_FP_API | ||
65 | #include <stdio.h> | ||
66 | #endif | ||
67 | |||
68 | #include <openssl/stack.h> | ||
69 | #include <openssl/safestack.h> | ||
70 | #include <openssl/opensslv.h> | ||
71 | |||
72 | #ifdef CHARSET_EBCDIC | ||
73 | #include <openssl/ebcdic.h> | ||
74 | #endif | ||
75 | |||
76 | /* Resolve problems on some operating systems with symbol names that clash | ||
77 | one way or another */ | ||
78 | #include <openssl/symhacks.h> | ||
79 | |||
62 | #ifdef __cplusplus | 80 | #ifdef __cplusplus |
63 | extern "C" { | 81 | extern "C" { |
64 | #endif | 82 | #endif |
65 | 83 | ||
66 | #include "stack.h" | 84 | /* Backward compatibility to SSLeay */ |
67 | |||
68 | /* This is more to be used to check the correct DLL is being used | 85 | /* This is more to be used to check the correct DLL is being used |
69 | * in the MS world. */ | 86 | * in the MS world. */ |
70 | #define SSLEAY_VERSION_NUMBER 0x0902 /* Version 0.5.1c would be 0513 */ | 87 | #define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER |
71 | |||
72 | #define SSLEAY_VERSION 0 | 88 | #define SSLEAY_VERSION 0 |
73 | /* #define SSLEAY_OPTIONS 1 no longer supported */ | 89 | /* #define SSLEAY_OPTIONS 1 no longer supported */ |
74 | #define SSLEAY_CFLAGS 2 | 90 | #define SSLEAY_CFLAGS 2 |
75 | #define SSLEAY_BUILT_ON 3 | 91 | #define SSLEAY_BUILT_ON 3 |
92 | #define SSLEAY_PLATFORM 4 | ||
93 | #define SSLEAY_DIR 5 | ||
76 | 94 | ||
77 | /* When changing the CRYPTO_LOCK_* list, be sure to maintin the text lock | 95 | /* When changing the CRYPTO_LOCK_* list, be sure to maintin the text lock |
78 | * names in cryptlib.c | 96 | * names in cryptlib.c |
79 | */ | 97 | */ |
80 | 98 | ||
81 | #define CRYPTO_LOCK_ERR 1 | 99 | #define CRYPTO_LOCK_ERR 1 |
82 | #define CRYPTO_LOCK_ERR_HASH 2 | 100 | #define CRYPTO_LOCK_EX_DATA 2 |
83 | #define CRYPTO_LOCK_X509 3 | 101 | #define CRYPTO_LOCK_X509 3 |
84 | #define CRYPTO_LOCK_X509_INFO 4 | 102 | #define CRYPTO_LOCK_X509_INFO 4 |
85 | #define CRYPTO_LOCK_X509_PKEY 5 | 103 | #define CRYPTO_LOCK_X509_PKEY 5 |
@@ -92,19 +110,30 @@ extern "C" { | |||
92 | #define CRYPTO_LOCK_SSL_CTX 12 | 110 | #define CRYPTO_LOCK_SSL_CTX 12 |
93 | #define CRYPTO_LOCK_SSL_CERT 13 | 111 | #define CRYPTO_LOCK_SSL_CERT 13 |
94 | #define CRYPTO_LOCK_SSL_SESSION 14 | 112 | #define CRYPTO_LOCK_SSL_SESSION 14 |
95 | #define CRYPTO_LOCK_SSL 15 | 113 | #define CRYPTO_LOCK_SSL_SESS_CERT 15 |
96 | #define CRYPTO_LOCK_RAND 16 | 114 | #define CRYPTO_LOCK_SSL 16 |
97 | #define CRYPTO_LOCK_MALLOC 17 | 115 | #define CRYPTO_LOCK_RAND 17 |
98 | #define CRYPTO_LOCK_BIO 18 | 116 | #define CRYPTO_LOCK_RAND2 18 |
99 | #define CRYPTO_LOCK_BIO_GETHOSTBYNAME 19 | 117 | #define CRYPTO_LOCK_MALLOC 19 |
100 | #define CRYPTO_LOCK_RSA_BLINDING 20 | 118 | #define CRYPTO_LOCK_BIO 20 |
101 | #define CRYPTO_NUM_LOCKS 21 | 119 | #define CRYPTO_LOCK_GETHOSTBYNAME 21 |
120 | #define CRYPTO_LOCK_GETSERVBYNAME 22 | ||
121 | #define CRYPTO_LOCK_READDIR 23 | ||
122 | #define CRYPTO_LOCK_RSA_BLINDING 24 | ||
123 | #define CRYPTO_LOCK_DH 25 | ||
124 | #define CRYPTO_LOCK_MALLOC2 26 | ||
125 | #define CRYPTO_LOCK_DSO 27 | ||
126 | #define CRYPTO_LOCK_DYNLOCK 28 | ||
127 | #define CRYPTO_LOCK_ENGINE 29 | ||
128 | #define CRYPTO_LOCK_UI 30 | ||
129 | #define CRYPTO_NUM_LOCKS 31 | ||
102 | 130 | ||
103 | #define CRYPTO_LOCK 1 | 131 | #define CRYPTO_LOCK 1 |
104 | #define CRYPTO_UNLOCK 2 | 132 | #define CRYPTO_UNLOCK 2 |
105 | #define CRYPTO_READ 4 | 133 | #define CRYPTO_READ 4 |
106 | #define CRYPTO_WRITE 8 | 134 | #define CRYPTO_WRITE 8 |
107 | 135 | ||
136 | #ifndef OPENSSL_NO_LOCKING | ||
108 | #ifndef CRYPTO_w_lock | 137 | #ifndef CRYPTO_w_lock |
109 | #define CRYPTO_w_lock(type) \ | 138 | #define CRYPTO_w_lock(type) \ |
110 | CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) | 139 | CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) |
@@ -116,23 +145,44 @@ extern "C" { | |||
116 | CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__) | 145 | CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__) |
117 | #define CRYPTO_add(addr,amount,type) \ | 146 | #define CRYPTO_add(addr,amount,type) \ |
118 | CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__) | 147 | CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__) |
119 | 148 | #endif | |
149 | #else | ||
150 | #define CRYPTO_w_lock(a) | ||
151 | #define CRYPTO_w_unlock(a) | ||
152 | #define CRYPTO_r_lock(a) | ||
153 | #define CRYPTO_r_unlock(a) | ||
154 | #define CRYPTO_add(a,b,c) ((*(a))+=(b)) | ||
120 | #endif | 155 | #endif |
121 | 156 | ||
157 | /* Some applications as well as some parts of OpenSSL need to allocate | ||
158 | and deallocate locks in a dynamic fashion. The following typedef | ||
159 | makes this possible in a type-safe manner. */ | ||
160 | /* struct CRYPTO_dynlock_value has to be defined by the application. */ | ||
161 | typedef struct | ||
162 | { | ||
163 | int references; | ||
164 | struct CRYPTO_dynlock_value *data; | ||
165 | } CRYPTO_dynlock; | ||
166 | |||
167 | |||
122 | /* The following can be used to detect memory leaks in the SSLeay library. | 168 | /* The following can be used to detect memory leaks in the SSLeay library. |
123 | * It used, it turns on malloc checking */ | 169 | * It used, it turns on malloc checking */ |
124 | 170 | ||
125 | #define CRYPTO_MEM_CHECK_OFF 0x0 | 171 | #define CRYPTO_MEM_CHECK_OFF 0x0 /* an enume */ |
126 | #define CRYPTO_MEM_CHECK_ON 0x1 | 172 | #define CRYPTO_MEM_CHECK_ON 0x1 /* a bit */ |
173 | #define CRYPTO_MEM_CHECK_ENABLE 0x2 /* a bit */ | ||
174 | #define CRYPTO_MEM_CHECK_DISABLE 0x3 /* an enume */ | ||
175 | |||
176 | /* The following are bit values to turn on or off options connected to the | ||
177 | * malloc checking functionality */ | ||
178 | |||
179 | /* Adds time to the memory checking information */ | ||
180 | #define V_CRYPTO_MDEBUG_TIME 0x1 /* a bit */ | ||
181 | /* Adds thread number to the memory checking information */ | ||
182 | #define V_CRYPTO_MDEBUG_THREAD 0x2 /* a bit */ | ||
183 | |||
184 | #define V_CRYPTO_MDEBUG_ALL (V_CRYPTO_MDEBUG_TIME | V_CRYPTO_MDEBUG_THREAD) | ||
127 | 185 | ||
128 | /* | ||
129 | typedef struct crypto_mem_st | ||
130 | { | ||
131 | char *(*malloc_func)(); | ||
132 | char *(*realloc_func)(); | ||
133 | void (*free_func)(); | ||
134 | } CRYPTO_MEM_FUNC; | ||
135 | */ | ||
136 | 186 | ||
137 | /* predec of the BIO type */ | 187 | /* predec of the BIO type */ |
138 | typedef struct bio_st BIO_dummy; | 188 | typedef struct bio_st BIO_dummy; |
@@ -143,24 +193,30 @@ typedef struct crypto_ex_data_st | |||
143 | int dummy; /* gcc is screwing up this data structure :-( */ | 193 | int dummy; /* gcc is screwing up this data structure :-( */ |
144 | } CRYPTO_EX_DATA; | 194 | } CRYPTO_EX_DATA; |
145 | 195 | ||
196 | /* Called when a new object is created */ | ||
197 | typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, | ||
198 | int idx, long argl, void *argp); | ||
199 | /* Called when an object is free()ed */ | ||
200 | typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, | ||
201 | int idx, long argl, void *argp); | ||
202 | /* Called when we need to dup an object */ | ||
203 | typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, | ||
204 | int idx, long argl, void *argp); | ||
205 | |||
146 | /* This stuff is basically class callback functions | 206 | /* This stuff is basically class callback functions |
147 | * The current classes are SSL_CTX, SSL, SSL_SESION, and a few more */ | 207 | * The current classes are SSL_CTX, SSL, SSL_SESSION, and a few more */ |
208 | |||
148 | typedef struct crypto_ex_data_func_st | 209 | typedef struct crypto_ex_data_func_st |
149 | { | 210 | { |
150 | long argl; /* Arbitary long */ | 211 | long argl; /* Arbitary long */ |
151 | char *argp; /* Arbitary char * */ | 212 | void *argp; /* Arbitary void * */ |
152 | /* Called when a new object is created */ | 213 | CRYPTO_EX_new *new_func; |
153 | int (*new_func)(/*char *obj, | 214 | CRYPTO_EX_free *free_func; |
154 | char *item,int index,long argl,char *argp*/); | 215 | CRYPTO_EX_dup *dup_func; |
155 | /* Called when this object is free()ed */ | ||
156 | void (*free_func)(/*char *obj, | ||
157 | char *item,int index,long argl,char *argp*/); | ||
158 | |||
159 | /* Called when we need to dup this one */ | ||
160 | int (*dup_func)(/*char *obj_to,char *obj_from, | ||
161 | char **new,int index,long argl,char *argp*/); | ||
162 | } CRYPTO_EX_DATA_FUNCS; | 216 | } CRYPTO_EX_DATA_FUNCS; |
163 | 217 | ||
218 | DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS) | ||
219 | |||
164 | /* Per class, we have a STACK of CRYPTO_EX_DATA_FUNCS for each CRYPTO_EX_DATA | 220 | /* Per class, we have a STACK of CRYPTO_EX_DATA_FUNCS for each CRYPTO_EX_DATA |
165 | * entry. | 221 | * entry. |
166 | */ | 222 | */ |
@@ -171,149 +227,225 @@ typedef struct crypto_ex_data_func_st | |||
171 | #define CRYPTO_EX_INDEX_SSL_SESSION 3 | 227 | #define CRYPTO_EX_INDEX_SSL_SESSION 3 |
172 | #define CRYPTO_EX_INDEX_X509_STORE 4 | 228 | #define CRYPTO_EX_INDEX_X509_STORE 4 |
173 | #define CRYPTO_EX_INDEX_X509_STORE_CTX 5 | 229 | #define CRYPTO_EX_INDEX_X509_STORE_CTX 5 |
230 | #define CRYPTO_EX_INDEX_RSA 6 | ||
231 | #define CRYPTO_EX_INDEX_DSA 7 | ||
232 | #define CRYPTO_EX_INDEX_DH 8 | ||
233 | #define CRYPTO_EX_INDEX_ENGINE 9 | ||
234 | #define CRYPTO_EX_INDEX_X509 10 | ||
235 | #define CRYPTO_EX_INDEX_UI 11 | ||
174 | 236 | ||
175 | /* Use this for win32 DLL's */ | 237 | /* Dynamically assigned indexes start from this value (don't use directly, use |
238 | * via CRYPTO_ex_data_new_class). */ | ||
239 | #define CRYPTO_EX_INDEX_USER 100 | ||
240 | |||
241 | |||
242 | /* This is the default callbacks, but we can have others as well: | ||
243 | * this is needed in Win32 where the application malloc and the | ||
244 | * library malloc may not be the same. | ||
245 | */ | ||
176 | #define CRYPTO_malloc_init() CRYPTO_set_mem_functions(\ | 246 | #define CRYPTO_malloc_init() CRYPTO_set_mem_functions(\ |
177 | (char *(*)())malloc,\ | 247 | malloc, realloc, free) |
178 | (char *(*)())realloc,\ | 248 | |
179 | (void (*)())free) | 249 | #if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD |
180 | 250 | # ifndef CRYPTO_MDEBUG /* avoid duplicate #define */ | |
181 | #ifdef CRYPTO_MDEBUG | 251 | # define CRYPTO_MDEBUG |
182 | #define Malloc(num) CRYPTO_dbg_malloc((int)num,__FILE__,__LINE__) | 252 | # endif |
183 | #define Realloc(addr,num) \ | ||
184 | CRYPTO_dbg_realloc((char *)addr,(int)num,__FILE__,__LINE__) | ||
185 | #define Remalloc(addr,num) \ | ||
186 | CRYPTO_dbg_remalloc((char **)addr,(int)num,__FILE__,__LINE__) | ||
187 | #define FreeFunc CRYPTO_dbg_free | ||
188 | #define Free(addr) CRYPTO_dbg_free((char *)(addr)) | ||
189 | #else | ||
190 | #define Remalloc CRYPTO_remalloc | ||
191 | #if defined(WIN32) || defined(MFUNC) | ||
192 | #define Malloc CRYPTO_malloc | ||
193 | #define Realloc(a,n) CRYPTO_realloc((char *)(a),(n)) | ||
194 | #define FreeFunc CRYPTO_free | ||
195 | #define Free(addr) CRYPTO_free((char *)(addr)) | ||
196 | #else | ||
197 | #define Malloc malloc | ||
198 | #define Realloc realloc | ||
199 | #define FreeFunc free | ||
200 | #define Free(addr) free((char *)(addr)) | ||
201 | #endif /* WIN32 || MFUNC */ | ||
202 | #endif /* MDEBUG */ | ||
203 | |||
204 | /* Case insensiteve linking causes problems.... */ | ||
205 | #ifdef WIN16 | ||
206 | #define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings | ||
207 | #endif | 253 | #endif |
208 | 254 | ||
209 | #ifndef NOPROTO | 255 | /* Set standard debugging functions (not done by default |
256 | * unless CRYPTO_MDEBUG is defined) */ | ||
257 | #define CRYPTO_malloc_debug_init() do {\ | ||
258 | CRYPTO_set_mem_debug_functions(\ | ||
259 | CRYPTO_dbg_malloc,\ | ||
260 | CRYPTO_dbg_realloc,\ | ||
261 | CRYPTO_dbg_free,\ | ||
262 | CRYPTO_dbg_set_options,\ | ||
263 | CRYPTO_dbg_get_options);\ | ||
264 | } while(0) | ||
265 | |||
266 | int CRYPTO_mem_ctrl(int mode); | ||
267 | int CRYPTO_is_mem_check_on(void); | ||
268 | |||
269 | /* for applications */ | ||
270 | #define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON) | ||
271 | #define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF) | ||
272 | |||
273 | /* for library-internal use */ | ||
274 | #define MemCheck_on() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE) | ||
275 | #define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE) | ||
276 | #define is_MemCheck_on() CRYPTO_is_mem_check_on() | ||
210 | 277 | ||
211 | char *SSLeay_version(int type); | 278 | #define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__) |
279 | #define OPENSSL_realloc(addr,num) \ | ||
280 | CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__) | ||
281 | #define OPENSSL_remalloc(addr,num) \ | ||
282 | CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__) | ||
283 | #define OPENSSL_freeFunc CRYPTO_free | ||
284 | #define OPENSSL_free(addr) CRYPTO_free(addr) | ||
285 | |||
286 | #define OPENSSL_malloc_locked(num) \ | ||
287 | CRYPTO_malloc_locked((int)num,__FILE__,__LINE__) | ||
288 | #define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr) | ||
289 | |||
290 | |||
291 | const char *SSLeay_version(int type); | ||
212 | unsigned long SSLeay(void); | 292 | unsigned long SSLeay(void); |
213 | 293 | ||
214 | int CRYPTO_get_ex_new_index(int idx,STACK **sk,long argl,char *argp, | 294 | int OPENSSL_issetugid(void); |
215 | int (*new_func)(),int (*dup_func)(),void (*free_func)()); | 295 | |
216 | int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad,int idx,char *val); | 296 | /* An opaque type representing an implementation of "ex_data" support */ |
217 | char *CRYPTO_get_ex_data(CRYPTO_EX_DATA *ad,int idx); | 297 | typedef struct st_CRYPTO_EX_DATA_IMPL CRYPTO_EX_DATA_IMPL; |
218 | int CRYPTO_dup_ex_data(STACK *meth,CRYPTO_EX_DATA *from,CRYPTO_EX_DATA *to); | 298 | /* Return an opaque pointer to the current "ex_data" implementation */ |
219 | void CRYPTO_free_ex_data(STACK *meth,char *obj,CRYPTO_EX_DATA *ad); | 299 | const CRYPTO_EX_DATA_IMPL *CRYPTO_get_ex_data_implementation(void); |
220 | void CRYPTO_new_ex_data(STACK *meth, char *obj, CRYPTO_EX_DATA *ad); | 300 | /* Sets the "ex_data" implementation to be used (if it's not too late) */ |
301 | int CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i); | ||
302 | /* Get a new "ex_data" class, and return the corresponding "class_index" */ | ||
303 | int CRYPTO_ex_data_new_class(void); | ||
304 | /* Within a given class, get/register a new index */ | ||
305 | int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, | ||
306 | CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, | ||
307 | CRYPTO_EX_free *free_func); | ||
308 | /* Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a given | ||
309 | * class (invokes whatever per-class callbacks are applicable) */ | ||
310 | int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); | ||
311 | int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to, | ||
312 | CRYPTO_EX_DATA *from); | ||
313 | void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); | ||
314 | /* Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular index | ||
315 | * (relative to the class type involved) */ | ||
316 | int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val); | ||
317 | void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad,int idx); | ||
318 | /* This function cleans up all "ex_data" state. It mustn't be called under | ||
319 | * potential race-conditions. */ | ||
320 | void CRYPTO_cleanup_all_ex_data(void); | ||
221 | 321 | ||
222 | int CRYPTO_mem_ctrl(int mode); | ||
223 | int CRYPTO_get_new_lockid(char *name); | 322 | int CRYPTO_get_new_lockid(char *name); |
224 | void CRYPTO_lock(int mode, int type,char *file,int line); | 323 | |
225 | void CRYPTO_set_locking_callback(void (*func)(int mode,int type,char *file, | 324 | int CRYPTO_num_locks(void); /* return CRYPTO_NUM_LOCKS (shared libs!) */ |
226 | int line)); | 325 | void CRYPTO_lock(int mode, int type,const char *file,int line); |
227 | void (*CRYPTO_get_locking_callback(void))(int mode,int type,char *file, | 326 | void CRYPTO_set_locking_callback(void (*func)(int mode,int type, |
327 | const char *file,int line)); | ||
328 | void (*CRYPTO_get_locking_callback(void))(int mode,int type,const char *file, | ||
228 | int line); | 329 | int line); |
229 | void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount, | 330 | void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount,int type, |
230 | int type,char *file, int line)); | 331 | const char *file, int line)); |
231 | int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount, | 332 | int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,int type, |
232 | int type,char *file,int line); | 333 | const char *file,int line); |
233 | void CRYPTO_set_id_callback(unsigned long (*func)(void)); | 334 | void CRYPTO_set_id_callback(unsigned long (*func)(void)); |
234 | unsigned long (*CRYPTO_get_id_callback(void))(void); | 335 | unsigned long (*CRYPTO_get_id_callback(void))(void); |
235 | unsigned long CRYPTO_thread_id(void); | 336 | unsigned long CRYPTO_thread_id(void); |
236 | char *CRYPTO_get_lock_name(int type); | 337 | const char *CRYPTO_get_lock_name(int type); |
237 | int CRYPTO_add_lock(int *pointer,int amount,int type, char *file,int line); | 338 | int CRYPTO_add_lock(int *pointer,int amount,int type, const char *file, |
238 | 339 | int line); | |
239 | void CRYPTO_set_mem_functions(char *(*m)(),char *(*r)(), void (*free_func)()); | 340 | |
240 | void CRYPTO_get_mem_functions(char *(**m)(),char *(**r)(), void (**f)()); | 341 | int CRYPTO_get_new_dynlockid(void); |
241 | 342 | void CRYPTO_destroy_dynlockid(int i); | |
242 | char *CRYPTO_malloc(int num); | 343 | struct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i); |
243 | char *CRYPTO_realloc(char *addr,int num); | 344 | void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *(*dyn_create_function)(const char *file, int line)); |
244 | void CRYPTO_free(char *); | 345 | void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)(int mode, struct CRYPTO_dynlock_value *l, const char *file, int line)); |
245 | char *CRYPTO_remalloc(char *addr,int num); | 346 | void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)(struct CRYPTO_dynlock_value *l, const char *file, int line)); |
246 | 347 | struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))(const char *file,int line); | |
247 | char *CRYPTO_dbg_malloc(int num,char *file,int line); | 348 | void (*CRYPTO_get_dynlock_lock_callback(void))(int mode, struct CRYPTO_dynlock_value *l, const char *file,int line); |
248 | char *CRYPTO_dbg_realloc(char *addr,int num,char *file,int line); | 349 | void (*CRYPTO_get_dynlock_destroy_callback(void))(struct CRYPTO_dynlock_value *l, const char *file,int line); |
249 | void CRYPTO_dbg_free(char *); | 350 | |
250 | char *CRYPTO_dbg_remalloc(char *addr,int num,char *file,int line); | 351 | /* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- |
251 | #ifndef NO_FP_API | 352 | * call the latter last if you need different functions */ |
353 | int CRYPTO_set_mem_functions(void *(*m)(size_t),void *(*r)(void *,size_t), void (*f)(void *)); | ||
354 | int CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*free_func)(void *)); | ||
355 | int CRYPTO_set_mem_ex_functions(void *(*m)(size_t,const char *,int), | ||
356 | void *(*r)(void *,size_t,const char *,int), | ||
357 | void (*f)(void *)); | ||
358 | int CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t,const char *,int), | ||
359 | void (*free_func)(void *)); | ||
360 | int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int), | ||
361 | void (*r)(void *,void *,int,const char *,int,int), | ||
362 | void (*f)(void *,int), | ||
363 | void (*so)(long), | ||
364 | long (*go)(void)); | ||
365 | void CRYPTO_get_mem_functions(void *(**m)(size_t),void *(**r)(void *, size_t), void (**f)(void *)); | ||
366 | void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *)); | ||
367 | void CRYPTO_get_mem_ex_functions(void *(**m)(size_t,const char *,int), | ||
368 | void *(**r)(void *, size_t,const char *,int), | ||
369 | void (**f)(void *)); | ||
370 | void CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t,const char *,int), | ||
371 | void (**f)(void *)); | ||
372 | void CRYPTO_get_mem_debug_functions(void (**m)(void *,int,const char *,int,int), | ||
373 | void (**r)(void *,void *,int,const char *,int,int), | ||
374 | void (**f)(void *,int), | ||
375 | void (**so)(long), | ||
376 | long (**go)(void)); | ||
377 | |||
378 | void *CRYPTO_malloc_locked(int num, const char *file, int line); | ||
379 | void CRYPTO_free_locked(void *); | ||
380 | void *CRYPTO_malloc(int num, const char *file, int line); | ||
381 | void CRYPTO_free(void *); | ||
382 | void *CRYPTO_realloc(void *addr,int num, const char *file, int line); | ||
383 | void *CRYPTO_remalloc(void *addr,int num, const char *file, int line); | ||
384 | |||
385 | void CRYPTO_set_mem_debug_options(long bits); | ||
386 | long CRYPTO_get_mem_debug_options(void); | ||
387 | |||
388 | #define CRYPTO_push_info(info) \ | ||
389 | CRYPTO_push_info_(info, __FILE__, __LINE__); | ||
390 | int CRYPTO_push_info_(const char *info, const char *file, int line); | ||
391 | int CRYPTO_pop_info(void); | ||
392 | int CRYPTO_remove_all_info(void); | ||
393 | |||
394 | |||
395 | /* Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro; | ||
396 | * used as default in CRYPTO_MDEBUG compilations): */ | ||
397 | /* The last argument has the following significance: | ||
398 | * | ||
399 | * 0: called before the actual memory allocation has taken place | ||
400 | * 1: called after the actual memory allocation has taken place | ||
401 | */ | ||
402 | void CRYPTO_dbg_malloc(void *addr,int num,const char *file,int line,int before_p); | ||
403 | void CRYPTO_dbg_realloc(void *addr1,void *addr2,int num,const char *file,int line,int before_p); | ||
404 | void CRYPTO_dbg_free(void *addr,int before_p); | ||
405 | /* Tell the debugging code about options. By default, the following values | ||
406 | * apply: | ||
407 | * | ||
408 | * 0: Clear all options. | ||
409 | * V_CRYPTO_MDEBUG_TIME (1): Set the "Show Time" option. | ||
410 | * V_CRYPTO_MDEBUG_THREAD (2): Set the "Show Thread Number" option. | ||
411 | * V_CRYPTO_MDEBUG_ALL (3): 1 + 2 | ||
412 | */ | ||
413 | void CRYPTO_dbg_set_options(long bits); | ||
414 | long CRYPTO_dbg_get_options(void); | ||
415 | |||
416 | |||
417 | #ifndef OPENSSL_NO_FP_API | ||
252 | void CRYPTO_mem_leaks_fp(FILE *); | 418 | void CRYPTO_mem_leaks_fp(FILE *); |
253 | #endif | 419 | #endif |
254 | void CRYPTO_mem_leaks(struct bio_st *bio); | 420 | void CRYPTO_mem_leaks(struct bio_st *bio); |
255 | /* unsigned long order, char *file, int line, int num_bytes, char *addr */ | 421 | /* unsigned long order, char *file, int line, int num_bytes, char *addr */ |
256 | void CRYPTO_mem_leaks_cb(void (*cb)()); | 422 | typedef void *CRYPTO_MEM_LEAK_CB(unsigned long, const char *, int, int, void *); |
257 | 423 | void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb); | |
258 | void ERR_load_CRYPTO_strings(void ); | ||
259 | |||
260 | #else | ||
261 | |||
262 | int CRYPTO_get_ex_new_index(); | ||
263 | int CRYPTO_set_ex_data(); | ||
264 | char *CRYPTO_get_ex_data(); | ||
265 | int CRYPTO_dup_ex_data(); | ||
266 | void CRYPTO_free_ex_data(); | ||
267 | void CRYPTO_new_ex_data(); | ||
268 | |||
269 | int CRYPTO_mem_ctrl(); | ||
270 | char *SSLeay_version(); | ||
271 | unsigned long SSLeay(); | ||
272 | |||
273 | int CRYPTO_get_new_lockid(); | ||
274 | void CRYPTO_lock(); | ||
275 | void CRYPTO_set_locking_callback(); | ||
276 | void (*CRYPTO_get_locking_callback())(); | ||
277 | void CRYPTO_set_add_lock_callback(); | ||
278 | int (*CRYPTO_get_add_lock_callback())(); | ||
279 | void CRYPTO_set_id_callback(); | ||
280 | unsigned long (*CRYPTO_get_id_callback())(); | ||
281 | unsigned long CRYPTO_thread_id(); | ||
282 | char *CRYPTO_get_lock_name(); | ||
283 | int CRYPTO_add_lock(); | ||
284 | |||
285 | void CRYPTO_set_mem_functions(); | ||
286 | void CRYPTO_get_mem_functions(); | ||
287 | char *CRYPTO_malloc(); | ||
288 | char *CRYPTO_realloc(); | ||
289 | void CRYPTO_free(); | ||
290 | char *CRYPTO_remalloc(); | ||
291 | char *CRYPTO_dbg_remalloc(); | ||
292 | char *CRYPTO_dbg_malloc(); | ||
293 | char *CRYPTO_dbg_realloc(); | ||
294 | void CRYPTO_dbg_free(); | ||
295 | #ifndef NO_FP_API | ||
296 | void CRYPTO_mem_leaks_fp(); | ||
297 | #endif | ||
298 | void CRYPTO_mem_leaks(); | ||
299 | void CRYPTO_mem_leaks_cb(); | ||
300 | 424 | ||
301 | void ERR_load_CRYPTO_strings(); | ||
302 | |||
303 | #endif | ||
304 | 425 | ||
305 | /* BEGIN ERROR CODES */ | 426 | /* BEGIN ERROR CODES */ |
427 | /* The following lines are auto generated by the script mkerr.pl. Any changes | ||
428 | * made after this point may be overwritten when the script is next run. | ||
429 | */ | ||
430 | void ERR_load_CRYPTO_strings(void); | ||
431 | |||
306 | /* Error codes for the CRYPTO functions. */ | 432 | /* Error codes for the CRYPTO functions. */ |
307 | 433 | ||
308 | /* Function codes. */ | 434 | /* Function codes. */ |
309 | #define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100 | 435 | #define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100 |
436 | #define CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID 103 | ||
310 | #define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101 | 437 | #define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101 |
311 | #define CRYPTO_F_CRYPTO_SET_EX_DATA 102 | 438 | #define CRYPTO_F_CRYPTO_SET_EX_DATA 102 |
439 | #define CRYPTO_F_DEF_ADD_INDEX 104 | ||
440 | #define CRYPTO_F_DEF_GET_CLASS 105 | ||
441 | #define CRYPTO_F_INT_DUP_EX_DATA 106 | ||
442 | #define CRYPTO_F_INT_FREE_EX_DATA 107 | ||
443 | #define CRYPTO_F_INT_NEW_EX_DATA 108 | ||
312 | 444 | ||
313 | /* Reason codes. */ | 445 | /* Reason codes. */ |
314 | 446 | #define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100 | |
447 | |||
315 | #ifdef __cplusplus | 448 | #ifdef __cplusplus |
316 | } | 449 | } |
317 | #endif | 450 | #endif |
318 | #endif | 451 | #endif |
319 | |||