Module Name:    src
Committed By:   manu
Date:           Mon Feb  4 01:44:47 UTC 2013

Modified Files:
        src/crypto/external/bsd/openssl/dist/engines/ccgost: gost_eng.c

Log Message:
Pull multiple free bua fix from upstream:
http://git.openssl.org/gitweb/?p=openssl.git;a=patch;h=d21bf10dea6588b632a65b4fe594e04f288aad83;hp=d47c01a31a67ff4370b1883a58cabd0279752bb4

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.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
    src/crypto/external/bsd/openssl/dist/engines/ccgost/gost_eng.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/openssl/dist/engines/ccgost/gost_eng.c
diff -u src/crypto/external/bsd/openssl/dist/engines/ccgost/gost_eng.c:1.1.1.1 src/crypto/external/bsd/openssl/dist/engines/ccgost/gost_eng.c:1.2
--- src/crypto/external/bsd/openssl/dist/engines/ccgost/gost_eng.c:1.1.1.1	Sun Jul 19 23:05:34 2009
+++ src/crypto/external/bsd/openssl/dist/engines/ccgost/gost_eng.c	Mon Feb  4 01:44:47 2013
@@ -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);

Reply via email to