[Opendnssec-user] botan1.8 fix for segfault (correct)

Ondřej Surý ondrej at sury.org
Sat Jan 23 08:26:39 UTC 2010


On Fri, Jan 22, 2010 at 21:00, Jack Lloyd <lloyd at randombit.net> wrote:
> On Fri, Jan 22, 2010 at 02:59:48PM -0500, Jack Lloyd wrote:
>> Can you try this version, attached?
>
> Argh. Now attached.

Works. Thanks a lot for speed.

root at howl:~/softhsm-1.1.2/checks# ./checks -f
Checking C_GenerateKeyPair, C_DestroyObject, and C_CreateObject: OK
root at howl:~/softhsm-1.1.2/checks# ./checks -z
Checking C_Initialize and C_Finalize: OK
Checking C_GetInfo, C_GetFunctionList, C_GetSlotList, C_GetSlotInfo,
C_GetTokenInfo, C_GetMechanismList, C_GetMechanismInfo: OK
Checking C_OpenSession, C_CloseSession, C_CloseAllSessions, and
C_GetSessionInfo: OK
Checking C_Login and C_Logout: OK
Checking C_SeedRandom and C_GenerateRandom: OK
Checking C_GenerateKeyPair, C_DestroyObject, and C_CreateObject: OK
Checking C_GetAttributeValue, C_SetAttributeValue, C_FindObjectsInit,
C_FindObjects, and C_FindObjectsFinal: OK
Checking C_DigestInit, C_Digest, C_DigestUpdate, and C_DigestFinal: OK
Checking C_SignInit, C_Sign, C_SignUpdate, and C_SignFinal: OK
Checking C_VerifyInit, C_Verify, C_VerifyUpdate, and C_VerifyFinal: OK

I'm going to upload botan 1.8.8-2 to debian unstable, and build depend
softhsm on this version.

Ondrej
-- 
Ondřej Surý <ondrej at sury.org>
http://blog.rfc1925.org/
-------------- next part --------------
#
# old_revision [7fac653e942e8af70d705de6647d934761884b4a]
#
# patch "src/engine/gnump/eng_gmp.h"
#  from [ea4f6fec7a484240ceaef4978d19cb34032f3deb]
#    to [af0120eef40798f812091047dcbe18eb649e3cc5]
# 
# patch "src/engine/gnump/gmp_mem.cpp"
#  from [3c12c09a9ce0217087ebcd7694e16f49c367048f]
#    to [ce6d1e98edf81b5b67e5c4826f4c5a16759b468b]
#
============================================================
--- src/engine/gnump/eng_gmp.h	ea4f6fec7a484240ceaef4978d19cb34032f3deb
+++ src/engine/gnump/eng_gmp.h	af0120eef40798f812091047dcbe18eb649e3cc5
@@ -48,8 +48,7 @@ class BOTAN_DLL GMP_Engine : public Engi
                                      Power_Mod::Usage_Hints) const;
 
       GMP_Engine();
-   private:
-      static void set_memory_hooks();
+      ~GMP_Engine();
    };
 
 }
============================================================
--- src/engine/gnump/gmp_mem.cpp	3c12c09a9ce0217087ebcd7694e16f49c367048f
+++ src/engine/gnump/gmp_mem.cpp	ce6d1e98edf81b5b67e5c4826f4c5a16759b468b
@@ -48,9 +48,9 @@ void gmp_free(void* ptr, size_t n)
 }
 
 /*
-* Set the GNU MP memory functions
+* GMP_Engine Constructor
 */
-void GMP_Engine::set_memory_hooks()
+GMP_Engine::GMP_Engine()
    {
    if(gmp_alloc == 0)
       {
@@ -59,12 +59,10 @@ void GMP_Engine::set_memory_hooks()
       }
    }
 
-/*
-* GMP_Engine Constructor
-*/
-GMP_Engine::GMP_Engine()
+GMP_Engine::~GMP_Engine()
    {
-   set_memory_hooks();
+   mp_set_memory_functions(NULL, NULL, NULL);
+   gmp_alloc = 0;
    }
 
 }


More information about the Opendnssec-user mailing list