]> git.pld-linux.org Git - packages/php-pecl-libsodium.git/blame - libsodium-pr70.patch
new, version 1.0.2
[packages/php-pecl-libsodium.git] / libsodium-pr70.patch
CommitLineData
9ce6e03e
ER
1From ca45bd4a55541d58136c21b38b9b90e750fedfbc Mon Sep 17 00:00:00 2001
2From: Remi Collet <fedora@famillecollet.com>
3Date: Mon, 30 Nov 2015 18:31:42 +0100
4Subject: [PATCH] fix test
5
6---
7 tests/crypto_auth.phpt | 12 ++++--------
8 1 file changed, 4 insertions(+), 8 deletions(-)
9
10diff --git a/tests/crypto_auth.phpt b/tests/crypto_auth.phpt
11index c72451e..76f30eb 100644
12--- a/tests/crypto_auth.phpt
13+++ b/tests/crypto_auth.phpt
14@@ -18,13 +18,9 @@ var_dump(\Sodium\crypto_auth_verify($mac, $badmsg, $key));
15
16 // Let's flip a bit pseudo-randomly
17 $badmsg = $msg;
18-$badmsg[mt_rand(0, 999)] = \chr(
19- \ord($msg[0]) ^ (
20- // Mask out higher bits (thus 256 => 0)
21- 0xFF & (
22- // 1, 2, 4, 8, 16, 32, 64, 128, 256
23- 1 << mt_rand(0, 8)
24- )
25+$badmsg[$i=mt_rand(0, 999)] = \chr(
26+ \ord($msg[$i]) ^ (
27+ 1 << mt_rand(0, 7)
28 )
29 );
30
31@@ -32,7 +28,7 @@ var_dump(\Sodium\crypto_auth_verify($mac, $badmsg, $key));
32
33 // Now let's change a bit in the MAC
34 $badmac = $mac;
35-$badmac[0] = \chr(\ord($badmsg[0]) ^ 0x80);
36+$badmac[0] = \chr(\ord($badmac[0]) ^ 0x80);
37 var_dump(\Sodium\crypto_auth_verify($badmac, $msg, $key));
38 ?>
39 --EXPECT--
This page took 0.051134 seconds and 4 git commands to generate.