As with RSA, which was modified recently, this change makes it possible to
[openssl.git] / engines / e_sureware.c
index 89f708661d2c5d057d64c418a581ec0d4713d9c5..cae8bf48565cb751edde54c9c3e78332b9449d3f 100644 (file)
 ====================================================================*/
 
 #include <stdio.h>
-#include "cryptlib.h"
+#include <string.h>
 #include <openssl/crypto.h>
 #include <openssl/pem.h>
 #include <openssl/dso.h>
-#include "eng_int.h"
-#include "engine.h"
 #include <openssl/engine.h>
 
 #ifndef OPENSSL_NO_HW
@@ -69,7 +67,7 @@
 #endif
 
 #define SUREWARE_LIB_NAME "sureware engine"
-#include "hw_sureware_err.c"
+#include "e_sureware_err.c"
 
 static int surewarehk_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)());
 static int surewarehk_destroy(ENGINE *e);
@@ -124,7 +122,8 @@ static RSA_METHOD surewarehk_rsa =
        0,      /* RSA flag*/
        NULL, 
        NULL, /* OpenSSL sign*/
-       NULL  /* OpenSSL verify*/
+       NULL, /* OpenSSL verify*/
+       NULL  /* keygen */
        };
 #endif
 
@@ -146,7 +145,8 @@ static DH_METHOD surewarehk_dh =
        NULL, /* init*/
        NULL, /* finish*/
        0,    /* flags*/
-       NULL 
+       NULL,
+       NULL
        };
 #endif
 
@@ -195,6 +195,8 @@ static DSA_METHOD surewarehk_dsa =
        NULL,/*finish*/
        0,
        NULL,
+       NULL,
+       NULL
        };
 #endif
 
@@ -278,7 +280,7 @@ static int bind_sureware(ENGINE *e)
        return 1;
 }
 
-#ifdef ENGINE_DYNAMIC_SUPPORT
+#ifndef OPENSSL_NO_DYNAMIC_ENGINE
 static int bind_helper(ENGINE *e, const char *id)
        {
        if(id && (strcmp(id, engine_sureware_id) != 0))
@@ -908,7 +910,7 @@ static int surewarehk_rsa_priv_dec(int flen,const unsigned char *from,unsigned c
 err:
        if (buf)
        {
-               memset(buf,0,tlen);
+               OPENSSL_cleanse(buf,tlen);
                OPENSSL_free(buf);
        }
        return ret;