Move on to beta7 (hopefully, that will never appear)
[oweals/openssl.git] / crypto / crypto.h
index 1490db9aa40065369c3abd73e00babc8ffa33748..273bc5e3f87df60d82e4dc75feed4c109d2ce3e0 100644 (file)
  * copied and put under another distribution licence
  * [including the GNU Public Licence.]
  */
-/* ====================================================================
- * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
- * ECDH support in OpenSSL originally developed by 
- * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
- */
 
 #ifndef HEADER_CRYPTO_H
 #define HEADER_CRYPTO_H
@@ -101,11 +96,11 @@ extern "C" {
  * names in cryptlib.c
  */
 
-#define        CRYPTO_LOCK_ERR                 1
-#define        CRYPTO_LOCK_EX_DATA             2
-#define        CRYPTO_LOCK_X509                3
-#define        CRYPTO_LOCK_X509_INFO           4
-#define        CRYPTO_LOCK_X509_PKEY           5
+#define CRYPTO_LOCK_ERR                        1
+#define CRYPTO_LOCK_EX_DATA            2
+#define CRYPTO_LOCK_X509               3
+#define CRYPTO_LOCK_X509_INFO          4
+#define CRYPTO_LOCK_X509_PKEY          5
 #define CRYPTO_LOCK_X509_CRL           6
 #define CRYPTO_LOCK_X509_REQ           7
 #define CRYPTO_LOCK_DSA                        8
@@ -132,10 +127,8 @@ extern "C" {
 #define CRYPTO_LOCK_DYNLOCK            29
 #define CRYPTO_LOCK_ENGINE             30
 #define CRYPTO_LOCK_UI                 31
-#define CRYPTO_LOCK_ECDSA               32
-#define CRYPTO_LOCK_EC                 33
-#define CRYPTO_LOCK_ECDH               34
-#define CRYPTO_NUM_LOCKS               35
+#define CRYPTO_LOCK_HWCRHK             32 /* This is a HACK which will disappear in 0.9.8 */
+#define CRYPTO_NUM_LOCKS               33
 
 #define CRYPTO_LOCK            1
 #define CRYPTO_UNLOCK          2
@@ -242,8 +235,6 @@ DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS)
 #define CRYPTO_EX_INDEX_ENGINE         9
 #define CRYPTO_EX_INDEX_X509           10
 #define CRYPTO_EX_INDEX_UI             11
-#define CRYPTO_EX_INDEX_ECDSA          12
-#define CRYPTO_EX_INDEX_ECDH           13
 
 /* Dynamically assigned indexes start from this value (don't use directly, use
  * via CRYPTO_ex_data_new_class). */
@@ -289,6 +280,8 @@ int CRYPTO_is_mem_check_on(void);
 #define OPENSSL_malloc(num)    CRYPTO_malloc((int)num,__FILE__,__LINE__)
 #define OPENSSL_realloc(addr,num) \
        CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__)
+#define OPENSSL_realloc_clean(addr,old_num,num) \
+       CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__)
 #define OPENSSL_remalloc(addr,num) \
        CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)
 #define OPENSSL_freeFunc       CRYPTO_free
@@ -391,8 +384,12 @@ void CRYPTO_free_locked(void *);
 void *CRYPTO_malloc(int num, const char *file, int line);
 void CRYPTO_free(void *);
 void *CRYPTO_realloc(void *addr,int num, const char *file, int line);
+void *CRYPTO_realloc_clean(void *addr,int old_num,int num,const char *file,
+                          int line);
 void *CRYPTO_remalloc(void *addr,int num, const char *file, int line);
 
+void OPENSSL_cleanse(void *ptr, size_t len);
+
 void CRYPTO_set_mem_debug_options(long bits);
 long CRYPTO_get_mem_debug_options(void);
 
@@ -433,6 +430,9 @@ void CRYPTO_mem_leaks(struct bio_st *bio);
 typedef void *CRYPTO_MEM_LEAK_CB(unsigned long, const char *, int, int, void *);
 void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb);
 
+/* die if we have to */
+void OpenSSLDie(const char *file,int line,const char *assertion);
+#define OPENSSL_assert(e)      ((e) ? (void)0 : OpenSSLDie(__FILE__, __LINE__, #e))
 
 /* BEGIN ERROR CODES */
 /* The following lines are auto generated by the script mkerr.pl. Any changes