aboutsummaryrefslogtreecommitdiffstats
path: root/engines/ccgost
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2012-09-01 11:30:53 +0000
committerDr. Stephen Henson <steve@openssl.org>2012-09-01 11:30:53 +0000
commitd21bf10dea6588b632a65b4fe594e04f288aad83 (patch)
tree6000e47b0d4e81d22cc94d8775c921af4146118f /engines/ccgost
parentd47c01a31a67ff4370b1883a58cabd0279752bb4 (diff)
downloadopenssl-d21bf10dea6588b632a65b4fe594e04f288aad83.tar.gz
Don't load GOST ENGINE if it is already loaded.
Multiple copies of the ENGINE will cause problems when it is cleaned up as the methods are stored in static structures which will be overwritten and freed up more than once. Set static methods to NULL when the ENGINE is freed so it can be reloaded.
Diffstat (limited to 'engines/ccgost')
-rw-r--r--engines/ccgost/gost_eng.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/ccgost/gost_eng.c b/engines/ccgost/gost_eng.c
index d2cbe3b831..ebf0b625b5 100644
--- a/engines/ccgost/gost_eng.c
+++ b/engines/ccgost/gost_eng.c
@@ -64,6 +64,13 @@ static int gost_engine_finish(ENGINE *e)
static int gost_engine_destroy(ENGINE *e)
{
gost_param_free();
+
+ pmeth_GostR3410_94 = NULL;
+ pmeth_GostR3410_2001 = NULL;
+ pmeth_Gost28147_MAC = NULL;
+ ameth_GostR3410_94 = NULL;
+ ameth_GostR3410_2001 = NULL;
+ ameth_Gost28147_MAC = NULL;
return 1;
}
@@ -263,7 +270,10 @@ static ENGINE *engine_gost(void)
void ENGINE_load_gost(void)
{
- ENGINE *toadd =engine_gost();
+ ENGINE *toadd;
+ if (pmeth_GostR3410_94)
+ return;
+ toadd = engine_gost();
if (!toadd) return;
ENGINE_add(toadd);
ENGINE_free(toadd);