From 3994b3a26c252cba4070337b036e3a1c12c81369 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sat, 23 May 2015 03:42:11 -0400
Subject: [PATCH] Installer: Use openssl_random_pseudo_bytes() (if available) to generate des_key (#1490402)

---
 tests/Framework/Utils.php |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/tests/Framework/Utils.php b/tests/Framework/Utils.php
index b881cea..b9b99ff 100644
--- a/tests/Framework/Utils.php
+++ b/tests/Framework/Utils.php
@@ -419,4 +419,15 @@
             $this->assertSame($output, $result);
         }
     }
+
+    /**
+     * rcube:utils::random_bytes()
+     */
+    function test_random_bytes()
+    {
+        $this->assertSame(15, strlen(rcube_utils::random_bytes(15)));
+        $this->assertSame(1, strlen(rcube_utils::random_bytes(1)));
+        $this->assertSame(0, strlen(rcube_utils::random_bytes(0)));
+        $this->assertSame(0, strlen(rcube_utils::random_bytes(-1)));
+    }
 }

--
Gitblit v1.9.1