clear dso pointer in case of an error
[openssl.git] / engines / e_aep.c
index aa4fe7570483686736d5431a52782d9aa3b268fd..c175a186e98a2a4db12638c83db3f8575c016375 100644 (file)
@@ -1,6 +1,3 @@
-/* crypto/engine/hw_aep.c */
-/*
- */
 /* ====================================================================
  * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
  *
@@ -72,6 +69,10 @@ typedef int pid_t;
 #include <openssl/dso.h>
 #include <openssl/engine.h>
 #include <openssl/buffer.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
+#include <openssl/dh.h>
+#include <openssl/bn.h>
 
 #ifndef OPENSSL_NO_HW
 #ifndef OPENSSL_NO_HW_AEP
@@ -478,6 +479,7 @@ static int aep_init(ENGINE *e)
 
        if(aep_dso)
                DSO_free(aep_dso);
+       aep_dso = NULL;
                
        p_AEP_OpenConnection    = NULL;
        p_AEP_ModExp            = NULL;
@@ -619,7 +621,7 @@ static int aep_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
        rv = aep_return_connection(hConnection);
        if (rv != AEP_R_OK)
                {
-               AEPHKerr(AEPHK_F_AEP_RAND,AEPHK_R_RETURN_CONNECTION_FAILED); 
+               AEPHKerr(AEPHK_F_AEP_MOD_EXP,AEPHK_R_RETURN_CONNECTION_FAILED); 
                goto err;
                }
 
@@ -657,7 +659,7 @@ static AEP_RV aep_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
        rv = aep_return_connection(hConnection);
        if (rv != AEP_R_OK)
                {
-               AEPHKerr(AEPHK_F_AEP_RAND,AEPHK_R_RETURN_CONNECTION_FAILED); 
+               AEPHKerr(AEPHK_F_AEP_MOD_EXP_CRT,AEPHK_R_RETURN_CONNECTION_FAILED); 
                goto err;
                }