Skip to content

Commit 6fe7f73

Browse files
committed
MC-41213: Update existing Magento 2.4 code to pass Insecure Function phpcs checks
1 parent fe053e9 commit 6fe7f73

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

app/code/Magento/EncryptionKey/Model/ResourceModel/Key/Change.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ public function changeEncryptionKey($key = null)
108108
}
109109

110110
if (null === $key) {
111+
// md5() here is not for cryptographic use. It used for generate encryption key itself
112+
// and do not encrypt any passwords
113+
// phpcs:ignore Magento2.Security.InsecureFunction
111114
$key = md5($this->random->getRandomString(ConfigOptionsListConstants::STORE_KEY_RANDOM_STRING_SIZE));
112115
}
113116
$this->encryptor->setNewKey($key);

setup/src/Magento/Setup/Model/CryptKeyGenerator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public function __construct(Random $random)
3737
*/
3838
public function generate()
3939
{
40+
// md5() here is not for cryptographic use. It used for generate encryption key itself
41+
// and do not encrypt any passwords
42+
// phpcs:ignore Magento2.Security.InsecureFunction
4043
return md5($this->getRandomString());
4144
}
4245

0 commit comments

Comments
 (0)