Make the shared library name and function symbol for the "nuron" ENGINE
[openssl.git] / crypto / engine / hw_nuron.c
index b6242de444907814725ed1f4ac049d58f8f66b2c..b5e63906c96503846cb2f3df86fcda890a552b2d 100644 (file)
 #include <openssl/engine.h>
 
 
-#ifndef NO_HW
-#ifndef NO_HW_NURON
+#ifndef OPENSSL_NO_HW
+#ifndef OPENSSL_NO_HW_NURON
+
+static const char *NURON_LIBNAME = "nuronssl";
+static const char *NURON_F1 = "nuron_mod_exp";
 
 typedef int tfnModExp(BIGNUM *r,const BIGNUM *a,const BIGNUM *p,const BIGNUM *m);
 static tfnModExp *pfnModExp = NULL;
 
 static DSO *pvDSOHandle = NULL;
 
-static int nuron_init()
+static int nuron_init(ENGINE *e)
        {
        if(pvDSOHandle != NULL)
                {
@@ -80,7 +83,7 @@ static int nuron_init()
                return 0;
                }
 
-       pvDSOHandle=DSO_load(NULL,"nuronssl",NULL,
+       pvDSOHandle=DSO_load(NULL, NURON_LIBNAME, NULL,
                DSO_FLAG_NAME_TRANSLATION_EXT_ONLY);
        if(!pvDSOHandle)
                {
@@ -88,7 +91,7 @@ static int nuron_init()
                return 0;
                }
 
-       pfnModExp=(tfnModExp *)DSO_bind_func(pvDSOHandle,"nuron_mod_exp");
+       pfnModExp=(tfnModExp *)DSO_bind_func(pvDSOHandle, NURON_F1);
        if(!pfnModExp)
                {
                ENGINEerr(ENGINE_F_NURON_INIT,ENGINE_R_DSO_FUNCTION_NOT_FOUND);
@@ -98,7 +101,7 @@ static int nuron_init()
        return 1;
        }
 
-static int nuron_finish()
+static int nuron_finish(ENGINE *e)
        {
        if(pvDSOHandle == NULL)
                {
@@ -282,5 +285,5 @@ ENGINE *ENGINE_nuron()
        return &engine_nuron;
        }
 
-#endif /* !NO_HW_NURON */
-#endif /* !NO_HW */
+#endif /* !OPENSSL_NO_HW_NURON */
+#endif /* !OPENSSL_NO_HW */