ofs | hex dump | ascii |
---|
0000 | 2d 2d 54 45 53 54 2d 2d 0a 62 75 67 20 23 33 37 35 39 35 20 28 6d 63 72 79 70 74 5f 67 65 6e 65 | --TEST--.bug.#37595.(mcrypt_gene |
0020 | 72 69 63 20 63 61 6c 63 75 6c 61 74 65 73 20 64 61 74 61 20 6c 65 6e 67 74 68 20 69 6e 20 77 72 | ric.calculates.data.length.in.wr |
0040 | 6f 6e 67 20 77 61 79 29 0a 2d 2d 46 49 4c 45 2d 2d 0a 3c 3f 70 68 70 0a 0a 24 63 69 70 68 65 72 | ong.way).--FILE--.<?php..$cipher |
0060 | 5f 61 6c 67 20 3d 20 4d 43 52 59 50 54 5f 42 4c 4f 57 46 49 53 48 3b 0a 24 73 6b 65 79 20 3d 20 | _alg.=.MCRYPT_BLOWFISH;.$skey.=. |
0080 | 61 72 72 61 79 28 30 2c 31 2c 32 2c 33 2c 34 2c 35 2c 36 2c 37 2c 38 2c 39 2c 31 30 2c 31 31 2c | array(0,1,2,3,4,5,6,7,8,9,10,11, |
00a0 | 31 32 2c 31 33 2c 31 34 2c 31 35 29 3b 0a 24 6b 65 79 3d 27 27 3b 0a 66 6f 72 65 61 63 68 28 24 | 12,13,14,15);.$key='';.foreach($ |
00c0 | 73 6b 65 79 20 61 73 20 24 74 29 20 7b 0a 09 20 20 20 20 24 6b 65 79 20 2e 3d 20 63 68 72 28 24 | skey.as.$t).{......$key..=.chr($ |
00e0 | 74 29 3b 0a 09 09 7d 0a 20 0a 24 73 73 74 72 20 3d 20 61 72 72 61 79 28 31 2c 32 2c 33 2c 34 2c | t);...}...$sstr.=.array(1,2,3,4, |
0100 | 35 2c 36 2c 37 2c 38 29 3b 0a 24 69 76 3d 27 27 3b 0a 66 6f 72 65 61 63 68 28 24 73 73 74 72 20 | 5,6,7,8);.$iv='';.foreach($sstr. |
0120 | 61 73 20 24 73 29 20 7b 0a 20 20 20 20 24 69 76 20 2e 3d 20 63 68 72 28 24 73 29 3b 0a 7d 0a 20 | as.$s).{.....$iv..=.chr($s);.}.. |
0140 | 0a 24 73 74 72 20 3d 20 22 31 32 33 34 35 36 37 38 22 3b 0a 20 0a 24 74 64 20 3d 20 6d 63 72 79 | .$str.=."12345678";...$td.=.mcry |
0160 | 70 74 5f 6d 6f 64 75 6c 65 5f 6f 70 65 6e 28 4d 43 52 59 50 54 5f 42 4c 4f 57 46 49 53 48 2c 27 | pt_module_open(MCRYPT_BLOWFISH,' |
0180 | 27 2c 4d 43 52 59 50 54 5f 4d 4f 44 45 5f 43 42 43 2c 27 27 29 3b 0a 20 0a 24 64 61 74 61 20 3d | ',MCRYPT_MODE_CBC,'');...$data.= |
01a0 | 20 41 72 72 61 79 28 0a 09 27 31 32 33 34 35 36 37 38 27 2c 0a 09 27 31 32 33 34 35 36 37 38 39 | .Array(..'12345678',..'123456789 |
01c0 | 27 2c 0a 09 22 5c 78 30 30 31 32 33 34 35 36 37 22 2c 0a 09 27 27 2c 0a 09 27 31 32 33 34 35 36 | ',.."\x001234567",..'',..'123456 |
01e0 | 37 38 31 32 33 34 35 36 37 38 27 2c 0a 09 27 31 32 33 34 35 36 37 38 31 32 33 34 35 36 37 38 39 | 7812345678',..'12345678123456789 |
0200 | 27 0a 09 29 3b 0a 0a 66 6f 72 65 61 63 68 20 28 24 64 61 74 61 20 61 73 20 24 76 61 6c 29 20 7b | '..);..foreach.($data.as.$val).{ |
0220 | 0a 09 6d 63 72 79 70 74 5f 67 65 6e 65 72 69 63 5f 69 6e 69 74 28 24 74 64 2c 20 24 6b 65 79 2c | ..mcrypt_generic_init($td,.$key, |
0240 | 20 24 69 76 29 3b 0a 09 24 65 6e 63 20 3d 20 6d 63 72 79 70 74 5f 67 65 6e 65 72 69 63 28 24 74 | .$iv);..$enc.=.mcrypt_generic($t |
0260 | 64 2c 20 24 76 61 6c 29 3b 0a 09 0a 09 6d 63 72 79 70 74 5f 67 65 6e 65 72 69 63 5f 64 65 69 6e | d,.$val);....mcrypt_generic_dein |
0280 | 69 74 28 24 74 64 29 3b 0a 09 0a 09 6d 63 72 79 70 74 5f 67 65 6e 65 72 69 63 5f 69 6e 69 74 28 | it($td);....mcrypt_generic_init( |
02a0 | 24 74 64 2c 20 24 6b 65 79 2c 20 24 69 76 29 3b 0a 09 76 61 72 5f 64 75 6d 70 28 24 64 65 63 20 | $td,.$key,.$iv);..var_dump($dec. |
02c0 | 3d 20 40 6d 64 65 63 72 79 70 74 5f 67 65 6e 65 72 69 63 28 24 74 64 2c 20 24 65 6e 63 29 29 3b | =.@mdecrypt_generic($td,.$enc)); |
02e0 | 0a 7d 0a 0a 6d 63 72 79 70 74 5f 6d 6f 64 75 6c 65 5f 63 6c 6f 73 65 28 24 74 64 29 3b 0a 0a 65 | .}..mcrypt_module_close($td);..e |
0300 | 63 68 6f 20 22 44 6f 6e 65 5c 6e 22 3b 0a 3f 3e 0a 2d 2d 45 58 50 45 43 54 46 2d 2d 09 0a 73 74 | cho."Done\n";.?>.--EXPECTF--..st |
0320 | 72 69 6e 67 28 38 29 20 22 31 32 33 34 35 36 37 38 22 0a 73 74 72 69 6e 67 28 31 36 29 20 22 31 | ring(8)."12345678".string(16)."1 |
0340 | 32 33 34 35 36 37 38 39 00 00 00 00 00 00 00 22 0a 73 74 72 69 6e 67 28 38 29 20 22 00 31 32 33 | 23456789.......".string(8).".123 |
0360 | 34 35 36 37 22 0a 0a 57 61 72 6e 69 6e 67 3a 20 6d 63 72 79 70 74 5f 67 65 6e 65 72 69 63 28 29 | 4567"..Warning:.mcrypt_generic() |
0380 | 3a 20 41 6e 20 65 6d 70 74 79 20 73 74 72 69 6e 67 20 77 61 73 20 70 61 73 73 65 64 20 69 6e 20 | :.An.empty.string.was.passed.in. |
03a0 | 25 73 20 6f 6e 20 6c 69 6e 65 20 25 64 0a 62 6f 6f 6c 28 66 61 6c 73 65 29 0a 73 74 72 69 6e 67 | %s.on.line.%d.bool(false).string |
03c0 | 28 31 36 29 20 22 31 32 33 34 35 36 37 38 31 32 33 34 35 36 37 38 22 0a 73 74 72 69 6e 67 28 32 | (16)."1234567812345678".string(2 |
03e0 | 34 29 20 22 31 32 33 34 35 36 37 38 31 32 33 34 35 36 37 38 39 00 00 00 00 00 00 00 22 0a 44 6f | 4)."12345678123456789.......".Do |
0400 | 6e 65 0a | ne. |