aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Laurie <ben@links.org>2016-04-16 05:37:04 +0100
committerBen Laurie <ben@links.org>2016-04-18 10:21:56 +0100
commita97d19d9e534fe69d6eb6c6413d1217d39032604 (patch)
tree5aff2e656bc41a3f1b1107000f85d09198438b70
parent913954768f4b25b93a89299d03b45611bbdd85b8 (diff)
downloadopenssl-a97d19d9e534fe69d6eb6c6413d1217d39032604.tar.gz
Free methods on destroy.
Reviewed-by: Matt Caswell <matt@openssl.org>
-rw-r--r--crypto/engine/eng_cryptodev.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c
index bdc49ed8a8..195912348c 100644
--- a/crypto/engine/eng_cryptodev.c
+++ b/crypto/engine/eng_cryptodev.c
@@ -84,9 +84,13 @@ struct dev_crypto_state {
static u_int32_t cryptodev_asymfeat = 0;
+static RSA_METHOD *cryptodev_rsa;
#ifndef OPENSSL_NO_DSA
static DSA_METHOD *cryptodev_dsa = NULL;
#endif
+#ifndef OPENSSL_NO_DH
+static DH_METHOD *cryptodev_dh;
+#endif
static int get_asym_dev_crypto(void);
static int open_dev_crypto(void);
@@ -1176,10 +1180,16 @@ static int cryptodev_engine_destroy(ENGINE *e)
EVP_MD_meth_free(md5_md);
md5_md = NULL;
# endif
+ RSA_meth_free(cryptodev_rsa);
+ cryptodev_rsa = NULL;
#ifndef OPENSSL_NO_DSA
DSA_meth_free(cryptodev_dsa);
cryptodev_dsa = NULL;
#endif
+#ifndef OPENSSL_NO_DH
+ DH_meth_free(cryptodev_dh);
+ cryptodev_dh = NULL;
+#endif
return 1;
}
@@ -1392,8 +1402,6 @@ cryptodev_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
return (ret);
}
-static RSA_METHOD *cryptodev_rsa;
-
#ifndef OPENSSL_NO_DSA
static int
cryptodev_dsa_bn_mod_exp(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
@@ -1597,8 +1605,6 @@ cryptodev_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
return (dhret);
}
-static DH_METHOD *cryptodev_dh;
-
#endif /* ndef OPENSSL_NO_DH */
/*