From 4740f66f01af140c19be5071819231f36f05f2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Kep=C3=A1k?= Date: Thu, 24 Oct 2024 01:39:13 +0200 Subject: [PATCH] Fix: first 5 characters is too weak for collisions (#454) Use full length of MD5 to make collisions more difficult --- src/Runner/TestHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Runner/TestHandler.php b/src/Runner/TestHandler.php index ebd7574c..bf2f5948 100644 --- a/src/Runner/TestHandler.php +++ b/src/Runner/TestHandler.php @@ -176,7 +176,7 @@ private function initiateTestCase(Test $test, $foo, PhpInterpreter $interpreter) $methods = null; if ($this->tempDir) { - $cacheFile = $this->tempDir . DIRECTORY_SEPARATOR . 'TestHandler.testCase.' . substr(md5($test->getSignature()), 0, 5) . '.list'; + $cacheFile = $this->tempDir . DIRECTORY_SEPARATOR . 'TestHandler.testCase.' . md5($test->getSignature()) . '.list'; if (is_file($cacheFile)) { $cache = unserialize(file_get_contents($cacheFile));