[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/qca/plugins/qca-botan
From:       Bernhard Rosenkraenzer <bero () arklinux ! org>
Date:       2009-12-04 16:02:12
Message-ID: 1259942532.233747.17675.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1058526 by bero:

Make it build with current versions of Botan
(tested 1.8.8)


 M  +11 -1     qca-botan.cpp  


--- trunk/kdesupport/qca/plugins/qca-botan/qca-botan.cpp #1058525:1058526
@@ -25,6 +25,9 @@
 #include <botan/botan.h>
 #include <botan/hmac.h>
 #include <botan/s2k.h>
+#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,8,0)
+#include <botan/algo_factory.h>
+#endif
 
 #include <stdlib.h>
 #include <iostream>
@@ -47,8 +50,11 @@
         QCA::SecureArray buf(size);
 #if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,5,0)
 	Botan::Global_RNG::randomize( (Botan::byte*)buf.data(), buf.size(), \
Botan::SessionKey ); +#elif BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,7,6)
+	Botan::Global_RNG::randomize( (Botan::byte*)buf.data(), buf.size() );
 #else
-	Botan::Global_RNG::randomize( (Botan::byte*)buf.data(), buf.size() );
+	Botan::AutoSeeded_RNG rng;
+	rng.randomize(reinterpret_cast<Botan::byte*>(buf.data()), buf.size());
 #endif
 	return buf;
     }
@@ -102,7 +108,11 @@
 public:
     BotanHMACContext( const QString &hashName, QCA::Provider *p, const QString \
&type) : QCA::MACContext(p, type)  {
+#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,8,0)
 	m_hashObj = new Botan::HMAC(hashName.toStdString());
+#else
+	m_hashObj = new Botan::HMAC(Botan::global_state().algorithm_factory().make_hash_function(hashName.toStdString()));
 +#endif
 	if (0 == m_hashObj) {
 	    std::cout << "null context object" << std::endl;
 	}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic