1.1 --- a/epoc32/include/stdapis/openssl/crypto.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/stdapis/openssl/crypto.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,559 @@
1.4 -crypto.h
1.5 +/* crypto/crypto.h */
1.6 +/* ====================================================================
1.7 + * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved.
1.8 + *
1.9 + * Redistribution and use in source and binary forms, with or without
1.10 + * modification, are permitted provided that the following conditions
1.11 + * are met:
1.12 + *
1.13 + * 1. Redistributions of source code must retain the above copyright
1.14 + * notice, this list of conditions and the following disclaimer.
1.15 + *
1.16 + * 2. Redistributions in binary form must reproduce the above copyright
1.17 + * notice, this list of conditions and the following disclaimer in
1.18 + * the documentation and/or other materials provided with the
1.19 + * distribution.
1.20 + *
1.21 + * 3. All advertising materials mentioning features or use of this
1.22 + * software must display the following acknowledgment:
1.23 + * "This product includes software developed by the OpenSSL Project
1.24 + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
1.25 + *
1.26 + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
1.27 + * endorse or promote products derived from this software without
1.28 + * prior written permission. For written permission, please contact
1.29 + * openssl-core@openssl.org.
1.30 + *
1.31 + * 5. Products derived from this software may not be called "OpenSSL"
1.32 + * nor may "OpenSSL" appear in their names without prior written
1.33 + * permission of the OpenSSL Project.
1.34 + *
1.35 + * 6. Redistributions of any form whatsoever must retain the following
1.36 + * acknowledgment:
1.37 + * "This product includes software developed by the OpenSSL Project
1.38 + * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
1.39 + *
1.40 + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
1.41 + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1.42 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1.43 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
1.44 + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1.45 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1.46 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1.47 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1.48 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
1.49 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1.50 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
1.51 + * OF THE POSSIBILITY OF SUCH DAMAGE.
1.52 + * ====================================================================
1.53 + *
1.54 + * This product includes cryptographic software written by Eric Young
1.55 + * (eay@cryptsoft.com). This product includes software written by Tim
1.56 + * Hudson (tjh@cryptsoft.com).
1.57 + *
1.58 + */
1.59 +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
1.60 + * All rights reserved.
1.61 + *
1.62 + * This package is an SSL implementation written
1.63 + * by Eric Young (eay@cryptsoft.com).
1.64 + * The implementation was written so as to conform with Netscapes SSL.
1.65 + *
1.66 + * This library is free for commercial and non-commercial use as long as
1.67 + * the following conditions are aheared to. The following conditions
1.68 + * apply to all code found in this distribution, be it the RC4, RSA,
1.69 + * lhash, DES, etc., code; not just the SSL code. The SSL documentation
1.70 + * included with this distribution is covered by the same copyright terms
1.71 + * except that the holder is Tim Hudson (tjh@cryptsoft.com).
1.72 + *
1.73 + * Copyright remains Eric Young's, and as such any Copyright notices in
1.74 + * the code are not to be removed.
1.75 + * If this package is used in a product, Eric Young should be given attribution
1.76 + * as the author of the parts of the library used.
1.77 + * This can be in the form of a textual message at program startup or
1.78 + * in documentation (online or textual) provided with the package.
1.79 + *
1.80 + * Redistribution and use in source and binary forms, with or without
1.81 + * modification, are permitted provided that the following conditions
1.82 + * are met:
1.83 + * 1. Redistributions of source code must retain the copyright
1.84 + * notice, this list of conditions and the following disclaimer.
1.85 + * 2. Redistributions in binary form must reproduce the above copyright
1.86 + * notice, this list of conditions and the following disclaimer in the
1.87 + * documentation and/or other materials provided with the distribution.
1.88 + * 3. All advertising materials mentioning features or use of this software
1.89 + * must display the following acknowledgement:
1.90 + * "This product includes cryptographic software written by
1.91 + * Eric Young (eay@cryptsoft.com)"
1.92 + * The word 'cryptographic' can be left out if the rouines from the library
1.93 + * being used are not cryptographic related :-).
1.94 + * 4. If you include any Windows specific code (or a derivative thereof) from
1.95 + * the apps directory (application code) you must include an acknowledgement:
1.96 + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
1.97 + *
1.98 + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
1.99 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1.100 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1.101 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1.102 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1.103 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1.104 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1.105 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1.106 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1.107 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1.108 + * SUCH DAMAGE.
1.109 + *
1.110 + * The licence and distribution terms for any publically available version or
1.111 + * derivative of this code cannot be changed. i.e. this code cannot simply be
1.112 + * copied and put under another distribution licence
1.113 + * [including the GNU Public Licence.]
1.114 + */
1.115 +/* ====================================================================
1.116 + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
1.117 + * ECDH support in OpenSSL originally developed by
1.118 + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
1.119 + */
1.120 +/*
1.121 + © Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
1.122 + */
1.123 +
1.124 +#ifndef HEADER_CRYPTO_H
1.125 +#define HEADER_CRYPTO_H
1.126 +#if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
1.127 +#define SYMBIAN
1.128 +#endif
1.129 +
1.130 +#ifdef SYMBIAN
1.131 +#include <e32def.h>
1.132 +#endif
1.133 +#include <stdlib.h>
1.134 +
1.135 +#include <openssl/e_os2.h>
1.136 +
1.137 +#ifndef OPENSSL_NO_FP_API
1.138 +#include <stdio.h>
1.139 +#endif
1.140 +
1.141 +#include <openssl/stack.h>
1.142 +#include <openssl/safestack.h>
1.143 +#include <openssl/opensslv.h>
1.144 +#include <openssl/ossl_typ.h>
1.145 +
1.146 +#ifdef CHARSET_EBCDIC
1.147 +#include <openssl/ebcdic.h>
1.148 +#endif
1.149 +
1.150 +/* Resolve problems on some operating systems with symbol names that clash
1.151 + one way or another */
1.152 +#include <openssl/symhacks.h>
1.153 +
1.154 +#ifdef __cplusplus
1.155 +extern "C" {
1.156 +#endif
1.157 +
1.158 +/* Backward compatibility to SSLeay */
1.159 +/* This is more to be used to check the correct DLL is being used
1.160 + * in the MS world. */
1.161 +#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
1.162 +#define SSLEAY_VERSION 0
1.163 +/* #define SSLEAY_OPTIONS 1 no longer supported */
1.164 +#define SSLEAY_CFLAGS 2
1.165 +#define SSLEAY_BUILT_ON 3
1.166 +#define SSLEAY_PLATFORM 4
1.167 +#define SSLEAY_DIR 5
1.168 +
1.169 +/* Already declared in ossl_typ.h */
1.170 +#if 0
1.171 +typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
1.172 +/* Called when a new object is created */
1.173 +typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
1.174 + int idx, long argl, void *argp);
1.175 +/* Called when an object is free()ed */
1.176 +typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
1.177 + int idx, long argl, void *argp);
1.178 +/* Called when we need to dup an object */
1.179 +typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
1.180 + int idx, long argl, void *argp);
1.181 +#endif
1.182 +
1.183 +/* A generic structure to pass assorted data in a expandable way */
1.184 +typedef struct openssl_item_st
1.185 + {
1.186 + int code;
1.187 + void *value; /* Not used for flag attributes */
1.188 + size_t value_size; /* Max size of value for output, length for input */
1.189 + size_t *value_length; /* Returned length of value for output */
1.190 + } OPENSSL_ITEM;
1.191 +
1.192 +
1.193 +/* When changing the CRYPTO_LOCK_* list, be sure to maintin the text lock
1.194 + * names in cryptlib.c
1.195 + */
1.196 +
1.197 +#define CRYPTO_LOCK_ERR 1
1.198 +#define CRYPTO_LOCK_EX_DATA 2
1.199 +#define CRYPTO_LOCK_X509 3
1.200 +#define CRYPTO_LOCK_X509_INFO 4
1.201 +#define CRYPTO_LOCK_X509_PKEY 5
1.202 +#define CRYPTO_LOCK_X509_CRL 6
1.203 +#define CRYPTO_LOCK_X509_REQ 7
1.204 +#define CRYPTO_LOCK_DSA 8
1.205 +#define CRYPTO_LOCK_RSA 9
1.206 +#define CRYPTO_LOCK_EVP_PKEY 10
1.207 +#define CRYPTO_LOCK_X509_STORE 11
1.208 +#define CRYPTO_LOCK_SSL_CTX 12
1.209 +#define CRYPTO_LOCK_SSL_CERT 13
1.210 +#define CRYPTO_LOCK_SSL_SESSION 14
1.211 +#define CRYPTO_LOCK_SSL_SESS_CERT 15
1.212 +#define CRYPTO_LOCK_SSL 16
1.213 +#define CRYPTO_LOCK_SSL_METHOD 17
1.214 +#define CRYPTO_LOCK_RAND 18
1.215 +#define CRYPTO_LOCK_RAND2 19
1.216 +#define CRYPTO_LOCK_MALLOC 20
1.217 +#define CRYPTO_LOCK_BIO 21
1.218 +#define CRYPTO_LOCK_GETHOSTBYNAME 22
1.219 +#define CRYPTO_LOCK_GETSERVBYNAME 23
1.220 +#define CRYPTO_LOCK_READDIR 24
1.221 +#define CRYPTO_LOCK_RSA_BLINDING 25
1.222 +#define CRYPTO_LOCK_DH 26
1.223 +#define CRYPTO_LOCK_MALLOC2 27
1.224 +#define CRYPTO_LOCK_DSO 28
1.225 +#define CRYPTO_LOCK_DYNLOCK 29
1.226 +#define CRYPTO_LOCK_ENGINE 30
1.227 +#define CRYPTO_LOCK_UI 31
1.228 +#define CRYPTO_LOCK_ECDSA 32
1.229 +#define CRYPTO_LOCK_EC 33
1.230 +#define CRYPTO_LOCK_ECDH 34
1.231 +#define CRYPTO_LOCK_BN 35
1.232 +#define CRYPTO_LOCK_EC_PRE_COMP 36
1.233 +#define CRYPTO_LOCK_STORE 37
1.234 +#define CRYPTO_LOCK_COMP 38
1.235 +#define CRYPTO_NUM_LOCKS 39
1.236 +
1.237 +#define CRYPTO_LOCK 1
1.238 +#define CRYPTO_UNLOCK 2
1.239 +#define CRYPTO_READ 4
1.240 +#define CRYPTO_WRITE 8
1.241 +
1.242 +#ifndef OPENSSL_NO_LOCKING
1.243 +#ifndef CRYPTO_w_lock
1.244 +#define CRYPTO_w_lock(type) \
1.245 + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
1.246 +#define CRYPTO_w_unlock(type) \
1.247 + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
1.248 +#define CRYPTO_r_lock(type) \
1.249 + CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__)
1.250 +#define CRYPTO_r_unlock(type) \
1.251 + CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__)
1.252 +#define CRYPTO_add(addr,amount,type) \
1.253 + CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__)
1.254 +#endif
1.255 +#else
1.256 +#define CRYPTO_w_lock(a)
1.257 +#define CRYPTO_w_unlock(a)
1.258 +#define CRYPTO_r_lock(a)
1.259 +#define CRYPTO_r_unlock(a)
1.260 +#define CRYPTO_add(a,b,c) ((*(a))+=(b))
1.261 +#endif
1.262 +
1.263 +/* Some applications as well as some parts of OpenSSL need to allocate
1.264 + and deallocate locks in a dynamic fashion. The following typedef
1.265 + makes this possible in a type-safe manner. */
1.266 +/* struct CRYPTO_dynlock_value has to be defined by the application. */
1.267 +typedef struct
1.268 + {
1.269 + int references;
1.270 + struct CRYPTO_dynlock_value *data;
1.271 + } CRYPTO_dynlock;
1.272 +
1.273 +
1.274 +/* The following can be used to detect memory leaks in the SSLeay library.
1.275 + * It used, it turns on malloc checking */
1.276 +
1.277 +#define CRYPTO_MEM_CHECK_OFF 0x0 /* an enume */
1.278 +#define CRYPTO_MEM_CHECK_ON 0x1 /* a bit */
1.279 +#define CRYPTO_MEM_CHECK_ENABLE 0x2 /* a bit */
1.280 +#define CRYPTO_MEM_CHECK_DISABLE 0x3 /* an enume */
1.281 +
1.282 +/* The following are bit values to turn on or off options connected to the
1.283 + * malloc checking functionality */
1.284 +
1.285 +/* Adds time to the memory checking information */
1.286 +#define V_CRYPTO_MDEBUG_TIME 0x1 /* a bit */
1.287 +/* Adds thread number to the memory checking information */
1.288 +#define V_CRYPTO_MDEBUG_THREAD 0x2 /* a bit */
1.289 +
1.290 +#define V_CRYPTO_MDEBUG_ALL (V_CRYPTO_MDEBUG_TIME | V_CRYPTO_MDEBUG_THREAD)
1.291 +
1.292 +
1.293 +/* predec of the BIO type */
1.294 +typedef struct bio_st BIO_dummy;
1.295 +
1.296 +struct crypto_ex_data_st
1.297 + {
1.298 + STACK *sk;
1.299 + int dummy; /* gcc is screwing up this data structure :-( */
1.300 + };
1.301 +
1.302 +/* This stuff is basically class callback functions
1.303 + * The current classes are SSL_CTX, SSL, SSL_SESSION, and a few more */
1.304 +
1.305 +typedef struct crypto_ex_data_func_st
1.306 + {
1.307 + long argl; /* Arbitary long */
1.308 + void *argp; /* Arbitary void * */
1.309 + CRYPTO_EX_new *new_func;
1.310 + CRYPTO_EX_free *free_func;
1.311 + CRYPTO_EX_dup *dup_func;
1.312 + } CRYPTO_EX_DATA_FUNCS;
1.313 +
1.314 +DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS)
1.315 +
1.316 +/* Per class, we have a STACK of CRYPTO_EX_DATA_FUNCS for each CRYPTO_EX_DATA
1.317 + * entry.
1.318 + */
1.319 +
1.320 +#define CRYPTO_EX_INDEX_BIO 0
1.321 +#define CRYPTO_EX_INDEX_SSL 1
1.322 +#define CRYPTO_EX_INDEX_SSL_CTX 2
1.323 +#define CRYPTO_EX_INDEX_SSL_SESSION 3
1.324 +#define CRYPTO_EX_INDEX_X509_STORE 4
1.325 +#define CRYPTO_EX_INDEX_X509_STORE_CTX 5
1.326 +#define CRYPTO_EX_INDEX_RSA 6
1.327 +#define CRYPTO_EX_INDEX_DSA 7
1.328 +#define CRYPTO_EX_INDEX_DH 8
1.329 +#define CRYPTO_EX_INDEX_ENGINE 9
1.330 +#define CRYPTO_EX_INDEX_X509 10
1.331 +#define CRYPTO_EX_INDEX_UI 11
1.332 +#define CRYPTO_EX_INDEX_ECDSA 12
1.333 +#define CRYPTO_EX_INDEX_ECDH 13
1.334 +#define CRYPTO_EX_INDEX_COMP 14
1.335 +#define CRYPTO_EX_INDEX_STORE 15
1.336 +
1.337 +/* Dynamically assigned indexes start from this value (don't use directly, use
1.338 + * via CRYPTO_ex_data_new_class). */
1.339 +#define CRYPTO_EX_INDEX_USER 100
1.340 +
1.341 +
1.342 +/* This is the default callbacks, but we can have others as well:
1.343 + * this is needed in Win32 where the application malloc and the
1.344 + * library malloc may not be the same.
1.345 + */
1.346 +#define CRYPTO_malloc_init() CRYPTO_set_mem_functions(\
1.347 + malloc, realloc, free)
1.348 +
1.349 +#if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD
1.350 +# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */
1.351 +# define CRYPTO_MDEBUG
1.352 +# endif
1.353 +#endif
1.354 +
1.355 +/* Set standard debugging functions (not done by default
1.356 + * unless CRYPTO_MDEBUG is defined) */
1.357 +#define CRYPTO_malloc_debug_init() do {\
1.358 + CRYPTO_set_mem_debug_functions(\
1.359 + CRYPTO_dbg_malloc,\
1.360 + CRYPTO_dbg_realloc,\
1.361 + CRYPTO_dbg_free,\
1.362 + CRYPTO_dbg_set_options,\
1.363 + CRYPTO_dbg_get_options);\
1.364 + } while(0)
1.365 +
1.366 +IMPORT_C int CRYPTO_mem_ctrl(int mode);
1.367 +IMPORT_C int CRYPTO_is_mem_check_on(void);
1.368 +
1.369 +/* for applications */
1.370 +#define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON)
1.371 +#define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF)
1.372 +
1.373 +/* for library-internal use */
1.374 +#define MemCheck_on() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE)
1.375 +#define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE)
1.376 +#define is_MemCheck_on() CRYPTO_is_mem_check_on()
1.377 +
1.378 +#define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__)
1.379 +#define OPENSSL_realloc(addr,num) \
1.380 + CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__)
1.381 +#define OPENSSL_realloc_clean(addr,old_num,num) \
1.382 + CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__)
1.383 +#define OPENSSL_remalloc(addr,num) \
1.384 + CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)
1.385 +#define OPENSSL_freeFunc CRYPTO_free
1.386 +#define OPENSSL_free(addr) CRYPTO_free(addr)
1.387 +
1.388 +#define OPENSSL_malloc_locked(num) \
1.389 + CRYPTO_malloc_locked((int)num,__FILE__,__LINE__)
1.390 +#define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr)
1.391 +
1.392 +
1.393 +IMPORT_C const char *SSLeay_version(int type);
1.394 +IMPORT_C unsigned long SSLeay(void);
1.395 +
1.396 +IMPORT_C int OPENSSL_issetugid(void);
1.397 +
1.398 +/* An opaque type representing an implementation of "ex_data" support */
1.399 +typedef struct st_CRYPTO_EX_DATA_IMPL CRYPTO_EX_DATA_IMPL;
1.400 +/* Return an opaque pointer to the current "ex_data" implementation */
1.401 +IMPORT_C const CRYPTO_EX_DATA_IMPL *CRYPTO_get_ex_data_implementation(void);
1.402 +/* Sets the "ex_data" implementation to be used (if it's not too late) */
1.403 +IMPORT_C int CRYPTO_set_ex_data_implementation(CRYPTO_EX_DATA_IMPL *i);
1.404 +/* Get a new "ex_data" class, and return the corresponding "class_index" */
1.405 +IMPORT_C int CRYPTO_ex_data_new_class(void);
1.406 +/* Within a given class, get/register a new index */
1.407 +IMPORT_C int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
1.408 + CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
1.409 + CRYPTO_EX_free *free_func);
1.410 +/* Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a given
1.411 + * class (invokes whatever per-class callbacks are applicable) */
1.412 +IMPORT_C int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
1.413 +IMPORT_C int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
1.414 + CRYPTO_EX_DATA *from);
1.415 +IMPORT_C void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
1.416 +/* Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular index
1.417 + * (relative to the class type involved) */
1.418 +IMPORT_C int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val);
1.419 +IMPORT_C void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad,int idx);
1.420 +/* This function cleans up all "ex_data" state. It mustn't be called under
1.421 + * potential race-conditions. */
1.422 +IMPORT_C void CRYPTO_cleanup_all_ex_data(void);
1.423 +
1.424 +IMPORT_C int CRYPTO_get_new_lockid(char *name);
1.425 +
1.426 +IMPORT_C int CRYPTO_num_locks(void); /* return CRYPTO_NUM_LOCKS (shared libs!) */
1.427 +IMPORT_C void CRYPTO_lock(int mode, int type,const char *file,int line);
1.428 +IMPORT_C void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
1.429 + const char *file,int line));
1.430 +IMPORT_C void (*CRYPTO_get_locking_callback(void))(int mode,int type,const char *file,
1.431 + int line);
1.432 +IMPORT_C void CRYPTO_set_add_lock_callback(int (*func)(int *num,int mount,int type,
1.433 + const char *file, int line));
1.434 +IMPORT_C int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,int type,
1.435 + const char *file,int line);
1.436 +IMPORT_C void CRYPTO_set_id_callback(unsigned long (*func)(void));
1.437 +IMPORT_C unsigned long (*CRYPTO_get_id_callback(void))(void);
1.438 +IMPORT_C unsigned long CRYPTO_thread_id(void);
1.439 +IMPORT_C const char *CRYPTO_get_lock_name(int type);
1.440 +IMPORT_C int CRYPTO_add_lock(int *pointer,int amount,int type, const char *file,
1.441 + int line);
1.442 +
1.443 +IMPORT_C int CRYPTO_get_new_dynlockid(void);
1.444 +IMPORT_C void CRYPTO_destroy_dynlockid(int i);
1.445 +IMPORT_C struct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i);
1.446 +IMPORT_C void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *(*dyn_create_function)(const char *file, int line));
1.447 +IMPORT_C void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)(int mode, struct CRYPTO_dynlock_value *l, const char *file, int line));
1.448 +IMPORT_C void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)(struct CRYPTO_dynlock_value *l, const char *file, int line));
1.449 +IMPORT_C struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))(const char *file,int line);
1.450 +IMPORT_C void (*CRYPTO_get_dynlock_lock_callback(void))(int mode, struct CRYPTO_dynlock_value *l, const char *file,int line);
1.451 +IMPORT_C void (*CRYPTO_get_dynlock_destroy_callback(void))(struct CRYPTO_dynlock_value *l, const char *file,int line);
1.452 +
1.453 +/* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions --
1.454 + * call the latter last if you need different functions */
1.455 +IMPORT_C int CRYPTO_set_mem_functions(void *(*m)(size_t),void *(*r)(void *,size_t), void (*f)(void *));
1.456 +IMPORT_C int CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*free_func)(void *));
1.457 +IMPORT_C int CRYPTO_set_mem_ex_functions(void *(*m)(size_t,const char *,int),
1.458 + void *(*r)(void *,size_t,const char *,int),
1.459 + void (*f)(void *));
1.460 +IMPORT_C int CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t,const char *,int),
1.461 + void (*free_func)(void *));
1.462 +IMPORT_C int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int),
1.463 + void (*r)(void *,void *,int,const char *,int,int),
1.464 + void (*f)(void *,int),
1.465 + void (*so)(long),
1.466 + long (*go)(void));
1.467 +IMPORT_C void CRYPTO_get_mem_functions(void *(**m)(size_t),void *(**r)(void *, size_t), void (**f)(void *));
1.468 +IMPORT_C void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *));
1.469 +IMPORT_C void CRYPTO_get_mem_ex_functions(void *(**m)(size_t,const char *,int),
1.470 + void *(**r)(void *, size_t,const char *,int),
1.471 + void (**f)(void *));
1.472 +IMPORT_C void CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t,const char *,int),
1.473 + void (**f)(void *));
1.474 +IMPORT_C void CRYPTO_get_mem_debug_functions(void (**m)(void *,int,const char *,int,int),
1.475 + void (**r)(void *,void *,int,const char *,int,int),
1.476 + void (**f)(void *,int),
1.477 + void (**so)(long),
1.478 + long (**go)(void));
1.479 +
1.480 +IMPORT_C void *CRYPTO_malloc_locked(int num, const char *file, int line);
1.481 +IMPORT_C void CRYPTO_free_locked(void *);
1.482 +IMPORT_C void *CRYPTO_malloc(int num, const char *file, int line);
1.483 +IMPORT_C void CRYPTO_free(void *);
1.484 +IMPORT_C void *CRYPTO_realloc(void *addr,int num, const char *file, int line);
1.485 +IMPORT_C void *CRYPTO_realloc_clean(void *addr,int old_num,int num,const char *file,
1.486 + int line);
1.487 +IMPORT_C void *CRYPTO_remalloc(void *addr,int num, const char *file, int line);
1.488 +
1.489 +IMPORT_C void OPENSSL_cleanse(void *ptr, size_t len);
1.490 +
1.491 +IMPORT_C void CRYPTO_set_mem_debug_options(long bits);
1.492 +long CRYPTO_get_mem_debug_options(void);
1.493 +
1.494 +#define CRYPTO_push_info(info) \
1.495 + CRYPTO_push_info_(info, __FILE__, __LINE__);
1.496 +IMPORT_C int CRYPTO_push_info_(const char *info, const char *file, int line);
1.497 +IMPORT_C int CRYPTO_pop_info(void);
1.498 +IMPORT_C int CRYPTO_remove_all_info(void);
1.499 +
1.500 +
1.501 +/* Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro;
1.502 + * used as default in CRYPTO_MDEBUG compilations): */
1.503 +/* The last argument has the following significance:
1.504 + *
1.505 + * 0: called before the actual memory allocation has taken place
1.506 + * 1: called after the actual memory allocation has taken place
1.507 + */
1.508 +IMPORT_C void CRYPTO_dbg_malloc(void *addr,int num,const char *file,int line,int before_p);
1.509 +IMPORT_C void CRYPTO_dbg_realloc(void *addr1,void *addr2,int num,const char *file,int line,int before_p);
1.510 +IMPORT_C void CRYPTO_dbg_free(void *addr,int before_p);
1.511 +/* Tell the debugging code about options. By default, the following values
1.512 + * apply:
1.513 + *
1.514 + * 0: Clear all options.
1.515 + * V_CRYPTO_MDEBUG_TIME (1): Set the "Show Time" option.
1.516 + * V_CRYPTO_MDEBUG_THREAD (2): Set the "Show Thread Number" option.
1.517 + * V_CRYPTO_MDEBUG_ALL (3): 1 + 2
1.518 + */
1.519 +IMPORT_C void CRYPTO_dbg_set_options(long bits);
1.520 +IMPORT_C long CRYPTO_dbg_get_options(void);
1.521 +
1.522 +
1.523 +#ifndef OPENSSL_NO_FP_API
1.524 +IMPORT_C void CRYPTO_mem_leaks_fp(FILE *);
1.525 +#endif
1.526 +IMPORT_C void CRYPTO_mem_leaks(struct bio_st *bio);
1.527 +/* unsigned long order, char *file, int line, int num_bytes, char *addr */
1.528 +typedef void *CRYPTO_MEM_LEAK_CB(unsigned long, const char *, int, int, void *);
1.529 +IMPORT_C void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb);
1.530 +
1.531 +/* die if we have to */
1.532 +IMPORT_C void OpenSSLDie(const char *file,int line,const char *assertion);
1.533 +#define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1))
1.534 +
1.535 +unsigned long *OPENSSL_ia32cap_loc(void);
1.536 +#define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
1.537 +
1.538 +/* BEGIN ERROR CODES */
1.539 +/* The following lines are auto generated by the script mkerr.pl. Any changes
1.540 + * made after this point may be overwritten when the script is next run.
1.541 + */
1.542 +IMPORT_C void ERR_load_crypto_strings(void);
1.543 +
1.544 +/* Error codes for the CRYPTO functions. */
1.545 +
1.546 +/* Function codes. */
1.547 +#define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100
1.548 +#define CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID 103
1.549 +#define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101
1.550 +#define CRYPTO_F_CRYPTO_SET_EX_DATA 102
1.551 +#define CRYPTO_F_DEF_ADD_INDEX 104
1.552 +#define CRYPTO_F_DEF_GET_CLASS 105
1.553 +#define CRYPTO_F_INT_DUP_EX_DATA 106
1.554 +#define CRYPTO_F_INT_FREE_EX_DATA 107
1.555 +#define CRYPTO_F_INT_NEW_EX_DATA 108
1.556 +
1.557 +/* Reason codes. */
1.558 +#define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100
1.559 +
1.560 +#ifdef __cplusplus
1.561 +}
1.562 +#endif
1.563 +#endif