Initial public key ASN1 method engine support. Not integrated yet.
[openssl.git] / crypto / engine / eng_dyn.c
index 5803c0123a0a22637a6fd6c685c24ec3ce2f503e..acb30c34d899290e79253dc2170c865c9c1ce41f 100644 (file)
  */
 
 
-#include <stdio.h>
-#include <openssl/crypto.h>
-#include "cryptlib.h"
 #include "eng_int.h"
-#include <openssl/engine.h>
 #include <openssl/dso.h>
 
 /* Shared libraries implementing ENGINEs for use by the "dynamic" ENGINE loader
@@ -70,7 +66,7 @@
 /* Our ENGINE handlers */
 static int dynamic_init(ENGINE *e);
 static int dynamic_finish(ENGINE *e);
-static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)());
+static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void));
 /* Predeclare our context type */
 typedef struct st_dynamic_data_ctx dynamic_data_ctx;
 /* The implementation for the important control command */
@@ -193,7 +189,7 @@ static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx)
        c = OPENSSL_malloc(sizeof(dynamic_data_ctx));
        if(!c)
                {
-               ENGINEerr(ENGINE_F_SET_DATA_CTX,ERR_R_MALLOC_FAILURE);
+               ENGINEerr(ENGINE_F_DYNAMIC_SET_DATA_CTX,ERR_R_MALLOC_FAILURE);
                return 0;
                }
        memset(c, 0, sizeof(dynamic_data_ctx));
@@ -210,7 +206,7 @@ static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx)
        c->dirs = sk_new_null();
        if(!c->dirs)
                {
-               ENGINEerr(ENGINE_F_SET_DATA_CTX,ERR_R_MALLOC_FAILURE);
+               ENGINEerr(ENGINE_F_DYNAMIC_SET_DATA_CTX,ERR_R_MALLOC_FAILURE);
                OPENSSL_free(c);
                return 0;
                }
@@ -316,7 +312,7 @@ static int dynamic_finish(ENGINE *e)
        return 0;
        }
 
-static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)())
+static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void))
        {
        dynamic_data_ctx *ctx = dynamic_get_data_ctx(e);
        int initialised;
@@ -500,6 +496,7 @@ static int dynamic_load(ENGINE *e, dynamic_data_ctx *ctx)
         * engine.h, much of this would be simplified if each area of code
         * provided its own "summary" structure of all related callbacks. It
         * would also increase opaqueness. */
+       fns.static_state = ENGINE_get_static_state();
        fns.err_fns = ERR_get_implementation();
        fns.ex_data_fns = CRYPTO_get_ex_data_implementation();
        CRYPTO_get_mem_functions(&fns.mem_fns.malloc_cb,