free up gost ciphers
authorDr. Stephen Henson <steve@openssl.org>
Thu, 14 Jan 2016 22:13:37 +0000 (22:13 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 15 Jan 2016 22:38:09 +0000 (22:38 +0000)
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
engines/ccgost/gost_crypt.c
engines/ccgost/gost_eng.c
engines/ccgost/gost_lcl.h

index 9c6dcc53a095264b4f5aee438115e80bf350c37f..63009a23d14d32bcc1b22161480711c8dd4891c7 100644 (file)
@@ -109,6 +109,14 @@ const EVP_CIPHER *cipher_gost_cpacnt(void)
     return _hidden_gost89_cnt;
 }
 
+void cipher_gost_destroy(void)
+{
+    EVP_CIPHER_meth_free(_hidden_Gost28147_89_cipher);
+    _hidden_Gost28147_89_cipher = NULL;
+    EVP_CIPHER_meth_free(_hidden_gost89_cnt);
+    _hidden_gost89_cnt = NULL;
+}
+
 /* Implementation of GOST 28147-89 in MAC (imitovstavka) mode */
 /* Init functions which set specific parameters */
 static int gost_imit_init_cpa(EVP_MD_CTX *ctx);
index bc43848b3784f42a54f2f4308486c43f4a9a40f8..38ed25ca30bfe1924bf721b134719267ecf04a5e 100644 (file)
@@ -77,6 +77,7 @@ static int gost_engine_finish(ENGINE *e)
 static int gost_engine_destroy(ENGINE *e)
 {
     digest_gost_destroy();
+    cipher_gost_destroy();
     imit_gost_cpa_destroy();
 
     gost_param_free();
index 895e2d66d781e4d565a3209458a3e3632f7a5ca1..61f657c833bd352246cc00d3fe2900bdf93e6936 100644 (file)
@@ -145,6 +145,7 @@ struct ossl_gost_digest_ctx {
 /* EVP_MD structure for GOST R 34.11 */
 EVP_MD *digest_gost(void);
 void digest_gost_destroy(void);
+void cipher_gost_destroy(void);
 /* EVP_MD structure for GOST 28147 in MAC mode */
 const EVP_MD *imit_gost_cpa(void);
 void imit_gost_cpa_destroy(void);