[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r5277 - in trunk: softHSM/m4 softHSM/src/lib utils/m4

Rickard Bellgrim rickard at opendnssec.org
Fri Jul 1 14:53:59 CEST 2011


Author: rb
Date: 2011-07-01 14:53:59 +0200 (Fri, 01 Jul 2011)
New Revision: 5277

Modified:
   trunk/softHSM/m4/acx_botan.m4
   trunk/softHSM/src/lib/main.cpp
   trunk/utils/m4/acx_botan.m4
Log:
Some versions of Botan cannot reuse the PK_Signer object


Modified: trunk/softHSM/m4/acx_botan.m4
===================================================================
--- trunk/softHSM/m4/acx_botan.m4	2011-07-01 08:44:37 UTC (rev 5276)
+++ trunk/softHSM/m4/acx_botan.m4	2011-07-01 12:53:59 UTC (rev 5277)
@@ -118,6 +118,25 @@
 				[Fixes an API change within Botan]
 			)]
 		)
+		AC_LINK_IFELSE(
+			[AC_LANG_PROGRAM([#include <botan/init.h>
+				#include <botan/version.h>],
+				[using namespace Botan;
+				LibraryInitializer::initialize();
+				#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,8,12)
+				#error "Old API";
+				#endif
+				#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,9,11) && BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,0)
+				#error "Old API";
+				#endif])],
+			[AC_MSG_RESULT([checking for Botan PK_Signer reuse ... yes])],
+			[AC_MSG_RESULT([checking for Botan PK_Signer reuse ... no])
+			AC_DEFINE_UNQUOTED(
+				[BOTAN_NO_PK_SIGNER_REUSE],
+				[1],
+				[A bug in Botan prevents reuse of PK_Signer]
+			)]
+		)
 	fi
 	AC_LANG_POP([C++])
 

Modified: trunk/softHSM/src/lib/main.cpp
===================================================================
--- trunk/softHSM/src/lib/main.cpp	2011-07-01 08:44:37 UTC (rev 5276)
+++ trunk/softHSM/src/lib/main.cpp	2011-07-01 12:53:59 UTC (rev 5277)
@@ -1569,8 +1569,11 @@
     return CKR_ARGUMENTS_BAD;
   }
 
+#ifndef BOTAN_NO_PK_SIGNER_REUSE
   // Check if we cannot reuse the old PK_Signer
   if(!session->pkSigner || session->signMech != pMechanism->mechanism || session->signKey != hKey) {
+#endif
+
     if(session->pkSigner) {
       delete session->pkSigner;
       session->pkSigner = NULL;
@@ -1681,7 +1684,10 @@
 
     session->signMech = pMechanism->mechanism;
     session->signKey = hKey;
+
+#ifndef BOTAN_NO_PK_SIGNER_REUSE
   }
+#endif
 
   session->signInitialized = true;
 

Modified: trunk/utils/m4/acx_botan.m4
===================================================================
--- trunk/utils/m4/acx_botan.m4	2011-07-01 08:44:37 UTC (rev 5276)
+++ trunk/utils/m4/acx_botan.m4	2011-07-01 12:53:59 UTC (rev 5277)
@@ -118,6 +118,25 @@
 				[Fixes an API change within Botan]
 			)]
 		)
+		AC_LINK_IFELSE(
+			[AC_LANG_PROGRAM([#include <botan/init.h>
+				#include <botan/version.h>],
+				[using namespace Botan;
+				LibraryInitializer::initialize();
+				#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,8,12)
+				#error "Old API";
+				#endif
+				#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,9,11) && BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,0)
+				#error "Old API";
+				#endif])],
+			[AC_MSG_RESULT([checking for Botan PK_Signer reuse ... yes])],
+			[AC_MSG_RESULT([checking for Botan PK_Signer reuse ... no])
+			AC_DEFINE_UNQUOTED(
+				[BOTAN_NO_PK_SIGNER_REUSE],
+				[1],
+				[A bug in Botan prevents reuse of PK_Signer]
+			)]
+		)
 	fi
 	AC_LANG_POP([C++])
 




More information about the Opendnssec-commits mailing list