@@ -38,23 +38,7 @@ protected function _getRandomString($length)
38
38
protected function _requireCipherInfo ()
39
39
{
40
40
$ filename = __DIR__ . '/Crypt/_files/_cipher_info.php ' ;
41
- /* Generate allowed sizes for encryption key and init vector
42
- $data = array();
43
- foreach ($this->_supportedCiphers as $cipher) {
44
- if (!array_key_exists($cipher, $data)) {
45
- $data[$cipher] = array();
46
- }
47
- foreach ($this->_supportedModes as $mode) {
48
- $cipherHandle = mcrypt_module_open($cipher, '', $mode, '');
49
- $data[$cipher][$mode] = array(
50
- 'key_size' => mcrypt_enc_get_key_size($cipherHandle),
51
- 'iv_size' => mcrypt_enc_get_iv_size($cipherHandle),
52
- );
53
- mcrypt_module_close($cipherHandle);
54
- }
55
- }
56
- file_put_contents($filename, '<?php return ' . var_export($data, true) . ";\n", LOCK_EX);
57
- */
41
+
58
42
if (!self ::$ _cipherInfo ) {
59
43
self ::$ _cipherInfo = include $ filename ;
60
44
}
@@ -138,27 +122,7 @@ public function testConstructorDefaults()
138
122
public function getCryptData ()
139
123
{
140
124
$ fixturesFilename = __DIR__ . '/Crypt/_files/_crypt_fixtures.php ' ;
141
- /* Generate fixtures
142
- $fixtures = array();
143
- foreach (array('', 'Hello world!!!') as $inputString) {
144
- foreach ($this->_supportedCiphers as $cipher) {
145
- foreach ($this->_supportedModes as $mode) {
146
- $randomKey = $this->_getRandomString($this->_getKeySize($cipher, $mode));
147
- $randomInitVector = $this->_getRandomString($this->_getInitVectorSize($cipher, $mode));
148
- $crypt = new \Magento\Framework\Encryption\Crypt($randomKey, $cipher, $mode, $randomInitVector);
149
- $fixtures[] = array(
150
- $randomKey, // Encryption key
151
- $cipher,
152
- $mode,
153
- $randomInitVector, // Init vector
154
- $inputString, // String to encrypt
155
- base64_encode($crypt->encrypt($inputString)) // Store result of encryption as base64
156
- );
157
- }
158
- }
159
- }
160
- file_put_contents($fixturesFilename, '<?php return ' . var_export($fixtures, true) . ";\n", LOCK_EX);
161
- */
125
+
162
126
$ result = include $ fixturesFilename ;
163
127
/* Restore encoded string back to binary */
164
128
foreach ($ result as &$ cryptParams ) {
0 commit comments