Date: Friday, April 6, 2018 @ 22:41:41
  Author: arojas
Revision: 321277

Fix memleak in botan2 patch

Modified:
  qca/trunk/PKGBUILD
  qca/trunk/qca-botan2.patch

------------------+
 PKGBUILD         |    4 ++--
 qca-botan2.patch |   20 +++++++++++---------
 2 files changed, 13 insertions(+), 11 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2018-04-06 21:04:00 UTC (rev 321276)
+++ PKGBUILD    2018-04-06 22:41:41 UTC (rev 321277)
@@ -6,7 +6,7 @@
 pkgbase=qca
 pkgname=(qca-qt4 qca-qt5)
 pkgver=2.1.3
-pkgrel=7
+pkgrel=8
 pkgdesc="Qt Cryptographic Architecture"
 arch=(x86_64)
 url="http://delta.affinix.com/qca/";
@@ -15,7 +15,7 @@
 
source=("http://download.kde.org/stable/$pkgbase/$pkgver/src/$pkgbase-$pkgver.tar.xz";
 qca-openssl-1.1.patch qca-botan2.patch)
 sha256sums=('003fd86a32421057a03b18a8168db52e2940978f9db5ebbb6a08882f8ab1e353'
             'b1505bc313fd2f4e350cd4c94af69256c901afa419ae6700b208cb6e40e6926d'
-            'f5132f3bc1c5098a583311d73b93ceef1d0c353cd15d02703e142045bd3ae7ea')
+            '33369553e41ccfbd8b304cfb3e887ae8df56b0e1b3eec88cc32ddb07f98f6a4c')
 
 prepare() {
   mkdir -p build{4,5}

Modified: qca-botan2.patch
===================================================================
--- qca-botan2.patch    2018-04-06 21:04:00 UTC (rev 321276)
+++ qca-botan2.patch    2018-04-06 22:41:41 UTC (rev 321277)
@@ -36,7 +36,7 @@
  if (BOTAN_FOUND)
     if (NOT Botan_FIND_QUIETLY)
 diff --git a/plugins/qca-botan/qca-botan.cpp b/plugins/qca-botan/qca-botan.cpp
-index f387575..ab28e57 100644
+index f387575..92820a0 100644
 --- a/plugins/qca-botan/qca-botan.cpp
 +++ b/plugins/qca-botan/qca-botan.cpp
 @@ -23,13 +23,18 @@
@@ -168,7 +168,7 @@
                return makeKey(secret, salt, keyLength, *iterationCount);
        }
  
-@@ -304,7 +282,12 @@ public:
+@@ -304,7 +282,14 @@ public:
  
      int blockSize() const
      {
@@ -175,13 +175,15 @@
 +#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(2,0,0)
        return Botan::block_size_of(m_algoName);
 +#else
-+      if(const Botan::BlockCipher *bc = 
Botan::BlockCipher::create(m_algoName).release())
++      if(const std::unique_ptr<Botan::BlockCipher> bc = 
Botan::BlockCipher::create(m_algoName))
 +          return bc->block_size();
++        
++        throw Botan::Algorithm_Not_Found(m_algoName);
 +#endif
      }
  
      QCA::AuthTag tag() const
-@@ -337,23 +320,31 @@ public:
+@@ -337,23 +322,31 @@ public:
  
      QCA::KeyLength keyLength() const
      {
@@ -197,19 +199,19 @@
 +#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(2,0,0)
          if(const Botan::BlockCipher *bc = 
af.prototype_block_cipher(m_algoName))
 +#else
-+        if(const Botan::BlockCipher *bc = 
Botan::BlockCipher::create(m_algoName).release())
++        if(const std::unique_ptr<Botan::BlockCipher> bc = 
Botan::BlockCipher::create(m_algoName))
 +#endif
              kls = bc->key_spec();
 +#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(2,0,0)
          else if(const Botan::StreamCipher *sc = 
af.prototype_stream_cipher(m_algoName))
 +#else
-+        else if(const Botan::StreamCipher *sc = 
Botan::StreamCipher::create(m_algoName).release())
++        else if(const std::unique_ptr<Botan::StreamCipher> sc = 
Botan::StreamCipher::create(m_algoName))
 +#endif
              kls = sc->key_spec();
 +#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(2,0,0)
          else if(const Botan::MessageAuthenticationCode *mac = 
af.prototype_mac(m_algoName))
 +#else
-+        else if(const Botan::MessageAuthenticationCode *mac = 
Botan::MessageAuthenticationCode::create(m_algoName).release())
++        else if(const std::unique_ptr<Botan::MessageAuthenticationCode> mac = 
Botan::MessageAuthenticationCode::create(m_algoName))
 +#endif
              kls = mac->key_spec();
          return QCA::KeyLength( kls.minimum_keylength(),
@@ -219,7 +221,7 @@
      }
  
  
-@@ -379,7 +370,9 @@ class botanProvider : public QCA::Provider
+@@ -379,7 +372,9 @@ class botanProvider : public QCA::Provider
  public:
      void init()
      {
@@ -229,7 +231,7 @@
      }
  
      ~botanProvider()
-@@ -538,7 +531,9 @@ public:
+@@ -538,7 +533,9 @@ public:
            return 0;
      }
  private:

Reply via email to