diff --git a/libraries/session.lib.php b/libraries/session.lib.php index 5b0404b99a..7bb27f81af 100644 --- a/libraries/session.lib.php +++ b/libraries/session.lib.php @@ -5,6 +5,7 @@ * * @package PhpMyAdmin */ +use PMA\libraries\Util; /** * tries to secure session from hijacking and fixation @@ -30,14 +31,10 @@ function PMA_secureSession() */ function PMA_generateToken() { - if (class_exists('phpseclib\Crypt\Random')) { - $_SESSION[' PMA_token '] = bin2hex(phpseclib\Crypt\Random::string(16)); - } else { - $_SESSION[' PMA_token '] = bin2hex(openssl_random_pseudo_bytes(16)); - } + $_SESSION[' PMA_token '] = Util::generateRandom(16); /** - * Check if token is properly generated (the genration can fail, for example + * Check if token is properly generated (the generation can fail, for example * due to missing /dev/random for openssl). */ if (empty($_SESSION[' PMA_token '])) {