Skip to content
Snippets Groups Projects
Commit 2fe748d6 authored by Safwan Khan's avatar Safwan Khan
Browse files

MAGETWO-42194: Weak encryption key generation/weak fallback - iSec 08/15

- Reverted change for throwing exception.
parent 4fe60a8d
Branches
No related merge requests found
...@@ -53,6 +53,10 @@ class Random ...@@ -53,6 +53,10 @@ class Random
$str .= $chars[$rand]; // random character in $chars $str .= $chars[$rand]; // random character in $chars
} }
fclose($fp); fclose($fp);
} else {
throw new \Magento\Framework\Exception\LocalizedException(
new \Magento\Framework\Phrase("Please make sure you have 'openssl' extension installed")
);
} }
return $str; return $str;
...@@ -85,6 +89,10 @@ class Random ...@@ -85,6 +89,10 @@ class Random
$hex = bin2hex($bytes); // hex() doubles the length of the string $hex = bin2hex($bytes); // hex() doubles the length of the string
$offset = abs(hexdec($hex) % $range); // random integer from 0 to $range $offset = abs(hexdec($hex) % $range); // random integer from 0 to $range
fclose($fp); fclose($fp);
} else {
throw new \Magento\Framework\Exception\LocalizedException(
new \Magento\Framework\Phrase("Please make sure you have 'openssl' extension installed")
);
} }
return $min + $offset; // random integer from $min to $max return $min + $offset; // random integer from $min to $max
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment