Skip to content

Commit a97d19d

Browse files
committedApr 18, 2016
Free methods on destroy.
Reviewed-by: Matt Caswell <[email protected]>
1 parent 9139547 commit a97d19d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed
 

‎crypto/engine/eng_cryptodev.c

+10-4
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,13 @@ struct dev_crypto_state {
8484

8585
static u_int32_t cryptodev_asymfeat = 0;
8686

87+
static RSA_METHOD *cryptodev_rsa;
8788
#ifndef OPENSSL_NO_DSA
8889
static DSA_METHOD *cryptodev_dsa = NULL;
8990
#endif
91+
#ifndef OPENSSL_NO_DH
92+
static DH_METHOD *cryptodev_dh;
93+
#endif
9094

9195
static int get_asym_dev_crypto(void);
9296
static int open_dev_crypto(void);
@@ -1176,9 +1180,15 @@ static int cryptodev_engine_destroy(ENGINE *e)
11761180
EVP_MD_meth_free(md5_md);
11771181
md5_md = NULL;
11781182
# endif
1183+
RSA_meth_free(cryptodev_rsa);
1184+
cryptodev_rsa = NULL;
11791185
#ifndef OPENSSL_NO_DSA
11801186
DSA_meth_free(cryptodev_dsa);
11811187
cryptodev_dsa = NULL;
1188+
#endif
1189+
#ifndef OPENSSL_NO_DH
1190+
DH_meth_free(cryptodev_dh);
1191+
cryptodev_dh = NULL;
11821192
#endif
11831193
return 1;
11841194
}
@@ -1392,8 +1402,6 @@ cryptodev_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
13921402
return (ret);
13931403
}
13941404

1395-
static RSA_METHOD *cryptodev_rsa;
1396-
13971405
#ifndef OPENSSL_NO_DSA
13981406
static int
13991407
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)
15971605
return (dhret);
15981606
}
15991607

1600-
static DH_METHOD *cryptodev_dh;
1601-
16021608
#endif /* ndef OPENSSL_NO_DH */
16031609

16041610
/*

0 commit comments

Comments
 (0)
Please sign in to comment.