Skip to content

Commit cb0e7ce

Browse files
committed
Merge branch '2.3.0-qwerty-perf' of github.com:magento-performance/magento2ce into 2.3.0-qwerty-perf
2 parents b916bae + 1ac809f commit cb0e7ce

File tree

3 files changed

+11
-25
lines changed

3 files changed

+11
-25
lines changed

app/code/Magento/Config/App/Config/Type/System.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class System implements ConfigTypeInterface
7474
/**
7575
* @var \Magento\Framework\Filter\Encrypt\AdapterInterface
7676
*/
77-
private $encriptFilter;
77+
private $encryptorFilter;
7878

7979
/**
8080
* @param ConfigSourceInterface $source
@@ -108,7 +108,7 @@ public function __construct(
108108
$this->serializer = $serializer;
109109
$this->configType = $configType;
110110
$this->reader = $reader ?: ObjectManager::getInstance()->get(Reader::class);
111-
$this->encriptFilter = ObjectManager::getInstance()->get(\Magento\Framework\Encryption\Encryptor::class);
111+
$this->encryptorFilter = ObjectManager::getInstance()->get(\Magento\Framework\Encryption\Encryptor::class);
112112
}
113113

114114
/**
@@ -198,7 +198,7 @@ private function loadAllData()
198198
if ($cachedData === false) {
199199
$data = $this->readData();
200200
} else {
201-
$data = $this->serializer->unserialize($this->encriptFilter->decrypt($cachedData));
201+
$data = $this->serializer->unserialize($this->encryptorFilter->decrypt($cachedData));
202202
}
203203

204204
return $data;
@@ -218,7 +218,7 @@ private function loadDefaultScopeData($scopeType)
218218
$data = $this->readData();
219219
$this->cacheData($data);
220220
} else {
221-
$data = [$scopeType => $this->serializer->unserialize($this->encriptFilter->decrypt($cachedData))];
221+
$data = [$scopeType => $this->serializer->unserialize($this->encryptorFilter->decrypt($cachedData))];
222222
}
223223

224224
return $data;
@@ -239,7 +239,7 @@ private function loadScopeData($scopeType, $scopeId)
239239
if ($this->availableDataScopes === null) {
240240
$cachedScopeData = $this->cache->load($this->configType . '_scopes');
241241
if ($cachedScopeData !== false) {
242-
$serializedCachedData = $this->encriptFilter->decrypt($cachedScopeData);
242+
$serializedCachedData = $this->encryptorFilter->decrypt($cachedScopeData);
243243
$this->availableDataScopes = $this->serializer->unserialize($serializedCachedData);
244244
}
245245
}
@@ -249,7 +249,7 @@ private function loadScopeData($scopeType, $scopeId)
249249
$data = $this->readData();
250250
$this->cacheData($data);
251251
} else {
252-
$serializedCachedData = $this->encriptFilter->decrypt($cachedData);
252+
$serializedCachedData = $this->encryptorFilter->decrypt($cachedData);
253253
$data = [$scopeType => [$scopeId => $this->serializer->unserialize($serializedCachedData)]];
254254
}
255255

@@ -267,12 +267,12 @@ private function loadScopeData($scopeType, $scopeId)
267267
private function cacheData(array $data)
268268
{
269269
$this->cache->save(
270-
$this->encriptFilter->encryptWithFastestAlgorithm($this->serializer->serialize($data)),
270+
$this->encryptorFilter->encryptWithFastestAlgorithm($this->serializer->serialize($data)),
271271
$this->configType,
272272
[self::CACHE_TAG]
273273
);
274274
$this->cache->save(
275-
$this->encriptFilter->encryptWithFastestAlgorithm($this->serializer->serialize($data['default'])),
275+
$this->encryptorFilter->encryptWithFastestAlgorithm($this->serializer->serialize($data['default'])),
276276
$this->configType . '_default',
277277
[self::CACHE_TAG]
278278
);
@@ -281,14 +281,14 @@ private function cacheData(array $data)
281281
foreach ($data[$curScopeType] ?? [] as $curScopeId => $curScopeData) {
282282
$scopes[$curScopeType][$curScopeId] = 1;
283283
$this->cache->save(
284-
$this->encriptFilter->encryptWithFastestAlgorithm($this->serializer->serialize($curScopeData)),
284+
$this->encryptorFilter->encryptWithFastestAlgorithm($this->serializer->serialize($curScopeData)),
285285
$this->configType . '_' . $curScopeType . '_' . $curScopeId,
286286
[self::CACHE_TAG]
287287
);
288288
}
289289
}
290290
$this->cache->save(
291-
$this->encriptFilter->encryptWithFastestAlgorithm($this->serializer->serialize($scopes)),
291+
$this->encryptorFilter->encryptWithFastestAlgorithm($this->serializer->serialize($scopes)),
292292
$this->configType . '_scopes',
293293
[self::CACHE_TAG]
294294
);

dev/tests/integration/testsuite/Magento/EncryptionKey/Setup/Patch/Data/SodiumChachaPatchTest.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,6 @@ private function legacyEncrypt(string $data): string
9393
@mcrypt_module_close($handle);
9494
// @codingStandardsIgnoreEnd
9595

96-
return '0:' . $this->getCipherVersion() . ':' . base64_encode($encrpted);
97-
}
98-
99-
/**
100-
* Get cipher version
101-
*
102-
* @return int
103-
*/
104-
private function getCipherVersion()
105-
{
106-
if (extension_loaded('sodium')) {
107-
return Encryptor::CIPHER_LATEST;
108-
}
109-
return Encryptor::CIPHER_RIJNDAEL_256;
96+
return '0:' . Encryptor::CIPHER_RIJNDAEL_256 . ':' . base64_encode($encrpted);
11097
}
11198
}

lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,3 @@ public function testGetHashMustUseSpecifiedHashingAlgo($password, $salt, $hashAl
266266
$this->assertEquals($expected, $hash);
267267
}
268268
}
269-

0 commit comments

Comments
 (0)