Hide OPENSSL_INIT_SETTINGS.
[openssl.git] / include / openssl / crypto.h
index 26f6c79c8ed869ed2a24b5c35551994d93ce3496..f05fa1e18630d00a3b12a7f93916cdba7a0c86fa 100644 (file)
@@ -1,5 +1,5 @@
 /* ====================================================================
- * Copyright (c) 1998-2006 The OpenSSL Project.  All rights reserved.
+ * Copyright (c) 1998-2016 The OpenSSL Project.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -205,7 +205,8 @@ extern "C" {
 # define CRYPTO_LOCK_COMP                38
 # define CRYPTO_LOCK_FIPS                39
 # define CRYPTO_LOCK_FIPS2               40
-# define CRYPTO_NUM_LOCKS                41
+# define CRYPTO_LOCK_INIT                41
+# define CRYPTO_NUM_LOCKS                42
 
 # define CRYPTO_LOCK             1
 # define CRYPTO_UNLOCK           2
@@ -361,6 +362,7 @@ const char *OpenSSL_version(int type);
 # define OPENSSL_BUILT_ON         2
 # define OPENSSL_PLATFORM         3
 # define OPENSSL_DIR              4
+# define OPENSSL_ENGINES_DIR      5
 
 int OPENSSL_issetugid(void);
 
@@ -542,7 +544,48 @@ int OPENSSL_gmtime_diff(int *pday, int *psec,
  * into a defined order as the return value when a != b is undefined, other
  * than to be non-zero.
  */
-int CRYPTO_memcmp(const void *a, const void *b, size_t len);
+int CRYPTO_memcmp(const volatile void * volatile in_a,
+                  const volatile void * volatile in_b,
+                  size_t len);
+
+/* Standard initialisation options */
+# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x000001
+# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x000002
+# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x000004
+# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x000008
+# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS     0x000010
+# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS     0x000020
+# define OPENSSL_INIT_LOAD_CONFIG            0x000040
+# define OPENSSL_INIT_NO_LOAD_CONFIG         0x000080
+# define OPENSSL_INIT_ASYNC                  0x000100
+# define OPENSSL_INIT_ENGINE_RDRAND          0x000200
+# define OPENSSL_INIT_ENGINE_DYNAMIC         0x000400
+# define OPENSSL_INIT_ENGINE_OPENSSL         0x000800
+# define OPENSSL_INIT_ENGINE_CRYPTODEV       0x001000
+# define OPENSSL_INIT_ENGINE_CAPI            0x002000
+# define OPENSSL_INIT_ENGINE_PADLOCK         0x004000
+# define OPENSSL_INIT_ENGINE_DASYNC          0x008000
+/* OPENSSL_INIT flag 0x010000 reserved for internal use */
+/* Max OPENSSL_INIT flag value is 0x80000000 */
+
+/* openssl and dasync not counted as builtin */
+# define OPENSSL_INIT_ENGINE_ALL_BUILTIN \
+    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
+    | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
+    OPENSSL_INIT_ENGINE_PADLOCK)
+
+
+/* Library initialisation functions */
+void OPENSSL_cleanup(void);
+int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
+int OPENSSL_atexit(void (*handler)(void));
+void OPENSSL_thread_stop(void);
+
+/* Low-level control of initialization */
+OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void);
+void OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings,
+                                      const char *config_file);
+void OPENSSL_INIT_free(OPENSSL_INIT_SETTINGS *settings);
 
 /* BEGIN ERROR CODES */
 /*
@@ -569,6 +612,7 @@ void ERR_load_CRYPTO_strings(void);
 # define CRYPTO_F_INT_DUP_EX_DATA                         106
 # define CRYPTO_F_INT_FREE_EX_DATA                        107
 # define CRYPTO_F_INT_NEW_EX_DATA                         108
+# define CRYPTO_F_OPENSSL_INIT_CRYPTO                     116
 # define CRYPTO_F_OPENSSL_MEMDUP                          114
 
 /* Reason codes. */