[SCM] QCA2 OpenSSL plugin packaging branch, master, updated. debian/2.0.0-beta3-1-6-g547f6af
Modestas Vainius
modax at alioth.debian.org
Sat Jun 2 20:26:53 UTC 2012
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-std/qca2-plugin-ossl.git;a=commitdiff;h=547f6af
The following commit has been merged in the master branch:
commit 547f6afc1b3c136df2f4e44fb6ab08e44852ac81
Author: Modestas Vainius <modestas at vainius.eu>
Date: Sat Jun 2 23:24:19 2012 +0300
Backport random password generation support.
Patch: backport_r820011_random_support.diff
---
debian/changelog | 2 +
.../patches/backport_r820011_random_support.diff | 81 ++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 84 insertions(+), 0 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 71317e7..38dae3d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ qca2-plugin-ossl (2.0.0~beta3-2) UNRELEASED; urgency=low
[ Modestas Vainius ]
* Add myself to Uploaders.
* Bump Standards-Version to 3.9.3: no changes needed.
+ * Backport random password generation support.
+ Patch: backport_r820011_random_support.diff
-- Felix Geyer <debfx-pkg at fobos.de> Sun, 23 Oct 2011 16:23:35 +0200
diff --git a/debian/patches/backport_r820011_random_support.diff b/debian/patches/backport_r820011_random_support.diff
new file mode 100644
index 0000000..a9d1926
--- /dev/null
+++ b/debian/patches/backport_r820011_random_support.diff
@@ -0,0 +1,81 @@
+Author: Justin Karneges <infiniti at affinix.com>
+Description: patch from Michael Leupold for random support
+Origin: backport, svn diff -c 820011 svn://anonsvn.kde.org/home/kde
+Last-Update: 2008-06-12
+
+--- a/qca-ossl.cpp
++++ b/qca-ossl.cpp
+@@ -6708,6 +6708,34 @@ public:
+ }
+ };
+
++class opensslRandomContext : public RandomContext
++{
++public:
++ opensslRandomContext(QCA::Provider *p) : RandomContext(p)
++ {
++ }
++
++ Context *clone() const
++ {
++ return new opensslRandomContext(*this);
++ }
++
++ QCA::SecureArray nextBytes(int size)
++ {
++ QCA::SecureArray buf(size);
++ int r;
++ // FIXME: loop while we don't have enough random bytes.
++ while (true) {
++ r = RAND_bytes((unsigned char*)(buf.data()), size);
++ if (r == 1) break; // success
++ r = RAND_pseudo_bytes((unsigned char*)(buf.data()),
++ size);
++ if (r >= 0) break; // accept insecure random numbers
++ }
++ return buf;
++ }
++};
++
+ }
+
+ using namespace opensslQCAPlugin;
+@@ -6727,11 +6755,14 @@ public:
+ OpenSSL_add_all_algorithms();
+ ERR_load_crypto_strings();
+
+- srand(time(NULL));
+- char buf[128];
+- for(int n = 0; n < 128; ++n)
+- buf[n] = rand();
+- RAND_seed(buf, 128);
++ // seed the RNG if it's not seeded yet
++ if (RAND_status() == 0) {
++ qsrand(time(NULL));
++ char buf[128];
++ for(int n = 0; n < 128; ++n)
++ buf[n] = qrand();
++ RAND_seed(buf, 128);
++ }
+
+ openssl_initted = true;
+ }
+@@ -6770,6 +6801,7 @@ public:
+ QStringList features() const
+ {
+ QStringList list;
++ list += "random";
+ list += all_hash_types();
+ list += all_mac_types();
+ list += all_cipher_types();
+@@ -6798,7 +6830,9 @@ public:
+ Context *createContext(const QString &type)
+ {
+ //OpenSSL_add_all_digests();
+- if ( type == "info" )
++ if ( type == "random" )
++ return new opensslRandomContext(this);
++ else if ( type == "info" )
+ return new opensslInfoContext(this);
+ else if ( type == "sha1" )
+ return new opensslHashContext( EVP_sha1(), this, type);
diff --git a/debian/patches/series b/debian/patches/series
index a15b674..79341b8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
remove_whirlpool_algo.diff
detect_md2_available.diff
detect_ssl2_available.diff
+backport_r820011_random_support.diff
--
QCA2 OpenSSL plugin packaging
More information about the pkg-kde-commits
mailing list