Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssl/dist/engines/ccgost Pull multipl...



details:   https://anonhg.NetBSD.org/src/rev/94135e436407
branches:  trunk
changeset: 784623:94135e436407
user:      manu <manu%NetBSD.org@localhost>
date:      Mon Feb 04 01:44:47 2013 +0000

description:
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.

diffstat:

 crypto/external/bsd/openssl/dist/engines/ccgost/gost_eng.c |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r e022e2085e14 -r 94135e436407 crypto/external/bsd/openssl/dist/engines/ccgost/gost_eng.c
--- a/crypto/external/bsd/openssl/dist/engines/ccgost/gost_eng.c        Mon Feb 04 01:22:14 2013 +0000
+++ b/crypto/external/bsd/openssl/dist/engines/ccgost/gost_eng.c        Mon Feb 04 01:44:47 2013 +0000
@@ -64,6 +64,13 @@
 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 @@
        
 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);



Home | Main Index | Thread Index | Old Index