We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b49a929 commit a91a986Copy full SHA for a91a986
src/Utils/Random.php
@@ -4,7 +4,7 @@
4
5
namespace SimpleSAML\XMLSecurity\Utils;
6
7
-use Random\RandomException;
+use Exception;
8
use SimpleSAML\Assert\Assert;
9
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
10
use SimpleSAML\XMLSecurity\Exception\RuntimeException;
@@ -43,7 +43,7 @@ public static function generateRandomBytes(int $length): string
43
return random_bytes($length);
44
} catch (ValueError) { // @phpstan-ignore-line
45
throw new InvalidArgumentException('Invalid length received to generate random bytes.');
46
- } catch (RandomException) {
+ } catch (Exception) {
47
throw new RuntimeException(
48
'Cannot generate random bytes, no cryptographically secure random generator available.',
49
);
0 commit comments