X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=engines%2Fe_nuron.c;h=4c2537cbc30d6f7b97128aad0ac663efbd785574;hp=130b6d8b40571e40bdd034d80dc4d16e3974392a;hb=23a22b4cf72b0c2aadcd65001d4a28941d570547;hpb=5572f482e797a5f6eee34ef7f04a8defde7bdecf diff --git a/engines/e_nuron.c b/engines/e_nuron.c index 130b6d8b40..4c2537cbc3 100644 --- a/engines/e_nuron.c +++ b/engines/e_nuron.c @@ -57,17 +57,27 @@ */ #include +#include #include -#include "cryptlib.h" +#include #include #include - +#ifndef OPENSSL_NO_RSA +#include +#endif +#ifndef OPENSSL_NO_DSA +#include +#endif +#ifndef OPENSSL_NO_DH +#include +#endif +#include #ifndef OPENSSL_NO_HW #ifndef OPENSSL_NO_HW_NURON #define NURON_LIB_NAME "nuron engine" -#include "hw_nuron_err.c" +#include "e_nuron_err.c" static const char *NURON_LIBNAME = NULL; static const char *get_NURON_LIBNAME(void) @@ -155,7 +165,7 @@ static int nuron_finish(ENGINE *e) return 1; } -static int nuron_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)()) +static int nuron_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void)) { int initialised = ((pvDSOHandle == NULL) ? 0 : 1); switch(cmd) @@ -191,9 +201,9 @@ static int nuron_mod_exp(BIGNUM *r,const BIGNUM *a,const BIGNUM *p, } #ifndef OPENSSL_NO_RSA -static int nuron_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa) +static int nuron_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx) { - return nuron_mod_exp(r0,I,rsa->d,rsa->n,NULL); + return nuron_mod_exp(r0,I,rsa->d,rsa->n,ctx); } #endif @@ -238,11 +248,13 @@ static int nuron_mod_exp_dsa(DSA *dsa, BIGNUM *r, BIGNUM *a, #endif /* This function is aliased to mod_exp (with the mont stuff dropped). */ +#ifndef OPENSSL_NO_RSA static int nuron_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx) { return nuron_mod_exp(r, a, p, m, ctx); } +#endif #ifndef OPENSSL_NO_DH /* This function is aliased to mod_exp (with the dh and mont dropped). */ @@ -269,6 +281,7 @@ static RSA_METHOD nuron_rsa = 0, NULL, NULL, + NULL, NULL }; #endif @@ -285,7 +298,9 @@ static DSA_METHOD nuron_dsa = NULL, /* init */ NULL, /* finish */ 0, /* flags */ - NULL /* app_data */ + NULL, /* app_data */ + NULL, /* dsa_paramgen */ + NULL /* dsa_keygen */ }; #endif @@ -299,6 +314,7 @@ static DH_METHOD nuron_dh = NULL, NULL, 0, + NULL, NULL }; #endif @@ -374,6 +390,7 @@ static int bind_helper(ENGINE *e) return 1; } +#ifdef OPENSSL_NO_DYNAMIC_ENGINE static ENGINE *engine_nuron(void) { ENGINE *ret = ENGINE_new(); @@ -396,10 +413,11 @@ void ENGINE_load_nuron(void) ENGINE_free(toadd); ERR_clear_error(); } +#endif /* This stuff is needed if this ENGINE is being compiled into a self-contained * shared-library. */ -#ifdef ENGINE_DYNAMIC_SUPPORT +#ifndef OPENSSL_NO_DYNAMIC_ENGINE static int bind_fn(ENGINE *e, const char *id) { if(id && (strcmp(id, engine_nuron_id) != 0)) @@ -410,7 +428,7 @@ static int bind_fn(ENGINE *e, const char *id) } IMPLEMENT_DYNAMIC_CHECK_FN() IMPLEMENT_DYNAMIC_BIND_FN(bind_fn) -#endif /* ENGINE_DYNAMIC_SUPPORT */ +#endif /* OPENSSL_NO_DYNAMIC_ENGINE */ #endif /* !OPENSSL_NO_HW_NURON */ #endif /* !OPENSSL_NO_HW */