summaryrefslogtreecommitdiff
path: root/ext/mcrypt/tests
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-08-19 10:22:38 +0200
committerOndřej Surý <ondrej@sury.org>2011-08-19 10:22:38 +0200
commitf452a2b3e4e4279b27594a8ddb66525442d59227 (patch)
treed05cb62c5515ada33076d3cc3e49b664733a478c /ext/mcrypt/tests
parent038ba12e8724d537040e88ec794354b0c063f0a6 (diff)
downloadphp-upstream/5.3.7.tar.gz
Imported Upstream version 5.3.7upstream/5.3.7
Diffstat (limited to 'ext/mcrypt/tests')
-rw-r--r--ext/mcrypt/tests/bug55169.phpt43
1 files changed, 43 insertions, 0 deletions
diff --git a/ext/mcrypt/tests/bug55169.phpt b/ext/mcrypt/tests/bug55169.phpt
new file mode 100644
index 000000000..7bddd5087
--- /dev/null
+++ b/ext/mcrypt/tests/bug55169.phpt
@@ -0,0 +1,43 @@
+--TEST--
+mcrypt_create_iv
+https://bugs.php.net/bug.php?id=55169
+--CREDIT--
+Ryan Biesemeyer <ryan@yaauie.com>
+--FILE--
+<?php
+for( $i=1; $i<=64; $i = $i*2 ){
+ echo 'Input: '. $i . PHP_EOL;
+ $random = mcrypt_create_iv( $i, MCRYPT_DEV_URANDOM );
+ echo ' Length: ' . strlen( $random ) . PHP_EOL;
+ echo ' Hex: '. bin2hex( $random ) . PHP_EOL;
+ echo PHP_EOL;
+}
+?>
+--EXPECTF--
+Input: 1
+ Length: 1
+ Hex: %x
+
+Input: 2
+ Length: 2
+ Hex: %x
+
+Input: 4
+ Length: 4
+ Hex: %x
+
+Input: 8
+ Length: 8
+ Hex: %x
+
+Input: 16
+ Length: 16
+ Hex: %x
+
+Input: 32
+ Length: 32
+ Hex: %x
+
+Input: 64
+ Length: 64
+ Hex: %x