This glues the GMP wrapper ENGINE into OpenSSL if it is being built (ie. if
[openssl.git] / crypto / engine / eng_int.h
index e07da813b68d7385040c2038e65bf71e815a4bf7..2c82861ebbb50e1c4365b1241886275809dee25b 100644 (file)
  * Hudson (tjh@cryptsoft.com).
  *
  */
+/* ====================================================================
+ * 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_ENGINE_INT_H
 #define HEADER_ENGINE_INT_H
@@ -92,7 +97,11 @@ extern "C" {
  * order. NB: both the "add" functions assume CRYPTO_LOCK_ENGINE to already be
  * held (in "write" mode). */
 typedef void (ENGINE_CLEANUP_CB)(void);
-DECLARE_STACK_OF(ENGINE_CLEANUP_CB)
+typedef struct st_engine_cleanup_item
+       {
+       ENGINE_CLEANUP_CB *cb;
+       } ENGINE_CLEANUP_ITEM;
+DECLARE_STACK_OF(ENGINE_CLEANUP_ITEM)
 void engine_cleanup_add_first(ENGINE_CLEANUP_CB *cb);
 void engine_cleanup_add_last(ENGINE_CLEANUP_CB *cb);
 
@@ -125,6 +134,11 @@ int engine_unlocked_init(ENGINE *e);
 int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers);
 int engine_free_util(ENGINE *e, int locked);
 
+/* This function will reset all "set"able values in an ENGINE to NULL. This
+ * won't touch reference counts or ex_data, but is equivalent to calling all the
+ * ENGINE_set_***() functions with a NULL value. */
+void engine_set_all_null(ENGINE *e);
+
 /* NB: Bitwise OR-able values for the "flags" variable in ENGINE are now exposed
  * in engine.h. */
 
@@ -137,7 +151,14 @@ struct engine_st
        const RSA_METHOD *rsa_meth;
        const DSA_METHOD *dsa_meth;
        const DH_METHOD *dh_meth;
+       const ECDH_METHOD *ecdh_meth;
+       const ECDSA_METHOD *ecdsa_meth;
        const RAND_METHOD *rand_meth;
+       /* Cipher handling is via this callback */
+       ENGINE_CIPHERS_PTR ciphers;
+       /* Digest handling is via this callback */
+       ENGINE_DIGESTS_PTR digests;
+
 
        ENGINE_GEN_INT_FUNC_PTR destroy;
 
@@ -157,7 +178,7 @@ struct engine_st
         * simply to cope with (de)allocation of this structure. Hence,
         * running_ref <= struct_ref at all times. */
        int funct_ref;
-       /* A place to store per-key data */
+       /* A place to store per-ENGINE data */
        CRYPTO_EX_DATA ex_data;
        /* Used to maintain the linked-list of engines. */
        struct engine_st *prev;